Skip to content
Ananda Technologies Pvt. Ltd.
  • AI & ML
  • Python
  • M.Tech
  • Abstract available · Project in build
  • 40% OFF

Chest X-ray Pneumonia Detection M.Tech Project: Single-Stage Hybrid CNN-ViT with Cross-Attention Fusion and Lung Masking for TB

Chest X-ray pneumonia detection M.Tech project with source code: a single-stage ResNet50 and ViT hybrid with cross-attention and U-Net lung masking labels X-rays as normal, pneumonia or TB, with an external hospital test. Includes thesis and IEEE paper.

ForM.Tech CSEM.Tech IT

Platform
AI & ML + Python
Thesis delivery
3–5 days, for you
1-on-1 setup
AnyDesk / Meet
Support
Till your viva
  • Source code
  • Thesis + paper
  • Review PPTs
  • Viva book
AI & ML + PYTHONChest X-ray Pneumonia Detection M.Tech Project: Single-Stage Hybrid CNN-ViT with Cross-Attention Fusion and Lung Masking for TB

About this project

About the chest X-ray pneumonia detection M.Tech project

A chest X-ray is the first test for most lung infections, and India carries a heavy load of both pneumonia and tuberculosis. This chest X-ray pneumonia detection M.Tech project reads a chest radiograph and labels it as normal, pneumonia or tuberculosis in one pass, with an attention map drawn only over the lung fields.

The research question: can a CNN and a Vision Transformer that query each other beat both single models and a two-step hybrid, even on X-rays from an unseen hospital?

Research behind it

Base paper. The work starts from From Binary to Multi-Class Classification: A Two-Step Hybrid CNN-ViT Model for Chest Disease Classification Based on X-Ray Images, published in Diagnostics (MDPI, 2024). It fuses a residual CNN with a ViT, first detects TB and then separates TB, viral pneumonia, bacterial pneumonia and normal, using public Kaggle collections.

Research gap. The two-step design needs two passes, and in its multi-class step a plain transformer did slightly better than the hybrid, so the fusion itself can improve. Public collections mix images from different sources, and a model may learn borders, text labels or scanner style rather than lungs. The study also does not test on X-rays from another hospital.

Proposed system and novelty. A U-Net first masks everything outside the lungs. ResNet50 then gives local feature tokens and ViT-Small gives global patch tokens. In a cross-attention block each branch asks the other which regions matter, and the two summaries feed one three-class head. The model is tested without retraining on the Shenzhen and Montgomery TB sets, and Grad-CAM and attention rollout maps are scored by how much of each map lies inside the lung mask.

Models compared. ResNet50, DenseNet121, ViT-Small and the base paper two-step hybrid re-implemented, against the proposed model, on one patient-wise split. The ablation removes lung masking, swaps cross-attention for plain concatenation and keeps one branch at a time.

A similar idea of joining two kinds of features appears in the deepfake image detection project, where spatial and frequency clues are combined.

How it works

  • A technician registers the patient and uploads the chest X-ray.
  • U-Net finds the lung fields, and the rest of the image is masked.
  • The image is enhanced with CLAHE and resized for both branches.
  • The hybrid returns normal, pneumonia or TB with a confidence score.
  • Disease cases above the limit move to the top of the radiologist's queue.
  • Grad-CAM and attention maps are laid over the X-ray.
  • The radiologist confirms or corrects the label and downloads a PDF report.

Users and modules

There are three roles. The technician uploads images and patient details and is told when the report is ready. The radiologist works through a priority queue, checks the lung mask and attention map, corrects the label if needed and signs the report. The admin manages users and scans, watches the dashboard, opens the model comparison page and edits settings.

What you get

  • Phase 1 Research: Base paper study: two-step hybrid CNN-ViT (Diagnostics, MDPI, 2024); Literature survey of 15-20 recent chest X-ray papers; Research gap, novelty and objectives; TB and pneumonia dataset EDA notebook; Synopsis and Phase-1 report.
  • Phase 2 Implementation: Flask web app with radiologist, technician and admin panels; U-Net lung masking and CLAHE pipeline; Baselines and two-step hybrid re-implementation; Proposed cross-attention CNN-ViT model; Grad-CAM and attention rollout module; MySQL database and trained models.
  • Results: Accuracy, macro F1, TB recall and ROC-AUC; External test on Shenzhen and Montgomery sets; Ablation graphs and map-in-lung scores; results.xlsx and all graphs in high resolution.
  • Thesis and paper: Thesis written for you (about 90 pages); IEEE conference paper draft; Journal paper draft; Publication guide.
  • Reviews, viva and support: PPTs for Review 1, Review 2 and final viva; Viva book with 50+ questions; A1 poster and project diary; Demo and code walkthrough videos; 1-on-1 setup, 2 revisions and support till viva.

Who can use this project

This suits M.Tech and M.E. students of CSE and IT who want a medical imaging dissertation with a modern architecture and a clear base paper. Students searching for a hybrid CNN vision transformer project, a cross-attention fusion medical imaging project or a lung segmentation U-Net project will find each part here. Training code is in commented PyTorch notebooks, and the web app loads the saved model on a CPU.

Who can take it

M.Tech CSE and M.Tech IT students who need a complete dissertation: research, working project, thesis and paper.

Your thesis stays unique

  • Different title variant for every student
  • Thesis and paper written fresh for you
  • Checked against all earlier copies
  • Same college, same year never repeated

Research behind it

Single-Stage Hybrid CNN-ViT with Cross-Attention Fusion and Lung-Field Masking for Explainable Pneumonia and Tuberculosis Detection in Chest X-rays

BASE PAPER

From Binary to Multi-Class Classification: A Two-Step Hybrid CNN-ViT Model for Chest Disease Classification Based on X-Ray Images

Y. Hadhoud, T. Mekhaznia, A. Bennour, M. Amroune, N. A. Kurdi, A. H. Aborujilah and M. Al-Sarem

Diagnostics, vol. 14, no. 23, Art. no. 2754, MDPI, open access under CC BY 4.0, 2024

DOI link Free copy

EXISTING SYSTEM

A recent hybrid CNN-ViT model works in two steps, first detecting TB and then separating pneumonia types, and in the multi-class step a plain transformer did slightly better than the hybrid. Models trained on mixed public collections can also pick up labels and borders instead of lung patterns.

PROPOSED SYSTEM

One single-stage model joins ResNet50 and ViT-Small tokens through cross-attention and reads only the lung fields after U-Net masking. It is compared with three single models and the re-implemented two-step hybrid, tested on Shenzhen and Montgomery X-rays without retraining, and explained with maps scored against lung masks.

RESEARCH GAP

  • The pipeline runs in two steps; a single-stage model that handles all classes in one pass is not studied.
  • In the multi-class step the standalone vision transformer slightly outperformed the hybrid, which leaves room for a better fusion design.
  • This work adds lung-field masking and an external test on other hospitals to check that the model reads the lungs and not source-specific artefacts.
  • Visual explanations for the hybrid, checked against lung regions, are added in this work.

NOVELTY

  • A single-stage three-class hybrid with bidirectional cross-attention fusion, compared with the two-step hybrid of the base paper.
  • U-Net lung-field masking before classification to reduce shortcut learning from labels and borders.
  • External test on the Shenzhen and Montgomery TB sets from other hospitals without retraining.
  • Grad-CAM and attention rollout scored by how much of the map falls inside the lung mask.

What you get

24 items, in the order you need them during M.Tech. This project is being built: the free abstract is ready now, and our team delivers everything below after you book.

Phase 1 Research

  • Base paper study: two-step hybrid CNN-ViT (Diagnostics, MDPI, 2024)
  • Literature survey of 15-20 recent chest X-ray papers
  • Research gap, novelty and objectives
  • TB and pneumonia dataset EDA notebook
  • Synopsis and Phase-1 report

Phase 2 Implementation

  • Flask web app with radiologist, technician and admin panels
  • U-Net lung masking and CLAHE pipeline
  • Baselines and two-step hybrid re-implementation
  • Proposed cross-attention CNN-ViT model
  • Grad-CAM and attention rollout module
  • MySQL database and trained models

