Spaces:
Runtime error
Runtime error
bennypepper commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,2 +1,65 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Here is the refined, "gold standard" `README.md` for your Fuzzy C-Means project. It follows the exact same professional structure we used for the Batik Detector, ensuring your portfolio looks incredibly consistent and recruiter-ready across all your repositories.
|
| 2 |
+
|
| 3 |
+
```markdown
|
| 4 |
+
# Brain Tumor Segmentation using Fuzzy C-Means (FCM) ๐ง
|
| 5 |
+
|
| 6 |
+
   
|
| 7 |
+
|
| 8 |
+
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.
|
| 9 |
+
|
| 10 |
+
## ๐ Project Overview
|
| 11 |
+
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.
|
| 12 |
+
|
| 13 |
+
## ๐ ๏ธ Tech Stack & Tools
|
| 14 |
+
* **Language:** Python
|
| 15 |
+
* **Computer Vision:** OpenCV
|
| 16 |
+
* **Machine Learning / Fuzzy Logic:** scikit-fuzzy, NumPy
|
| 17 |
+
* **Visualization:** Matplotlib, Graphviz (for automated process mapping)
|
| 18 |
+
* **GUI / Interactions:** Tkinter
|
| 19 |
+
|
| 20 |
+
## ๐ Key Features
|
| 21 |
+
* **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.
|
| 22 |
+
* **Automated Workflow Mapping:** Dynamically generates and displays Graphviz flowcharts mapping both the overall system process and the internal FCM algorithmic loops.
|
| 23 |
+
* **Interactive File Selection:** Built-in Tkinter GUI for seamless, user-friendly local image selection and processing.
|
| 24 |
+
* **Quantitative Evaluation:** Automatically calculates and outputs the Fuzzy Partition Coefficient (FPC) and objective function convergence to validate clustering quality.
|
| 25 |
+
|
| 26 |
+
## ๐ Repository Structure
|
| 27 |
+
```text
|
| 28 |
+
fcm-brain-tumor-segmentation/
|
| 29 |
+
โโโ data/
|
| 30 |
+
โ โโโ sample_mri.jpg # Example MRI scans for testing
|
| 31 |
+
โโโ src/
|
| 32 |
+
โ โโโ segment_fcm.py # Main execution script
|
| 33 |
+
โโโ requirements.txt # Python dependencies
|
| 34 |
+
โโโ README.md
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## ๐ป How to Run Locally
|
| 38 |
+
|
| 39 |
+
1. **Clone the repository:**
|
| 40 |
+
```bash
|
| 41 |
+
git clone [https://github.com/yourusername/fcm-brain-tumor-segmentation.git](https://github.com/yourusername/fcm-brain-tumor-segmentation.git)
|
| 42 |
+
cd fcm-brain-tumor-segmentation
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
2. **Install the required dependencies:**
|
| 46 |
+
```bash
|
| 47 |
+
pip install -r requirements.txt
|
| 48 |
+
```
|
| 49 |
+
*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.*
|
| 50 |
+
|
| 51 |
+
3. **Execute the segmentation script:**
|
| 52 |
+
```bash
|
| 53 |
+
python src/segment_fcm.py
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
## ๐ Results & Performance
|
| 57 |
+
The algorithm efficiently reached optimal convergence in **34 iterations** with a minimized objective function of **10,852,001.55**.
|
| 58 |
+
* **Fuzzy Partition Coefficient (FPC):** `0.9156` (A score highly close to 1.0, indicating exceptionally well-defined and compact clusters).
|
| 59 |
+
* **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.
|
| 60 |
+
|
| 61 |
+
## ๐ฎ Future Development
|
| 62 |
+
* **Ground Truth Validation:** Compare algorithmic outputs against expert-annotated masks to calculate exact Accuracy, Specificity, and Dice Coefficients.
|
| 63 |
+
* **Skull Stripping Pipeline:** Introduce a pre-processing step to isolate brain tissue from the skull for improved clustering focus.
|
| 64 |
+
* **Texture Analysis Integration:** Expand feature extraction beyond pixel intensity to include tissue texture matrices.
|
| 65 |
+
```
|