International Peer-Reviewed Publisher
Serving Researchers Since 2012

Vitamin Deficiency Detection using Image Processing and Neural Network

DOI : 10.5281/zenodo.21673269
Download Full-Text PDF Cite this Publication

Text Only Version

Vitamin Deficiency Detection using Image Processing and Neural Network

Sushmitha Gowda K R

Assistant Professor, Dept. of ECE Maharaja Institute of Technology Thandavapura Mysuru, Karnataka, India

Monika H

Student, Dept. of ECE Maharaja Institute of Technology Thandavapura Mysuru, Karnataka, India

Ranjitha D

Student, Dept. of ECE Maharaja Institute of Technology Thandavapura Mysuru, Karnataka, India

Rakshitha K

Student, Dept. of ECE Maharaja Institute of Technology Thandavapura Mysuru, Karnataka, India

Prathik R U

Student, Dept. of ECE, Maharaja Institute of Technology Thandavapura Mysuru, Karnataka, India

Abstract – Vitamin deficiencies are among the most common nutritional disorders affecting global health, often leading to chronic diseases if left undiagnosed. This project presents an AI-powered Vitamin Deficiency Detection System designed to identify various vitamin deficiencies such as Vitamin A, C, D, E, and K from image inputs. The system uses a Convolutional Neural Network (CNN) model developed with Keras and TensorFlow to analyze images and predict the type of deficiency with high accuracy. A Flask-based web interface allows users to register, log in, upload images, and receive predictions along with dietary recommendations specific to the

detected deficiency. User data and interactions are securely managed using a MySQL database, ensuring reliability and privacy. The uploaded image is preprocessed and classified by the trained model, and the result is displayed with the corresponding confidence level. In addition, a personalized diet suggestion is provided from pre-stored text files for better nutritional management. This integrated system offers a fast, accessible, and cost-effective approach for early detection of vitamin deficiencies, supporting preventive healthcare and promoting nutritional awareness through artificial intelligence.

  1. INTRODUCTION

    Vitamins are vital micronutrients that play a crucial role in maintaining proper body functions, metabolism, and overall well- being. Deficiency of essential vitamins such as Vitamin A, C, D, E, and K can lead to serious health problems including poor immunity, skin disorders, bone weakness, and vision impairment. Traditional methods for detecting vitamin deficiencies involve medical tests that can be time-consuming, costly, and inaccessible in remote areas.

    Revolutionize your journey to optimal health with our AI- based Vitamin Deficiency Detection System, a state-of-the-art innovation that merges cutting-edge Deep Learning technologies with the precision of Convolutional Neural Networks (CNN). Designed for both ease and efficacy, this sophisticated system offers an intuitive Flask web interface, allowing users to seamlessly upload images and instantly access detailed results. Beyond mere detection, this groundbreaking tool provides tailor- made dietary recommendations, empowering you to make informed decisions and take proactive steps towards your nutritional well-being. intelligence.

  2. METHODOLOGY

Convolutional Neural Network technology, this system is impeccably designed to identify deficiencies in essential vitamins such as A, C, D, E, and K with remarkable accuracy. Our model, expertly crafted using the robust Keras and TensorFlow frameworks, meticulously analyzes visual patterns to ensure precise classification of each deficiency. Experience unparalleled convenience through our interactive and intuitively designed Flask web application.

Seamlessly register, log in, and effortlessly upload images for analysis. Every uploaded image undergoes meticulous preprocessing resize to perfection at 224×224pixels, transformed into an array, and normalized for accuracy before being expertly evaluated by our unparalleled CNN model. Upon prediction, the system provides you with not only the most probable vitamin deficiency but also the confidence score of the prediction.

But our system delivers tailored dietary recommendations, extracted from a wealth of pre-stored knowledge, ensuring you are equipped with the best advice to restore your vitamin balance. Engage with a product that doesn’t just inform it empowers.

Stop

Save model

NO

YES

Betteraccuracy achieved

Validation

Hyper parameter

Model training

Model selection

Data pre-processing

Start

Data collection

BLOCK DIAGRAM

Fig 1: Block diagram of Vitamin Deficiency Detection Using Image Processing and CNN

Introducing the unparalleled Vitamin and Mineral Deficiency Detection System, an innovation at the forefront of health technology. Imagine harnessing the power of image processing and deep learning to unveil your body’s hidden nutritional needs, all wrapped in a seamlessly designed Flask web application for effortless user experience.

User Interface (Flask Application):

The Flask-based web application serves as the main interface for users. It allows users to register, log in, and upload images for analysis. It also displays the prediction results along with corresponding diet recommendations.

User Registration and Login Module:

This module enables users to create an account and securely log in to the system. User credentials and details are stored in the MySQL database. Authentication ensures that only authorized users can access the prediction features.

Image Upload Module:

