Built to order

COVID-19 Detection using Chest X-Rays

This project builds a convolutional neural network that classifies chest X-rays into COVID-19, viral pneumonia, lung opacity and normal using the COVID-19 Radiography Database, with COVIDx as an external validation set. A training notebook logs sensitivity, specificity, ROC-AUC and the confusion matrix on a held-out test split, Grad-CAM heatmaps show which lung regions drove each prediction, and a Flask demo app classifies uploaded radiographs. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

COVID-19 Detection using Chest X-Rays — project thumbnail preview
More project photos (3)

The problem

During the pandemic, chest X-ray analysis became a frontline triage aid — but reading radiographs is expert work, radiologists were overwhelmed, and PCR turnaround could take a day or more. Deep learning offered a fast second reader: the open-source COVID-Net project (Wang and Wong, University of Waterloo, 2020) showed a tailored CNN could flag COVID-19 patterns in chest X-rays, and released the COVIDx dataset so others could build on it. This project reconstructs that line of work as a complete student build: a transfer-learned classifier trained on the COVID-19 Radiography Database across 4 classes, validated externally on COVIDx, with Grad-CAM explanations and a careful discussion of dataset bias — the issue examiners probe first in this topic. It demonstrates medical-image classification end to end while being explicit that it is a research prototype, not a diagnostic device, and that PCR plus clinical assessment remains the reference standard.

SYSTEM FLOW

5 components 7 connections

Live flow
Drag to explore
100%
storageChest X-ray set

COVID-19 Radiography Database images across COVID, lung opacity, normal and viral pneumonia, de-duplicated before splitting; COVIDx held separate.

Follow the working sequence

How it works

  1. The COVID-19 Radiography Database is downloaded (chest X-rays across COVID, lung opacity, normal, viral pneumonia) and exact duplicates are removed before any split.
  2. Images are resized to 224x224, normalized, and split with stratification; COVIDx is held entirely separate as the external validation set.
  3. An ImageNet-pretrained DenseNet121 (or ResNet50) is fine-tuned in two phases — classifier head first, then the top backbone blocks at a lower learning rate — with class-weighted loss.
  4. Training uses X-ray-appropriate augmentation and logs loss, accuracy, sensitivity and specificity per epoch on the validation split.
  5. The evaluation notebook computes final metrics on the held-out test split: per-class precision/recall/F1, 4x4 confusion matrix, ROC-AUC one-vs-rest, and the COVIDx external-validation scores.
  6. The Flask demo accepts an uploaded radiograph, runs inference, and displays the predicted class with confidence, the Grad-CAM overlay and the threshold-adjustable probability panel.

Tech stack:

  • Python 3.10, PyTorch / TensorFlow-Keras (transfer-learning classifier)
  • OpenCV (CLAHE contrast enhancement, preprocessing)
  • scikit-learn (metrics, ROC-AUC, stratified splits)
  • Grad-CAM implementation (explainability heatmaps)
  • Matplotlib, Seaborn (curves, ROC plots, confusion matrix)
  • Flask demo web app (radiograph upload, triage-style result panel)
  • Jupyter notebook (buyer-run training and evaluation)
Parameter Value
Task 4-class chest X-ray classification (triage-style screening aid)
Dataset COVID-19 Radiography Database (Kaggle) — COVID, lung opacity, normal, viral pneumonia; COVIDx (Wang & Wong, U. Waterloo) for external validation
Model DenseNet121 or ResNet50, ImageNet transfer learning, two-phase fine-tuning, class-weighted loss
Input Chest X-ray images resized to 224x224, contrast-normalized
Output Predicted class, per-class probabilities, Grad-CAM lung overlay
Evaluation Per-class precision/recall/F1, 4x4 confusion matrix, ROC-AUC one-vs-rest, COVIDx external scores — computed by the notebook on your held-out split
Design targets COVID-class sensitivity ~0.92, specificity ~0.94 (targets, not measured claims)
Demo Flask app with upload, triage panel, heatmap overlay, threshold slider
Scope note Academic research prototype — not a medical device; PCR and clinical assessment remain the reference standard