Results

  • Accuracy, macro F1, TB recall and ROC-AUC
  • External test on Shenzhen and Montgomery sets
  • Ablation graphs and map-in-lung scores
  • results.xlsx and all graphs in high resolution

Thesis and paper

  • Thesis written for you (about 90 pages)
  • IEEE conference paper draft
  • Journal paper draft
  • Publication guide

Reviews, viva and support

  • PPTs for Review 1, Review 2 and final viva
  • Viva book with 50+ questions
  • A1 poster and project diary
  • Demo and code walkthrough videos
  • 1-on-1 setup, 2 revisions and support till viva

Included free with this project

1-on-1 setup session on AnyDesk or Google Meet

After you buy, we schedule a session at a time that suits you. Our developer installs the complete project on your own laptop, runs it with you and explains it — so you can present it with confidence.

  1. 1

    Pick a time

    We call or WhatsApp you to fix the slot

  2. 2

    We install it

    Full setup on your system over AnyDesk

  3. 3

    We explain it

    Flow, modules and database on Google Meet

Modules inside

15 working modules — each one is explained in the report.

  • Radiologist: secure login with role-based access
  • Radiologist: register patients and upload chest X-ray images
  • Radiologist: normal, pneumonia or TB result with confidence
  • Radiologist: lung mask preview and attention map overlay
  • Radiologist: confirm or correct the result and add findings
  • Radiologist: download a PDF report with image and findings
  • Radiologist: patient history and priority queue for urgent cases
  • Technician: upload X-rays and fill patient details
  • Technician: status notifications when a report is ready
  • Analytics page: cases per class and per week
  • Admin: dashboard with scan counts and chart
  • Admin: manage radiologists, technicians, patients and scans
  • Admin: model comparison page (ResNet50, DenseNet121, ViT, two-step hybrid, proposed)
  • Admin: settings for confidence limit and report header
  • Profile, change password and notifications for every role

Want an extra module or a change?

We can add the features your guide asked for. Tell us what to change and get a quote on WhatsApp.

Customise this project

Technology used

Built with
Python 3.11, Flask (blueprints), Jinja2PyTorch and torchvision (CPU inference)timm for pretrained ResNet50, DenseNet121 and ViT-SmallCross-attention fusion block between CNN and ViT tokensU-Net lung segmentation for maskingGrad-CAM and attention rollout for explanationsOpenCV and scikit-learn for preprocessing and metricsMySQL (XAMPP) with PyMySQLBootstrap 5 and Chart.js (local copies)Jupyter Notebook and Google Colab for training
Documents
Project abstract (2 pages, Word and PDF), Synopsis (Word and PDF), Phase-1 report (Word and PDF), Thesis / dissertation written for you (Word and PDF, about 90 pages), IEEE conference paper draft (Word), Journal paper draft (Word), Publication guide, Review 1, Review 2 and final viva PPTs, Viva book with 50+ questions and answers, A1 poster (PDF and PPTX), Project diary / logbook and guide meeting record, Setup guide with first-run checklist (Word and PDF), Project explanation with code walkthrough, Demo video and code walkthrough video

How buying works

  1. 1

    Read the free abstract

    Show it to your guide first

  2. 2

    Book on WhatsApp

    Sign in and tap Book

  3. 3

    Our team calls you

    Price, timeline and your details

  4. 4

    Project built for you

    Code, results and videos

  5. 5

    Thesis and paper

    Written with your details

  6. 6

    1-on-1 setup

    Installed and explained

How to run it

An overview — the full guide comes with the project, and we help you if anything doesn’t start.

  1. 1Install Python 3.11 (tick "Add to PATH") and XAMPP; start MySQL in XAMPP.
  2. 2Extract the project ZIP to a short path such as D:\MTech\.
  3. 3Open phpMyAdmin, create the database mtech_chestxray and import Database\mtech_chestxray.sql.
  4. 4Check config.py (default XAMPP user root with an empty password).
  5. 5Double-click Web_App\chest_xray_pneumonia_detection\run.bat: it creates the virtual environment and installs the requirements the first time.
  6. 6The browser opens at http://127.0.0.1:5000; log in with the demo accounts from README.txt.
  7. 7Trained models are already in the models folder, so no training is needed for the demo.
  8. 8Full steps with screenshots and the first-run checklist are in SETUP_GUIDE.pdf.

