This repository contains a copy of Mask R-CNN model modified for the purpose of carrying out C. Elegans fitness analysis described in paper (Journal of Nematology):
"Competitive fitness analysis with a Convolutional Neural Network"
Authors: Joanna K. Palka1, Krzysztof Fiok2, Weronika Antoł1, Zofia M. Prokop1
1 Jagiellonian University in Krakow, Institute of Environmental Sciences
2 University of Central Florida, Department of Industrial Engineering & Management Systems
The study was supported by National Science Centre, Poland, Grant UMO-2013/09/B/NZ8/03317 to Zofia M.Prokop.
The whole repository is published under MIT License (please refer to the License file).
In due course full description of usage will appear here.
Trained model weights are available in the release section.
The code is written in Python3 and requires GPU computing machine for achieving reasonable performance.
C elegans fitness in google colaboratory Select the runtime type Python3 with GPU acceleration for reasonable performance.
Please clone this repository and extract zipped files.
Model-specific-problem-causing package is called PyCoCoTools. It is provided in a proper version in this repo as "modified_pycoco_files.zip". Before using the model, please unzip this file so that the "coco" folder is on the same level as your .py files. Next run:
cd coco/PythonAPI
python setup.py build_ext install
The model is written in Keras and Tensorflow. Dependecies are described more precisely in Mask R-CNN, and are met e.g. by Google Colaboratory most of the time.
Datasets with bounding box annotations and precise instance segmentation masks used for training and evaluation of the model are provided in .zip files in the "datasets" folder. It is advised to unpack them at the same level as .py files.
Description of model parameters along with adopted values is available in mrcnn/config.py.
Changes in visualisation of detections by the model can be done in mrcnn/visualize.py, especially in the "display_instances" function.
To analyze images you can run:
python3 ce_bbx.py inference --image_folder=/path/to/images/for/inference --DMC=0.9 --NMS=0.6 --model=/path/to/model_weights
The model returns .csv file with number of instances of glowing and not glowing c.elegans per image, another .csv file with locations of found c.elegans (rectangles) and a folder with images after inference.
To compute modified MS COCO metrics:
python3 ce_bbx.py evaluate --dataset=/path/to/evaluation_dataset --model=/path/to/model_weights
To train your own model:
python3 ce_bbx.py train --dataset=/path/to/train_dataset --model=path_to_initial_model_weights
Training the model on segmantation dataset is possible:
python3 ce_segmentation.py train --dataset=/path/to/dataset --model=/path/to/model_weights
If you wish to train your model from MS CoCo weights, please download them from the original repository Mask R-CNN.
If you decide to use here published version of the Mask R-CNN model, model weights or labelled or unlabelled images from our datasets please cite our work referring to Competitive fitness analysis using Convolutional Neural Network Joanna K. Palka * / Krzysztof Fiok / Weronika Antoł / Zofia M. Prokop Journal of Nematology. Volume 52, Pages 1-15, DOI: https://doi.org/10.21307/jofnem-2020-108