The Pneumonia Detection App is a desktop application designed to detect pneumonia from chest X-ray images using deep learning. The application features a user-friendly interface built with PyQt5 and utilizes a TensorFlow-KERAS based model for image recognition. It provides real-time results through visual and audio feedback.
Also, image-based data Numonia detection dashboard, powered by a deep learning model built on the VGG16 architecture.
- This model leverages the power of neural networks to classify and analyze medical images with high accuracy.
- At the heart of our solution is the VGG16 model, pre-trained on the ImageNet dataset. We've fine-tuned it by adding custom layers on top. To maintain efficiency, we've kept the original VGG16 layers frozen and focused our training on the custom layers we've added.
- Our dashboard is designed to process and classify medical images seamlessly. Users can upload an image, and the system will analyze it, predict the class of the image.
- One of the standout features of our dashboard is the real-time audio announcement of results. Once the model makes a prediction, also popup result will immediately displayed on the screen with a color-coded message—green for positive results and red for negative results. making it easy for users to understand the outcome instantly. Additionally, we've included a text-to-speech function to read out the results loundly all kind of users.
- This functionality is particularly useful in clinical settings where quick and clear communication is critical. Additionally, the text-to-speech capability enhances accessibility, making our system user-friendly.
freecompress-output.crop-video.com.1.1.mp4
freecompress-DataSet_Xrays.mp4
- Image Upload: Allows users to upload chest X-ray images.
- Prediction: Classifies the uploaded image to detect pneumonia.
- Result Feedback: Displays results via pop-ups and text-to-speech (Audio Results)
- Animated Loading GIF: Shows a GIF while processing the image.
Dataset link : https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia
- Python: Programming language used for the application.
- PyQt5: Framework for creating the graphical user interface (GUI).
- TensorFlow: Library for deep learning and model inference.
- PIL (Pillow): Used for image processing.
- win32com: Provides text-to-speech functionality.
- Warnings and PIL: Used to handle image processing and suppress warnings.
- NumPy: For numerical operations on image data.
- Threading: To run text-to-speech operations asynchronously.
- VGG16 Architecture
- Python 3.x
- TensorFlow
- PyQt5
- Pillow
- pywin32
- Prepare Data:
- Training Path: Datasets_Chest_xrays/train
- Validation Path: Datasets_Chest_xrays/test
- Model Architecture:
- Base Model: VGG16 with ImageNet weights (excluding top layers).
- Custom Layers: Added Flatten and Dense layers for classification.
- Code for Model Creation: ML_Model_Code_Roshni.ipynb
- Training and Saving Used the code snippet above to train the model and saved it as chest_xray_Roshnis_Model.h5.
- Run the Application: chest_xray_App_Roshni.py
- Upload an Image: Click the "Upload Image" button to select and upload a chest X-ray image.
- Predict Results: Click the "Prediction" button to analyze the image and receive the result.
- View Results: A message box will display the result, and the result will be announced via speech synthesis.
The codebase for the Pneumonia Detection App consists of several key components. Here's an overview of the main sections:
- Warnings and PIL: Used to handle image processing and suppress warnings.
- TensorFlow: For loading the pre-trained deep learning model and making predictions.
- NumPy: For numerical operations on image data.
- PyQt5: For creating the graphical user interface (GUI) of the application.
- win32com.client: Provides text-to-speech functionality.
- Threading: To run text-to-speech operations asynchronously.
- Purpose: To perform text-to-speech operations asynchronously.
- Implementation: Uses the win32com.client library to convert text to speech in a separate thread.
-
setupUi(self, MainWindow)
-
Purpose: Initializes the main window, sets up the layout, and configures widgets.
-
Components:
- Labels and GIF: For displaying an animated GIF and image names.
- Buttons: For uploading images and making predictions.
- Styling: Customizes the appearance of widgets.
-
retranslateUi(self, MainWindow)
- Purpose: Sets the text for various UI elements and configures tooltips.
- Functionality: Updates widget texts and tooltips based on the application's language settings.
-
upload_image(self)
- Purpose: Handles the image upload process.
- Functionality: Opens a file dialog to select an image, displays the image name, and prepares the image for prediction using a pre-trained model.
-
clear/reset_image(self) (Automated)
- Purpose: Resets the image display and restarts the GIF animation.
- Functionality: Clears the current image and restarts the GIF animation.
-
predict_result(self)
- Purpose: Makes predictions on the uploaded image and displays the result.
- Functionality: Shows a message box with the prediction result (Normal or Affected By PNEUMONIA) and applies color coding to the text.