# Attention Score Enhancement Model Through Pairwise Image Comparison
## 4 Discussion  
This study proposes the PAE model, optimized for diagnosing cognitive impairments by analyzing CDT data, and evaluates its performance compared to various existing deep learning models. The PAE model is based on the ViT architecture and is designed to enhance attention scores between reference and training images. This unique attention mechanism in the PAE model is effective in handling complex visual features, particularly in diagnosing conditions such as cognitive impairment in medical image analysis. The primary contributions of the PAE model are as follows:  
First, while the ViT learns global relationships at the patch level for individual images, PAE supplements local feature learning by adding an attention enhancement process based on the similarity between training and reference images. This approach allows the PAE model to capture more intricate visual patterns compared to the ViT. As shown in Figure 2, the changes in attention maps before and after enhancement visually confirm that the PAE model learns important visual information more clearly. Second, the performance analysis of the PAE model evaluated the impact of the ASMS (Attention Score Map Median Cosine Similarity) threshold on model accuracy. Table 1 clearly illustrates the performance differences based on various ASMS threshold settings, with the F1-Score and accuracy peaking when the ASMS threshold is set at 0.7. This indicates that setting the ASMS threshold plays a crucial role in the learning effectiveness of the PAE model, and selecting the optimal threshold is essential for optimizing model performance. At higher thresholds, such as 0.9, the model demands a high similarity between reference and training images, which maintains high precision but reduces recall, negatively affecting the F1-Score. Third, as shown in Table 2, the PAE model outperformed not only traditional CNN-based models such as ResNet, VGG, and DenseNet, but also API-Net. Particularly, when compared to API-Net, the PAE model demonstrated better performance in terms of accuracy and F1-Score. API-Net recorded an F1-Score of 0.8013 and an accuracy of 80.33%, whereas the PAE_L_32_384 model achieved an F1-Score of 0.9058 and an accuracy of 92.42%, showing superior results. This implies that the PAE model can capture and learn more precise visual features compared to the simple pairwise learning approach of API-Net. Additionally, the attention score enhancement mechanism in the PAE model focuses on important patches within the image, enabling more efficient processing and learning of complex visual information. Consequently, the PAE model achieved higher precision and recall compared to API-Net, highlighting its advantages in visual information processing. It is true that the PAE model incurs higher computational costs compared to the ViT model. In this study, 71,484 images were trained in an RTX 4090 environment, and the PAE model required up to 1 additional hour of training time compared to the ViT model. However, improvements in accuracy and F1-Score were confirmed, demonstrating that the benefits of enhanced performance outweigh the increase in computational cost. As a result, the PAE model achieved higher precision and recall than API-Net, further proving its superiority in visual information processing. The attention score enhancement technique in the PAE model offers substantial advantages for analyzing complex visual information, particularly in medical applications such as cognitive impairment assessment. Experimental results using CDT data demonstrate that the PAE model effectively focuses on image patches critical for predicting cognitive impairment through its attention enhancement process. This indicates that the PAE model improves precision and recall by emphasizing specific regions within image data and learning key visual features with greater clarity. The design of the PAE model preserves the ViT model's global relationship learning capabilities while capturing subtle differences in local features, enabling more precise visual analysis.