Your Cart

Your Wishlist

EXPLORE

Project Categories

9:30 AM - 6:30 PM | Call Us | WhatsApp

Chat with us Download App Stress detection in IT professionals big data using machine learning and flask web application

AI-Based Skin Disease Detection and Medical Explanation Using Generative AI

Category: AI Projects

Price: ₹ 6000 ₹ 15000 0% OFF

YouTube Video
Product Image

ABSTRACT
The Skin Disease Detection Using Generative AI system is an intelligent healthcare support application designed to identify potential skin diseases through image-based classification and provide detailed medical information using Generative Artificial Intelligence. Skin diseases are common health conditions that affect people of different age groups and may cause symptoms such as itching, redness, inflammation, irritation, rashes, and changes in skin texture. Early identification and proper medical guidance are important for preventing complications and improving skin health. However, identifying different skin conditions through manual examination may require specialized dermatological knowledge and medical consultation. To address these challenges, the proposed system integrates Convolutional Neural Network (CNN) based image classification with Retrieval-Augmented Generation (RAG) and Large Language Model (LLM) technology to provide an intelligent skin disease screening and information platform. The system is developed using Python as the primary programming language and Flask as the web application framework. The CNN model processes uploaded skin images after resizing them into a standard dimension of 224 × 224 pixels and predicts the corresponding disease category from six classes, namely Atopic Dermatitis, Contact Dermatitis, Eczema, Scabies, Seborrheic Dermatitis, and Tinea Corporis. The model generates a prediction score that indicates its output confidence for the selected classification. In addition to image classification, the proposed application incorporates Generative AI to provide detailed explanations about the predicted skin condition. The RAG architecture uses ChromaDB as the vector database to store and retrieve relevant information from medical knowledge documents. The retrieved information is converted into numerical embeddings using the Nomic Embed Text model through Ollama. The retrieved medical context is then provided to the Llama 3.2:3B language model to generate meaningful explanations about the condition, common symptoms, possible causes, contributing factors, general precautions, recommended care practices, and situations requiring medical attention. This approach enables the system to generate context-based explanations rather than depending entirely on predefined descriptions. Furthermore, the application includes a nearby dermatologist finder that allows users to enter their PIN code, locality, or city name to locate dermatologists, skin hospitals, and general hospitals through Google Maps. A secure user authentication mechanism is implemented using registration, login, password hashing, and session management to protect application access. The system also provides an interactive web interface through which users can upload skin images, view classification results, and obtain AI-generated medical information. By combining CNN-based skin image classification, RAG-based medical information retrieval, and Generative AI explanations, the proposed system provides an integrated platform for preliminary skin disease screening and healthcare awareness. The application is intended to support users in understanding possible skin conditions and accessing relevant medical information. However, the generated results are not a confirmed medical diagnosis or a substitute for professional dermatological examination, and users are advised to consult qualified healthcare professionals for accurate diagnosis and treatment.

