unet_image_segmentaion
A semantic segmentation model with UNet architecture using Keras
Kaggle competion: https://www.kaggle.com/c/data-science-bowl-2018
Task was complited with help of https://www.kaggle.com/keegil/keras-u-net-starter-lb-0-277
Plan:
- Importing modules for forking with arrays and dataframes (numpy, pandas), images (skimage), building deeplearning model (keras, tensorflow)
- Getting input data from folders
- Preprocess pictures (merging masks, resizing images)
- Establishing metric function - dice coef
- Building u-net model
- Training model and saving weights (validation split - 0.1 data which are using to calculate metrics on untrained data, 15 epochs are enough to not be overfitted (loss score stops growing))
- Loading model's weights from file and make prediction on train, test data
- Converting prediction values to [0, 1] (threshold = 0.5)
- Showing random samples from test dataset (picture - mask)
Instructions:
-
run Train.py to get train data, preprocess it, build model and train it output: logs in console (training process, metrics), saved weights in .h5 file
-
run Preduct_masks.py to get test data, preprocess it, load model, make predictions and view 5 pairs (test picture - predicted mask). We can't calcultate metric on test data, because we don't have original masks to compare with
-
model.ipynb is jupyter notebook with building model, testing it, viewing results and performance (during the test was detected class of images which has very low dice coef)
Details about modules in requirements.txt