Skip to content

About

End-to-End Deep Learning-Powered PCOS Classification: Built a Custom Augmented Dataset, Fine-Tuned Swin Transformer Model, and Deployed a Dockerized API for Scalable Inference.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Swin Transformer PCOS Classifier

Description

This project implements a PCOS classification model using the Swin Transformer architecture. The model classifies images into two categories: "Infected" and "Not Infected.", Created an augmented and enhanced PCOS dataset (which extented orignal dataset to 20,000 images) using Multi-Scale Retinex Enhancement and image transformation operations, publicly available on Kaggle to support research.(https://www.kaggle.com/datasets/amritarajput54/augmented-enhanced-pcos) ● Developed an end-to-end deep learning system for Polycystic Ovary Syndrome (PCOS) classification, addressing medical imaging challenges by building a custom augmented dataset and fine-tuning a Swin Transformer model.

● Fine-tuned the pretrained Swin Transformer for high-accuracy medical image classification, optimizing for sensitivity to subtle PCOS features; deployed as a scalable, containerized API with FastAPI and Docker for real-time inference in clinical settings. ● Tools: PyTorch, Torchvision, TIMM, FastAPI, NumPy, Scikit-learn, TensorFlow, Keras, Docker

Project Structure

  • swincyst/: Contains the main application files.
    • app.py: FastAPI application that serves the model and provides endpoints for predictions.
    • best_swin_pcos_model(4).pth: The trained model weights.(couldnt upload because of size constraints, results can be seen on notebook)
    • Dockerfile: Docker configuration for containerizing the application.
    • requirements.txt: Python dependencies required for the project.
    • trained_model/: Directory for storing trained models.
  • pcos_classifier.py: Contains the implementation of the SwinPCOSClassifier class, which handles model training and evaluation.
  • model_metadata_20250223_110549.json: Metadata about the model, including its type, architecture, and framework versions.
  • swincyst-ii-1.ipynb: Jupyter notebook for experimentation and analysis.
  • test_image.jpg and test_image2.jpg: Sample images for testing the model.
  • img_0_38.jpg and img_0_75.jpg: Additional images used in the project.

Screenshot 2025-02-24 233317

Model Details

  • Model Type: Swin Transformer
  • Base Model: swin_base_patch4_window7_224
  • Classes:
    • Not Infected
    • Infected
  • Framework Versions:
    • PyTorch: 2.5.1+cu121
    • timm: 1.0.12 0.0.0 --port 8000

About

End-to-End Deep Learning-Powered PCOS Classification: Built a Custom Augmented Dataset, Fine-Tuned Swin Transformer Model, and Deployed a Dockerized API for Scalable Inference.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages