For the purpose of this project, we have planned to use the MicroCT Scan of Sandstone obtained from this repo bnsreenu/python_for_microscopists, which contains the train images and the train masks of the Sandstone image.
In digital image processing and computer vision, image segmentation is the process of partitioning a digital image into multiple segments (sets of pixels). The goal of segmentation is to simplify and/or change the representation of an image into something that is more meaningful and easier to analyze. Image segmentation is typically used to locate objects and boundaries (lines, curves, etc.) in images. [1]
- Segmentation Techniques :
- Classical approach
- Traditional Machine Learning approach (Our Approach)
- Deep Learning approach
For our project we will implement semantic image segmentation to locate the Quartz, Pore, Clay and Heavy materials in the sandstone microscopic image.
We will be using traditional machine learning algorithms for the purpose of image segmentation. We will be using multiple feature extraction filters like Gaussian Blur, Sobel Filter, Gabor Filter for feature extraction. The original image, the image obtained after applying the filters and the mask image (label) will give the final dataset. The mask image contains 4 classes which includes Quartz, Pore, Clay and Heavy materials. The train data will then be fed into multiple machine learning algorithms. We will then use evaluation metrics of Precision, Recall, F-score, and Accuracy of the model on the test set. The importance of the different features obtained from using different filters will also be analyzed. The algorithm with better performance will then be used to obtain the segmented image of the new MicroCT scan image of sandstone.
- The directory structure is inspired from Cookiecutter Data Science
- You should have
make
installed in your system - To prepare dataset run :
$ make dataset n_images=5
final_dataset.csv
will be generated in ./data/processed/ directory
- To train the model:
- decision tree
$ make train_dt
dtree.pkl
will be generated in ./models/ directory
- random forest
$ make train_rf
rf_dummy.pkl
will be generated in ./models/ directory
- decision tree
- For getting the segmented masks
- Using model
$ make predict model=<model_path> img=<image_path>
- The models are available in ./models directory
- A mask image will be obtained on ./results/ directory
- Using multiotsu
$ make multi_otsu img=<image_path>
- A mask image will be obtained on ./results/ directory with postfix otsu_mask
- Using model
- To check score of the obtained segmented mask
$ make scores pred_mask=<mask1_path> real_mask=<mask2_path>
[1] https://www.wikiwand.com/en/Image_segmentation
- Utsav Darlami (14)
- Babin Joshi (19)
- Gyanas Luitel (27)
- Niraj Tamang (47)