Deep Learning pipeline for Retinitis Pigmentosa (RP) gene group classification using Convolutional Neural Networks and Transfer Learning with ResNet architectures.
Retinitis Pigmentosa (RP) is a heterogeneous group of inherited retinal dystrophies caused by mutations in over 80 genes. This project develops a CNN-based classification pipeline to distinguish between 5 gene groups — both syndromic and non-syndromic — from retinal imaging data, leveraging Transfer Learning with ResNet models pre-trained on ImageNet.
- Transfer Learning with ResNet (ResNet-18 / ResNet-50) via PyTorch & torchvision
- 5-class classification covering syndromic and non-syndromic RP gene groups
- K-Fold Cross-Validation for robust model evaluation across data splits
- Detailed metrics: Classification Report, Confusion Matrix, per-class accuracy
- Reproducible training pipeline with configurable hyperparameters
| Group | Type | Description |
|---|---|---|
| Group 1 | Non-syndromic | Autosomal dominant RP genes |
| Group 2 | Non-syndromic | Autosomal recessive RP genes |
| Group 3 | Non-syndromic | X-linked RP genes |
| Group 4 | Syndromic | Usher syndrome genes |
| Group 5 | Syndromic | Bardet-Biedl syndrome genes |
RP-CNN-Classification/
│
├── notebooks/ # Jupyter notebooks for experiments
│ └── .gitkeep
│
├── docs/ # Documentation and figures
│ └── .gitkeep
│
├── .github/
│ └── ISSUE_TEMPLATE/
│ ├── bug_report.md
│ └── feature_request.md
│
├── README.md
├── LICENSE
├── .gitignore
└── requirements.txt
- Python 3.8+
- CUDA-compatible GPU (recommended)
# Clone the repository
git clone https://github.com/YOUR_USERNAME/RP-CNN-Classification.git
cd RP-CNN-Classification
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtOpen and run the main training notebook:
jupyter notebook notebooks/The pipeline uses stratified K-Fold cross-validation. Each fold trains a ResNet model from scratch (with frozen/unfrozen backbone options) and evaluates on the held-out fold.
After training, the pipeline produces:
- Confusion Matrix — per-fold and aggregated
- Classification Report — precision, recall, F1-score per gene group
- Accuracy curves — training vs. validation per epoch
Results section to be updated after final experiments.
| Model | Folds | Mean Accuracy | Mean F1 (macro) |
|---|---|---|---|
| ResNet-18 | 5 | — | — |
| ResNet-50 | 5 | — | — |
See requirements.txt for the full list. Core libraries:
- PyTorch — model training and inference
- torchvision — ResNet models and image transforms
- scikit-learn — cross-validation and metrics
- Pillow — image loading
- matplotlib / seaborn — visualization
This project was developed as part of a Deep Learning coursework focused on medical image analysis and genetic classification of retinal diseases.
This project is licensed under the MIT License — see the LICENSE file for details.