Users can upload images that display visible symptoms such as skin, nail, or facial conditions.

The uploaded image is sent to the backend for preprocessing and classification.

Fig 2: Flow Chart

Data Preprocessing Module:

The preprocessing module prepares the uploaded image before prediction. It resizes, normalizes, and formats the image according to the VGG16 models input requirements to ensure accurate predictions.

VGG16 Trained Model:

This is the core deep learning component of the system. The pre-trained and fine-tuned VGG16 convolutional neural network analyzes the processed image and classifies it into one of several vitamin deficiency categories.

Prediction and Diet Recommendation:

Once the model predicts the deficiency type, the system retrieves corresponding diet recommendations from the database and displays them to the user. The result includes the predicted class and confidence probability.

MySQL Database:

The database stores user credentials, uploaded image records, and diet information related to each vitamin deficiency. It ensures data persistence and retrieval for the Flask application.

System Output:

Finally, the Flask application presents the predicted deficiency type and the recommended diet plan on the user interface, helping users understand and act upon their health condition.

III.IMPLEMENTATION

Unleash the power of simplicity and innovation with Python, the quintessential programming tool for both novice and veteran developers. Python stands at the pinnacle of programming languages with its unparalleled ability to streamline complex algorithms and offer unparalleled clarity and readability in code. Its design empowers developers to channel their creativity and expertise into solving machine learning challenges, devoid of distracting technical intricacies.

Pythons allure lies in its accessibility; an intuitive and easily graspable syntax ensures a smooth learning curve for newcomers while maintaining the depth and capability dmanded by seasoned professionals. Its human-readable code is a testament to its approachability, fostering seamless collaboration in team environments. Harness the vast and diverse ecosystem of frameworks, libraries, and extensions that Python provides, simplifying the execution of intricate functionalities. Whether its the robust community support or the language’s versatility in handling sophisticated machine learning tasks, Python is indeed the language that adapts with your vision.

One of Pythons sterling attributes is its platform independence a beacon of versatility. Deploy solutions on any major operating system including Linux, Windows, and macOS with negligible modifications. Whether you are leveraging Google’s or Amazon’s computing prowess or tapping into personal powerful GPUs, Pythons adaptability makes it your unequivocal companion. Discover why Pythons thriving community and ever-growing popularity make it the preferred choice for developers worldwide. Choose Pythonwhere simplicity meets power, and innovation meets accessibility.

IV. RESULTS AND DISCUSSION

The proposed model integrates image preprocessing and deep learning-based classification to detect vitamin deficiencies through facial analysis. The results demonstrate that neural network architectures, particularly convolutional models, can accurately identify visual symptoms associated with specific vitamin deficiencies.

A curated dataset containing facial images of individuals with diagnosed vitamin deficiencies (Vitamin A, B12, C, and D) and healthy subjects was used. The dataset was divided into 70% for training, 20% for validation, and 10% for testing. To enhance robustness, data augmentation techniques such as rotation, flipping, and illumination adjustment were applied.

Parameter Value

Total Images 2,500 Image Resolution 224

× 224 pixels

Classes 5 (A, B12, C, D, Healthy) Augmentation Methods Rotation, Brightness, Flip, Zoom

  • B. Image Preprocessing Results

Facial images were subjected to several preprocessing stages:

  1. Face Detection: Implemented using Haar cascade classifiers to isolate the region of interest.

  2. Noise Reduction: Median filtering minimized high frequency noise while retaining edge details.

  3. Colour Space Transformation: Conversion from RGB to HSV and YCbCr enhanced the detection of discoloration, pallor, and other visible indicators of deficiency.

    • F. Comparative Analysis

      To evaluate the superiority of the proposed neural network model, its performance was compared with traditional image processing and machine learning methods (e.g., SVM, KNN).

  4. Feature Extraction: Key facial areas such as skin, lips,

    Accuracy

    Precision F1-Score

    and eyes were segmented, as these regions exhibit prominent changes due to deficiencies. This preprocessing pipeline improved the clarity and contrast of affected facial regions, allowing the neural network to extract more discriminative features.

    • C. Model Performance

      The model performance was evaluated using common classification metrics, including accuracy, precision, recall, and F1-score.

      Metric Training Validation Testing

      Image Processing +

      SVM

      Image Processing +

      KNN Proposed CNN Model

      (%)

      73.4

      75.6

      89.5

      (%)

      70.8

      73.9

      91.0

      (%)

      71.2

      74.3

      90.0

      Accuracy 94.2%

      91.7%

      89.5%

      hierarchical feature representations instead of relying on

      Loss 0.16

      0.21 0.28

      manually engineered features.

      The accuracy and loss curves indicated smooth convergence, with minimal overfitting due to regularization and dropout layers.

    • D. Classification Metrics

      The per-class performance metrics are summarized below: Class Precision Recall F1-Score

      Vitamin A 0.90

      0.87

      0.88

      Vitamin B12 0.92

      0.90

      0.91

      Vitamin C 0.89

      0.88

      0.88

      Vitamin D 0.91

      0.89

      0.90

      Healthy 0.93

      0.91

      0.92

      Average 0.91

      0.89

      0.90

      model performs consistently across all classes, with slight misclassification between Vitamin A and D deficiencies due to overlapping skin-tone characteristics.

    • E. Confusion Matrix Analysis

      The confusion matrix (Fig. 6) illustrates the correct and incorrect classifications among different vitamin deficiency categories. Most errors occurred between Vitamin A and D, as both deficiencies exhibit similar visual symptoms such as dry or dull skin tones.

      The confusion matrix further confirms that the model can distinguish healthy individuals from those with deficiencies with high confidence. The CNN-based approach significantly outperforms conventional methods by automatically learning

    • G. Discussion

      The experimental results confirm the feasibility of vitamin deficiency detection using image-based neural networks. The system demonstrated strong classification accuracy, generalization capability, and efficient feature extraction. However, certain limitations were observed:

    • Model accuracy depends on image quality and

      lighting conditions.

    • Data imbalance among deficiency types may lead to biased predictions.

    • Some overlapping symptoms among vitamin types (e.g., A and D) can confuse the classifier.

