# A Study on Pine Larva Detection System Using Swin Transformer and Cascade R-CNN Hybrid Model
## 1 Introduction  
Pine trees are the most widely distributed trees in the forests of Korea, and their number is also greater than that in other forests. A characteristic of pine trees is that they are strong because they have high endurance in dry or low-landing places, so they grow well in the alpine areas of granite, accounting for 21.9% of all forests in Korea. The areas in which pine trees are used the most are construction, telephone poles, bridges, agricultural implements, implements, and furniture. In addition, they are used in the paper industry and as a raw material for precious medicinal materials, and pine branches and pine roots are used in various ways as inks and materials for black painting. The extract of pine needles lowers blood pressure and can promote human blood circulation because it is rich in antioxidants and anti-aging substances [1]. However, pine trees are very vulnerable to pests and diseases when compared with other trees. The types of pests include pine leaf black flies, pine bark beetles, and oak wilt [2]. In Korea, after the first outbreak of pine wilt disease in 1988, a special law was enacted (2005), and as a result of active control, such as greatly expanding manpower and budget and supplementing control methods, it showed a decreasing trend. However, in 2013, due to diseases and climatic factors such as high temperatures and drought, damage spread rapidly due to the unauthorized movement of dead pine trees and anthropogenic factors. According to the \"Forestry Statistical Yearbook\" issued by the Korea Forest Service, since 2013, the Korea Forest Service, local governments, and related organizations havejointly responded to the control response, and the damage from pine wilt disease has changed. It increased until 2008, but from 2008 onwards, the rate of increase has been showing a slowing trend. In addition, the pine bark beetle pest spread gradually until 2007, but it tended to decrease gradually due to climate and environmental changes. After a lot of damage occurred in the Seoul metropolitan area and provinces of Korea in 2011, it has been intensively occurring in the metropolitan area [3]. It is possible to manage agriculture or forests and orchards using artificial intelligence and manage pests. Currently, deep learning, which belongs to the realm of artificial intelligence, is widely used in image recognition and classification research. Convolutional neural networks (CNNs or ConvNets) [4] showed excellent performance in classifying diseases according to pests and damage to crops such as orchards in agricultural research [5]. The data that were used in this paper had to be enlarged on a screen to accurately detect very small pests of the pine moth, and the accuracy was poor because the amount of collected data was very small. To solve this problem, this paper used a converter model using a method called 'Self-Attention' [6]. Self-Attention was created to overcome the limitations of RNNs (Recurrent Neural Networks, RNNs) [7], which are slow due to parallel processing. We used the Cascade R-CNN_Swin Transformer mixed model to try to detect the causative moth or pest of pine disease. The main research content of this paper is the tracking and detection of pests that cause pine pests using artificial intelligence models. The artificial intelligence (AI) techniques used in this study include the You Only Look Once (YOLOv5s)_Focus+C3 model, the Faster Region-Based Convolutional Neural Networks (Faster R-CNN)_Residual Network 50 (ResNet50) model, the Cascade Region-Based Convolutional Neural Networks (Cascade R-CNN)_ResNet50 model and we compare them with the model that combines the Swin Transformer and Cascade R-CNN models proposed in this study to find the model with the highest accuracy and apply it to detect pine pests. The data available so far are insufficient because the sizes of the pine pests used here are too small.