Switch to unified view

a/README.md b/README.md
1
# Meta-Learning: Finetuning of Pretrained Network with Attention
1
# Meta-Learning: Finetuning of Pretrained Network with Attention
2
2
3
This repo contains the code submitted to Medival challenge on GI tract's poly segmentaion. The pre-trained
3
This repo contains the code submitted to Medival challenge on GI tract's poly segmentaion. The pre-trained
4
weights of Unet model trained on brain MRI images were fine tuned ; which is a open source available at  https://pytorch.org/hub/mateuszbuda_brain-segmentation-pytorch_unet/,thanks to "mateuszbuda" .Attention mechanism was incorporated while finetuning weights transfered from Unet trained on MRI dataset.
4
weights of Unet model trained on brain MRI images were fine tuned ; which is a open source available at  https://pytorch.org/hub/mateuszbuda_brain-segmentation-pytorch_unet/,thanks to "mateuszbuda" .Attention mechanism was incorporated while finetuning weights transfered from Unet trained on MRI dataset.
5
5
6
6
7
7
8
## Docker
8
## Docker
9
9
10
```
10
```
11
docker build -f Dockerfile -t polypseg .
11
docker build -f Dockerfile -t polypseg .
12
```
12
```
13
13
14
14
15
15
16
## Data
16
## Data
17
Dataset were made publicly available on  [/multimediaeval.github.io/editions/2020/tasks/medico/](https://multimediaeval.github.io/editions/2020/tasks/medico/). It consists of  images of  polyps in GI tract and its masks. Data folders should be  arranged as in the tree structure below to load data in different mode.
17
Dataset were made publicly available on  [/multimediaeval.github.io/editions/2020/tasks/medico/](https://multimediaeval.github.io/editions/2020/tasks/medico/). It consists of  images of  polyps in GI tract and its masks. Data folders should be  arranged as in the tree structure below to load data in different mode.
18
![Data Folder Structure](./readme_fig/folder_tree.png)
18
19
20
21
## Model
19
## Model
22
20
23
The pretrained model has been finetuned  with the polyp  dataset.Unet model is guided with attention mechanism.The dataset consists of 1000 images which was then splitted into 80:20 ratio of train and validation set. The test data consisted of 160 images .
21
The pretrained model has been finetuned  with the polyp  dataset.Unet model is guided with attention mechanism.The dataset consists of 1000 images which was then splitted into 80:20 ratio of train and validation set. The test data consisted of 160 images .
24
22
25
23
26
## Training steps
24
## Training steps
27
25
28
1. Download the dataset .
26
1. Download the dataset .
29
2. Run docker container.
27
2. Run docker container.
30
3. Run `main.py` script.Root path is set to `./medico2020`. For  help run: `python3 main.py --help`.
28
3. Run `main.py` script.Root path is set to `./medico2020`. For  help run: `python3 main.py --help`.
31
29
32
30
33
31
34
## Test prediction
32
## Test prediction
35
33
36
1. Download the test data
34
1. Download the test data
37
2. Run docker container.
35
2. Run docker container.
38
3. Run `test.py`  which will load the provided  trained weights from `./weights/unet.pt` file  
36
3. Run `test.py`  which will load the provided  trained weights from `./weights/unet.pt` file  
39
. Test predicted images will be saved in "./predictions". For  help run: `python3 test.py --help`.
37
. Test predicted images will be saved in "./predictions". For  help run: `python3 test.py --help`.
40
38
41
39
42
40
43
41
44
# Results
42
# Results
45
43
46
For viewing the graph,images and events; "./log" can be loaded and viewed in tensorboard.
44
For viewing the graph,images and events; "./log" can be loaded and viewed in tensorboard.
47
45
48
46
49
Mean DSC on validation=96.35 %  
47
Mean DSC on validation=96.35 %  
50
48
51
Mean IOU on validation=87.91%
49
Mean IOU on validation=87.91%
52
50
53
## Plot
54
55
![Validation DSC VS Iterations ](./readme_fig/val_dsc.png)
56
57
58
## Sample predictions(Red) over groundtruth(Green)
59
60
![Green- GT, Red- Pred](./readme_fig/img.gif)