An application that counts colony-forming units in images of petri dishes. CFU Counter uses Mask R-CNN which is a state-of-the-art model for instance segmentation, developed on top of Faster R-CNN. The CNN was trained using the Agar dataset.
Mask R-CNN: https://github.com/matterport/Mask_RCNN
Agar Dataset: https://agar.neurosys.com/
- Download .h5 file from this link: https://drive.google.com/file/d/19-mxrjV_EeSQAb7SppIVG_vgjse_pP7u/view?usp=sharing
- Put .h5 file to "agar_cfg20221010T2320" folder
- Create an environment with Python 3.6.3 and install dependencies with the following commands in terminal/powershell:
- conda create -n agarrcnn python=3.6.3
- conda activate agarrcnn
- pip install -r requirements.txt
python cfucounter.py
To upload a single image use the "Upload File" button.
To upload all images from a folder use the "Upload Folder" button.
Set Number of Samples, the maximum number of final detections. If you don't know the estimated number of colonies, leave this number high.
Set Detection Confidence, minimum probability value to accept a detected instance. ROIs below this threshold are skipped. For the best results raise its value to 0.99. If you have a vague picture and you think that the application underestimates the number of colonies you can leave the default number or decrease it.
Or just leave the default parameters.
Hint: you can run the detection multiple times on the same image with different configuration parameters. All the input configuration parameters are saved in the output .csv table.
-
Click "Detect selected" to detect colonies on the displayed image. The detection will be performed on the picture that is shown in the main window. To change the picture use arrow buttons near thumbnails of images.
Click "Detect all" to detect colonies in all the uploaded images.
Click "Export csv table" after the detection process to save a table containing information: img name, number of colonies, bounding boxes (rectangles that surround colonies, that specify their position).
Please always export the table before closing the application!
Click "Export image" to save displayed image.
Filename | Number of colonies | Bounding boxes | conf_numsamples | conf_det_confidence | Colonies per sector |
---|---|---|---|---|---|
Filename | Number of detected colonies | Coordinates of colonies as boxes | Max. number of samples | Min. detection confidence | Number of colonies in each sector |
Progress bar shows percentage-wise progress of a current detection process. For a large number of images, it does not update itself consistently.
In the bottom part of the application there is log window capturing all the events.
Ekaterina Baikova, TU Graz, 2022