Fig 3: Welcome Page

Fig 5: Vitamin deficiency detected and give diet recommendation for

deficiency

CONCLUSION

The Vitamin Deficiency Detection and Diet Recommendation System successfully demonstrate how deep learning and web technologies can be combined to provide an intelligent, accessible, and affordable health assessment tool. By utilizing the VGG16 convolutional neural network (CNN) model, the system is capable of analyzing images of skin, nails, and other visible features to accurately predict different

types of vitamin and mineral deficiencies.

The developed Flask web application offers a user-friendly interface where users can easily register, log in, and upload images for analysis. Once the image is processed, the system provides the predicted deficiency along with the models confidence probability and suggests appropriate dietary recommendations to help users improve their nutritional intake. This integration of AI-based diagnosis with preventive dietary advice enhances user awareness about health and nutrition.

Overall, the project provides a cost-effective and efficient digital health solution that can assist individuals in identifying potential deficiencies at an early stage, reducing dependency on complex medical tests for preliminary detection. In the future, the system can be enhanced by including a larger and more diverse dataset, adding real-time detection using camera input, and extending the scope to cover more diseases and health conditions, making it a more comprehensive AI-driven health assistant.

Preventive dietary advice enhances user awareness about health and nutrition.

Overall, the project provides a cost-effective and efficient digital health solution that can assist individuals in identifying potential deficiencies at an early stage, reducing dependency on complex medical tests for preliminary detection. In the future, the system can be enhanced by including a larger and more diverse dataset, adding real-time

Fig 4: Create ccount Page

detection using camera input, and extending the scope to cover more diseases and health conditions, making it a more comprehensive AI-driven health assistant.

FUTURE ENHANCEMENT

In the future, this project can be enhanced by expanding the dataset with more diverse images to improve model accuracy across various skin tones, age groups, and lighting conditions. The system can be upgraded such as Vision Transformers or hybrid CNN models to achieve higher precision in detecting subtle signs of vitamin deficiencies. Integration with medical data, such as blood test results or nutritional history, can make the predictions more reliable. A mobile or web-based application can also be developed to provide real-time detection and easy accessibility for users and healthcare professionals. Future enhancements could also include extending the model to detect multiple nutrient deficiencies and integrating it with telemedicine platforms for remote health monitoring and preventivecare.

