Skip to content

Keras detector of neurons on medical images of brain slices of rats

Notifications You must be signed in to change notification settings

AlexeyLevashov/Keras_Neurons_Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neurons Detector

Overview

This is a Keras detector of neurons on medical images of brain slices of rats. This implementation achieve approximately 80% F1 score on dataset of 61 annotated images. Solution is tested and worked well on Linux Ubuntu 14.0 and Windows 10 with Python3
image image image

Installation

First you should install tensorflow (CPU or GPU version if you have Video Card with Cuda Compute Capability 3.0) https://www.tensorflow.org/install/

Then install all dependencies by
pip install requirements.txt

Dataset

The dataset included to repository:
data/labeled_images
Each image is annotated by LabelImg:
https://github.com/tzutalin/labelImg
Just download binaries for any platform from repo for looking and editing the neurons annotations.

Training

For training just run:
python train.py

Training takes ~2 hours on Tesla P40.
After training the model weights with quality report will be created in data/trained_weights/vgg
data/trained_weights/vgg/best_weights.hdf5
data/trained_weights/vgg/best_weights_quality_report.txt

Last trained weights for VGG-like network you can download from here:
https://drive.google.com/file/d/11h7gJpFrQgUPx_Uq7YLxPANx7BjYemLo
This weights should be placed here:
data/trained_weights/vgg/best_weights.hdf5

Testing

For testing trained net on dataset:
python estimate_quality.py

Detection

For making detections on new images run:
python detect.py <images_mask>
e.g.
python detect.py data/validation_images/*.jpg

This script creates for each image the xml file with annotated rects in LabelImg format