Skip to main content
. 2025 Mar 11;15(6):691. doi: 10.3390/diagnostics15060691
Algorithm 1. Multi-Dataset YOLOv8 Training Pipeline
Input: ISIC 2020, HAM10000, PH2 Datasets
Output: Trained YOLOv8 Model for Melanoma Detection and Segmentation
1:Load Datasets:
2:Import ISIC 2020, HAM10000, and PH2 datasets.
3:   Apply dataset balancing using stratified sampling.
4:   Normalize pixel intensity values to [0, 1] range.
5:end
6:Preprocessing
7:Resize all images to 512 × 512 resolution.
8:   Apply histogram matching to standardize color distribution.
9:   Remove artifacts using morphological operations.
10:end
11:Data Augmentation
12:Start Apply geometric transformations (rotation, flipping, scaling).
13:   Adjust brightness and contrast.
14:   Use advanced augmentation (CutMix, Mosaic) to improve generalization.
15:end
16:Training (YOLOv8 Model)
17:Initialize model with pre-trained weights.
18:   Use multi-dataset training with dataset weighting.
19:   Train using Adam optimizer and learning rate scheduling.
20:   Apply batch normalization and dropout to prevent overfitting.
21:end
22:Post-Processing
23:Start Apply segmentation boundary refinement.
24:   Filter false positives using confidence thresholding.
25:end
26: Performance Evaluation
27:Start Compute mAP@0.5, Dice Coefficient, and IoU.
28:   Compare results with U-Net, DeepLabV3+, and Mask R-CNN.
29:end
30:Model Deployment
31:Start Optimize for real-time inference.
32:   Test deployment on clinical and mobile health applications.
33:end
34:End Algorithm