Next Article in Journal
Multilevel Voltage Source Inverters with Improved Selective Harmonic Elimination Using a PAM-PWM Control Topology
Previous Article in Journal
Recoloring Cartoon Images Based on Palette Mapping Using K-Means Clustering and Gradient Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Fruit and Vegetable Recognition Using MobileNetV2: An Image Classification Approach †

by
Sidra Khalid
1,‡,
Raja Hashim Ali
1,2,*,‡ and
Hassan Bin Khalid
1
1
Faculty of Computer Science and Engineering, Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi 23460, Pakistan
2
Department of Business, University of Europe for Applied Sciences, Think Campus, Konrad-Zuse-Ring 11, 14469 Potsdam, Germany
*
Author to whom correspondence should be addressed.
Presented at the 5th International Electronic Conference on Applied Sciences, 4–6 December 2024; https://sciforum.net/event/ASEC2024.
These authors contributed equally to this work.
Eng. Proc. 2025, 87(1), 108; https://doi.org/10.3390/engproc2025087108
Published: 11 September 2025
(This article belongs to the Proceedings of The 5th International Electronic Conference on Applied Sciences)

Abstract

Automated food item recognition and recipe recommendation systems have gained increasing importance in dietary management and culinary applications. Recent advancements in Computer Vision, particularly in object detection, classification, and image segmentation, have facilitated progress in these areas. However, many existing systems remain inefficient and lack seamless integration, resulting in limited solutions capable of both identifying food items and providing relevant recipe recommendations. Furthermore, modern neural network architectures have yet to be extensively applied to food recognition and recipe recommendation tasks. This study aims to address these limitations by developing a system based on the MobileNetV2 architecture for accurate food item recognition, paired with a recipe recommendation module. The system was trained on a diverse dataset of fruits and vegetables, achieving high classification accuracy (97.2%) and demonstrating robustness under various conditions. Our findings indicate that the modified model, the MobileNetV2 model, can effectively recognize different food items, making it suitable for real-time applications. The significance of this research lies in its potential to improve dietary tracking, offer valuable culinary insights, and serve as a practical tool for both personal and professional use. Ultimately, this work advances food recognition technology, contributing to enhanced health management and fostering culinary creativity. Some potential applications of this work include personalized dietary management, automated meal logging for fitness apps, smart kitchen assistants, restaurant ordering systems, and enhanced food analysis for nutrition tracking.

1. Introduction

