Spaces:
Runtime error
Runtime error
|
Download README.md from benedictpepper/Brain-Tumor-Segmentation: direct link, hf CLI and curl.
- Browser
- Download file 3.81 kB
-
https://huggingface.co/spaces/benedictpepper/Brain-Tumor-Segmentation/resolve/main/README.md
- Command line
-
hf download hf://spaces/benedictpepper/Brain-Tumor-Segmentation/README.md
-
curl -L -o README.md https://huggingface.co/spaces/benedictpepper/Brain-Tumor-Segmentation/resolve/main/README.md
3.81 kB
| title: Brain Tumor Segmentation | |
| emoji: ๐ง | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: streamlit | |
| sdk_version: 1.32.0 | |
| app_file: app.py | |
| pinned: false | |
| # Brain Tumor Segmentation using Fuzzy C-Means (FCM) | |
|     | |
| An automated medical image analysis tool that applies the **Fuzzy C-Means (FCM)** soft clustering algorithm to segment brain MRI scans and highlight potential tumor regions. | |
| ## ๐ Project Overview | |
| Diagnosing brain tumors accurately from Magnetic Resonance Imaging (MRI) is critical but often subjective and time-consuming. This project provides an automated segmentation pipeline using Fuzzy Logic. By clustering pixel data into distinct tissue groups (background, healthy tissue, fluids, and potential tumors), this tool serves as a reliable aid for medical image analysis. | |
| ## ๐ ๏ธ Tech Stack & Tools | |
| * **Language:** Python | |
| * **Computer Vision:** OpenCV | |
| * **Machine Learning / Fuzzy Logic:** scikit-fuzzy, NumPy | |
| * **Visualization:** Matplotlib, Graphviz (for automated process mapping) | |
| * **GUI / Interactions:** Tkinter | |
| ## ๐ Key Features | |
| * **Fuzzy C-Means Implementation:** Configured to dynamically group MRI pixels into 4 distinct clusters with a fuzziness parameter of 2.0, ideal for handling the blurred boundaries of medical tissues. | |
| * **Automated Workflow Mapping:** Dynamically generates and displays Graphviz flowcharts mapping both the overall system process and the internal FCM algorithmic loops. | |
| * **Interactive File Selection:** Built-in Tkinter GUI for seamless, user-friendly local image selection and processing. | |
| * **Quantitative Evaluation:** Automatically calculates and outputs the Fuzzy Partition Coefficient (FPC) and objective function convergence to validate clustering quality. | |
| ## ๐ Repository Structure | |
| ```text | |
| fcm-brain-tumor-segmentation/ | |
| โโโ data/ | |
| โ โโโ sample_mri.jpg # Example MRI scans for testing | |
| โโโ src/ | |
| โ โโโ segment_fcm.py # Main execution script | |
| โโโ requirements.txt # Python dependencies | |
| โโโ README.md | |
| ``` | |
| ## ๐ป How to Run Locally | |
| 1. **Clone the repository:** | |
| ```bash | |
| git clone https://github.com/bennypepper/Brain-Tumor-Segmentation.git | |
| cd brain-tumor-segmentation | |
| ``` | |
| 2. **Install the required dependencies:** | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| *Note for Windows Users: Graphviz requires a system-level installation. If the executable is missing from your PATH, the script will open an interactive prompt to help you locate the `bin` folder automatically.* | |
| 3. **Execute the segmentation script:** | |
| ```bash | |
| python src/segment_fcm.py | |
| ``` | |
| ## ๐ Results & Performance | |
| The algorithm efficiently reached optimal convergence in **34 iterations** with a minimized objective function of **10,852,001.55**. | |
| * **Fuzzy Partition Coefficient (FPC):** `0.9156` (A score highly close to 1.0, indicating exceptionally well-defined and compact clusters). | |
| * **Visual Output:** The system outputs a side-by-side comparison of the original MRI, the isolated cluster labels, and a color-mapped segmentation where potential tumor mass is isolated. | |
| ## ๐ฎ Future Development | |
| * **Ground Truth Validation:** Compare algorithmic outputs against expert-annotated masks to calculate exact Accuracy, Specificity, and Dice Coefficients. | |
| * **Skull Stripping Pipeline:** Introduce a pre-processing step to isolate brain tissue from the skull for improved clustering focus. | |
| * **Texture Analysis Integration:** Expand feature extraction beyond pixel intensity to include tissue texture matrices. | |