Object Classifier

The object classifier can be trained to distinguish between immuno positive cells, immuno negative cells and no cells.

By still having the drawing tool selected but holding the space bar you can freely move around the image and draw again once you let go of the space bar. Alternatively, choose the icon to move again.

By choosing a class and pressing the SPACE bar the class gets hidden and doesn't show

  1. Under Classify, Object Classification, Train object classifier or ctrl+L and search it, open the PlugIn.

The object classifier might give you an error message at the beginning, but as soon as you have 2 or more classes defined, it will be fine

  • Under the Annotations tab choose the classes created for the cell classification, set on auto draw, and draw over some positive cells, negative cells, and no cell with the according class on Auto set chosen.

  1. The closer you zoom into the image, the more accurate you can draw, as the image size increases but the brush stays the same.

  2. Click on live update and the detected objects will get a suggested class, visible in the marked colors. If the class isn’t right, you can easily change it by drawing over it with the right class.

Choose the classes created for the cell classification and draw over some positive cells, negative cells and no cell with the according class chosen
Automatic classification of objects based on primary selections
  1. The object classifier will be trained based on those selections; therefore all the detections must have the right class.

  2. Once satisfied with the classification of the objects the classifier should be saved as ObjectClassifier if you only have 1 tissue type, and as ObjectClassifier_componentx if you have multiple types. The name must be chosen the same as this will ensure the script runs properly. The ObjectClassifier will be saved in a subfolder of your project directly by QuPath.

Within your ProjectFolder a subfolder classifier > object_classifiers get created
  1. A random region in a slide should be chosen to test the accuracy of the object classifier. Therefore choose a random region in a slide and run the "EstimateStainVectors" Script followed by the "CellDetection" Script. Make sure that the region is selected whilst running the cell detection.

  2. If you have closed the Train object classifier window, you can reopen it under Classify > Object classification > Train object classifier

  3. By clicking on load training in the Train object classifier box click the initial training image can be added and applied (your training image might be called Sparse Image (18 Regions)). Make sure that the live update is selected then the detected cells and artifacts are classified.

Using the training images to see how well it applies to regions within the slides
  1. The classification of an object can easily be changed by drawing over it with another classification. It should be ensured that all the objects are correctly classified before adding them as training images and the repetition of the process.

  2. Once satisfied with the classified objects, add the image to the "Load training" images as in step 8. Repeat steps 6-10 till the object classification is highly accurate.

Sparse image (18 regions) was the initial training image. The Object Classifier was then tested on the slide..R3-S17.mrsx. The detections wrongly classified were corrected by overdrawing them with the right classification. Once all the detection had the right Classification the slide was added to the Load training list, and the process was repeated on a different slide until satisfaction of the first classification of the detections on the slide.
  1. The objects in the classifier should be saved as ObjectClassifier if you only have 1 tissue type, and as ObjectClassifier_Component1, e.g. ObjectClassifier_NP if you have multiple types.

Copy the created scripts and classifiers folder from the project_classifiers to the project_regions

Last updated