Skip to content

sandip-mondal-0248/SkinGlance-ModelAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkinGlance-ModelAPI

An intelligent and lightweight backend for skin cancer detection — combining multiple deep learning models into a robust ensemble, accessible via a FastAPI interface.


🧠 About the Project

SkinGlance-ModelAPI is the backend engine for the SkinGlance Android application — a mobile-first solution for early detection of skin cancer using deep learning. This repository contains:

  • 🧪 Code to train and save multiple CNN models (DenseNet169, InceptionV3, MobileNetV2)
  • 🤖 A fuzzy ensemble prediction strategy combining model outputs
  • 🚀 A FastAPI-based RESTful API to serve predictions in real-time
  • 🧹 Can be run locally or cloud environments like Kaggle Notebooks

🗂️ Project Structure

SkinGlance-ModelAPI/
├── model_training/        # Model development notebooks scripts
├── api_service/           # FastAPI app + saved models
└── README.md

🧪 Use Cases

✅ Case 1: Run on Kaggle

Ideal for experimenting without setting up a local environment

Follow these steps:

  1. 🔁 Clone this repo to understand the full project structure:

    git clone https://github.com/sandip-mondal-0248/SkinGlance-ModelAPI
  2. 📅 Import the training notebook (model_training/skinglance_model.ipynb) into Kaggle Notebooks.

  3. 📂 Add a skin cancer dataset: Use ISIC Dataset(Preprocess version) or any other similar dataset of your choice. Structure it like:

    dataset/
    ├── train/
    │   ├── benign/
    │   └── malignant/
    └── test/
    
  4. 🧠 Train the models by running the notebook in Kaggle. It will save:

    • DenseNet169_best.keras
    • InceptionV3_best.keras
    • MobileNetV2_best.keras
  5. Test the ensemble prediction logic in the same notebook.

  6. ⬇️ Download the trained models from Kaggle into your local computer.

  7. 📦 Place them into:

    api_service/app/models/
    
  8. 🚀 Run the FastAPI server locally using the command in main.py (Replace with actual host and port number):

    uvicorn app.main:app --host 0.0.0.0 --port 8000
  9. 🌐 Test the API:

    • Using Postman or any HTTP client
    • Or simply send an image request from browser

💻 Case 2: Run Locally

If you're setting up the full system on your machine follow these steps:

  1. 🔁 Clone the repo:

    git clone https://github.com/sandip-mondal-0248/SkinGlance-ModelAPI
    cd SkinGlance-ModelAPI
  2. 🔧 Modify paths (if needed):

    • Replace dataset paths in notebooks or scripts with local ones
    • Set up any file I/O based on your directory structure
  3. 🧠 Train the models by running the notebooks. It will save:

    • DenseNet169_best.keras
    • InceptionV3_best.keras
    • MobileNetV2_best.keras
  4. 🧱 Set up the api environment:

    cd api_service
    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    pip install -r requirements.txt
  5. Continue with the same process as described in Case 1:

    • Train models
    • Save them to api_service/app/models/
    • Run FastAPI server
    • Test the API

📱 Try the Android App

You can also try our Android app, which uses this same API.

📱 Android App GitHub Repo: SkinGlance Android App


🔁 API Endpoints

Method Endpoint Description
GET / Health check
POST /predict Upload an image for prediction

🧠 Models Used in Ensemble

  • ✅ DenseNet169 (models/DenseNet169_best.keras)
  • ✅ InceptionV3 (models/InceptionV3_best.keras)
  • ✅ MobileNetV2 (models/MobileNetV2_best.keras)
  • 📊 Combined using a fuzzy rank-based fusion strategy

📂 Datasets

You can use public datasets like:


📜 License

This project is licensed under the MIT License


🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first. If you find this helpful, please ⭐ star the repo!


📬 Contact

For questions, suggestions, or collaborations: Sandip Mondalhttps://sandipmondal.bio.link/ 🔗 LinkedIn

About

SkinGlance-ModelAPI is the backend for the SkinGlance app. It includes deep learning model training and a REST API for classifying skin lesions as benign or malignant.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors