Tool for segmenting images with weak supervision

Hi all community!

I am looking for the right tool to segment my images.

I usually like ilastik, because allows specifying classes by direct drawing on image while training a random forest, but right now I need to train the model on a GPU (w/o GUI). I am then looking at “U-net”like models, but the ones I found are supervised by a mask in which I need to specify the class of every pixels, whereas I’d like to specify the classes only of a few pixels (in a similar way I do w ilastik).

Essentially, I would like to annotate a few landmarks in images (in local, for example by drawing on image), then transfer images and annotations on GPU cluster to train a segmentation model on it.

Which model would it be your first choice for this task?



As far as I know, training U-Net like models with sparse annotations (i.e. not a dense mask) is a major topic of current research in the field. I don’t think a standard solution is around yet.

There is however one tool in ImageJ called YAPIC, which might do what you want. I ping Christoph @cmohl2013 , how is the developer and could probably tell you more (I tried to Google for YAPIC, but did not find much…).

Hi Lewlin and Tischi,

Thank you, Tischi for mentioning our YAPiC tool.

YAPiC is a command line tool written in Python for making the training of unet models with sparse labels as easy as possible. It supports multichannel 3D data. YAPiC loads your Ilastik project file (ilp) and associated image data and trains a model by using Keras with TensorFlow backend.

You can train and a model with a very simple command:

yapic train unet_2d path/to/images/*.tif path/to/ilasik_project.ilp


yapic predict my_trained_model.h5 path/to/images/*.tif 

We are actively using it internally for various projects of different research groups and it works quite well.
YAPiC is not published yet. But I got the OK last week to publish it open source now. I am currently working on installation instructions and tutorial. We will release it in the week 6th of May to 10th of May.

Once we release it, I will also promote the tool here in the forum.

All the best


That is awesome - I look forward to your code as well as the method paper. You’ll see a PR soon :slight_smile:

PRs will be very welcome :slight_smile:

Hi lewlin,

it’s published :sweat_smile:

happy testing!


Hi Christoph,

Thanks a lot for making YAPiC available!
I tried to download the dataset as described in the tutorial with this link:
But the zip file appears empty.

Regards, Peter

i’ll fix it today, thank you!!

@PeterRZ it’s fixed now