# AI-Powered Stroke Diagnosis System: Methodological Framework and Implementation
## 5 Theoretical Evaluation
### Comparative Analysis  
A comprehensive comparative analysis is conducted through a methodical examination of both numerical results and visual diagnostics, providing a critical basis for understanding the efficacy and limitations of the various models. The CatBoost model, for example, exhibits performance patterns similar to XGBoost. Its ROC and PR curves are presented in Figure 4a, the CatBoost ROC curve, and Figure 4b, the CatBoost precision-recall curve, while its probability distribution and sensitivity analyses are shown in Figure 4c, the CatBoost probability distribution, and Figure 4d, the CatBoost sensitivity analysis, respectively. The CatBoost calibration curve in Figure 4e further corroborates these observations. Ensemble strategies are also evaluated. The soft-voting ensemble, which aggregates predictions from XGBoost and CatBoost, is characterized by its calibration, probability distribution, and sensitivity to the threshold adjustments, as depicted in Figure 5a, the voting ensemble calibration curve; Figure 5b, the voting ensemble probability distribution; and Figure 5c, the voting ensemble sensitivity analysis. Figure 3: XGBoost model analysis: (**a**) XGBoost precision–recall curve—demonstrates the trade-off between precision and recall across different thresholds; (**b**) XGBoost ROC curve—presents the ROC curve with an approximate AUC of 0.85; (**c**) XGBoost probability distribution—depicts how predicted probabilities are distributed for stroke and no-stroke cases; (**d**) XGBoost sensitivity analysis—illustrates the change in recall as the decision threshold is varied; (**e**) XGBoost calibration curve—assesses the alignment between predicted probabilities and observed outcomes. In contrast, the stacking ensemble achieves the highest overall accuracy among numeric models (94.4%), but suffers from a markedly low stroke recall of 26%. This trade-off is illustrated in Figure 6a, the stacking ensemble calibration curve; Figure 6b, the stacking ensemble probability distribution; and Figure 6c, the stacking ensemble sensitivity analysis, which reveal how minor adjustments in decision thresholds can lead to a precipitous decline in stroke recall. Figure 4: CatBoost model analysis: (**a**) CatBoost ROC curve—presents the ROC performance of the CatBoost model; (**b**) CatBoost precision–recall curve—shows the trade-off between precision and recall specific to CatBoost; (**c**) CatBoost probability distribution—displays the distribution of probability outputs; (**d**) CatBoost sensitivity analysis—details the sensitivity of CatBoost with varying thresholds; (**e**) CatBoost calibration curve—evaluates the calibration of predicted probabilities. For the deep learning approach, the CNN-based model is evaluated using curated imaging data. Its performance is exceptional, with an accuracy of 96.0%, a stroke precision of 0.97, and a stroke recall of 0.91. Additionally, Figure 7a, the CNN calibration curve, shows that the probability estimates from the CNN closely align with the actual outcomes, while Figure 7b, the CNN probability distribution, exhibits a nearly bimodal distribution, clearly separating stroke from non-stroke predictions. The stability of the CNN's image sensitivity across various thresholds is further confirmed by Figure 7c, the CNN sensitivity analysis. Figure 7d,e presents the confusion matrix for our MobileNet-V2 CNN on the held-out image validation set. The model achieved 97% overall accuracy, correctly identifying 265 of 276 stroke cases (recall = 96%) and 464 of 478 non-stroke cases. Table 3 serves to synthesize the qualitative characteristics that were observed throughout the course of our experimental investigations. The analysis effectively illustrates that while the implementation of ensemble methods may lead to enhancements in the overall accuracy, such improvements necessitate the careful tuning of the decision thresholds to prevent the unintended consequence of compromising the detection capabilities for the minority class, specifically the stroke cases.