A web-based system to detect skin diseases from images using deep learning. The project uses ensemble learning with CNN architectures to improve diagnostic accuracy.
Users can upload a skin image, and the backend uses three trained CNNs (EfficientNetB3, ResNet101, DenseNet121) to classify it. The predictions are averaged to determine the final result.
- πΌοΈ Upload dermatoscopic images for prediction
- π§ Ensemble of EfficientNetB3, ResNet101, and DenseNet121
- β JWT-based authentication system (register/login)
- π Confidence score for each prediction
- π Description of predicted skin condition
- π± Responsive UI using React 18
- Python 3.12
- Flask + Flask-JWT-Extended
- TensorFlow / Keras
- MongoDB (via PyMongo)
- OpenCV & Albumentations for preprocessing
- dotenv for environment configs
- React 18
- Axios
- React Router DOM
- Styled Components
- React Icons
skin_disease_detection/
βββ backend/
β βββ app/ # Backend app logic
β βββ main.py # Flask app entry
β βββ requirements.txt # Python dependencies
β βββ uploads/ # Uploaded images
βββ frontend/
β βββ src/ # React app
βββ trained_models/ # Pretrained .h5 models
βββ README.md
- Dataset: HAM10000 (Kaggle)
- 10,000 labeled images across 7 classes:
akiec,bcc,bkl,df,mel,nv,vasc
To prepare:
- Extract dataset into:
backend/data/skin_disease_dataset/base_dir/
with subdirectories:train_dir/,val_dir/,test_dir/
- Ensemble of:
- β DenseNet121
- β EfficientNetB3
- β ResNet101
- Each model is trained independently.
- Final prediction: average of softmax scores from all 3 models.
Download the pre-trained models from Google Drive:
π Download Models
After downloading, extract and place the trained_models folder in the project root directory:
skin_disease_detection/
βββ backend/
βββ frontend/
βββ trained_models/ β Place here
β βββ densenet121.h5
β βββ efficientnetb3.h5
β βββ resnet101.h5
βββ README.md
- JWT-based login/register system
- Tokens must be passed in
Authorizationheader for prediction requests.
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/auth/register |
POST | β | Register a new user |
/auth/login |
POST | β | Login, receive JWT token |
/predict |
POST | β | Upload image & get results |
- Python 3.12+
- Node.js v18+
- MongoDB (local or cloud)
- Git
# Navigate to backend
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtFLASK_SECRET_KEY=YourSecretKey
JWT_SECRET_KEY=YourJWTSecretKey
MONGO_URI=mongodb://localhost:27017/skin_disease_dbIf you want to train the models yourself instead of using the pre-trained ones, download and extract the HAM10000 dataset into:
backend/data/skin_disease_dataset/base_dir/
βββ train_dir/
βββ val_dir/
βββ test_dir/python main.pycd frontend
npm install
npm startLogin β Receive JWT token
Upload skin image
Backend runs predictions using all 3 models
Softmax probabilities are averaged
Highest scoring class is selected
Response includes:
Predicted disease
Confidence score
Disease name + descriptionMIT License See LICENSE file.
Detailed project documentation is available in the docs/ folder:
- Architecture Overview - System design and component breakdown
- Working Flow - End-to-end process flows
- Modules Documentation - Detailed module and component reference
- Frontend Flow - React architecture and patterns
- Backend Flow - Flask API and request lifecycle
- API Overview - Complete API endpoint reference
- Interview Notes - Interview preparation guide
- Improvements - Future enhancements and recommendations
