Loading repository dataβ¦
Loading repository dataβ¦
LuvishkumarLokye / repository
π« AI-powered pneumonia detection from chest X-rays using PyTorch CNN. Achieves 75% accuracy with GUI, Web App, and CLI interfaces. Real-time diagnosis with confidence scores. Open-source medical AI tool. #AI #DeepLearning #Healthcare #Python #PyTorch #ComputerVision
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A Flask and PyTorch web application that predicts whether a chest X-ray image is classified as NORMAL or PNEUMONIA. The project includes a trained convolutional neural network model, a browser-based upload interface, and a Jupyter notebook used for model development.
Important: This project is for educational and research purposes only. It is not a medical device and should not be used as a substitute for professional clinical diagnosis.
NORMAL and PNEUMONIA| Area | Tools |
|---|---|
| Backend | Flask |
| Deep Learning | PyTorch, Torchvision |
| Image Processing | OpenCV, NumPy |
| Frontend | HTML, CSS, JavaScript, jQuery |
| Model Development | Jupyter Notebook |
pneumonia_prediction/
|-- app.py
|-- best_pneumonia_model.pth
|-- pneumonia_model_creation.ipynb
|-- templates/
| `-- dashboard.html
|-- Test sample images/
`-- README.md
The application uses a custom convolutional neural network with:
NORMAL and PNEUMONIAInput images are resized to 224x224, converted to tensors, and normalized before being passed to the model.
best_pneumonia_model.pthClone the repository:
git clone https://github.com/your-username/pneumonia_prediction.git
cd pneumonia_prediction
Create and activate a virtual environment:
python -m venv .venv
.venv\Scripts\activate
Install dependencies:
pip install flask torch torchvision opencv-python numpy
python app.py
Open the application in your browser:
http://127.0.0.1:8080
Upload a chest X-ray image in PNG or JPEG format to generate a prediction.
The app exposes a prediction endpoint:
POST /predict
Form field:
image: chest X-ray image file
Example JSON response:
{
"prediction": "PNEUMONIA",
"confidence": 96.42,
"prob_normal": 3.58,
"prob_pneumonia": 96.42
}
The model notebook is designed around a chest X-ray pneumonia dataset with separate training, validation, and test folders.
Example dataset source:
https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia
Expected folder structure:
chest_xray/
|-- train/
| |-- NORMAL/
| `-- PNEUMONIA/
|-- val/
| |-- NORMAL/
| `-- PNEUMONIA/
`-- test/
|-- NORMAL/
`-- PNEUMONIA/
Open the notebook to review or retrain the model:
jupyter notebook pneumonia_model_creation.ipynb
After training, save the best model weights as:
best_pneumonia_model.pth
The Flask app loads this file automatically on startup.