Pneumonia-Classifier.mp4
The Pneumonia Classifier is a machine learning model that uses chest X-ray images to classify whether a person has pneumonia or not. This project includes a Jupyter Notebook containing the model implementation and the user interface consists of a React website connected to a Flask backend.
The dataset used for training and testing the model is the "Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification" dataset provided by Daniel S. Kermany, Kang Zhang and Michael Goldbaum.
- Dataset Citation: http://www.cell.com/cell/fulltext/S0092-8674(18)30154-5
- Data: Download Dataset
The Pneumonia Classifier model has achieved an accuracy of 84% on the test dataset. This accuracy represents the model's ability to correctly classify pneumonia and non-pneumonia cases based on the provided chest X-ray images.
Before running the Pneumonia Classifier project, make sure you have the following prerequisites installed:
-
Clone the repository:
git clone https://github.com/techrajat/pneumonia-classifier.git
-
Set up the backend:
- Navigate to the backend directory:
cd pneumonia-classifier/backend
- Create a virtual environment (optional):
python -m venv myenv
- Activate the virtual environment:
- On Windows:
myenv\Scripts\activate
- On macOS/Linux:
source myenv/bin/activate
- On Windows:
- Install the project dependencies:
pip install -r requirements.txt
- Navigate to the backend directory:
-
Set up the frontend:
- Navigate to the root directory:
cd ../
- Install the frontend dependencies:
npm install
- Navigate to the root directory:
-
Start the backend server:
- Navigate to the backend directory:
cd pneumonia-classifier/backend
- Activate the virtual environment (if using one):
- On Windows:
myenv\Scripts\activate
- On macOS/Linux:
source myenv/bin/activate
- On Windows:
- Run the Flask server:
python app.py
- Navigate to the backend directory:
-
Start the frontend development server:
- Open a new terminal and navigate to the root directory:
cd pneumonia-classifier
- Run the React development server:
npm start
- Open a new terminal and navigate to the root directory:
-
Access the Pneumonia Classifier website:
- Open your web browser and visit: http://localhost:3000
The Pneumonia Classifier consists of a React frontend for user interaction and a Flask backend for serving the machine learning model.
- The React frontend provides a user-friendly interface for uploading chest X-ray images and displaying the classification results.
- The Flask backend handles the image classification process and communicates with the frontend to send the results back to the user.
The interaction between the frontend and backend follows the following steps:
- The user uploads a chest X-ray image through the React frontend.
- The React frontend sends the image to the Flask backend via an HTTP request.
- The Flask backend receives the image and performs the classification using the trained machine learning model.
- The Flask backend sends the classification results back to the React frontend.
- The React frontend displays the results to the user.
This architecture allows for a seamless integration between the machine learning model and the user interface, providing a smooth user experience for pneumonia classification based on chest X-ray images.