# STHarDNet: Swin Transformer with HarDNet for MRI Segmentation
## 1 Introduction  
Strokes pose a threat to human health because of their high incidence, mortality rate, and potential for causing disabilities. Strokes can be diagnosed using a variety of advanced testing methods, among which brain computed tomography (CT) or magnetic resonance imaging (MRI) are often used. The CT scan is the best method for classifying acute cerebral infarction and brain hemorrhage and is performed first in patients suspected of having strokes to determine initial treatment. In the case of cerebral infarction, it is displayed as a low density, and in the case of a stroke, it is displayed as high density. However, the infarction part does not appear well in the early stage of cerebral infarction. An MRI test is similar to a CT scan, but it has the advantage that it can accurately find small lesions or lesions in the brain region that are difficult to find in CT scans because it has much better imaging power. Many studies have been conducted on stroke diagnosis using computer vision technology to help doctors with diagnosis [1; 2; 3]. Conventional CT or MRI image-based diagnoses have often used U-Net models [4] with encoder-decoder structure using the convolution neural network (CNN) structure and obtained good results. Recently, with the application of transformers to the computer vision field, many segmentation models using transformers have also been proposed [5; 6]. A transformer is a successful example of applying the method of processing sequence data in natural language processing (NLP) analysis to the field of computer vision. Transformers currently exhibit good performance in the field of computer vision, including detection [7], segmentation [8],and classification [9]. Furthermore, models that have an encoder-decoder structure by combining a CNN model and a vision transformer (ViT) model have also performed well in medical image analysis [10; 11]. Currently, many combination models of CNN and ViT use transformers in the bottleneck of the CNN-based encoder-decoder model so that parameters of the encoder and decoder can be delivered more effectively [12; 13]. However, CNN-based encoder-decoder models are large in size and slow in terms of calculation speed, and ViT models have the problem that the calculation amount of the model increases sharply as the image size increases. One of the reasons why the transformer is used in the bottleneck in conventional combination models of CNN and ViT is to minimize the effect that the transformer has on the overall calculation speed as the size of the input feature map increases. This study combines a HarDNet block [14], a lightweight model structure among CNN models, and a Swin Transformer model, which solves the problem of the calculation amount increasing sharply in the transformer model as the image size increases in the ViT model. This is to solve the existing problem and, at the same time, obtain high performance. To this end, an encoder-decoder model in the form of U-Net is constructed with HarDNet blocks. Unlike a method that uses a transformer layer in the bottleneck of the encoder-decoder in past studies, this study uses a Swin Transformer [15] model in the first skip connection layer of the encoder model. As a result, the Swin Transformer model maintains the advantages of shifted windows approach based on self-attention and hierarchical feature extraction because a larger feature map is applied compared to when it is used in the bottleneck. The STHarDNet model proposed in this study has the following characteristics:  
* Using HarDNet blocks, the proposed model improves slow computational speed, a disadvantage of the conventional CNN-based encoder-decoder structure model. * Using the Swin Transformer, the proposed model solves the problem in which the memory use and computations increase as the image size increases in the ViT model.