Skip to content

dinnyhub/cleft-lip-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cleft Lip & Palate Detection System

This repository contains a deep learning-based application for classifying images as either exhibiting a "Cleft Lip & Palate" or being "Non-Cleft". It provides a simple web interface for users to upload an image and receive instant predictions along with a confidence score.

Project Structure

  • app.py: The main entry point for the web application, built using Streamlit. It handles the user interface, image uploading, and displaying the prediction results and confidence scores.
  • inference.py: Handles the machine learning prediction pipeline. It loads the PyTorch model, pre-processes the uploaded image (resizing to 224x224), runs it through the model, and extracts the predicted label and confidence.
  • model.py: Defines the neural network architecture. It uses a ResNet-18 architecture (from torchvision.models) and modifies the final fully connected layer to output predictions for 2 classes.
  • requirements.txt: Contains the Python dependencies required to run the project.
  • model/: A directory expected to contain the pre-trained PyTorch model weights file (resnet_cleft_model.pth).

Setup & Installation

  1. Clone the repository (or navigate to the project directory).

  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt

    Note: streamlit is required to run app.py. If it's not installed via requirements.txt, you may need to install it manually:

    pip install streamlit
  4. Ensure Model Weights are Present: Make sure the pre-trained weights file resnet_cleft_model.pth is located inside the model/ directory.

Running the Application

To start the Streamlit web server, run the following command in your terminal:

streamlit run app.py

This will launch the application in your default web browser (usually at http://localhost:8501). You can then upload an image (JPG, JPEG, PNG, or WEBP) and view the model's prediction and confidence score out of 10.

About

AI-powered image classification system for cleft lip and palate detection using PyTorch and ResNet18, with an interactive Streamlit UI for real-time predictions and model interpretability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages