theodore-ioann commited on
Commit
b62d916
·
verified ·
1 Parent(s): 5b303e8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +45 -48
README.md CHANGED
@@ -1,48 +1,45 @@
1
- # ISIC 2018 Skin Lesion Segmentation
2
- This project explores unsupervised and supervised image segmentation methods applied to the **ISIC 2018 skin lesion dataset**. It compares simple segmentation techniques like **KMeans** and **Gaussian Mixture Models (GMM)** against deep learning models (Unet, Inception-inspired CNN and SegFormer). The deep models are trained on ISIC data, evaluated on the test set and its performance is compared with the baseline models.
3
-
4
- ## Goals
5
- - Segment skin lesions from dermoscopic images.
6
- - Compare baseline unsupervised methods (KMeans, GMM) with deep learning models (Unet, Inception-inspired CNN, SegFormer).
7
- - Evaluate masks using standard metrics: **IoU**, **F1-score**, **Accuracy**.
8
- - Visualize results with overlays (predictions vs. ground truth).
9
- - Explore which morphological operations can improve the quality of the segmentations.
10
- (erosion, dilation, opening, closing)
11
-
12
- ## Dataset
13
- - **ISIC 2018 Challenge - Task 1**
14
- - ~2,600 dermoscopic images and ground truth lesion masks.
15
- - Downloaded from [ISIC Archive](https://challenge.isic-archive.com/data/#2018).
16
- The images and masks are stored in different folders.
17
- - The dataset is split into training, validation, and test sets.
18
- - Due to the nature of the task, there is a notable class imbalance, which we have to take into account when training and evaluating the models.
19
-
20
- ![Class Distribution](results/class_distribution.png)
21
-
22
- ## Unsupervised Methods
23
- - **KMeans**: Clustering algorithm that partitions the image into K clusters based on distances between pixel values.
24
- - Results:
25
- ![KMeans Results](results/kmeans_distribution.png)
26
-
27
- - **Gaussian Mixture Models (GMM)**: Probabilistic model that assumes the presence of multiple Gaussian distributions in the data.
28
- - Results:
29
- ![GMM Results](results/gmm_distribution.png)
30
-
31
- ## Supervised Methods
32
- - **Unet**: A convolutional neural network architecture designed for biomedical image segmentation.
33
- - Results:
34
- ![Unet Results](results/unet_distribution.png)
35
- - **Inception CNN**: A custom architecture inspired by the Inception model, designed for image segmentation tasks.
36
- - Results:
37
- <!-- ![Inception Results](results/inception_distribution.png) -->
38
- - **SegFormer**: A transformer-based model that captures long-range dependencies in images, achieving state-of-the-art results in various vision tasks.
39
- - Results:
40
- ![SegFormer Results](results/segformer_distribution.png)
41
-
42
- ## Evaluation results
43
- From the evaluation of the models on the test set, we can see that the deep learning models outperform the unsupervised methods in terms of IoU, F1-score, and accuracy. The SegFormer model achieves the best results, followed by Unet and Inception CNN. Overall, it is clear that the deep learning models are able to segment skin lesions better than the unsupervised methods. It is also worth noting that all models significantly outperform the majority baseline (which would achieve an accuracy of 76.4%).
44
-
45
- ## How to Run
46
- 1. **Setup**: Install dependencies with `pip install -r requirements.txt`.
47
- 2. **Training**: Run `python main.py --model segformer --epochs 20 --visualize True` to train the SegFormer (or any of the other models).
48
- 3. **Testing**: Use the `python main.py --model segformer --visualize True` to evaluate and visualize model predictions on the test set, with a `segformer.pt` file in the same directory.
 
1
+ ---
2
+ title: Skin Lesion Segmentation Demo
3
+ emoji: 🧴
4
+ colorFrom: pink
5
+ colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: 4.28.1
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ ---
12
+
13
+ # 🧴 Skin Lesion Segmentation Demo
14
+
15
+ This interactive web application allows you to upload a skin image, select a segmentation model, and visualize the predicted lesion mask with optional post-processing.
16
+
17
+ ## 🧠 Available Models
18
+ - **UNet**
19
+ - **SegFormer**
20
+ - **Inception-based CNN**
21
+ - **KMeans** (Unsupervised)
22
+ - **Gaussian Mixture Model** (Unsupervised)
23
+
24
+ ## 🔧 Postprocessing Options
25
+ - None
26
+ - Morphological Open
27
+ - Morphological Close
28
+ - Erosion
29
+ - Dilation
30
+
31
+ ## 💡 How it Works
32
+ The model takes in a skin lesion image (resized to 128×128), performs segmentation, and visualizes both:
33
+ - A binary predicted mask
34
+ - A color overlay on the original image
35
+
36
+ ## 🛠️ Built With
37
+ - PyTorch & torchvision
38
+ - scikit-learn
39
+ - Hugging Face Transformers
40
+ - Gradio
41
+ - OpenCV
42
+
43
+ ---
44
+
45
+ Demo created by Theodore Ioannidis (https://github.com/TheodoreIoannidis).