Pneumonia-Disease-Detection

๐Ÿง  Pneumonia Disease Detection using MobileNetV2 Model (Deep Learning)

This project presents an AI-powered pneumonia detection system using MobileNetV2, a lightweight convolutional neural network, to classify Normal, Bacterial Pneumonia, and Viral Pneumonia from chest X-ray images. The model integrates image preprocessing (CLAHE and Median Filtering) to improve feature extraction and diagnostic accuracy. The final trained model is converted to TensorFlow Lite for real-time deployment on Android mobile devices.


๐Ÿฉบ Abstract

Pneumonia is a respiratory disease that causes inflammation in the lungs. Early detection is crucial for effective treatment. This system automates pneumonia detection using deep learning to reduce manual diagnosis time. MobileNetV2 provides high accuracy, low computation cost, and mobile deployment capability, making it ideal for real-time medical diagnostics.


๐Ÿš€ Objectives


๐Ÿ› ๏ธ Technologies Used

Category Technology
Language Python
Framework TensorFlow, Keras
Environment Google Colab
Deployment TensorFlow Lite, Android Studio
Libraries NumPy, Pandas, Scikit-learn, OpenCV, Matplotlib
Visualization Seaborn, Matplotlib
Storage Google Drive
OS Windows 11

๐Ÿงฉ System Modules

1. Dataset Preparation

2. Model Development

3. Model Accuracy Comparison

| Configuration | Train Acc | Validation Acc | Test Acc | |โ€”โ€”โ€”โ€”โ€”-|โ€”โ€”โ€”โ€”|โ€”โ€”โ€”โ€”โ€”-|โ€”โ€”โ€”โ€“| | Without Preprocessing | 94% | 84% | 83% | | With Preprocessing | 99% | 86% | 84% |

4. Performance Metrics

| Metric | Without Preprocessing | With Preprocessing | |โ€”โ€”โ€”|โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”|โ€”โ€”โ€”โ€”โ€”โ€”โ€“| | Precision | 83% | 84% | | Recall | 83% | 84% | | F1-Score | 83% | 84% |


๐Ÿ“ฑ Mobile Application Integration

App Features:


๐Ÿง  Model Workflow

  1. Data Collection
    • Gathered chest X-ray images labeled as Normal, Bacterial Pneumonia, and Viral Pneumonia.
  2. Image Preprocessing
    • Applied CLAHE for contrast enhancement.
    • Used Median Filtering to remove noise.
    • Resized images to 128ร—128 pixels.
  3. Data Augmentation
    • Performed rotation, flipping, zoom, and normalization to improve model generalization.
  4. Model Training (MobileNetV2)
    • Transfer learning with pretrained ImageNet weights.
    • Optimizer: Adam Epochs: 25 Batch size: 32.
    • Output classes: Normal, Bacterial, Viral.
  5. Model Evaluation
    • Metrics: Accuracy, Precision, Recall, F1-Score, Confusion Matrix.
  6. Model Conversion
    • Converted the trained model (.h5) to TensorFlow Lite (.tflite) for mobile deployment.
  7. Mobile App Integration
    • Integrated with Android Studio using TensorFlow Lite Interpreter.
    • User uploads X-ray โ†’ Model predicts disease type in real-time.
  8. Output
    • โœ… Normal
    • ๐Ÿฆ  Bacterial Pneumonia
    • ๐Ÿงฌ Viral Pneumonia

๐Ÿงช Results


๐ŸŒŸ Advantages


๐Ÿ”ฎ Future Enhancements


๐Ÿงพ Conclusion

This project successfully demonstrates how MobileNetV2 can be leveraged for medical image classification with excellent performance and efficiency. The system provides a scalable, mobile-friendly solution for early pneumonia detection, improving access to diagnostic tools in underdeveloped and rural healthcare systems.


๐Ÿ‘จโ€๐Ÿ’ป Developer

Ravin Raj S (23322009)
Department of Computer Science and Applications
The Gandhigram Rural Institute (Deemed to be University)
๐Ÿ“… April 2025


๐Ÿ“š References


๐Ÿชช License

This project is open-source and licensed under the MIT License.