Project features

  • [4-class chest X-ray classifier] DenseNet121 / ResNet50 fine-tuned on the COVID-19 Radiography Database across COVID-19, viral pneumonia, lung opacity and normal.
  • [COVIDx external validation] The trained model is additionally evaluated on COVIDx (COVID vs non-COVID) as an out-of-distribution check, with the performance gap discussed honestly in the report.
  • [Radiograph preprocessing] Resize to 224x224, contrast normalization (CLAHE option), and augmentation tuned for X-rays — rotations, translations, brightness — without flips that would break anatomical orientation.
  • [Grad-CAM lung overlays] Heatmaps highlighting the lung regions behind each prediction, expected to concentrate on bilateral peripheral opacities for COVID-19 cases.
  • [Duplicate-removal pipeline] Exact-duplicate detection before splitting, since public X-ray collections are known to contain near-duplicate images that leak across splits.
  • [Triage-style demo UI] The Flask app returns the predicted class, confidence, Grad-CAM overlay and a per-class probability panel styled as a radiology worklist aid.
  • [Threshold analysis] The notebook plots ROC curves one-vs-rest and shows how moving the COVID decision threshold trades sensitivity against specificity.
  • [Bias documentation] Dataset notes cover source bias (COVID vs normal images from different collections), the pediatric/adult mix in pneumonia images, and what the build does about each.

What is included

  • Complete source code (data pipeline, duplicate removal, training, Grad-CAM, demo app, evaluation utilities)
  • Jupyter training and evaluation notebook (buyer-run: train, validate, threshold analysis, external validation)
  • Flask demo application with radiograph upload and triage-style result panel
  • Project report PDF (background, COVID-Net lineage, dataset bias analysis, methodology, evaluation, limitations)
  • PPT presentation for final review
  • Viva Q&A preparation document (transfer learning, sensitivity vs specificity, ROC-AUC, Grad-CAM, dataset bias, why not a diagnostic device)
  • Setup guide (environment, dataset download, training on CPU/GPU, running the demo)

Advantages

  • 4-class chest X-ray classifier (COVID-19, viral pneumonia, lung opacity, normal) on the COVID-19 Radiography Database, using DenseNet121 and ResNet50 fine-tuning.
  • COVIDx external validation (COVID versus non-COVID) as an out-of-distribution check, with the performance gap discussed honestly in the report.
  • Radiograph preprocessing at 224x224 with contrast normalization (CLAHE option) and augmentation tuned for X-rays: rotations, translations and brightness, without flips that would break anatomical orientation.
  • Grad-CAM lung overlays highlighting the lung regions behind each prediction, expected to concentrate on bilateral peripheral opacities for COVID-19 cases.
  • Duplicate-removal pipeline before splitting, since public X-ray collections are known to contain near-duplicate images that leak across splits.
  • Triage-style demo UI returning predicted class, confidence, Grad-CAM overlay and per-class probability panel, plus threshold analysis plotting ROC curves one-vs-rest and the sensitivity versus specificity tradeoff.

Disadvantages

  • Academic prototype, not a medical device: not clinically validated, not certified, and must never guide diagnosis or treatment; PCR testing and clinical assessment remain the reference standard for COVID-19.
  • Public X-ray collections carry source bias: COVID and normal images often come from different hospitals and scanners, so the model can partly learn the source instead of the disease; COVIDx external validation quantifies it.
  • Chest X-ray findings overlap across respiratory illnesses: viral pneumonia and lung opacity are genuinely confusable with COVID-19 patterns, and the confusion matrix will show it.
  • The model reads a single frontal radiograph; real triage uses symptoms, vitals, exposure history and often CT, none of which this project sees.
  • Performance on any hospital's own scanner data is not promised; acquisition differences shift image statistics.