INTRODUCTION
The increasing prevalence of skin-related diseases has become an important healthcare concern affecting people across different age groups and geographical regions. Skin diseases are medical conditions that affect the outer protective layer of the human body and may cause symptoms such as itching, redness, inflammation, irritation, rashes, dryness, swelling, and changes in skin texture. These conditions may develop due to various factors, including infections, allergic reactions, environmental exposure, genetic conditions, immune system abnormalities, and other underlying health problems. Some skin diseases may remain mild and temporary, whereas others may become chronic and require continuous medical attention. Early identification and appropriate medical guidance are important for managing these conditions and preventing further complications. However, identifying different skin diseases can be challenging because several dermatological conditions exhibit similar visual characteristics. Traditional identification procedures generally depend on physical examination, medical history, laboratory investigations, and consultation with qualified dermatologists. Access to specialized dermatological services may also be limited in certain geographical areas. Therefore, the application of Artificial Intelligence (AI), deep learning, computer vision, and Generative Artificial Intelligence has created opportunities to develop intelligent healthcare support applications that assist in preliminary skin disease screening and provide accessible medical information.
The proposed Skin Disease Detection Using Generative AI system is designed to integrate deep learning-based skin image classification with Retrieval-Augmented Generation (RAG) and Large Language Model (LLM) technologies. The main purpose of this project is to develop an intelligent web-based application that analyzes uploaded skin images, provides potential disease classification results, and generates detailed explanations about the corresponding skin conditions. Unlike conventional image classification applications that provide only a predicted disease name or numerical confidence score, the proposed system combines image analysis with an AI-powered medical information generation mechanism. This integration allows users to obtain additional information about possible symptoms, causes, contributing factors, general precautions, healthcare practices, and situations requiring professional medical attention. The system is developed using Python as the primary programming language, TensorFlow and Keras for deep learning implementation, and Flask for web application development. The application provides a centralized interface through which users can access the skin disease screening functionality, view generated explanations, and search for nearby dermatological healthcare facilities.
The skin disease classification component utilizes a deep learning approach based on Convolutional Neural Networks (CNN) and transfer learning. The training implementation employs the EfficientNetB0 architecture, which is a convolutional neural network originally trained on the ImageNet dataset. EfficientNetB0 is used as the feature extraction backbone to learn meaningful visual characteristics from skin images. The classification model is developed using six skin disease categories, namely Atopic Dermatitis, Contact Dermatitis, Eczema, Scabies, Seborrheic Dermatitis, and Tinea Corporis. A structured image dataset is organized into separate disease folders, and the corresponding metadata information is used to associate image filenames with their source records. The dataset preparation process includes image collection, class identification, metadata matching, and grouping of copied images with their original samples. A group-aware dataset splitting technique is implemented using GroupShuffleSplit to divide the available images into training, validation, and testing subsets while preventing images belonging to the same patient or original source group from appearing across different subsets. This approach helps reduce the possibility of data leakage during model evaluation. The images are resized to 224 × 224 pixels and converted into three-channel RGB representations before being supplied to the deep learning model.
To improve the classification capability of the model, data augmentation techniques are incorporated into the training architecture. These techniques include horizontal flipping, random rotation, zooming, translation, and contrast adjustment. Such transformations help the model learn different visual variations and reduce excessive dependence on specific image orientations or appearances. The EfficientNetB0 feature extraction layers are initially kept frozen while the newly added classification layers are trained. A Global Average Pooling layer is used to reduce the extracted feature dimensions, followed by dropout layers to reduce overfitting and a dense layer containing 128 neurons with ReLU activation. The final output layer uses the Softmax activation function to generate classification scores for the six disease categories. The model is trained using the Adam optimizer and sparse categorical cross-entropy loss function. Class weighting is also incorporated to address variations in the number of training samples across different disease categories. After the initial classification stage, fine-tuning is performed by unfreezing selected layers of the EfficientNetB0 backbone and training them with a lower learning rate. Early stopping, model checkpointing, and learning rate reduction techniques are implemented to support training stability and preserve the best-performing model weights. The final trained model is saved in the Keras format and integrated into the Flask application for image-based prediction.
An important feature of the proposed system is the integration of Generative Artificial Intelligence for producing detailed skin disease explanations. Conventional classification systems generally provide limited information after identifying a possible disease category. Users may not understand the characteristics of the predicted condition, its possible causes, common symptoms, or the precautions that should be followed. To address this limitation, the proposed application incorporates a RAG-based medical information retrieval architecture connected with a Large Language Model. Retrieval-Augmented Generation combines information retrieval and natural language generation to produce responses using relevant reference documents. In the proposed implementation, ChromaDB is used as the persistent vector database for storing medical knowledge documents. The medical reference documents are collected and maintained in a dedicated knowledge directory. These documents are divided into smaller text segments using a chunking mechanism with an overlap of 150 characters to preserve relevant contextual information between consecutive segments. The Nomic Embed Text model is used through Ollama to convert the text segments into numerical embedding representations. These embeddings are stored in ChromaDB using cosine similarity as the vector comparison method. When an explanation is requested for a particular skin condition, the system generates a relevant query and converts it into an embedding representation. ChromaDB retrieves the five most relevant medical information segments based on semantic similarity. The retrieved information is then supplied as contextual input to the language generation model.
The Generative AI component utilizes the Llama 3.2:3B language model through the Ollama framework to generate meaningful explanations based on the retrieved medical knowledge. The model receives the selected disease category, CNN output score, and retrieved medical context as input. Based on this information, it generates explanations covering the general description of the condition, common symptoms, possible causes, contributing factors, general care practices, precautions, conditions to avoid, treatment options to discuss with a qualified healthcare professional, and warning signs that require medical attention. This approach provides users with understandable medical information instead of displaying only a classification label. The RAG architecture also helps connect generated responses with the available medical reference documents rather than relying entirely on the language model's internally learned knowledge. The application includes safety instructions to prevent the language model from presenting an image-based prediction as a confirmed diagnosis or generating medication prescriptions and dosages. When reliable supporting information is unavailable in the retrieved documents, the system is instructed not to invent medical details. Therefore, the integration of RAG and Generative AI provides an additional information-support mechanism that complements the image classification component.
The proposed system also incorporates a location-based dermatologist finder to help users identify suitable healthcare facilities for further medical consultation. After examining the generated skin disease information, users may require professional dermatological evaluation to confirm their condition and receive appropriate treatment. To support this requirement, the application provides a facility for entering an Indian PIN code, locality, or city name. Based on the entered location, the system generates relevant Google Maps search links for nearby dermatologists, skin hospitals, and general hospitals. It also provides an embedded map interface to help users explore available healthcare facilities in the specified area. This functionality connects the AI-based screening process with access to professional healthcare services. The application does not independently verify the availability or medical qualifications of every healthcare provider returned by the map search; users must confirm these details before visiting a facility.
In addition to disease classification and medical information generation, user authentication and secure application access are important components of the proposed system. A registration and login mechanism is implemented using Flask and SQLite to manage user account information. During registration, the application collects the username, email address, and password. The password is converted into a secure hash using the Werkzeug security library before being stored in the database. During login, the entered credentials are verified against the stored account information, and Flask session management is used to maintain the authenticated user's access state. Protected application routes restrict unauthorized users from accessing the prediction and dermatologist finder functionalities. Uploaded skin images are validated before processing, and supported image formats include JPG, JPEG, PNG, WEBP, and BMP. The application also maintains the uploaded image files within a designated storage directory and returns the corresponding prediction information through JSON responses. These functionalities provide a structured web-based environment for integrating image classification, medical information retrieval, and location-based healthcare search.
Overall, the Skin Disease Detection Using Generative AI project represents an integrated approach to intelligent dermatological information support through deep learning, computer vision, vector database retrieval, and natural language generation. The combination of EfficientNetB0-based image classification, ChromaDB-based medical knowledge retrieval, Nomic Embed Text embeddings, and the Llama 3.2:3B language model provides a platform for preliminary skin disease screening and detailed medical information generation. The application is designed to make skin-related information more accessible by combining image analysis, understandable AI-generated explanations, and nearby healthcare facility search within a single web-based interface. It also provides a foundation for future improvements involving larger and more diverse dermatological datasets, advanced classification architectures, improved model calibration, expanded medical knowledge repositories, conversational medical information retrieval, and enhanced healthcare integration. The proposed system is intended as an academic research and screening-support prototype rather than a certified medical diagnostic application. Through the integration of deep learning and Generative AI technologies, the project aims to demonstrate how intelligent software applications can support skin health awareness, preliminary image-based screening, and access to relevant dermatological information.

Block Diagram

block-diagram