A sample project to perform blob analysis on images to detect blobs and analyze their shape features such as the presence, number, area, position, length, and direction of lumps.
Here is a demonstration of input and output image. Output image has maskings and bounding boxes around the blobs. Blob shape features like area and perimeter are calculated using OpenCV and scikit-image and all these information are stored in proper csv files.
The output csv file has these headers to store blob shape properties: Blob Number, Blob Area (pixel), Blob Area (mm2), Blob Perimeter (pixel), Blob Perimeter (mm).
As a summary:
-
Input:
- An image file
-
Outputs:
- Bounding boxes around the detected blobs
- Masking the blobs
- The area of the blobs
- The perimeter of the blobs
This project has 2 main components:
- training_layer: This layer provides performing transfer learning on pre-trained deep learning models using TensorFlow and Keras API. Basically, transfer learning is performed on the model to fine tune it for our custom cases. We specify our custom cases with our training data. The output of this layer is used in processing_layer to process the images using our own trained deep learning model. The implementation and more detailed information for training_layer can be found in here.
- processing_layer: This layer provides to process images using our own trained model, which is an output of training_layer, to produces output images contain bounding boxes and maskings. This also provides csv file, which stores blob shapes' information, as an output. The implementation and more detailed information for processing_layer can be found in here.
- Clone this repository
- Install dependencies
pip3 install -r requirements.txt
- Run setup from the repository root directory
python3 setup.py install
- Install
pycocotools
from one of these repos. Here are listed the necessary commands:pip3 install Cython git clone https://github.com/pdollar/coco.git cd coco/PythonAPI make sudo make install sudo python3 setup.py install
If you use this code for your publications, please cite it as:
@ONLINE{
author = "Ahmet Özlü",
title = "TensorFlow Blob Analysis",
year = "2021",
url = "https://github.com/ahmetozlu/tensorflow_blob_analysis"
}
Ahmet Özlü
This system is available under the MIT license. See the LICENSE file for more info.