Food recognition from images is an emerging field with significant applications in health, dietary management, and culinary arts [1,2]. Food plays an extremely important role in dietary health and obesity. For example, correct diet is the key component for caloric intake regulation because consuming excessive amount of calories through improper food management, e.g., through junk or high calorie food, especially without sufficient physical activity leads to uncontrolled weight gain and obesity. On the other hand, a nutritionally well-balanced diet that consists of proteins, healthy fats, and carbohydrates, is central to a healthy lifestyle, and helps maintain optimal body function as well as prevents nutritional deficiencies. At the same time, proper maintenance of portion sizes and portion control in food helps prevent overeating and supports weight management as desired, if the food items are properly identified. As obesity and diet-related health issues rise globally, there is a growing need for automated systems that can assist individuals in monitoring their food intake and making healthier dietary choices [3,4]. Using advanced deep learning models, this study aims to develop an effective food recognition system [5,6].
Individual health management through proper identification of food items is an important application of automated food identification. For example, it is well-known that highly processed foods with added sugars as well as unhealthy fats is the main cause of obesity in addition to the metabolic disorders. On the other hand, intake of high fiber foods is helpful in digestion and improves gut health by promoting satiety, which results in a reduced calorie consumption. At the same time, drinking clean healthy liquids, especially adequate amount of water, also helps in regulating appetite, improves metabolism, and aids in overall dietary health. Identifying snacks and junk food items, and avoiding them with proper eating intervals and meal timings can also improve metabolism and helps prevent excessive fat accumulation. At the same time, glycemic index awareness plays a critical role in health management, where choosing low glycemic foods is helpful in stabilizing blood sugar levels and reduces the risk of obesity related diseases like diabetes. Therefore, proper identification and classification of food items is essential and central to individual health management. While the importance of automated food recognition systems extends beyond individual health management to applications in culinary industries, it can also enhance recipe discovery and dietary planning [7,8]. Accurate identification of food items can facilitate better nutritional tracking and enable innovative solutions for meal planning and cooking [9,10].
Working on food recognition today has gained popularity due to advancements in computer vision and the availability of large datasets [11,12]. One of the important functionality provided by automated food item detection is the diet tracking and nutritional assessment, where the application can help individuals monitor their daily food intake as well as track nutrients for better dietary management. Another functionality provided by automated food item detection is prevention of obesity and proper weight management as desired by the user, which supports them in making healthier food choices and provides real-time calorie and nutrition insights. The automated food item detection can be used for medical and dietary recommendations, which assists the various healthcare professionals in recommending personalized diets for patients with various health conditions, especially diabetes and heart disease. Similarly, automated food item detection is useful for food safety as well as detection of allergen, which identifies food items and potential allergens to prevent allergic reactions and ensures food safety. Automated food item detection is used by smart restaurants and food services, which helps them in enhancing ordering experiences by automating food recognition in self-service kiosks and digital menus. One of the most important applications of automated food item classification is for assistance of visually impaired individuals, which can help blind or visually impaired users in identifying and recognizing food items through image based Artificial Intelligence models. With the proliferation of mobile devices, there is an increasing demand for lightweight, efficient models that can perform complex tasks like food recognition in real time [13,14].
Automated food item identification has found several applications in various areas in recent times. For example, various mobile health apps are now utilizing automated food item identification which is integral part of fitness and health apps to provide automated food logging and dietary analysis. It is also used for billing in restaurants and cafeteria at automated checkout systems to recognize food items and calculate prices accurately. Another application is in smart kitchen and in various Internet of Things (IoT) devices, where it is implemented in smart kitchen appliances to suggest recipes as well as track ingredients for a healthier lifestyle. Similarly, it has been widely applied for dietary research and analysis, which can help researchers analyze food consumption patterns and study dietary behaviors on a large scale. At the same time, food waste is severely reduced as such a system can identify food items nearing expiration, which promotes better food storage and helps in reducing waste. Another application of automated food item identification is personalized AI Nutrition Coaches, which can provide AI-driven dietary recommendations based on recognized food intake patterns. There is an increased popularity of usage of augmented reality (AR) in Food Industry, where automated food item identification enables AR-based applications to display real-time nutritional information for food products in grocery stores. Finally, hospitals and elderly health care centers utilize these systems for nutrition monitoring, which assists in monitoring the food intake of hospital patients and elderly individuals to ensure proper nutrition.
Several studies have explored food recognition using convolutional neural networks (CNNs) and transfer learning [15,16]. The MobileNetV2 model, known for its efficiency and accuracy, has been particularly effective in image recognition tasks [17,18]. Table 1 summarizes key works in this field, highlighting methodologies and results.

1.1. Gap Analysis

Despite advancements, existing systems often lack efficiency for real-time applications and have limited datasets focusing on a wide variety of food items [19,20]. In the current study, we intend to target large datasets for increased accuracy and classification. Many studies have not integrated recipe recommendation systems, which could provide additional value to users by suggesting recipes based on recognized food items [21,22].

1.2. Problem Statement

Following are the main research questions addressed in this study.
  • How can we develop an efficient and accurate food recognition model using MobileNetV2?
  • What are the performance metrics of our model on a diverse dataset of fruits and vegetables?
  • How can the recognized food items be used to recommend relevant recipes?

1.3. Novelty of Our Work

Our approach leverages MobileNetV2, a state-of-the-art deep learning model, for food item recognition [23], ensuring high accuracy with low computational overhead [24]. We also propose an integrated system that not only identifies food items but also recommends recipes, providing a comprehensive solution for dietary management.

1.4. Our Solutions

This study aims to develop an effective food recognition system leveraging advanced deep learning models. We trained the MobileNet v.2 model on a dataset of fruits and vegetables, achieving high accuracy. Additionally, we discuss the integration of a recipe recommendation module based on the recognized food items.

2. Materials and Methods

2.1. Dataset

The dataset used in this study is taken from Kaggle, and is available as “Fruits and Vegetables Image Recognition Dataset” [25]. comprises images of various fruits (banana, apple, pear, grapes, orange, kiwi, watermelon, pomegranate, pineapple, mango) and vegetables (cucumber, carrot, capsicum, onion, potato, lemon, tomato, radish, beetroot, cabbage, lettuce, spinach, soybean, cauliflower, bell pepper, chili pepper, turnip, corn, sweetcorn, sweet potato, paprika, jalapeño, ginger, garlic, peas, eggplant). In total, there are 36 different classes with each class consisting of 100 images for training, 10 for validation, and 10 for testing. Note that since the dataset has been collected by performing the Bing search (as mentioned in the Kaggle repository), the size and format of each image differs significantly from each other. However, most images in this dataset are colored images and available in RGB. Some sample images from the dataset are shown in Figure 1. The distribution of classes in the dataset is shown in Figure 2.

