Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

The Python FCN plus filter enables cell detection


Jun 01, 2021 Article blog



This article was reproduced to Know ID: Charles (Bai Lu) knows his personal column

Download the W3Cschool Mobile App, 0 Foundation Anytime, Anywhere Learning Programming >> Poke this to learn

Lead

Hi~~~

"After a different cloud, the water has been flowing for ten years." Busy found that there are many days did not update the public number, come to a more hair

Start pushing some reptile-related content next month, and there really isn't much time this month.

Cell detection is achieved using a full convolution network plus filter.

Let's get off to a happy start!


Related documents

Baidu web download link: https://pan.baidu.com/s/16W2uByTpThAH8GUrv7pOZg

Password: 5f5k


Develop tools

Python version: 3.6.4

Related modules:

numpy module;

PIL module;

scipy module;

TensorFlow-GPU module;

tensorlayer module;

matplotlib module;

and some Python's own modules.

TensorFlow-GPU version:

1.6.0

Test platform:

Windows10


Environment construction

Install Python and add it to the environment variable, and pip installs the relevant modules that are required.

Among them, TensorFlow-GPU environment construction please refer to the relevant network tutorials, pay attention to the version and drive strict correspondence can be.

Introduction to the principle

Cell detection algorithms implemented using a simple full convolution network plus Gaussian and statistical sorting filters.

The structure of the full convolutional network is:

 The Python FCN plus filter enables cell detection1

The training set contains 6 types of cell images:

(categorized by its center)

(1) Cell overlap:

 The Python FCN plus filter enables cell detection2

(2) Non-target cells:

 The Python FCN plus filter enables cell detection3

(3) Cell edge

 The Python FCN plus filter enables cell detection4

(4) Cell gap:

 The Python FCN plus filter enables cell detection5

(5) Background:

 The Python FCN plus filter enables cell detection6

(6) Cell center point:

 The Python FCN plus filter enables cell detection7

T_T believe that the clever little buddy has guessed:

The cell detection algorithm we use is actually to use a sliding window to traverse a given image, each window's image feel wild input to a well-trained network, to determine whether the center of the window is the center of the cell, if so marked. The idea is similar to RCNN, but we added filters to the test results to improve its accuracy.

For details of the implementation process, see the source code in the relevant file.


Use the demo

Model training:

Run the train.py file in the cmd window.

The original dataset and the data set that was converted to the tfrecords format are provided in the relevant files. T raining is done using a dataset in the tfrecords format. If you want to build it yourself, remove the comments from the following image and modify the original dataset path in the function as your own dataset path:

 The Python FCN plus filter enables cell detection8

Training effect map:

 The Python FCN plus filter enables cell detection9

Model testing:

The trained model is provided in the relevant file, run the test.py file in the cmd window, and modify the test image path in the file yourself before running:

 The Python FCN plus filter enables cell detection10


Effect display

Original image 1:

 The Python FCN plus filter enables cell detection11

Detection effect 1 (note the red dot):

 The Python FCN plus filter enables cell detection12

Original image 2:

 The Python FCN plus filter enables cell detection13

Detection Effect 2:

 The Python FCN plus filter enables cell detection14

That'all~~~


more

The model design is simple and the efficiency is low. After that, some high-end point algorithms will be pushed

The code has been tested as of 2018-05-30.