# Swin Transformer-Based Object Detection Model Using Explainable Meta-Learning Mining
## 3 Swin Transformer-Based Object Detection Model Using Explainable Meta-Learning Mining
### Object Detection Based on Swin Transformer  
An object detection algorithm makes detection through the localization used to classify objects and find their position information. A general CNN considers all areas of an image through sliding. Although it is simple, it is executed multiple times, and thus its speed is slow [26]. Therefore, there is a speed limit for detecting objects from much data. The one-stage object detection method conducts regional proposal and classification at the same time so that it is excellent at speed. The two-stage object detection method processes regional proposal and classification sequentially, and thus it has high accuracy even though its speed is slower than that of the one-stage approach. YOLO as an object detection algorithm scans the entire image once. Due to its high speed, it is possible to detect objects in real-time. The algorithm, however, has a low recognition rate of small objects. In fact, image data include not only big objects but small ones. Accordingly, it is necessary to apply a method of improving the recognition rate and detection rate of objects of various sizes. When ViT is applied to YOLO for object detection, there is a good performance [27]. However, when standard ViT tokenizes an input image, it slides a patch without overlapping. This approach ignores modeling for image local structures such as lines and edges, so that information loss can occur. Therefore, this study makes use of the Swin Transformer for object detection. Swin Transformer refers to the model in which transformer structure is applied to object detection. Through the shifted window, it carries out expression learning with a hierarchical transformer [28]. For object detection in various scales, the method uses a feature pyramid structure. In addition, YOLOv3 uses a model. YOLOv3 applies the sigmoid function to all classes in the last layer in order to make a binary classification in each class. It has low accuracy for small objects. To improve the efficiency of object detection, YOLOv3 is combined with the Swin Transformer. Figure 5 shows the architecture of the Swin Transformer-based object detection model.  
Figure 5: The architecture of the Swin Transformer-based object detection model.  
In Figure 5, the architecture consists of the Swin Transformer section and the YOLOv3 section. The Swin Transformer transforms input image data into patches and merges them in the way of increasing a patch size gradually from a small one. Window-Multi-Head Self-Attention executes self-attention operation between patches found in the current window. It can reduce the cost of operations due to the high association of adjacent pixels. Shifted-Window-Multi-Head Self-Attention shifts the window and applies a mask in order to prevent self-attention operation. That is because it is meaningless for a patch to move to the opposite side through the shift and to execute the self-attention operation. After mask operation, the original value is recovered, and thereby it is possible to present the connectivity of windows. The object detector is based on YOLOv3. DarkNet53 is used as a backbone network. Initial, intermediate, and final feature maps are used in the feature pyramid network. In the feature pyramid network, each feature map is set to the same size through up-sampling and is connected together. Accordingly, binary classification of the image is possible through the sigmoid function. As a result, in the combination of YOLOv3 and Swin Transformer, the Swin Transformer is capable of detecting small objects of various sizes, the ones which YOLOv3 hardly detect. Nevertheless, the model is heavy because of many parameters. To solve the problem and design a relatively light model, Few-Shot Learning is applied.