Performance analysis of a CNN object detector for blood cell detection and counting


Counting the number of white blood cells (WBCs), red blood cells (RBCs), and platelet in the blood is an important test for evaluating the health conditions. Lack or excess of any one of these can be a sign of a disease and can lead to more severe health problems in the future. For instance, WBCs are protecting the body against different diseases and external invaders. These cells occupy around 1% of the volume of the blood in the body. An increase in the number of WBCs in the blood indicates a health problem such as infection, allergy, leukemia, and many other types of problems. RBCs are oxygen carriers in the body and make up around 45% of the cells in the blood. Insufficient number of these cells in the body causes anemia. Platelets are responsible for creating clots to prevent bleeding.


After the RetinaNet model was trained on the train set, I evaluated the performance of the model on the test set. The test set contains 64 images which include 813 instances of RBCs, 65 WBCs, and 57 Platelets. Figure 1 shows two images of the test set with the detection boxes drawn on them. As the images show, the model is able to correctly classify and localize almost all of the blood cells. The confidence score and IoU threshold for the model inference on these images were both set to 0.5.

Figures 2–4 show the precision-recall curve for each type of cell, setting the IoU threshold at 0.5. The graphs show that the model has a better performance for detecting WBCs (AP=1). Tabel 1 and 2 show the recall and precision of the model for different confidence thresholds (with IoU threshold=0.5). The tables are followed by their corresponding graphs. By increasing the confidence threshold, the recall decreases while the precision increases, as it is expected. For WBCs, the recall doesn’t change much, because the model is always able to detect all the WBCs. However, by decreasing the threshold, the number of false-positives increases and therefore the precision of the model in detecting WBCs decreases. The higher performance of the model for WBCs is due to bigger size of these type of cells in compare to others. Table 3 shows the AP for each cell type at different IoU thresholds and figure 7 show that mAP decreseas as the IoU threshold increases.


I successfully trained a RetinaNet model for detection of different types of cells in the blood. The trained model had a very good mean average precision on the test set. Particularly for the white blood cells the model performed better. Platelets were harder to be detected by the model due to their smaller sizes, but still the model were able to detect them with a good accuracy.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store