Skip to content

danielroshardt/assignment5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chest X-ray Disease Classification with DenseNet121

This project trains a deep learning model using transfer learning (DenseNet121) to classify chest X-ray images into 15 categories (14 disease states + "No_Finding") using the NIH Chest X-ray dataset.


πŸ“ Dataset

  • Source: NIH Chest X-ray dataset (provided on HiPerGator)
  • Path: /lustre/fs0/bsc4892/share/ChestXray-NIHCC/images_14_cat
  • Classes: 15 total (including "No_Finding")

🧠 Model & Approach

  • Architecture: DenseNet121 with pretrained ImageNet weights
  • Modification: Final classifier layer adjusted to output 15 classes
  • Loss Function: CrossEntropyLoss with class balancing via WeightedRandomSampler
  • Optimizer: Adam (lr=1e-4)

πŸ” Training Details

  • Image Size: 224 x 224
  • Epochs: 5
  • Batch Size: 32
  • Transforms:
    • Resize
    • ToTensor
    • Normalize (ImageNet stats)

πŸ“Š Evaluation

  • Confusion Matrix: Plotted after model evaluation
  • Metrics: Accuracy, Precision, Recall, F1-score via classification_report

πŸ§ͺ Reproducibility

Dependencies

See requirements.txt for all required libraries. Key ones include:

  • torch
  • torchvision
  • matplotlib
  • seaborn
  • scikit-learn
  • tqdm

πŸ“ Notes

  • The model uses a weighted sampler to handle class imbalance.
  • ROC curves can be added by calculating per-class AUC using roc_auc_score from sklearn.

πŸ“‚ Files in this Repository

  • chest_xray_densenet.ipynb – Full training and evaluation notebook
  • README.md – This file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors