{"id":29550876,"url":"https://github.com/shubhamahobia/x_ray_classifier","last_synced_at":"2026-04-16T12:02:11.887Z","repository":{"id":304626716,"uuid":"1019362783","full_name":"ShubhaMahobia/X_Ray_Classifier","owner":"ShubhaMahobia","description":"A deep learning-powered web application that automatically detects pneumonia from chest X-ray images using YOLOv8 classification. Built with Streamlit for an intuitive user interface, the system provides instant analysis with confidence scores and detailed probability breakdowns.","archived":false,"fork":false,"pushed_at":"2025-07-14T08:28:21.000Z","size":11033,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-14T11:23:14.038Z","etag":null,"topics":["deeplearning","machine-learning","opencv","yolov8"],"latest_commit_sha":null,"homepage":"https://x-ray-classification-8432.streamlit.app/","language":"Jupyter Notebook","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/ShubhaMahobia.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-07-14T08:02:39.000Z","updated_at":"2025-07-14T08:28:31.000Z","dependencies_parsed_at":"2025-07-14T11:24:20.905Z","dependency_job_id":"e6892938-92c6-418f-8f4d-e03a4d798428","html_url":"https://github.com/ShubhaMahobia/X_Ray_Classifier","commit_stats":null,"previous_names":["shubhamahobia/x_ray_classifier"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ShubhaMahobia/X_Ray_Classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhaMahobia%2FX_Ray_Classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhaMahobia%2FX_Ray_Classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhaMahobia%2FX_Ray_Classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhaMahobia%2FX_Ray_Classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShubhaMahobia","download_url":"https://codeload.github.com/ShubhaMahobia/X_Ray_Classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhaMahobia%2FX_Ray_Classifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31884929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["deeplearning","machine-learning","opencv","yolov8"],"created_at":"2025-07-18T04:01:17.172Z","updated_at":"2026-04-16T12:02:11.879Z","avatar_url":"https://github.com/ShubhaMahobia.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🫁 Pneumonia Detection System\n\nA comprehensive deep learning-based system for detecting pneumonia from chest X-ray images using YOLOv8 classification model and a user-friendly Streamlit web application.\n\n## 📋 Table of Contents\n\nLIVE LINK - https://x-ray-classification-8432.streamlit.app/\n\nDATA SET LINK - https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia\n\n- [Overview](#overview)\n- [Features](#features)\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Model Training](#model-training)\n- [Streamlit Application](#streamlit-application)\n- [API Documentation](#api-documentation)\n- [Contributing](#contributing)\n- [License](#license)\n\n## 🎯 Overview\n\nThis project implements an automated pneumonia detection system using state-of-the-art deep learning techniques. The system can analyze chest X-ray images and classify them as either normal or showing signs of pneumonia, providing confidence scores and detailed probability breakdowns.\n\n### Key Capabilities:\n- **Real-time Analysis**: Instant classification of chest X-ray images\n- **High Accuracy**: Trained on a large dataset of medical images\n- **User-Friendly Interface**: Web-based application for easy access\n- **Sample Images**: Built-in sample images for testing and demonstration\n- **Professional Results**: Detailed probability breakdowns and confidence scores\n\n## ✨ Features\n\n### 🖥️ Streamlit Web Application\n- **Interactive Upload**: Drag-and-drop or click-to-upload interface\n- **Real-time Processing**: Instant analysis with loading indicators\n- **Visual Results**: Side-by-side display of uploaded image and results\n- **Sample Images**: Downloadable sample images for testing\n- **Responsive Design**: Works on desktop and mobile devices\n- **Professional UI**: Medical-themed interface with clear instructions\n\n### 🤖 AI Model\n- **YOLOv8 Classification**: State-of-the-art deep learning model\n- **Binary Classification**: Normal vs. Pneumonia detection\n- **Confidence Scoring**: Detailed probability breakdowns\n- **Pre-trained Weights**: Ready-to-use trained model\n- **Custom Training**: Full training pipeline included\n\n### 📊 Results Display\n- **Prediction Labels**: Clear normal/pneumonia classification\n- **Confidence Metrics**: Percentage-based confidence scores\n- **Probability Breakdown**: Detailed class-wise probabilities\n- **Visual Indicators**: Color-coded results (green for normal, red for pneumonia)\n- **Medical Disclaimers**: Professional healthcare warnings\n\n  \n## 🚀 Installation\n\n### Prerequisites\n- Python 3.8 or higher\n- pip or conda package manager\n\n### Step 1: Clone the Repository\n```bash\ngit clone \u003crepository-url\u003e\ncd Image-Processing\n```\n\n### Step 2: Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n### Step 3: Verify Installation\n```bash\npython -c \"import streamlit, ultralytics, PIL; print('Installation successful!')\"\n```\n\n## 💻 Usage\n\n### Running the Streamlit Application\n\n1. **Start the Application**:\n   ```bash\n   streamlit run app.py\n   ```\n\n2. **Access the Web Interface**:\n   - Open your browser and go to `http://localhost:8501`\n   - The application will automatically load\n\n3. **Using the Application**:\n   - **Upload an Image**: Use the file uploader to select a chest X-ray image\n   - **Download Samples**: If you don't have images, download the provided sample images\n   - **View Results**: See the prediction results with confidence scores\n   - **Analyze Probabilities**: Review the detailed probability breakdown\n\n### Supported Image Formats\n- JPEG (.jpg, .jpeg)\n- PNG (.png)\n- BMP (.bmp)\n- TIFF (.tiff)\n\n## 🎓 Model Training\n\n### Training Data\nThe model is trained on a comprehensive dataset of chest X-ray images:\n- **Normal Images**: 6,084 images of healthy chest X-rays\n- **Pneumonia Images**: 7,744 images showing signs of pneumonia\n- **Total Dataset**: 13,828 high-quality medical images\n\n### Training Process\n1. **Data Preparation**: Images are organized into normal and suffering categories\n2. **Model Configuration**: YOLOv8 classification model with custom parameters\n3. **Training Execution**: Automated training with validation\n4. **Model Evaluation**: Performance metrics and confusion matrix generation\n5. **Weight Saving**: Best and latest model weights are saved\n\n### Training Script\n```bash\ncd yolov8_custom_training\npython main.py\n```\n\n### Model Performance\n- **Accuracy**: High classification accuracy on validation set\n- **Confusion Matrix**: Visual representation of model performance\n- **Training Metrics**: Detailed training and validation curves\n- **Model Weights**: Optimized weights for production use\n\n## 🌐 Streamlit Application Details\n\n### Key Components\n\n#### 1. **Model Loading**\n- Cached model loading for performance\n- Automatic error handling for missing model files\n- Support for both best and latest weights\n\n#### 2. **Image Processing**\n- Automatic image format conversion\n- Temporary file handling for YOLO compatibility\n- Error handling for unsupported formats\n\n#### 3. **Results Display**\n- Two-column layout for image and results\n- Color-coded prediction indicators\n- Professional medical disclaimers\n- Detailed probability breakdowns\n\n#### 4. **Sample Images**\n- Real training images for testing\n- Downloadable sample files\n- Authentic medical image quality\n\n### Application Features\n- **Responsive Design**: Works on all device sizes\n- **Professional UI**: Medical-themed interface\n- **Error Handling**: Graceful error messages\n- **Loading States**: User-friendly loading indicators\n- **File Validation**: Automatic format checking\n\n## 📚 API Documentation\n\n### Prediction Function\n```python\ndef predict_image(image):\n    \"\"\"\n    Make prediction on uploaded image\n    \n    Args:\n        image: PIL Image object\n        \n    Returns:\n        dict: Prediction results with class names, probabilities, \n              predicted class, confidence, and class index\n    \"\"\"\n```\n\n### Model Loading\n```python\n@st.cache_resource\ndef load_model():\n    \"\"\"\n    Load the trained YOLO model with caching\n    \n    Returns:\n        YOLO: Loaded model object or None if error\n    \"\"\"\n```\n\n## ⚠️ Important Disclaimers\n\n### Medical Disclaimer\nThis application is for **educational and demonstration purposes only**. It should not be used for actual medical diagnosis. Always consult with qualified healthcare professionals for medical decisions.\n\n### Model Limitations\n- The model is trained on specific types of chest X-ray images\n- Performance may vary with different image qualities and formats\n- Results should be validated by medical professionals\n- The system is not a replacement for professional medical diagnosis\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **YOLOv8**: Ultralytics for the excellent object detection framework\n- **Streamlit**: For the powerful web application framework\n- **Medical Dataset**: Contributors to the chest X-ray dataset\n- **Open Source Community**: For various supporting libraries and tools\n\n**Built with ❤️ using Streamlit and YOLOv8**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamahobia%2Fx_ray_classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhamahobia%2Fx_ray_classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamahobia%2Fx_ray_classifier/lists"}