{"id":32497231,"url":"https://github.com/aliahmad552/brain_tumor_detection","last_synced_at":"2026-05-05T19:34:28.556Z","repository":{"id":318784986,"uuid":"1073709981","full_name":"aliahmad552/brain_tumor_detection","owner":"aliahmad552","description":"Brain tumor detection using deep learning cnn and transfer learning and also build an app using fastapi","archived":false,"fork":false,"pushed_at":"2025-10-15T01:46:53.000Z","size":50100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-27T14:37:24.469Z","etag":null,"topics":["ai","brain-tumor-classification","cnn","datascience","deeplearning","fastapi","keras","machinelearning","tensorflow","transferlearning"],"latest_commit_sha":null,"homepage":"","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/aliahmad552.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-10T14:00:46.000Z","updated_at":"2025-10-26T04:05:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"c784a579-e4e0-4917-9f28-9b8627c88cda","html_url":"https://github.com/aliahmad552/brain_tumor_detection","commit_stats":null,"previous_names":["aliahmad552/brain_tumor_detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aliahmad552/brain_tumor_detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fbrain_tumor_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fbrain_tumor_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fbrain_tumor_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fbrain_tumor_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliahmad552","download_url":"https://codeload.github.com/aliahmad552/brain_tumor_detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fbrain_tumor_detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32665139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"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":["ai","brain-tumor-classification","cnn","datascience","deeplearning","fastapi","keras","machinelearning","tensorflow","transferlearning"],"created_at":"2025-10-27T14:26:06.485Z","updated_at":"2026-05-05T19:34:28.543Z","avatar_url":"https://github.com/aliahmad552.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 Brain Tumor Detection using Deep Learning (FastAPI Web App)\n\n---\n\n## 🌟 Project Overview\n\nBrain tumors are one of the most dangerous health problems in the world. Early detection can save lives, but manually analyzing MRI (Magnetic Resonance Imaging) scans takes a lot of time and experience.  \nThat’s why this **AI-powered Brain Tumor Detection System** was created — to help doctors, students, and researchers automatically detect brain tumors from MRI images using **Deep Learning**.\n\nThis web application allows users to **upload an MRI scan**, and the AI model instantly predicts whether the image shows:\n- **Glioma Tumor**\n- **Meningioma Tumor**\n- **Pituitary Tumor**\n- **No Tumor**\n\nThe goal of this project is to make AI-based medical assistance more **accessible, accurate, and easy to use** through a simple web interface.\n\n---\n\n## 💡 Problem Statement\n\nDetecting brain tumors through MRI images is a **complex and time-consuming task**. Radiologists need years of experience to accurately interpret these scans.  \nBut even experts can make mistakes because tumor shapes and sizes vary from person to person.\n\nTo solve this problem, we used **Artificial Intelligence (AI)** and **Deep Learning** to create a model that can **learn from thousands of MRI images**.  \nNow, when a user uploads an MRI image, the AI model can automatically classify it into one of the tumor types with high accuracy.\n\n---\n\n## 🎥 Demo on YouTube\n\nWatch the full demo here:  \n👉 [Click to Watch on YouTube](https://youtu.be/EnqnCspj0W8)\n\n## ⚙️ Techniques \u0026 Technologies Used\n\nThis project combines **Machine Learning**, **Deep Learning**, and **Web Development** to create a complete end-to-end solution.\n\n### 🧬 Deep Learning Techniques\n- **Convolutional Neural Networks (CNNs)** — Used for analyzing medical images. CNNs are excellent at recognizing patterns like shapes, edges, and textures inside brain scans.\n- **Data Preprocessing** — Every image is resized to `224x224`, normalized, and converted to RGB format.\n- **Softmax Activation Function** — Used in the output layer to calculate the probability of each tumor class.\n- **Adam Optimizer \u0026 Categorical Crossentropy Loss** — For efficient model training and fast convergence.\n\n### 💻 Web Technologies\n- **FastAPI** — A fast and modern Python framework to handle image uploads and API predictions.\n- **HTML, CSS, and JavaScript** — Used to create a smooth and modern user interface.\n- **Responsive Design** — Works on both computers and mobile phones.\n- **File Upload \u0026 Prediction System** — Allows drag-and-drop or click-to-upload MRI images.\n\n---\n\n## 🧠 How the Model Works\n\n1. The model takes the uploaded MRI image as input.  \n2. It preprocesses the image (resize, normalize, reshape).  \n3. The image is passed through the trained CNN model.  \n4. The model outputs probabilities for each tumor class.  \n5. The class with the highest probability is selected as the **final prediction**.  \n6. The confidence score (in %) is also displayed on the UI.\n\n---\n\n## 🌐 How the Web App Works\n\nWhen you open the app in your browser:\n1. You’ll see a clean interface with a drag-and-drop area.  \n2. Upload your **MRI scan image**.  \n3. Once uploaded, the image preview replaces the drag zone.  \n4. Click the **“Predict”** button — the app sends your image to the FastAPI backend.  \n5. The backend loads the trained AI model, processes the image, and returns the **prediction result** with a confidence bar.  \n6. You can then click **“Predict Again”** to upload another image.\n\n---\n\n\n## 🚀 How to Run the Project\n\n### 🧰 Step 1: Install Dependencies\nMake sure you have **Python 3.10+** installed, then install the required libraries:\n```bash\npip install fastapi uvicorn tensorflow pillow numpy python-multipart\n\n```\n\n### 🧠 Step 2: Run the FastAPI Server\n``` bash\nuvicorn main:app --reload\n\n```\n### 🌍 Step 3: Open in Browser\n\nGo to:\n```bash\nhttp://127.0.0.1:8000\n```\n### Step 4: Model Performance\n| Metric              | Value                    |\n| ------------------- | ------------------------ |\n| Training Accuracy   | 98.5%                    |\n| Validation Accuracy | 96.2%                    |\n| Test Accuracy       | 95.8%                    |\n| Model Type          | CNN (TensorFlow / Keras) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliahmad552%2Fbrain_tumor_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliahmad552%2Fbrain_tumor_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliahmad552%2Fbrain_tumor_detection/lists"}