Skip to content

arnavgarg233/2.5CNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2.5 CNN: Leveraging 2D CNNs to Pretrain 3D Models in Low-Data Regimes for COVID-19 Diagnosis

License: MIT — see LICENSE.

Python 3.10+ License: MIT Status: published

Official code for 2D / 2.5D / 3D CNN pipelines on COVID-19 CT volumes and slices: pretraining and fine-tuning when 3D labels are scarce.

Publication

Journal Electronics (MDPI)
Article MDPI landing page
DOI 10.3390/electronics14132571
PDF Direct PDF
Article license Open access CC BY 4.0 (see journal page for legal text)
Code license MIT (LICENSE)
Authors Arnav Garg, Aksh Garg, Dominique Duncan (corresponding)

Citation:

@Article{electronics14132571,
  AUTHOR = {Garg, Arnav and Garg, Aksh and Duncan, Dominique},
  TITLE = {2.5 CNN: Leveraging 2D CNNs to Pretrain 3D Models in Low-Data Regimes for COVID-19 Diagnosis},
  JOURNAL = {Electronics},
  VOLUME = {14},
  YEAR = {2025},
  NUMBER = {13},
  ARTICLE-NUMBER = {2571},
  URL = {https://www.mdpi.com/2079-9292/14/13/2571},
  ISSN = {2079-9292},
  DOI = {10.3390/electronics14132571}
}

Plain: Garg, A.; Garg, A.; Duncan, D. 2.5 CNN: Leveraging 2D CNNs to Pretrain 3D Models in Low-Data Regimes for COVID-19 Diagnosis. Electronics 2025, 14 (13), 2571. https://doi.org/10.3390/electronics14132571

Overview

End-to-end training and evaluation for classifying CT scans with 2D slice and 3D volume models, data augmentation, class imbalance handling, and optional GPU job scheduling via multiplexer/.

Key features

  • Architectures: 2D CNNs, 3D CNNs, hybrid / 2.5D-style use of 2D pretraining for 3D (see paper).
  • Data: Custom datasets, transforms, weighted sampling for imbalanced medical labels.
  • Training: YAML configs under Configs/; Weights & Biases support; checkpoints and resume.
  • Ops: multiplexer/ for batch GPU scheduling and experiment queues.
  • Evaluation: Multi-class and binary setups, confusion matrices, prediction logging, visualization scripts.

Installation

Requirements: PyTorch, MONAI (medical imaging), Weights & Biases, NumPy, Pillow, PyYAML (pin versions to your CUDA / platform).

git clone https://github.com/arnavgarg233/2.5CNN.git
cd 2.5CNN
# create env (conda or venv), then install PyTorch (CUDA/MPS/CPU), MONAI, wandb, PyYAML, Pillow, NumPy

Quick start

python src/launch.py --config Configs/config.yaml

Override hyperparameters:

python src/launch.py --config Configs/custom.yaml --batch_size 32 --learning_rate 0.001

GPU scheduling (optional):

cd multiplexer
python scheduler.py

Data format

Expected layout (.npy per sample: 2D slice or 3D volume):

data/
├── train/
│   ├── class_0/
│   ├── class_1/
│   └── ...
└── val/
    ├── class_0/
    ├── class_1/
    └── ...

Class labels: 5 severity levels (0–4), normal through critical.

Repository structure

2.5CNN/
├── Configs/           # YAML training configs
├── Data/              # Datasets, transforms, weighted sampling
├── Models/            # 2D / 3D / hybrid model code and notebooks
├── Scripts/           # Visualization, storage, 2D vs 3D comparisons
├── Utils/             # Helpers, timing, system checks
├── multiplexer/       # GPU scheduler and job configs
├── src/               # launch.py, evaluate.py, core training entrypoints
├── LICENSE
└── README.md

License

MIT License — see LICENSE. Copyright (c) 2025 Arnav Garg, Aksh Garg, Dominique Duncan.

Contact

Arnav Garg · arnavgarg888@gmail.com

For questions about the published article, contact the corresponding author listed on the MDPI page.

About

2.5 CNN: leverage 2D CNNs to pretrain 3D models for low-data COVID-19 CT diagnosis. Official code for Electronics (MDPI) 2025, 14(13):2571.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors