- Notifications
You must be signed in to change notification settings - Fork8
Cell detection using a convolutional neueral network
License
NotificationsYou must be signed in to change notification settings
johannesu/cnn-cells
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This code show how to train a cell detector using a convolutional neural network inLasagne.
Look atmain.ipynb.
- Python 2 or 3
- The python packages inrequirements.txt, if you have pip you can install them using:
pip3 install -r requirements.txt
- Each image is manually annotated with the center point of each cell as well as some hard negative examples
- All points within
sample radius
of a cell centre are sampled aspositive samples
- An equal number of
negative samples
are randomly sampled outside thepositive radius
- All points within
sample radius
of the hard negative examples are sampled asnegative samples
- Aconvolutional neural network is trained using the negative and positive samples. For each sample, a box of size
box_size
, is used as input to the network. - Given a new image a
box_sized
window is slided through each possible patch in the image, generating a probability map - Local maxima in the probability map are marked as cell centers
Note: There is no padding on the boundary so no detection is possiblebox_size/2
pixels from the image boundary.
The network and code structure is based on LasangesMNIST
examplehttps://github.com/Lasagne/Lasagne/blob/master/examples/mnist.py