CoolFace
Modelpublic

rehabaam/ds-cxr-covid19

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
Model Card

Chest X-Ray Classification Model (🦠)

πŸ“‹ Overview

This project focuses on building and evaluating a Convolutional Neural Network (CNN) model for classifying chest X-ray images into four categories:

  • β€”Normal
  • β€”Pneumonia
  • β€”Lung Opacity
  • β€”COVID-19

The model was trained using masked chest X-ray images (lungs only) to enhance focus on medically relevant areas.

βΈ»

🧠 Model Architecture

The CNN model includes:

  • β€”Input size: (256, 256, 1) RGB masked lung images
  • β€”Convolutional blocks: Conv2D(32) β†’ Conv2D(64) β†’ Conv2D(128) β†’ Conv2D(256) β†’ Conv2D(512)
  • β€”ASPP Block: Atrous Spatial Pyramid Pooling (ASPP) to capture multi-scale features.
  • β€”Attention Block: Squeeze-and-Excitation (SE Block) applied after key stages.
  • β€”Pooling Layers: Global Average Pooling 2D
  • β€”Custom Loss function: Focuses more on hard examples and less on easy one.
  • β€”Classifier Head: Dense β†’ Softmax for multiclass classification (4 classes)

Additional techniques used:

  • β€”Data Augmentation: Random flipping, rotation (range from 0 to 10 degrees)
  • β€”Dropout: Regularization to prevent overfitting (20%)
  • β€”EarlyStopping & ReduceLROnPlateau: For efficient training

πŸ“Š Metrics

Final evaluation results:

MetricScore
Accuracy~93%
Precision~92%
Recall~92%
F1-Score~92%

Note:

  • β€”The dataset was balanced manually into training and validation datasets (80%/20%)
  • β€”Grad-CAM visualization was used to verify model attention inside the lungs.
  • β€”The model is still being improved for higher F1 scores.

πŸ—ƒ Dataset

  • β€”Source: https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database
  • β€”Masked lungs: Masked lungs were generated using GAN model (maja011235/lung-segmentation-gan)

πŸš€ Future Work

  • β€”Fine-tuning with different loss functions
  • β€”Model ensembling
  • β€”Clinical-grade evaluation with external datasets