DZNE

YAPiC is developed by the Image and Data Analysis Facility, Core Reseach Facilities of the DZNE (German Center for Neurodegenerative Diseases). CLI Documentation CLI Documentation

What is YAPiC for?

With YAPiC you can make your own customzied filter (we call it model or classifier) to enhance a certain structure of your choice.

We can, e.g train a model for detection of oak leafs in color images, and use this oak leaf model to filter out all image regions that are not covered by oak leaves:

The output image is also called a pobability map, because the intensity of each pixel corresponds to the probability of the pixel belonging to an oak leave region.

You can train a model for almost any structure you are interested in, for example to detect a certain cell type ist histological micrographs (here: purkinje cells of the human brain):

Histology data provided by Oliver Kaut (University Clinic Bonn, Dept. of Neurology)

We have used YAPiC for analyzing various microscopy image data. Our experiments are mainly related to neurobiology, cell biology, histopathology and drug discovery (high content screening). However, YAPiC is a very generally applicable tool and can be applied to very different domains. It could be used for detecting e.g. forest regions in satellite images, clouds in landscape photographs or fried eggs in food photography.

Examples

Why YAPiC?

Pixel classification in YAPiC is based on deep learning with fully convolutional neural networks. Development of YAPiC started in 2015, when Ronneberger et al. presented a U-shaped fully convolutional neural network that was capable of solving highly challenging pixel classification tasks in bio images, such as tumor classification in histological slides or cell segmentation in brightfield DIC images.

YAPiC was designed to make this new kind of AI powered pixel classification simply applicable, i.e feasible to use for a PhD student in his/her imaging project.

Simply applicable means here in detail:

How to use it

Command line interface

Model training

yapic train unet_2d "path/to/my/images/*.tif" path/to/my/labels.ilp

Prediction

yapic predict my_trained_model.h5 path/to/results/

Get hands on YAPiC with the tutorial.

Go to CLI Documentation for more details.

Python API

Model training

from yapic.session import Session

img_path = 'path/to/my/images/*.tif'
label_path = 'path/to/my/labels.ilp'

model_size_zxy = (5, 572, 572)

t = Session()
t.load_training_data(img_path, label_path)
t.make_model('unet_multi_z', model_size_zxy)

t.define_validation_data(0.2) # 80% training data, 20% validation data

t.train(max_epochs=5000,
        steps_per_epoch=48,
        log_filename='log.csv')

t.model.save('my_model.h5')

Prediction

from yapic.session import Session

img_path = 'path/to/my/images/*.tif'
results_path = 'path/to/my/results/'

t = Session()
t.load_prediction_data(img_path, results_path)
t.load_model('my_model.h5')

t.predict() # applies the classfier to all images in img_path

Try it out with the leaves example dataset

How to install

Linux

pip install yapic

Windows and Mac

YAPiC is currently only supported on Linux. It runs in principle on Mac OS, but installing Tensorflow with GPU support in currently not that straightforward on Mac OS. We may release Docker images in the future to run YAPiC easily in Windows and Mac workstations.

Hardware Recommendations

YAPiC is designed to run on dedicated hardware. In production, it should not run on your everyday-work notebook, but on a dedicated workstation or a server. The reason is, that training a model requires long time (multiple hours to multiple days) and a lot of computing power. Running these processes in the background on your notebook while e.g. writing E-Mails is not feasible. Moreover, you will need powerful GPU hardware that is normally not available on office notebooks.