Study design and patient population
This retrospective study analyzed thyroid ultrasound examinations obtained between 13 June 2024 and 13 January 2025. The study protocol was approved by the Ethics Committee of Beijing Friendship Hospital, Capital Medical University (approval No. BFHHZS20240300) and was conducted in accordance with the ethical principles outlined in the Declaration of Helsinki, and informed consent was waived because of the retrospective design. The dataset comprised 68 thyroid nodules from 63 patients (30 benign and 38 malignant), and the nodule was the analytic unit. Reference diagnoses were based on ultrasound-guided fine-needle aspiration cytology (FNAC). The malignant group comprised 38 nodules reported as papillary thyroid carcinoma on FNAC.
Inclusion criteria
Eligible patients were required to meet all of the following criteria: (1) underwent conventional grayscale and Doppler ultrasonography, followed by CEUS with satisfactory image quality permitting subsequent microvascular flow imaging analysis; (2) had a cytopathological diagnosis of PTC confirmed by fine-needle aspiration biopsy, with or without concomitant positive BRAFV600E mutation testing; or had a Bethesda Category III (atypia of undetermined significance) cytology result, but with concurrent positive BRAFV600E mutation testing; (3) had a cytopathological diagnosis of benign, proliferative nodules, adenomatous nodules, or benign follicular nodules in Bethesda Category II without concomitant positive BRAFV600E mutation testing.
Exclusion criteria
Patients were excluded from the study if any of the following conditions were present: (1) poor-quality CEUS images or insufficient microbubble signal precluding reliable microvascular flow assessment; (2) absence of cytological or pathological results; (3) histopathological diagnosis of a rare or special subtype of thyroid carcinoma (e.g. anaplastic variants); or (4) cytological findings suggestive of follicular neoplasm (Bethesda Category IV) or any lesion with indeterminate follicular origin, regardless of mutational status; (5) Hashimoto's thyroiditis
Ultrasound, CEUS, and SRUS acquisition
All examinations were performed with the referenced ultrasound system and a linear-array transducer. Patients were positioned supine with the neck extended. The target nodule was localized and measured on B-mode ultrasound; microcalcifications were recorded, and the same lesion-centered imaging plane was used to assess intranodular vascularity with Color Doppler.
After intravenous access was established, the system was switched to a low-mechanical-index CEUS/URM mode (URM means Ultra-Resolution Microscopy imaging). CEUS was performed with a SonoVue intravenous bolus injection of 1.2 mL immediately followed by a saline flush of 5ml; the onscreen timer and continuous cine acquisition were started with bolus administration. The probe was kept in a fixed plane with minimal pressure, and the patient was asked to avoid swallowing during wash-in and wash-out.
For quantitative CEUS, a lesion-restricted region of interest was used to derive the time-intensity parameters. For SRUS, the URM workflow localized and tracked microbubble signals after motion control and generated vessel-ratio, complexity, microvascular density, perfusion index, and flow velocity measurements. The representative image exports showed settings of VSP 4, RES 2, CTR 3, SM 2, VEN 3, and CPT 10 s; corresponding settings were unavailable for the remaining examinations.
The 25 model-input variables are listed in Table 1 and grouped by acquisition modality: age and sex; B-mode microcalcification; Color Doppler intranodular vascularity; qualitative CEUS; quantitative CEUS; and 11 SRUS microvascular measurements.
Feature selection
All 25 quantitative features were retained in the machine learning models. Only numeric features were used; patient names, registration numbers, and lesion-size fields were excluded. No data-driven feature selection was performed, and the same prespecified predictors were entered into each classifier.
Feature standardization
No transformation, imputation, or global scaling was applied before cross-validation. Standardization was applied only to the radial-basis-function SVM via a StandardScaler pipeline. The scaler was fitted on each fold's training nodules and then applied to that fold's validation nodules. Tree-based classifiers received the original numeric scales:

