# Scale-Sensitive Attention for Multi-Scale Maritime Vessel Detection Using EO/IR Cameras
## 3 Proposed Method
### Proposed Architecture  
The overall system overview is presented in Figure 2. For real-time detection, the 1-stage detection model YOLOv8 was used. YOLOv8 features an anchor-free design, advanced network architecture, efficient data augmentation and normalization techniques, and an optimized training algorithm, providing higher accuracy and faster processing speeds compared to previous YOLO versions. In this study, we introduced a newly proposed ML-MHA based on this model to improve precision in detecting objects of various sizes. However, the anchor-free method may struggle with predicting the position and size of small objects, potentially leading to lower accuracy in small object detection. To address this, we introduced a newly proposed ML-MHA mechanism based on YOLOv8. This module allows for focused detection of both small and large objects separately, enhancing the precision of detecting objects of various sizes.  
The input data consists of 512 \(\times\) 512 resolution camera images, with both EO and IR cameras having the same resolution. The backbone is composed of five convolutional layers, and as the data passes through each layer, the feature map sizes gradually decrease to 128 \(\times\) 128, 64 \(\times\) 64, 32 \(\times\) 32, and 16\(\times\) 16. During this process, important information is extracted from each feature map. These extracted features from the backbone are then passed to the neck, which is composed of Feature Pyramid Network (FPN) and Path Aggregation Network (PAN).  
PAN propagates lower level information to higher levels, further enhancing the precision of detecting both small and large objects.  
As a result, very small objects are included in the 128 \(\times\) 128 feature map, small objects in the 64 \(\times\) 64 feature map, medium sized objects in the 32 \(\times\) 32 feature map, and large objects in the 16 \(\times\) 16 feature map. The very small and small objects are passed to the SSCA module, while the medium sized and large objects are passed to the SA module. This process is executed in parallel through multi-head attention. The detection head then predicts and displays bounding boxes and object classes from the various-sized feature mAP\({}_{\text{s}}\) based on the results of the multi-head attention.  
Figure 3 shows the attention process within the SA and SSCA modules of the ML-MHA. The SA module detects large objects by utilizing feature mAP\({}_{\text{s}}\) (16 \(\times\) 16 and 32 \(\times\) 32, with 384 channels) extracted from the neck as input. In this process, the attention score for positional information is calculated using the transpose of the key, composed of 128 channels, and the query, composed of 256 channels. Based on this score, the value is updated to efficiently determine the location of the objects. In contrast, the SSCA module focuses on detecting small objects by employing feature mAP\({}_{\text{s}}\) of small objects (64 \(\times\) 64 and 128 \(\times\) 128, with 384 channels) extracted from the neck as the query. The key receives positional information from a resized mask corresponding to the same feature map size, and the attention score is computed based on the relationship between these two elements. This score is then used to update the value, enabling precise localization of small objects. Through this process, ML-MHA implements an attention mechanism capable of effectively detecting objects of various sizes.