{"id":23676432,"url":"https://github.com/tictechtoee/diagnosis","last_synced_at":"2026-02-10T22:03:30.710Z","repository":{"id":268535864,"uuid":"809945473","full_name":"ticTechtoee/diagnosis","owner":"ticTechtoee","description":"AI Powered Web App to Detect Pneumonia, Lung Cancer and COVID.","archived":false,"fork":false,"pushed_at":"2024-12-17T10:50:35.000Z","size":23108,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-27T10:39:07.300Z","etag":null,"topics":["ai","django","machine-learning","python"],"latest_commit_sha":null,"homepage":"https://portfoliofarhan.pythonanywhere.com/","language":"CSS","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/ticTechtoee.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}},"created_at":"2024-06-03T18:48:51.000Z","updated_at":"2025-03-18T14:48:47.000Z","dependencies_parsed_at":"2024-12-17T11:44:12.132Z","dependency_job_id":null,"html_url":"https://github.com/ticTechtoee/diagnosis","commit_stats":null,"previous_names":["tictechtoee/diagnosis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ticTechtoee/diagnosis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticTechtoee%2Fdiagnosis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticTechtoee%2Fdiagnosis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticTechtoee%2Fdiagnosis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticTechtoee%2Fdiagnosis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ticTechtoee","download_url":"https://codeload.github.com/ticTechtoee/diagnosis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticTechtoee%2Fdiagnosis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29319275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ai","django","machine-learning","python"],"created_at":"2024-12-29T14:53:31.461Z","updated_at":"2026-02-10T22:03:30.690Z","avatar_url":"https://github.com/ticTechtoee.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **AI-Powered Medical Diagnostic Tool** 🩺\n**Detect Pneumonia, COVID-19, and Lung Cancer using Machine Learning and Medical Imaging**\n\n## 🚀 **Overview**\nThis project implements an AI-driven diagnostic application capable of detecting:\n- **Pneumonia** and **COVID-19** from Chest X-Rays\n- **Lung Cancer** from Chest CT Scans\n\nThe application combines a **Convolutional Neural Network (CNN)** for image classification with a web interface built using Django, providing an accessible and user-friendly diagnostic solution.\n\n---\n\n## 🛠️ **Technologies Used**\n\n### **Machine Learning**\n- **TensorFlow/Keras**: Deep learning framework for model building and training\n- **NumPy**: Efficient array manipulation and computations\n\n### **Web Development**\n- **Django**: Python-based backend web framework\n- **Bootstrap**: Front-end framework for responsive UI design\n\n### **Data Preprocessing**\n- **OpenCV**: Image processing for grayscale conversion, resizing, and enhancements\n- **Sklearn**: For data splitting (train-test split)\n\n---\n\n## 🧪 **How It Works**\n\n### **1. Data Preprocessing**\nThe `preprocess.py` script:\n- Loads X-Ray or CT Scan images from the dataset directory.\n- Converts images to grayscale and resizes them to **224x224 pixels**.\n- Normalizes pixel values to the range [0, 1].\n- Splits the data into training and testing sets.\n\n```bash\n# Run preprocessing to prepare the dataset\npython preprocess.py\n```\n\n### **2. Model Training**\nThe `build_model.py` script trains a **Convolutional Neural Network (CNN)** for multi-class classification:\n- 3 Classes for Pneumonia/COVID Detection: `COVID`, `Non-COVID`, and `Pneumonia`\n- 2 Classes for Lung Cancer Detection: `Lung Cancer` and `Normal`\n\nTraining features include:\n- **3 Convolutional Layers** with ReLU activation\n- **MaxPooling** for dimensionality reduction\n- **Dropout** to avoid overfitting\n- **Softmax** activation for multi-class outputs\n\n```bash\n# Train the machine learning model\npython build_model.py\n```\n\n### **3. Disease Detection via Web Application**\nThe `detect.py` file integrates the trained models into a Django web application.\n- Upload chest X-Ray/CT images through the frontend.\n- Process the uploaded image and predict results using the model.\n- Return diagnosis (e.g., COVID, Pneumonia, or Lung Cancer) with status updates.\n\n**Sample Workflow**:\n1. Upload an image (`.jpg` or `.png`)\n2. Process the image with the selected ML model.\n3. Display prediction results on the UI.\n\n---\n\n## 🌟 **Features**\n- **Multiple Disease Detection**: Predict COVID-19, Pneumonia, and Lung Cancer.\n- **Responsive Web UI**: Built with Django and Bootstrap for usability.\n- **Fast and Accurate Predictions**: Achieved with optimized CNN models.\n- **Image Preprocessing**: Automatic image resizing and normalization for consistent results.\n\n---\n\n## 🖥️ **Folder Structure**\n\n```plaintext\n|-- assets/\n|    |-- models/                # Pre-trained models (.h5 files)\n|-- dataset/                    # Dataset of X-Ray and CT Scan images\n|-- templates/                  # HTML templates for Django\n|-- static/                     # Static files (CSS, JS, images)\n|-- build_model.py              # ML model training script\n|-- preprocess.py               # Image preprocessing script\n|-- detect.py                   # Disease detection logic (Django view)\n|-- requirements.txt            # Project dependencies\n|-- manage.py                   # Django app manager\n|-- README.md                   # Project documentation\n```\n\n---\n\n## ⚙️ **Setup Instructions**\n\n1. **Clone the Repository**\n```bash\ngit clone https://github.com/ticTechtoee/diagnosis\ncd medical-diagnostic-tool\n```\n\n2. **Create Virtual Environment**\n```bash\npython -m venv venv\nsource venv/bin/activate   # For Linux/Mac\nvenv\\Scripts\\activate      # For Windows\n```\n\n3. **Install Dependencies**\n```bash\npip install -r requirements.txt\n```\n\n4. **Prepare Dataset**\nPlace your dataset (Chest X-Ray/CT images) in the `dataset/` folder, organized into subfolders:\n```plaintext\ndataset/\n|-- COVID/\n|-- Non-COVID/\n|-- Pneumonia/\n|-- Lung_cancer/\n|-- Normal/\n```\n\nRun preprocessing:\n```bash\npython preprocess.py\n```\n\n5. **Train the Model**\n```bash\npython build_model.py\n```\n\n6. **Run the Web Application**\n```bash\npython manage.py runserver\n```\n\nVisit `http://127.0.0.1:8000/` in your browser to use the application.\n\n---\n\n## 📊 **Results**\nThe CNN models achieved high accuracy on test datasets:\n- **Pneumonia/COVID Detection**: Accurate classification into `COVID`, `Non-COVID`, and `Pneumonia`.\n- **Lung Cancer Detection**: Effective binary classification into `Lung Cancer` or `Normal`.\n\n---\n\n## 👨‍💻 **Future Improvements**\n- Add real-time image analysis using webcams.\n- Improve accuracy with larger datasets and transfer learning.\n- Deploy the application on cloud platforms for global access.\n\n---\n\n## 🤝 **Contributing**\nContributions are welcome! If you'd like to improve this project, feel free to fork the repository, create a new branch, and submit a pull request.\n\n---\n\n## 📝 **License**\nThis project is licensed under the MIT License.\n\n---\n\n## 📫 **Contact**\nFor collaborations, inquiries, or feedback:\n- **Name**: Farhan Basheer\n- **LinkedIn**: [Farhan's LinkedIn](https://www.linkedin.com/in/farhanbasheerofficial10)\n- **Email**: farhanbasheerofficial10@gmail.com\n\n---\n\n### **If you find this project useful, don’t forget to ⭐ star the repository!** 🌟\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftictechtoee%2Fdiagnosis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftictechtoee%2Fdiagnosis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftictechtoee%2Fdiagnosis/lists"}