where x is the original feature value, µ is the training-fold mean, and σ is the training-fold standard deviation. Fold-wise preprocessing prevented validation observations from contributing to the SVM scaling parameters.
Data partitioning
Primary performance evaluation used five-fold StratifiedGroupKFold cross-validation with shuffle = True and random_state = 42. A patient identifier defined 63 groups, and all nodules from the same patient were assigned to the same fold. No patient contributed nodules to both the training and validation subsets of a fold.
Model training and validation
Training protocol
Five classifiers were evaluated: random forest (100 trees; random_state = 42), radial-basis-function SVM (C = 1.0; gamma = scale; probability = True; StandardScaler pipeline; random_state = 42), decision tree (Gini criterion; unrestricted depth; random_state = 42), XGBoost (100 estimators; learning_rate = 0.3; max_depth = 6; subsample = 1.0; colsample_bytree = 1.0; random_state = 42), and gradient boosting (100 estimators; learning_rate = 0.1; max_depth = 3; random_state = 42). No grid search, Bayesian optimization, threshold tuning, or nested model selection was performed.
Cross-validation
Within each of five patient-grouped folds, models were trained on the remaining patient groups and evaluated on the held-out groups. Accuracy, sensitivity, specificity, precision, F1-score, and ROC-AUC were calculated for each fold and summarized as mean ± SD. OOF predictions were pooled across all 68 nodules to generate one cross-validated ROC curve and one confusion matrix for each model.
Performance evaluation
Evaluation metrics
Model performance was assessed within each patient-grouped validation fold and from pooled OOF predictions using the following metrics:
Accuracy: Overall proportion of correct predictions

Sensitivity (Recall): Proportion of actual malignant nodules correctly identified

Specificity: Proportion of actual benign nodules correctly identified

Precision (Positive Predictive Value): Proportion of predicted malignant cases that were truly malignant

F1-Score: Harmonic mean of precision and recall

Area Under the Receiver Operating Characteristic Curve (ROC-AUC): Measure of the model's ability to discriminate between benign and malignant nodules across all classification thresholds
where TP = true positives (correctly identified malignant nodules), TN = true negatives (correctly identified benign nodules), FP = false positives (benign nodules incorrectly classified as malignant), and FN = false negatives (malignant nodules incorrectly classified as benign).
Confusion matrix analysis
OOF confusion matrices were generated by pooling the predictions made for each nodule only in the fold in which that patient was held out. Thus, each nodule received a prediction from a model trained on nodules from other patients.
Feature importance analysis
For the Random Forest model, feature importance scores were calculated based on the mean decrease in Gini impurity across all decision trees. The top 15 most important features were identified and ranked to determine which microvascular parameters contributed most significantly to classification performance.
Exploratory SHAP analysis
A focused OOF SHAP analysis using a permutation-based explainer was performed for the SVM. For each held-out nodule, only the corresponding training-fold observations were used as the background distribution (128 antithetic permutations; random seed = 20260716). Mean absolute SHAP values summarized the magnitude of contributions, and signed values indicated the direction. The analysis was exploratory and not used to infer causality, identify independent biomarkers, or define clinical thresholds.
Statistical analysis
Comparative analysis
Model performance was summarized descriptively across the five patient-grouped validation folds and in pooled OOF predictions. No formal between-model hypothesis test or P-value-based ranking was performed because the folds are related and the cohort is small.
For baseline group comparisons, normality of continuous variables was assessed within each outcome group using the Shapiro-Wilk test. Welch's t test was used when both groups were compatible with normality; otherwise, a two-sided Mann-Whitney U test was used. Categorical variables were assessed with Pearson's chi-square test, with Fisher's exact test for sparse 2 x 2 tables. P values were two-sided, exploratory, and unadjusted (alpha = 0.05).
Reproducibility
Reproducibility was supported by a specified patient-group definition, fixed random seed (42), fixed classifier configurations, and fold-wise preprocessing. Identifiers were used only for grouping and were not entered as predictors or exported with model outputs.