# Staining-Independent Malaria Parasite Detection and Life Stage Classification in Blood Smear Images
## 3 Proposed Methods
### Malaria Parasite Detection  
For malaria parasite detection, in order to improve detection performance, preprocessing the original data is essential and efficacious. Upon visual inspection, it becomes apparent that the cellular components within the images exhibit a darker contrast relative to the background. Thus, when the contrast limited adaptive histogram equalization (CLAHE) [38; 39; 40] or contrast stretching [41] are applied, they create obvious effects by tuning the brightness levels of various image regions. Consequently, the background region becomes brighter while the cell regions become darker. This preprocessing step significantly facilitates the differentiation between cells and their background surroundings. In addition, due to the different staining methods between the MBB dataset and the MP-IDB dataset, the MBB dataset is stained by Giemsa reagent while the MP-IDB dataset is not. To subside the effect of image color on detection and to simplify the detection process for the algorithm, the grayscale image converting process is indispensable here. The you only look once (YOLO) algorithm is applied to train the proposed malaria parasite detection models. The YOLO algorithm used in this research is the 5 th version of it. Because the descriptions of the YOLO algorithm are widely available in the literature [42], only brief descriptions are provided here. Among several versions of YOLO algorithms, the key differences between different versions are that each version has been built on top of the previous version with enhanced features such as improved accuracy, faster processing (by reducing the number of parameters and the amount of calculations), and better handling of small objects. However, compared with some new algorithms released recently, like the YOLOv8 (2023) and YOLOv9 (2024) algorithms, the YOLOv5 algorithm has stood the test of time and is still a relatively stable and reliable algorithm. The YOLOv5x algorithm is a popular object detection algorithm in the computer vision field and is known for its high-speed performance and high accuracy in object detection tasks. It has simpler implementation and training procedures due to its integration with PyTorch version 1.12.0 [43]. For malaria parasite detection experiments, only the MBB dataset is trained by the YOLO algorithm. The MP-IDB dataset is only utilized as a test group. Before the training process, the input images are preprocessed by each of 5 different operations, i.e., (1) contrast limited adaptive histogram equalization (CLAHE), (2) contrast stretching, (3) median blur [43], and 2 other methods that combined CLAHE with contrast stretching together, (4) contrast stretching then CLAHE, and (5) CLAHE then contrast stretching. To lessen the impact of Giemsa staining in the training set on the unstained dataset of blood smears, all images are converted into grayscale version [44] before training. Thus, for the first stage, there are totally 11 different input image groups after preprocessing. Sample output images of these 5 preprocessing methods on the MBB dataset are shown in Figures 4 and 5. In Figure 4, each input color image is preprocessed, and then each output is converted into the grayscale image. Meanwhile, in Figure 5, each input color image is converted into the grayscale space, and then the grayscale image is preprocessed accordingly. Moreover, it is straightforward that the model with the highest accuracy will be selected as the optimal model on the MBB dataset. Then, the optimal model is used to test the malaria detection performance of the MP-IDB dataset, respectively. To fine-tune the detection outputs, the non-maximum suppression is applied, as it is commonly used in object detection to filter out redundant or overlapping bounding boxes [45]. Thus, to reduce a large number of duplicate bounding boxes detected by the YOLO algorithm here, the non-maximum suppression is applied.