Questions about Chest X-ray Pneumonia Detection M.Tech…

Which base paper and X-ray collections are used for training and testing?

The base paper is the two-step hybrid CNN-ViT model in Diagnostics (2024). Training uses the public Kaggle TB database and the Guangzhou pneumonia images; the Shenzhen and Montgomery sets are kept only for external testing.

Why mask the X-ray to the lungs first?

Without masking, a model can learn hospital text labels or film borders that happen to match a class. Masking forces it to read lung tissue, and the ablation shows the difference.

Can it tell bacterial pneumonia from viral pneumonia?

The default model uses three classes. The same code can be trained with separate bacterial and viral labels as your model change, and the thesis can discuss that variant.

Will my thesis match another student's thesis?

No. Your title, your model change and your thesis are your own, and the thesis is written fresh for you. Before delivery it is checked against all earlier copies of this project and must be under 10% match.

Does the hybrid run without a GPU?

Yes. The trained model and the U-Net are included, and one prediction takes a few seconds on a normal laptop. Training is done on Google Colab with the given notebook.

Chest X-ray Pneumonia Detection M.Tech… is "in build" — what does that mean?

The free abstract is ready now; the code, model and results are being built. Sign in and tap Book this project on WhatsApp: our team calls you, confirms the price and timeline, and delivers the project, thesis, papers and PPTs with your details.

Do I need a GPU or to train the model?

No. The trained model comes with the project. We install and run it on your own laptop in the free 1-on-1 setup session.

My university needs its own thesis format.

Upload your university format in the details form after you pay. Your thesis is written in that format.

Can I see something before buying?

Yes. Sign in and download the free abstract from this page, and check it with your guide first. All sales are final.

Can you publish the paper for me?

You get IEEE conference and journal format drafts and a publication guide with a journal list. Submitting and publishing is done by you and your guide; we do not promise acceptance.

Similar projects

All AI & ML projects →
M.TechIn buildAI & ML40% OFF

Stress and Depression Detection M.Tech Project: Calibrated MentalBERT with Multi-Day Journal Aggregation on Android

Stress and depression detection M.Tech project with source code: a diary-adapted, temperature-calibrated MentalBERT reads daily journal entries in an Android app and raises a counsellor alert only on multi-day patterns. Includes thesis and IEEE paper.

Free abstract· Download₹0
Book on WhatsApp₹15,000₹25,000View Project
M.TechIn buildAI & ML40% OFF

Multi-Disease Prediction M.Tech Project: Calibrated Diversity-Aware Stacked Ensemble with SHAP for Diabetes, Heart and Kidney Disease

Multi-disease prediction M.Tech project with source code: calibrated stacked ensembles predict diabetes, heart and chronic kidney disease risk from one form, with SHAP reasons and a base paper comparison. Includes thesis and IEEE paper.

Free abstract· Download₹0
Book on WhatsApp₹15,000₹25,000View Project
M.TechIn buildAI & ML40% OFF

Skin Cancer Detection M.Tech Project: Quantization-Aware MobileNetV3 with Focal Loss for Offline Lesion Classification on Android

Skin cancer detection M.Tech project with source code: a quantization-aware MobileNetV3-Small trained with focal loss classifies seven HAM10000 lesion types offline on an Android phone, with doctor review. Includes thesis and IEEE paper.

Free abstract· Download₹0
Book on WhatsApp₹15,000₹25,000View Project
None of these fit your topic?Send your idea — we build it and share the quote first.Request custom project

Get Chest X-ray Pneumonia Detection M.Tech… for your submission

Leave your details and a counsellor will call to confirm your branch, any changes your guide needs, and how you want to pay.