Skip to main content

OCTMNIST Classifier

A Python package for classifying retinal OCT images into four categories: CNV, DME, Drusen, and Normal, based on the OCTMNIST dataset. Built with a custom CNN and includes preprocessing, class balancing strategies, and a CLI for inference.

🔧 Installation

pip install octmnist-classifier

Make sure to have 'torch', 'medmnist', and other dependencies listed in 'setup.py' installed.

📦 Features

  • Preprocessing and loading of the OCTMNIST dataset

  • Class balancing using:

    • SMOTE
    • SMOTE + Tomek Links
    • Undersampling
  • CNN model with ReLU, BatchNorm, MaxPooling

  • Trainable via script interface ('scripts/train.py')

  • CLI interface to run inference on new images

🧠 Pretrained Models

Download pretrained models from the Releases page:

  • 'model_smote.pt'
  • 'model_smote_tomek.pt'

Place them in the 'saved_model/' directory before running predictions.

🚀 Usage

1. Predict a single image

octmnist-predict --image retina.png --model saved_model/model_smote.pt

Output:

Predicted class: NORMAL (Class ID: 3)

2. Training with balancing

python scripts/train.py --strategy smote --epochs 15

Options for '--strategy': 'smote', 'smote_tomek', 'undersample'

🧪 Evaluation (planned)

In future versions, you'll be able to run:

octmnist-eval --model saved_model/model_smote.pt --test_dir test_images/

🔍 Model Architecture

  • 4 Conv layers with ReLU, BatchNorm, MaxPooling
  • Final Linear layer with Dropout
  • Xavier/He initialization supported

🗂️ Project Structure

octmnist-classifier/
├── octmnist_classifier/
│   ├── model.py
│   ├── preprocess.py
│   ├── predict.py
│   └── cli.py
├── saved_model/
│   └── model_smote.pt
├── scripts/
│   └── train.py
└── setup.py

📄 License

MIT License


Maintained by Kirupanandan Jagadeesan. Contributions and feedback welcome!

Metadata

Release files for octmnist-classifier 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for octmnist-classifier 0.1.2
File Size Uploaded Provenance Actions
octmnist_classifier-0.1.2.tar.gz 7.3 kB Without provenance Details for octmnist_classifier-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for octmnist-classifier 0.1.2
File Interpreter ABI Platform Actions
octmnist_classifier-0.1.2-py3-none-any.whl Python 3 none any Details for octmnist_classifier-0.1.2-py3-none-any.whl

Total release size: 15.3 kB

Release files / octmnist_classifier-0.1.2.tar.gz

Download URL octmnist_classifier-0.1.2.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3c51894f80a612a45cd5c54d5eb4bb32d029cb3c8c1f3c7f68e47fcdaa568d31
BLAKE2b-256 checksum
How to use checksums
b9bf8973dc703101f5c8d186fd45f6f74fdc0e1abf9a84d6c127bdef74365fb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Release files / octmnist_classifier-0.1.2-py3-none-any.whl

Download URL octmnist_classifier-0.1.2-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05124abb3a9438b686ff77937d68fce40cd79e552b75695216e42d1f7b624c2c
BLAKE2b-256 checksum
How to use checksums
04e8e7b4b3b4a91761997fb5fc4cc69109418f69360ccc1c7768dd6c6ca5b4bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Security for octmnist-classifier 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page