Limitations & prerequisites

  • This is an academic prototype, not a medical device: not clinically validated, not certified, and must never guide diagnosis or treatment — PCR testing and clinical assessment remain the reference standard for COVID-19.
  • Public X-ray collections carry source bias — COVID and normal images often come from different hospitals and scanners, so the model can partly learn the source instead of the disease; the report discusses this openly and COVIDx external validation quantifies it.
  • Chest X-ray findings overlap across respiratory illnesses: viral pneumonia and lung opacity are genuinely confusable with COVID-19 patterns, and the confusion matrix will show it.
  • The model reads a single frontal radiograph; real triage uses symptoms, vitals, exposure history and often CT — none of which this project sees.
  • Performance on any hospital's own scanner data is not promised; acquisition differences shift image statistics.
  • Reported metrics come from the buyer's own training run and vary with dataset version, split, preprocessing and hyperparameters; design targets are goals, not guarantees.

Frequently Asked Questions

Which datasets are used?

The COVID-19 Radiography Database (Kaggle — chest X-rays across COVID, lung opacity, normal and viral pneumonia) for training, and COVIDx (Wang and Wong, University of Waterloo, released with COVID-Net) as a separate external validation set.

Which model is used?

A DenseNet121 or ResNet50 backbone with ImageNet transfer learning, fine-tuned in two phases with class-weighted loss. The notebook also includes a small custom CNN baseline for comparison.

Is the accuracy guaranteed?

No. The page states design targets (COVID sensitivity ~0.92, specificity ~0.94), but actual numbers come from your training run — including the COVIDx external-validation scores — logged by the notebook and presented in the report.

Is this a medical device? Can it diagnose COVID-19?

No. This is strictly an academic research prototype. It is not clinically validated or certified and must never be used for diagnosis or triage decisions; PCR testing and clinical assessment are the reference standard.

What is dataset bias, and why does the report discuss it?

COVID and normal images in public collections often come from different sources, so a model can learn scanner or demographic differences instead of disease patterns. The build addresses this with duplicate removal, careful splits, COVIDx external validation — and an honest discussion section.

What will I receive with the project?

Source code, the training/evaluation notebook, the Flask demo app, report PDF, PPT, viva Q&A document and setup guide — everything prepared fresh for your build. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Components & software requirements
  • Python 3.10, PyTorch / TensorFlow-Keras (transfer-learning classifier)
  • OpenCV (CLAHE contrast enhancement, preprocessing)
  • scikit-learn (metrics, ROC-AUC, stratified splits)
  • Grad-CAM implementation (explainability heatmaps)
  • Matplotlib, Seaborn (curves, ROC plots, confusion matrix)
  • Flask demo web app (radiograph upload, triage-style result panel)
  • Jupyter notebook (buyer-run training and evaluation)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Chowdhury et al. (2020), Can AI Help in Screening Viral and COVID-19 Pneumonia? (IEEE Access)

Related guides

All guides

YOLO Object Detection for Final-Year Projects: Datasets, Colab Training, mAP and Deployment

How do you build a YOLO object detection project for your final year? Start with a labelled dataset in YOLO format (300-500+ images per class with real variation), train a small pretrained model on Google Colab with early stopping, evaluate with mAP@0.5 and mAP@0.5:0.95 on a held-out test set, and deploy the exported model on your demo hardware. This guide covers the full pipeline - version choice, labelling discipline, Colab training, honest evaluation, common errors, and deployment - with the decision tables and checklists your report needs.

Read guide

Confusion Matrix Explained: Precision, Recall, F1 and ROC for Student ML Projects

A confusion matrix shows not just how often a classifier is right, but how it is wrong. This guide explains the four cells (TP, FP, TN, FN), derives precision, recall, specificity and F1 with a small illustrative example, and covers imbalanced classes, threshold choice, ROC curves and AUC, and multi-class averaging.

Read guide

ML Evaluation Metrics Explained: Accuracy, Precision, Recall, F1 and ROC-AUC with Worked Examples

Confused by accuracy, precision, recall, F1 and ROC-AUC? Start from the confusion matrix: precision measures how many flagged cases were correct, recall measures how many real cases were caught, F1 balances the two, and ROC-AUC rates ranking quality across thresholds. On imbalanced data, accuracy lies - report per-class metrics and macro-F1 instead. This guide works every formula with numbers you can adapt into your project report.

Read guide
Get a quotation