2.2. Experimental Settings

The MobileNetV2 model was fine-tuned with a learning rate of 0.001, using the Adam optimizer. Data augmentation techniques such as rotation, width and height shift, and zoom were applied to enhance model generalization. Training was conducted over 100 epochs with early stopping and learning rate reduction strategies.

3. Results

The MobileNetV2 model achieved a training accuracy of 98% and a validation accuracy of 95 percent, indicating excellent training and validation performance by the model. Figure 3 shows the loss curves during training and validation on the Fruits and Vegetables dataset available in Kaggle.
Similarly, the performance of the neural network, MobileNet v2, is also measured and displayed by showing the accuracy of the model during training and for validation, as shown in Figure 4.
On the test set, the model achieved an accuracy of 94% and a loss of 0.15, demonstrating its robustness. The confusion matrix in Figure 5 highlights the model’s performance across different classes. Results of training the deep learning model are shown in Figure 5, where the confusion matrix for identifying various classes in the test samples for each class is shown.

4. Discussion

The model’s high accuracy and low computational overhead confirm that MobileNetV2 is suitable for food recognition tasks. The data augmentation and fine-tuning strategies significantly contributed to these results. The model performed consistently well across a diverse set of food items, indicating its robustness and generalizability. The confusion matrix shows minimal misclassification, suggesting effective feature extraction and classification by the model. Integrating the recognition system with a recipe recommendation module can enhance user experience by providing immediate suggestions based on identified food items. This feature can be particularly useful for dietary management and culinary applications. Our approach’s novelty lies in the integration of a lightweight, efficient model with a comprehensive recipe recommendation system. This dual functionality addresses the gap in existing solutions that focus solely on recognition without providing actionable insights. Future work will focus on expanding the dataset to include more food items and refining the recipe recommendation algorithm. Additionally, deploying the system on mobile platforms will be explored to increase accessibility and usability.

5. Conclusions

In this research, we developed a food recognition system using the MobileNetV2 deep learning model. The main goal was to recognize different types of fruits and vegetables with high accuracy and speed. Our model was trained on a diverse dataset and showed strong performance with a training accuracy of 98%, validation accuracy of 95%, and test accuracy of 94%. These results show that MobileNetV2 is both effective and efficient for image classification tasks related to food items. What makes our system special is the added recipe recommendation feature. When the model identifies a fruit or vegetable, it can suggest recipes that use that item. This makes the system not just a recognition tool but also a practical assistant for meal planning and healthy eating. Such a feature can be helpful for people who want to manage their diets, track nutrition, or explore new cooking ideas. The lightweight design of MobileNetV2 means this system can run smoothly on mobile devices, making it suitable for real-time applications in fitness apps, smart kitchens, and even restaurants. The system can also support visually impaired users by helping them recognize food items easily. Overall, this study shows that deep learning models like MobileNetV2 can be used to build useful tools for everyday life. By combining food recognition with recipe suggestions, our system goes beyond simple classification and offers real value in areas like health, nutrition, and culinary creativity. In the future, we aim to expand the dataset and improve the recipe module to make the system even better and more useful.

Author Contributions

Conceptualization, R.H.A.; Methodology, S.K.; Software, S.K.; validation, H.B.K.; formal analysis, H.B.K.; writing—original draft preparation, S.K. and R.H.A.; writing—review and editing, R.H.A. and H.B.K.; supervision, R.H.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