REFERENCES

  1. J. Bethencourt, A. Sahai, and B. Waters, Ciphertext policy attribute based encryption, in Proc. IEEE Symp. Secure. Privacy, Berkeley, CA, USA, May 2007, pp. 321 334.

  2. Chollet, F. (2017) Exception. Deep Learning with Depth wise Separable Convolutions. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.

  3. Kaggle Dataset Vitamin Deficiency Image Dataset. Available at: https://www.kaggle.com/ (Dataset used for training and testing the model)

  4. Nagaraj, P., & Chandrasekar, R. Automated Skin Condition Detection Using Convolutional Neural Networks. Journal of Medical Imaging & Health Informatics, 2020. Relevant because vitamin deficiency symptoms appear on skin/nails.

  5. Vitamin Deficiency Detection Using Image Processing and Neural Network Authors: Ramesh B. E., Likhith Kumar V., Prasad C. R. V., Rahul R. C., Sandeep M. N.

  6. Boneh and M. Franklin, Identity-based encryption from the Weil pairing, in Proc. CRYPTO, vol. 2139. Berlin, Germany: Springer, 2001,

    pp. 213229.

  7. Williams, S. M., & Davis, J. R. (2021). Multi-modal Deep Learning for Vitamin Deficiency Detection: Integrating Clinical and Imaging Data.

  8. Vitamin Deficiency Detection Using Image Processing and Neural Network Authors: Ramesh B. E., Likhith Kumar V., Prasad C. R. V., Rahul R. C., Sandeep M. N.

  9. A Predictive Performance Analysis of Vitamin D Deficiency Severity Using Machine Learning Methods G. Sambasivam, J. Amudhavel, and G. Sathya.

  10. Brownlee, J. (2019). Deep Learning for Computer Vision with Python. Machine Learning Mastery. (Used as reference for CNN and transfer learning concepts)

  11. N.Attrapadung and H. Imai, Attribute-based encryption supporting direct/indirect revocation modes, in Proc. IMACC, Cirencester, U.K., Dec. 2009, pp. 278330.

  12. J. Baek, R. Safavi-Naini, and W. Susilo, Public key encryption with keyword search revisited, in Proc. ICCSA, Perugia, Italy, 2008, pp. 12491259.

  13. Boldyreva, V. Goyal, and V. Kumar, Identity-based encryption with efficient revocation, in Proc. ACM CCS, Alexandria, VA, USA, 2008,

pp. 417426.

ACKNOWLEDGEMENT

The authors sincerely thank Mrs. Sushmitha Gowda K R., Project Guide, Department of Electronics and Communication Engineering, Maharaja Institute of Technology Thandavapura, for her valuable guidance, continuous support, and encouragement throughout this project. The authors also express gratitude to Dr. M. G. Srinivasa, Head of the Department, and all faculty members of the Department of Electronics and

Communication Engineering for providing the facilities and assistance needed to complete this work. The authors further thank their project team members for their cooperation and dedication in successfully developing the Vitamin Deficiency Detection Using Image Processing And Neural

Network

AUTHORS PROFILE

Mrs. Sushmitha Gowda K R M. Tech in Signal Processing, pursuing PhD in the Field of Image Processing from Visvesvaraya Technological University, Belgaum, under the guidance of Dr. Rajalakshmi M C, Professor, Department of ECE, VVIET, Mysore. Presently working as Assistant Professor in the Department of Electronics and Communication Engineering, Maharaja Institute of Technology Thandavapura, with 5 years of teaching experience. Field of interest: Siganls and System, Network Analysis, Embedded System Design, Operating System, Microcontroller, Basic Electronics.

Monika H, an undergraduate student of Electronics and Communication

Engineering student at Maharaja Institute of Technology, Thandavapura with practical exposure to Iot, Embedded systems and VLSI fundamentals. Worked on projects like turbidity sensor using Arduino and I have knowledge about Arduino IDE, sensors,

vitamin deficiency using image processing and neural network proficient in python ,C, MATLAB ,proteus, and cadence virtuoso. Complete certifications in PCB Basic Design, Arduino IDE, VLSI fundamentals, AI/ML keen interest in electronics and I aim to build a career in embedded and IoT driven Technologies.

Prathik R U, an undergraduate student of Electronics and Communication Engineering at Maharaja Institute of Technology Thandavapura, with strong practical exposure to IoT, Embedded Systems, and

VLSI concepts. Worked on real-time engineering projects including Vitamin Deficiency Detection Using Image Processing And Neural Network

,focusing on Detection of Physical Symptoms, Image Processing, Neural Network/Deep Learning, Early & Non- Invasive Diagnosis. Proficient in C, Python, MATLAB, Arduino IDE, and Cadence Virtuoso. Completed certifications in AI/ML and programming technologies, Arduino Training, PCB Basic Design. Keen interests lie in developing innovative embedded and IoT based solutions for real-world applications.

Ranjitha D is a final-year

Electronics and Communication Engineering student at Maharaja Institute of Technology, Thandavapura..I have strong technical interest in Internet of Things (IoT), Embedded Systems, and VLSI. Worked on the

Project like a Laser Home security system and Vitamin

deficiency using image processing and neural network and Proficient in C, Python, MATLAB, Arduino IDE, and Cadence Virtuoso. Completed certifications and internships in AI/ML and programming technologies. I aim to build a career in embedded and IoT-driven technologies

Rakshita K, an undergraduate student of Electronics and Communication Engineering at Maharaja Institute of Technology Thandavapura, with strong interest and practical exposure to Iot, Embedded systems and VLSI fundamentals.

Worked on projects like Toll tax

smart system using RFID tags and Arduino uno and I have knowledge about Arduino IDE, sensors, vitamin deficiency detection using image processing and neural network. Proficient in python, C, proteus. Completed the certifications in PCB Basic Design, Arduino IDE, VLSI fundamentals, keen interest in electronics and I aim to build a career in Embedded and IoT driven Technologies