Skip to content

Semi-automatic image annotation application for irregular objects.

License

Notifications You must be signed in to change notification settings

maxfrei750/SemiAutomaticAnnotation

Repository files navigation

SemiAutomaticAnnotation

DOI License: MIT License: Apache-2.0 Platform: docker

This browser-based application allows the pixel-perfect annotation of objects, by just labeling their bounding box. It can therefore yield significant speed-ups of the annotation process, especially for irregularly shaped objects.

Demo

Installation

  1. Install Git.

  2. Install Docker.

  3. Open a command line.

  4. Clone this repository: git clone https://github.com/maxfrei750/SemiAutomaticAnnotation.git

  5. Change into the repository folder: cd SemiAutomaticAnnotation

  6. Download the required Docker images (this might take some time): docker compose pull

Usage

  1. Place your input images in the ./SemiAutomaticAnnotation/data/input folder.

  2. Open a command line.

  3. Change into the repository folder: cd SemiAutomaticAnnotation

  4. Start the application (might take a few seconds): docker compose up

  5. Visit the web application: http://localhost:8502

  6. Annotate your images.

  7. Evaluate your images.

  8. Inspect your results.

  9. Take your results from the ./SemiAutomaticAnnotation/data/results folder.

Update

  1. Open a command line in the repository folder.

  2. Pull the latest version: git pull

  3. Rebuild the Docker images: docker compose pull

Acknowledgement

This application is based on the following publication:

The authors of this application and the aforementioned publication are not associated in any way.

Deep-MAC versus Deep-MARC

Birodkar et al. proposed two models, Deep-MAC (Deep Mask-heads Above CenterNet) and Deep-MARC (Deep Mask-heads Above R-CNN). In this application, you can choose between the two models, however, for most particle analysis applications, they produce very similar results.

We compared the two models on a dataset of 32 grain images (with 3500+ grains) like the following one:

Grain image

The resulting masks were compared using the intersection over union (IoU) metric and by comparing their sizes.

IoU

The IoU is defined as the area of the intersection of the masks divided by the area of the union of the masks. The following figure shows a histogram of the IoU values for pairs of masks, produced by the two models.

Histogram of the IOU values

The median IoU is 0.92 and 99% of the IoU are larger than 0.62, which indicates a high similarity between the masks produced by the two models. As an illustration, the following figures show corresponding IoU values.

Median IoU Example 99% quantile of IoU Example

Grain size

For this comparison, we used the square root of the number of pixels in the mask as a measure for the grain size. The following figures show histograms of the absolute (left), as well as relative (right) deviations of grain sizes between the two models:

Histogram of absolute size deviations Histogram of relative size deviations

The deviations were calculated as follows:

size_deviation_absolute = size_deep_marc - size_deep_mac
size_deviation_relative = size_deviation_absolute / size_deep_mac

Citation

If you use this repository for a publication, then please cite it using the following bibtex-entry:

@article{Gorynski.2023,
	title = {Machine Learning Based Quantitative Characterization of Microstructures},
	author = {Gorynski, Claudia and Frei, Max and Kruis, Frank Einar and Winterer, Markus},
	year = {2023},
	journal = {Acta Materialia},
	volume = {256},
	pages = {119106},
	issn = {1359-6454},
	doi = {10.1016/j.actamat.2023.119106},
}

For developers

Enable debugger in VSCode

  1. Create a file named .env in the repository folder.

  2. Add the following content to the file: DEBUGGER=1

  3. Optional: Stop running containers.

  4. Start containers: docker compose up

  5. Attach to the debugger by using the run configuration Python: Remote Attach in VSCode.

  6. Set breakpoints and start debugging.

About

Semi-automatic image annotation application for irregular objects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published