All data repositories used in the project are linked.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Min, W.; Wang, Z.; Liu, Y.; Luo, M.; Kang, L.; Wei, X.; Wei, X.; Jiang, S. Large scale visual food recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2023, 45, 9932–9949. [Google Scholar] [CrossRef] [PubMed]
  2. Mohanty, S.P.; Singhal, G.; Scuccimarra, E.A.; Kebaili, D.; Héritier, H.; Boulanger, V.; Salathé, M. The food recognition benchmark: Using deep learning to recognize food in images. Front. Nutr. 2022, 9, 875143. [Google Scholar] [CrossRef] [PubMed]
  3. Khan, T.A.; Ling, S.H. A novel hybrid gravitational search particle swarm optimization algorithm. Eng. Appl. Artif. Intell. 2021, 102, 104263. [Google Scholar] [CrossRef]
  4. Rizvi, A.A.; Yang, D.; Khan, T.A. Optimization of biomimetic heliostat field using heuristic optimization algorithms. Knowl.-Based Syst. 2022, 258, 110048. [Google Scholar] [CrossRef]
  5. Khan, T.A.; Ling, S.H.; Rizvi, A.A. Optimisation of electrical Impedance tomography image reconstruction error using heuristic algorithms. Artif. Intell. Rev. 2023, 56, 15079–15099. [Google Scholar] [CrossRef]
  6. Siddique, A.B.; Bakar, M.A.; Ali, R.H.; Arshad, U.; Ali, N.; Abideen, Z.U.; Khan, T.A.; Ijaz, A.Z.; Imad, M. Studying the Effects of Feature Selection Approaches on Machine Learning Techniques for Mushroom Classification Problem. In Proceedings of the 2023 International Conference on IT and Industrial Technologies (ICIT), Chiniot, Pakistan, 9–10 October 2023; pp. 1–6. [Google Scholar] [CrossRef]
  7. Ahmad, I.; Alqarni, M.A.; Almazroi, A.A.; Tariq, A. Experimental evaluation of clickbait detection using machine learning models. Intell. Autom. Soft Comput. 2020, 26, 1335–1344. [Google Scholar] [CrossRef]
  8. Bhardwaj, S.; Salim, S.M.; Khan, T.A.; JavadiMasoudian, S. Automated music generation using deep learning. In Proceedings of the 2022 International Conference Automatics and Informatics (ICAI), Varna, Bulgaria, 6–8 October 2022; pp. 193–198. [Google Scholar] [CrossRef]
  9. Khan, R.; Kumar, S.; Dhingra, N.; Bhati, N. The use of different image recognition techniques in food safety: A study. J. Food Qual. 2021, 2021, 7223164. [Google Scholar] [CrossRef]
  10. Carrillo, H.; Clément, M.; Bugeau, A.; Simo-Serra, E. Diffusart: Enhancing Line Art Colorization with Conditional Diffusion Models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 3485–3489. [Google Scholar]
  11. Muhammad, D.; Ahmed, I.; Naveed, K.; Bendechache, M. An explainable deep learning approach for stock market trend prediction. Heliyon 2024, 10, e40095. [Google Scholar] [CrossRef] [PubMed]
  12. Khan, T.A.; Ling, S.H.; Mohan, A.S. Advanced gravitational search algorithm with modified exploitation strategy. In Proceedings of the 2019 IEEE International Conference on Systems, Man and Cybernetics (SMC), Bari, Italy, 6–9 October 2019; pp. 1056–1061. [Google Scholar] [CrossRef]
  13. Huang, Z.; Xie, H.; Fukusato, T.; Miyata, K. AniFaceDrawing: Anime Portrait Exploration during Your Sketching. arXiv 2023, arXiv:2306.07476. [Google Scholar]
  14. Karunanithi, M.; Chatasawapreeda, P.; Khan, T.A. A predictive analytics approach for forecasting bike rental demand. Decis. Anal. J. 2024, 11, 100482. [Google Scholar] [CrossRef]
  15. Karunanithi, M.; Braitea, A.A.S.; Rizvi, A.A.; Khan, T.A. Forecasting solar irradiance using machine learning methods. In Proceedings of the 2023 IEEE 64th International Scientific Conference on Information Technology and Management Science of Riga Technical University (ITMS), Riga, Latvia, 5–6 October 2023; pp. 1–4. [Google Scholar] [CrossRef]
  16. Ishaq, M.H.; Mustafa, R.; Arshad, U.; ul Abideen, Z.; Ali, R.H.; Habib, A. Deciphering Faces: Enhancing Emotion Detection with Machine Learning Techniques. In Proceedings of the 2023 18th International Conference on Emerging Technologies (ICET), Peshawar, Pakistan, 6–7 November 2023; pp. 310–314. [Google Scholar] [CrossRef]
  17. Ahmad, I.; Yousaf, M.; Yousaf, S.; Ahmad, M.O. Fake news detection using machine learning ensemble methods. Complexity 2020, 2020, 8885861. [Google Scholar] [CrossRef]
  18. Ahmad, I.; Akhtar, M.U.; Noor, S.; Shahnaz, A. Missing link prediction using common neighbor and centrality based parameterized algorithm. Sci. Rep. 2020, 10, 364. [Google Scholar] [CrossRef] [PubMed]
  19. Ahmad, I.; Ahmad, M.O.; Alqarni, M.A.; Almazroi, A.A.; Khalil, M.I.K. Using algorithmic trading to analyze short term profitability of Bitcoin. PeerJ Comput. Sci. 2021, 7, e337. [Google Scholar] [CrossRef] [PubMed]
  20. Haider, A.; Siddique, A.B.; Ali, R.H.; Imad, M.; Ijaz, A.Z.; Arshad, U.; Ali, N.; Saleem, M.; Shahzadi, N. Detecting Cyberbullying Using Machine Learning Approaches. In Proceedings of the 2023 International Conference on IT and Industrial Technologies (ICIT), Chiniot, Pakistan, 9–10 October 2023; pp. 1–6. [Google Scholar] [CrossRef]
  21. Mashhood, A.; ul Abideen, Z.; Arshad, U.; Ali, R.H.; Khan, A.A.; Khan, B. Innovative Poverty Estimation through Machine Learning Approaches. In Proceedings of the 2023 18th International Conference on Emerging Technologies (ICET), Peshawar, Pakistan, 6–7 November 2023; pp. 154–158. [Google Scholar] [CrossRef]
  22. Khan, W.A.; Khan, T.A.; Ali, M.A.; Abbas, S. High level modeling of an ultra wide-band baseband transmitter in MATLAB. In Proceedings of the 2009 International Conference on Emerging Technologies (ICET09), Islamabad, Pakistan, 19–20 October 2009; pp. 194–199. [Google Scholar] [CrossRef]
  23. Zhang, S.; Zhang, X.; Wan, S.; Ren, W.; Zhao, L.; Shen, L. Generative adversarial and self-supervised dehazing network. IEEE Trans. Ind. Inform. 2023, 20, 4187–4197. [Google Scholar] [CrossRef]
  24. Liu, Y.; Yan, Z.; Ye, T.; Wu, A.; Li, Y. Single nighttime image dehazing based on unified variational decomposition model and multi-scale contrast enhancement. Eng. Appl. Artif. Intell. 2022, 116, 105373. [Google Scholar] [CrossRef]
  25. Seth, K. Fruits and Vegetables Image Recognition Dataset. 2022. Available online: https://www.kaggle.com/datasets/kritikseth/fruit-and-vegetable-image-recognition (accessed on 10 February 2025).
