Skip to content

Repository files navigation

Protein Multi-Label Classification

Multi-label classification of protein types in biological microscopy images using deep learning.

Overview

This project applies transfer learning to classify different protein localizations in human cells. Multiple protein types can coexist in a single image, making this a multi-label classification problem.

Dataset

Human Protein Atlas - Fluorescence microscopy images of human cells

  • Total Samples: ~19,000 images
  • Training Set: 17,335 images (90%)
  • Validation Set: 1,901 images (10%)
  • Image Size: 512 × 512 pixels
  • Classes: 10 protein localization types

Protein Classes

  1. Mitochondria
  2. Nuclear bodies
  3. Nucleoli
  4. Golgi apparatus
  5. Nucleoplasm
  6. Nucleoli fibrillar center
  7. Cytosol
  8. Plasma membrane
  9. Centrosome
  10. Nuclear speckles

Architecture

Model: ResNet34 with Transfer Learning

  • Base: Pre-trained ResNet34 (ImageNet weights)
  • Modifications: Replace final FC layer (512 → 10 outputs)
  • Activation: Sigmoid (for multi-label predictions)
  • Loss: Binary Cross-Entropy
  • Optimizer: Adam

Training Strategy:

  1. Phase 1: Freeze backbone, train final layer (5 epochs)
  2. Phase 2: Unfreeze and fine-tune all layers

Data Augmentation:

  • Random crop
  • Random horizontal flip
  • Random rotation (±10°)
  • Random erasing

Results

Phase 1 (Frozen Backbone)

Epoch Train Loss Val Loss F1 Score
0 0.2891 0.3427 0.3954
4 0.2285 0.2160 0.6660

Phase 2 (Full Network)

Epoch Train Loss Val Loss F1 Score
0 0.2216 0.2225 0.6479
2 0.2145 0.2068 0.6930

Final Performance: F1 Score = 69.30%

Tech Stack

  • Python, PyTorch
  • torchvision (pre-trained models, transforms)
  • scikit-learn (metrics)
  • Jupyter Notebook

Repository Structure

├── Protein Multi-label classification.ipynb
├── README.md
└── LICENSE

Getting Started

# Install dependencies
pip install torch torchvision pandas numpy scikit-learn pillow tqdm

# Run the notebook
jupyter notebook "Protein Multi-label classification.ipynb"

Author

Haider Zainuddin Ali
GitHub | LinkedIn

License

MIT License

About

Classifying different kind of protein cells.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages