Skip to content

A sample project to perform blob analysis on images with TensorFlow and Keras to detect blobs and analyze their shape features such as the presence, number, area, position, length, and direction of lumps.

License

Notifications You must be signed in to change notification settings

ahmetozlu/tensorflow_blob_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tensorflow Blob Analysis

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.

Quick Demo

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

Theory

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.

Installation

  1. Clone this repository
  2. Install dependencies
    pip3 install -r requirements.txt
  3. Run setup from the repository root directory
    python3 setup.py install
  4. 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

Citation

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"
}

Author

Ahmet Özlü

License

This system is available under the MIT license. See the LICENSE file for more info.