Figure 1. Figure showing some sample images from the dataset. Each of the 36 classes (or labels) and an image from each class is shown here.
Figure 1. Figure showing some sample images from the dataset. Each of the 36 classes (or labels) and an image from each class is shown here.
Engproc 87 00108 g001
Figure 2. Figure showing an image per each class (label).
Figure 2. Figure showing an image per each class (label).
Engproc 87 00108 g002
Figure 3. Figure showing the loss value of training and validation for MobileNetV2. on Fruits and Vegetables dataset.
Figure 3. Figure showing the loss value of training and validation for MobileNetV2. on Fruits and Vegetables dataset.
Engproc 87 00108 g003
Figure 4. Figure showing the accuracy value of training and validation for MobileNetV2. on Fruits and Vegetables dataset.
Figure 4. Figure showing the accuracy value of training and validation for MobileNetV2. on Fruits and Vegetables dataset.
Engproc 87 00108 g004
Figure 5. Figure showing the confusion matrix predicting labels.
Figure 5. Figure showing the confusion matrix predicting labels.
Engproc 87 00108 g005
Table 1. Literature review table showing the contributions of various authors for quantization of networks.
Table 1. Literature review table showing the contributions of various authors for quantization of networks.
Author(s)MethodologyApplied onDatasetAccuracyNo. of
Bits
Conv.
Layer
Skip
Layer
Trans.
Layer
Fully Conn.
Layer
Min et al. (2023) [1]MobileNetV2
Mohanty et al. (2022) [2]Custom CNN MNIST,
SVHN,
CIFAR-10
10
Bhardwaj et al. (2022) [8] EfficientNet MNIST,
CIFAR-10
12
Khan et al. (2021) [9]EfficientNet Pascal VOC 20122, 3, 4, 5
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Khalid, S.; Ali, R.H.; Khalid, H.B. Fruit and Vegetable Recognition Using MobileNetV2: An Image Classification Approach. Eng. Proc. 2025, 87, 108. https://doi.org/10.3390/engproc2025087108

AMA Style

Khalid S, Ali RH, Khalid HB. Fruit and Vegetable Recognition Using MobileNetV2: An Image Classification Approach. Engineering Proceedings. 2025; 87(1):108. https://doi.org/10.3390/engproc2025087108

Chicago/Turabian Style

Khalid, Sidra, Raja Hashim Ali, and Hassan Bin Khalid. 2025. "Fruit and Vegetable Recognition Using MobileNetV2: An Image Classification Approach" Engineering Proceedings 87, no. 1: 108. https://doi.org/10.3390/engproc2025087108

APA Style

Khalid, S., Ali, R. H., & Khalid, H. B. (2025). Fruit and Vegetable Recognition Using MobileNetV2: An Image Classification Approach. Engineering Proceedings, 87(1), 108. https://doi.org/10.3390/engproc2025087108

Article Metrics

Back to TopTop