# Sequential Brain CT Image Captioning Based on the Pre-Trained Classifiers and a Language Model
## 3 Methodology  
### Pre-Trained CNN Based Classifier  
The automatic text generation model for ICH CT images proposed in this study is depicted in Figure 2. Firstly, pre-trained CNN models are fine-tuned for binary classification tasks, as shown in Figure 3.  
Figure 1: The preprocessing process for DICOM images containing meta-information. The size of CT images is \(512\times 512\), with a window center of 47, window width of 80, intercept of \(-1024\), and slope of 1.0 applied for windowing. The images were resized to \(224\times 224\). Figure 2: The overall flowchart of the interpretation text generation model using CNN encoder and GPT-2. The pre-trained CNN has an input layer of size 224 \(\times\) 224, and a fully-connected layer with a size of 1024 is added for fine-tuning, just before the output layer, to ensure the extraction of features of the same size before the output layer. Following this, it learns the presence of ICH from preprocessed Kaggle image data. During training for text generation, we use the architecture excluding the last layer responsible for classification, referred to as the CNN encoder. In this context, we compare and analyze the performance using the following four fine-tuned CNNs to determine a suitable encoder architecture:  
* ResNet-50V2 is a lightweight and efficient model compared to its predecessor, ResNet-50. It utilizes residual connections to improve the learning process by adding skip connections, which add the feature maps extracted from the previous layer to the input of the next layer. This increases the depth of the network, showcasing improved performance during the training process. The architecture of ResNet-50V2, depicted in Figure 4, incorporates pretrained weights that enhance the performance in training with low-resource data, making it adept at feature extraction for untrained data such as medical images. The hyperparameters used in ResNet-50V2 are as follows: the initial layer consists of a 2D convolution layer with a 7 \(\times\) 7 kernel size and 64 filters, followed by batch normalization and ReLU activation functions. Subsequently, a 3 \(\times\) 3 max-pooling layer with a stride of 2 is added. The following layers include four residual blocks. The first block has 64 filters and a stride of 2, the second block has 128 filters and a stride of 2, the third block has 256 filters and a stride of 2, and the fourth block has 512 filters with a stride of 1. * DenseNet-121 is structured with dense blocks and transition layers, utilizing a sequence of convolution layers and skip connections. While ResNet forms a pathway by connecting the immediate layer with an element-wise addition, DenseNet densely connects layers as it goes deeper, employing channel-wise concatenation. The dense block forms dense connections between internal layers, enhancing feature extraction and the ability to reuse information. The transition layer adjusts the size of feature maps, maintaining the efficiency of the model. In addition, through the dense connection structure, features between layers accumulate, enabling the extraction of optimized  
Figure 4: ResNet-50V2 architecture, the value before each block is connected to the value after the block through a simple addition in residual connections. Figure 3: Fine-tuning the pre-trained CNN. features for subtle changes or patterns related to ICH. The architecture of DenseNet-121 is depicted in Figure 5, and the hyperparameters used are as follows: the first layer uses a \(7\times 7\) kernel size with 64 filters, along with batch normalization and ReLU activation functions. Furthermore, the transition layer consists of a \(1\times 1\) convolution layer and a \(2\times 2\) average pooling layer. * VGG-16 consists of 16 layers, comprising 13 convolution layers and 3 fully connected layers. The distinctive feature of VGG-16 is its deep structure and the use of small filter sizes. VGG-16 is a simple yet powerful model primarily employed in computer vision tasks, capable of extracting rich features due to its very deep network architecture.