{"id":31809104,"url":"https://github.com/allanotieno254/pneumonia-xray-classification","last_synced_at":"2026-04-10T13:31:43.001Z","repository":{"id":311257114,"uuid":"1043139008","full_name":"AllanOtieno254/pneumonia-xray-classification","owner":"AllanOtieno254","description":"This project is a Deep Learning-based Pneumonia classification system that allows medical staff to upload chest X-ray images and quickly determine whether a patient shows signs of pneumonia.","archived":false,"fork":false,"pushed_at":"2025-08-23T17:14:24.000Z","size":2236,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-11T05:19:40.410Z","etag":null,"topics":["keras","machine-learning","numpy","pandas","pil","pillow","python","streamlit","streamlit-webapp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AllanOtieno254.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-23T08:12:04.000Z","updated_at":"2025-08-23T17:14:27.000Z","dependencies_parsed_at":"2025-08-23T13:00:08.892Z","dependency_job_id":"d0e214f6-93ca-4920-a899-cc0ed36e44d4","html_url":"https://github.com/AllanOtieno254/pneumonia-xray-classification","commit_stats":null,"previous_names":["allanotieno254/pneumonia-xray-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AllanOtieno254/pneumonia-xray-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2Fpneumonia-xray-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2Fpneumonia-xray-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2Fpneumonia-xray-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2Fpneumonia-xray-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllanOtieno254","download_url":"https://codeload.github.com/AllanOtieno254/pneumonia-xray-classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanOtieno254%2Fpneumonia-xray-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31645243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keras","machine-learning","numpy","pandas","pil","pillow","python","streamlit","streamlit-webapp"],"created_at":"2025-10-11T05:18:46.891Z","updated_at":"2026-04-10T13:31:42.984Z","avatar_url":"https://github.com/AllanOtieno254.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pneumonia Classification Using Chest X-ray Images\n![Normal](https://github.com/user-attachments/assets/cf0027a3-7def-4338-a1e3-13038620439a)\n![pneumonia](https://github.com/user-attachments/assets/ed288db9-50a4-48de-89be-9547d5c78ac1)\n\nDataset:https://data.mendeley.com/datasets/rscbjbr9sj/2\n\n## Table of Contents\n- [Project Overview](#project-overview)\n- [Features](#features)\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Model Details](#model-details)\n- [Integration into Hospital Systems](#integration-into-hospital-systems)\n- [Benefits and Usefulness](#benefits-and-usefulness)\n- [License](#license)\n\n---\n\n## Project Overview\nThis project is a **Deep Learning-based Pneumonia classification system** that allows medical staff to upload chest X-ray images and quickly determine whether a patient shows signs of pneumonia. The system uses a pre-trained Keras model to predict the condition and provides a confidence score for the diagnosis.\n\nThe project is built using:  \n- **Python**  \n- **Streamlit** for web interface  \n- **Keras / TensorFlow** for model inference  \n- **Pillow (PIL)** and **NumPy** for image processing  \n\nThis tool is designed for **rapid, accurate preliminary screening** in medical facilities, reducing the burden on radiologists and improving response time for patient care.  \n\n---\n\n## Features\n- Upload a chest X-ray image in multiple formats (`jpeg`, `jpg`, `png`, `dcm`, `tiff`, `bmp`, `gif`)  \n- Automatic classification of **Pneumonia** (label 0) or **Normal** (label 1)  \n- Confidence score displayed for each prediction  \n- Simple, interactive web interface using Streamlit  \n- Preprocessing steps for consistent image input (resizing, normalization)  \n- Option to integrate a custom background for branding  \n\n---\n\n## Project Structure\n```\npneumonia-classification/\n│\n├── main.py                 # Streamlit application\n├── util.py                 # Utility functions: classify images, set background\n├── model/\n│   ├── keras_model.h5      # Pre-trained pneumonia classification model\n│   └── labels.txt          # Labels: Pneumonia (0), Normal (1)\n├── requirements.txt        # Python dependencies\n└── README.md               # Project documentation\n```\n\n---\n\n## Installation\n1. **Clone the repository**\n```bash\ngit clone https://github.com/YourUsername/pneumonia-classification.git\ncd pneumonia-classification\n```\n\n2. **Create and activate a virtual environment**\n```bash\npython -m venv venv\nsource venv/bin/activate  # Linux / macOS\nvenv\\Scripts\\activate     # Windows\n```\n\n3. **Install dependencies**\n```bash\npip install -r requirements.txt\n```\n\n4. **Run the Streamlit app**\n```bash\nstreamlit run main.py\n```\n\n---\n\n## Usage\n1. Open the Streamlit web app.  \n2. Upload a chest X-ray image using the file uploader.  \n3. The app will display the uploaded image.  \n4. Classification result will appear below the image along with the confidence score.  \n\n\u003e Example Output:  \n```\nPneumonia\nScore: 0.98\n```\n\n---\n\n## Model Details\n- **Input Size:** 224x224 pixels  \n- **Normalization:** [-1, 1] scale  \n- **Custom Thresholding:** Images are labeled Pneumonia if probability \u003e 0.95, else Normal  \n- **Output:** Class name (`Pneumonia` or `Normal`) and confidence score  \n\nThis approach ensures **high accuracy for pneumonia detection** while minimizing false negatives for normal cases.\n\n---\n\n## Integration into Hospital Systems\nThe system can be integrated into hospital workflows in several ways:  \n\n1. **Electronic Medical Records (EMR) Integration:**  \n   - The app can automatically save classification results to patient records for radiologists to review.  \n\n2. **Triage Support:**  \n   - Patients showing high-confidence Pneumonia predictions can be prioritized for urgent care.  \n\n3. **Remote Diagnostics:**  \n   - Hospitals in rural areas can upload X-rays to this system and receive preliminary screening results before consulting specialists.  \n\n4. **Dashboard and Reporting:**  \n   - Aggregate statistics can be generated for hospital administration to monitor pneumonia cases and trends over time.\n\n---\n\n## Benefits and Usefulness\n- **Speed:** Provides near-instantaneous preliminary results.  \n- **Accuracy:** Reduces human error in X-ray interpretation.  \n- **Accessibility:** Can be used in hospitals without enough radiologists.  \n- **Cost-effective:** Requires only a standard computer and X-ray images; reduces unnecessary tests.  \n- **Data-driven decisions:** Helps hospitals track outbreaks, patient load, and optimize resources.  \n\n---\n\n## License\nThis project is licensed under the **MIT License**. See `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanotieno254%2Fpneumonia-xray-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallanotieno254%2Fpneumonia-xray-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanotieno254%2Fpneumonia-xray-classification/lists"}