Inspiration

Access to immediate dermatological feedback is a massive challenge for many people. When someone notices a strange rash, burn, or lesion, waiting days or weeks for a doctor's appointment can cause immense anxiety. We wanted to build a bridge—an accessible, real-time AI tool that could give users an immediate preliminary assessment of their skin conditions, blending classic computer vision with cutting-edge generative AI.

What it does

AI Skin Doctor is a dual-AI web application that acts as a preliminary dermatological assistant. When a user uploads an image of a skin condition:

The CNN Engine: A custom-trained Convolutional Neural Network immediately analyzes the image and outputs a confidence score, classifying the skin as either "Normal" or detecting a potential "Infection/Abnormality."

The Generative AI Analyst: Simultaneously, the image is passed to Gemini 1.5 Flash, which acts as a virtual medical assistant. It generates a detailed multimodal analysis, describing the visual symptoms (redness, texture, severity) and providing safe, professional recommendations on whether to consult a doctor.

How we built it

We built the backend logic using Python.

For the core classification, we used TensorFlow and Keras to build a Convolutional Neural Network. To achieve high accuracy without needing a supercomputer, we utilized Transfer Learning by importing the pre-trained MobileNetV2 model and attaching a custom dense layer with a sigmoid activation function for binary classification.

For the detailed medical descriptions, we integrated the Google Generative AI API (Gemini 1.5 Flash) to process the image and prompt in real-time.

To bring it all together into a clean, interactive user interface, we used Streamlit.

Challenges we ran into

Building this was a massive learning curve! A few major hurdles we overcame:

The "False Negative" Bias: Early on, the model confidently flagged a severe burn mark as "Normal." We realized the model was acting blindly because the training dataset only contained rashes. We had to quickly source diverse images of burns and retrain the model to understand different types of skin damage.

Pixel Normalization: The AI initially couldn't "see" anything because we were feeding it raw image pixels (0-255). We had to implement a Rescaling layer to perfectly normalize the data between -1 and 1 so MobileNetV2 could process it.

Environment Conflicts: We ran into severe protobuf versioning clashes between TensorFlow and Streamlit while developing in a Windows/WSL environment, requiring deep-dives into dependency management.

API Security: Figuring out how to safely deploy the app and push to GitHub without leaking our private Gemini API keys required setting up strict .env variables and .gitignore protocols.

Accomplishments that we're proud of

We are incredibly proud of successfully fusing two completely different types of AI—a local, locally-trained predictive CNN model and a cloud-based Generative Large Language Model—into one seamless, real-time pipeline. It doesn't just give a robotic "Yes/No" answer; it explains why it gave that answer.

What we learned

This project was a crash course in Machine Learning realities. We learned that an AI is only as smart as the dataset you feed it. We learned how to read a Confusion Matrix to track dangerous False Negatives, how to implement Transfer Learning, and how to properly secure environment variables for production.

What's next for AI_SKIN_DOCTOR

Multi-Class Diagnosis: Expanding the dataset to categorize specific issues (e.g., classifying a lesion specifically as a First-Degree Burn, Fungal Infection, or Allergic Reaction) rather than just a binary "Infected vs. Normal".

Doctor Locator: Integrating a Maps API so that if the AI detects a severe infection, it automatically lists the contact info for the three nearest dermatologists.

Cloud Deployment: Moving the local Streamlit server to a live cloud host so anyone can access it from their mobile browser.

Built With

Share this project:

Updates