{"id":15158989,"url":"https://github.com/samir-atra/cancerdetector","last_synced_at":"2026-02-11T10:01:28.841Z","repository":{"id":37420269,"uuid":"502305312","full_name":"Samir-atra/CancerDetector","owner":"Samir-atra","description":"The final project of AI50xIraq course is found in the commit on 21-3-2023","archived":false,"fork":false,"pushed_at":"2023-12-27T19:24:57.000Z","size":623,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T16:19:41.924Z","etag":null,"topics":["cancer-detection","cnn","dataset","inceptionv3","matplotlib","numpy","opencv","tensorboard","tensorflow","tensorflow-tutorials","transfer-learning"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samir-atra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-06-11T09:30:13.000Z","updated_at":"2023-04-09T19:57:20.000Z","dependencies_parsed_at":"2023-12-27T21:31:53.923Z","dependency_job_id":"23698f44-f65f-4110-beaf-c934a27d2eaa","html_url":"https://github.com/Samir-atra/CancerDetector","commit_stats":{"total_commits":49,"total_committers":3,"mean_commits":"16.333333333333332","dds":"0.12244897959183676","last_synced_commit":"bef9b8367baf295e28f7a6324fab607989d6d78d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samir-atra%2FCancerDetector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samir-atra%2FCancerDetector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samir-atra%2FCancerDetector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samir-atra%2FCancerDetector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samir-atra","download_url":"https://codeload.github.com/Samir-atra/CancerDetector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685634,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cancer-detection","cnn","dataset","inceptionv3","matplotlib","numpy","opencv","tensorboard","tensorflow","tensorflow-tutorials","transfer-learning"],"created_at":"2024-09-26T21:01:47.149Z","updated_at":"2026-02-11T10:01:28.804Z","avatar_url":"https://github.com/Samir-atra.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CancerDetector\n\nThis project is focused on the detection of brain tumors from MRI scans using deep learning. It originated as a final project and has since been updated and expanded. The project explores two different models for cancer detection: one for detecting meningioma tumors and another for classifying multiple types of brain tumors.\n\n## Features\n\n*   **Meningioma Tumor Detection:** A model to classify MRI scans as either positive or negative for meningioma tumors, achieving an accuracy of 93%.\n*   **Multi-Class Tumor Detection:** A more advanced model that detects and classifies three types of brain tumors (Glioma, Meningioma, and Pituitary), achieving an accuracy of 95%.\n*   **Transfer Learning:** Utilizes the InceptionV3 architecture with weights pre-trained on ImageNet for the multi-class detector, demonstrating the effectiveness of transfer learning for medical imaging tasks.\n*   **Jupyter Notebooks:** The repository includes the Jupyter notebooks used for training, evaluation, and prediction, providing a clear view of the entire workflow.\n\n## Models\n\nThis project includes two distinct models for brain tumor detection.\n\n\nThis project is focused on the detection of brain tumors from MRI scans using deep learning. It originated as a final project and has since been updated and expanded. The project explores two different models for cancer detection: one for detecting meningioma tumors and another for classifying multiple types of brain tumors.\n\n## Features\n\n*   **Meningioma Tumor Detection:** A model to classify MRI scans as either positive or negative for meningioma tumors, achieving an accuracy of 93%.\n*   **Multi-Class Tumor Detection:** A more advanced model that detects and classifies three types of brain tumors (Glioma, Meningioma, and Pituitary), achieving an accuracy of 95%.\n*   **Transfer Learning:** Utilizes the InceptionV3 architecture with weights pre-trained on ImageNet for the multi-class detector, demonstrating the effectiveness of transfer learning for medical imaging tasks.\n*   **Jupyter Notebooks:** The repository includes the Jupyter notebooks used for training, evaluation, and prediction, providing a clear view of the entire workflow.\n\n## Models\n\nThis project includes two distinct models for brain tumor detection.\n\n### Meningioma Detector\n\nThis model is a Convolutional Neural Network (CNN) built from scratch using TensorFlow. It is designed for the binary classification of meningioma tumors.\n\n*   **Architecture:**\n    *   The model consists of three convolutional layers with 16, 32, and 64 filters, respectively.\n    *   The `ELU` (Exponential Linear Unit) activation function is used in all convolutional and dense layers.\n    *   `MaxPooling2D` is applied after each convolutional layer to downsample the feature maps.\n    *   Two fully-connected (`Dense`) layers with 128 units each follow the convolutional layers.\n    *   The final output layer uses a `softmax` activation function for classification.\n*   **Regularization:** To prevent overfitting, the model employs two regularization techniques:\n    *   `Dropout` with a rate of 0.2 is applied after each pooling layer and between the dense layers.\n    *   `L2 regularization` is applied to the weights of all convolutional and dense layers.\n*   **Performance:** This model achieves an accuracy of 93% on the test set.\n\n### Multi-Class Cancer Detector\n\nThis model is designed to classify MRI scans into four categories: Glioma, Meningioma, Pituitary tumor, or no tumor. It leverages transfer learning to achieve high accuracy.\n\n*   **Technique:** Transfer learning and fine-tuning.\n*   **Base Model:** The `InceptionV3` model, pre-trained on the ImageNet dataset, is used as the base for feature extraction. The original classification head of InceptionV3 is removed.\n*   **Custom Head:** A new classification head is added on top of the InceptionV3 base, which includes:\n    *   A `GlobalAveragePooling2D` layer.\n    *   A `Dense` output layer with 4 units and a `softmax` activation function.\n*   **Training Process:**\n    1.  **Feature Extraction:** The model is first trained with the InceptionV3 base frozen (weights are not updated). This allows the new classification head to adapt to the brain tumor dataset.\n    2.  **Fine-Tuning:** After the initial training, the InceptionV3 base is unfrozen, and the entire model is trained with a very low learning rate. This fine-tunes the pre-trained weights to be more specific to the task of tumor detection. During this phase, the `BatchNormalization` layers in InceptionV3 are kept frozen to stabilize training.\n*   **Data Augmentation:** To improve generalization, the training data is augmented with `RandomFlip` (horizontal) and `RandomRotation`.\n*   **Performance:** This model achieves an accuracy of 95% on the test set.\n\n## Datasets\n\nThe models were trained on datasets from Kaggle:\n\n*   **Brain Tumor Classification (MRI):** [https://www.kaggle.com/datasets/sartajbhuvaji/brain-tumor-classification-mri](https://www.kaggle.com/datasets/sartajbhuvaji/brain-tumor-classification-mri)\n*   **Brain Tumor MRI Dataset:** [https://www.kaggle.com/datasets/masoudnickparvar/brain-tumor-mri-dataset](https://www.kaggle.com/datasets/masoudnickparvar/brain-tumor-mri-dataset)\n\n## Installation and Usage\n\nTo use this project, you will need to have Python, TensorFlow, and other standard data science libraries installed. The `Transfer.ipynb` and `Train\u0026Test.ipynb` notebooks in the `Cancer_Detector` and `Meningioma_Detector` directories, respectively, contain the code for training the models.\n\nThe pre-trained model file for the multi-class detector can be found at the following link:\n[https://drive.google.com/drive/folders/1o7ts623pJQxxuOs5kQBkyjEyorH8lT0X?usp=sharing](https://drive.google.com/drive/folders/1o7ts623pJQxxuOs5kQBkyjEyorH8lT0X?usp=sharing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamir-atra%2Fcancerdetector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamir-atra%2Fcancerdetector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamir-atra%2Fcancerdetector/lists"}