$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
The data used in this study came from a public research database of microscopic urine sediment images. During the study, no personal information identifying the patient was used. The commercially available elements associated with this protocol are listed in the Table of Materials.
Acquire and Prepare Dataset
Microscopic urine sediment images comprising RBCs, WBCs, epithelial cells, crystals, casts, bacteria, and yeast were obtained. All images were saved in PNG or JPEG format using consistent naming conventions. Blurry or poor-quality images containing incomplete sediment artifacts were eliminated. Bounding box annotation software was used for object-level annotation of urine sediment particles. Each sediment type was assigned a class number, and annotations were exported in YOLO format containing the class identifier, normalized center coordinates, bounding box width, and bounding box height. Annotation quality was validated manually by randomly selecting annotated images.
The dataset was randomly divided into three subsets consisting of 70% training data, 15% validation data, and 15% testing data. We used Python Scikit-learn train_test_split() function with stratified sampling to divide the dataset. Each subset maintained proportional representation of all sediment classes. Stratified random splitting was employed to minimize class disparity across dataset partitions. The class-wise distribution of images to urine sediment categories is illustrated in Table 1.
All microscopic images were resized to 640 × 640 pixels using bilinear interpolation with OpenCV. Pixel intensity values were normalized to the range [0,1]. Data augmentation was performed using horizontal flipping, vertical flipping, random rotation (±15°), brightness adjustment, and contrast adjustment during training. The preprocessed images were saved in separate training, validation, and testing folders.
System Configuration
The experimental environment was configured for deep learning-based urine sediment analysis. Python version 3.10, the PyTorch deep learning framework, and CUDA Toolkit version 12.1 for GPU acceleration were installed. Additional Python packages including OpenCV, NumPy, Pandas, Matplotlib, and Scikit-learn, were installed. The repository for YOLOv10 implementation was downloaded and configured prior to experimentation. Deterministic GPU computation was enabled where possible, and all package versions used during experimentation were recorded to support reproducibility.
YOLOv10-Based Urine Sediment Detection
A schematic diagram of YOLOv10 is shown in Figure 1. Pretrained YOLOv10 weights trained on the COCO dataset were loaded. The final detection layer was replaced with a custom output layer by replacing the default COCO class count with the urine sediment class count. An anchor-free detection configuration was implemented based on the YOLOv10 structure.
Training hyperparameters were initialized with a learning rate of 0.001, batch size of 16, 300 epochs, AdamW optimizer, and weight decay of 0.0005. Cosine annealing learning rate scheduling was applied, and early stopping with a patience value of 20 was enabled during training.
The training dataset was input into the YOLOv10 network to generate bounding box predictions and class probabilities. Localization loss, classification loss, confidence loss, and total loss were calculated during training. Model weights were updated using backpropagation and gradient descent optimization. Validation was performed after each epoch using the validation dataset.

Figure 1: Architecture of YOLOv10. Schematic representation of the YOLOv10 object detection architecture used for automated urine sediment analysis. The figure illustrates the backbone, neck, and detection head components involved in feature extraction, multi-scale feature fusion, and anchor-free object detection for microscopic urine sediment particles. Please click here to view a larger version of this figure.
Chimpanzee Leader Election Optimization (CLEO)
A schematic diagram of CLEO is shown in Figure 2. The optimization search space included learning rate 0.0001–0.01, batch size 8–32, momentum 0.8–0.99, weight decay 0.0001–0.001, and confidence threshold 0.25–0.75. An initial chimpanzee population containing random candidate solutions was generated. YOLOv10 was trained using hyperparameters represented by each candidate chimpanzee, and model performance was evaluated using validation mean Average Precision (mAP). The fitness function was defined as:

Here,
, and
represent weighting coefficients. The chimpanzee candidate with the highest fitness score was selected as the leader. The remaining candidate solutions were updated according to CLEO position updating rules. Exploration and exploitation processes were performed iteratively to identify optimal hyperparameters. The optimization process was repeated for 50 iterations or until the fitness improvement < 0.001. The weights assigned were
0.5,
0.25, and
0.25. The optimal CLEO-generated hyperparameters were applied to the YOLOv10 framework. The network was retrained using the complete training dataset, and the best-performing model weights were saved based on validation performance. The workflow of the proposed model is illustrated in Figure 3.

Figure 2: Chimpanzee Leader Election Optimization algorithm. Workflow of the CLEO optimization algorithm showing initialization of candidate solutions, fitness evaluation, leader selection, exploration-exploitation updating strategy, and iterative convergence for hyperparameter optimization of the YOLOv10 framework. Please click here to view a larger version of this figure.

Figure 3: Workflow of the proposed model. Overall workflow of the proposed YOLOv10 + CLEO framework for automated urine sediment analysis, including dataset acquisition, image preprocessing, annotation, model training, CLEO-based hyperparameter optimization, detection, and performance evaluation. Please click here to view a larger version of this figure.
Model Evaluation
The optimized YOLOv10 + CLEO model was tested using the independent testing dataset. Performance evaluation metrics including accuracy, precision, recall, F1-score, mAP50, and mAP50-95, were calculated. Scikit-learn metrics functions were used for calculations. Average inference time per image was also recorded. Predicted sediment classes were compared with ground truth annotations to generate confusion matrices for all sediment categories. Frequently misclassified sediment particles were identified based on classification results. Comparison models including YOLOv5, YOLOv8, and Faster R-CNN were trained and evaluated using the UMID dataset under identical hardware configurations.