Interactive Annotator causing Pixel Classification Model to fail

Hi everyone,

I’m new to KNIME.

I’ve been attempting to segment cell nuclei using 9 images (originally UnsignedByteType, 4096 x 4096) to train a model. I’m using the Interactive Annotator and the Pixel Classification Model node to do the manual labeling.

The annotator is creating a new table of images with the options “Add unique segment id as label”, ARRAY_IMG_FACTORY and BYTETYPE as storage type.

The first round of manual annotations goes well and the Pixel Classification Model executes without problems. However, when attempting to add new annotations to some of the images for fine-tuning, the Pixel Classification Model fails with the error Value not defined for given nominal attribute!.

The new features I want to annotate are on the 4th image, but I’m only allowed to create new annotations on the 1st image.

What could I be doing wrong?

This doesn’t appear to be the normal behavior for the Image Annotator.

I’ve been at it for 2 days and I can’t seem find detailed documentation for these nodes anywhere, so I would really appreciate some pointers.



Hi @ffernandes,
have you taken a look at ? There you can download an example workflow that demonstrates the plugin. It might give you some further ideas for your work.

As far as I can tell from your error description you are trying to add a new class to the image? It is possible that this is not fully supported for later images in the table. Do you have an image that contains all classes? If so try to put it first, then the model should be correctly initialized. Feel free to ask more questions if this unclear or doesn’t work.


Hi Gabriel,

Thanks for the link.

Actually, “new features” was a wrong choice of words on my side. I’m not trying to add any new labels.

My images only contain nuclei and background, and I have 2 corresponding labels: nuclei and background. I’m trying to annotate within these labels.


Ok I experimented a bit more with the example workflow, it seems that the Pixel Classification Model node does not work well with missing values in the input. So you need to filter those out first, e.g. with a Missing Value node. With that taken care of I could add labels from several images.



I’ve tested the Missing Value node (with the Missing Value (Apply)) configured in several different ways (including default), but my Pixel Classification Model still threw the same Value not defined for given nominal attribute! error after every run.

One remark about my workflow is that the images going through the Interactive Annotator have passed through ImageJ Macro for background removal, whereas the ones being fed into pixel training (I’m using Fiji Trainable Segmentation Features 2D) have not. Could this be causing the issue?

Ok this sounds like a different problem then, are you able to share the workflow with some example data with us?
That would make fixing this much easier.

Hi Gabriel,

Our image dataset is massive and it had to be moved into the cloud for processing. It would be a bit difficult to share some of that through here, I think.

I have made some screenshots.

This is the part of the workflow that is failing:

This is what happens to the Labels (under the Configuration tab) when the error occurs. An “Unknown” label is created:

At the same time, when we look at the “View: TableCellView” option, the labels are out of sequence (Here we put 3 annotations. Shouldn’t they be 0, 1 and 2, instead of 4, 5 and 6?):

Whereas, on a successfully labeled image, the labels appear in sequence (Here with 2 annotations):

Sometimes, deleting an annotation and moving it by 1 mm in either direction will solve the issue. Other times, nothing helps.

At some point I was convinced that the Image Normalizer node was causing it, but it happens even without it.

PS: I must add that the annotating issue persisted on a different workflow, when attempting to segment some particles in another channel of the same image.

Hi @ffernandes,

What does the output table of the Interactive Annotator look like? That is, do you have images in there that do not contain any label?

Also, disable the Add unique segment id as label in the Interactive Annotator, it screws with the training of the classifier and I assume that it is the source of error. If you really need the unique labels, use two Labeling Filters after the Interactive Annotator to include and exclude Segment: *, respectively. Subsequently, you can feed the the output of the one where you have excluded them to the Pixel Classification Model.



Hi Stefan,

Disabling the Add unique segment id as label solved the problem. Thank you.

I guess we were using it because it came enabled by default on the Interactive Annotator.

Is there a place where I could read more about the use of unique segments as labels?

Thank you!


Hi @ffernandes,
Unique segments ID labels are required when you want to annotate several distinct elements of a class in a picture and need them to be handled as distinct objects, not as a single entity.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.