## 3 Materials and Methods
### Overall Framework  
This paper proposes an automatic generation model for end-to-end Lenke classification reports for scoliosis. The model uses ResNet-50 [11], which integrates the CBAM channel and spatial attention mechanism, as the feature encoder. Image features extracted by the ResNet50 network are re-calibrated into maps and weighted for different feature channels after compression, excitation, and spatial attention operations in the CBAM module. Therefore, the network is able to extract better-correlated features from spinal images for encoding. The improved long and short-term memory network M-LSTM fusion attention mechanism is used as the decoder. After the input of the coding vector, the features requiring active attention in the corresponding image region are dynamically selected according to the corresponding feature weights, and the image region with a high correlation with the current word is focused on. The key parts of the image are selectively focused by selecting a subset of the feature vector, and more reasonable description words are generated. The overall framework of the model is shown in Figure 3. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Dataset** & **Total** & **Lenke-1** & **Lenke-2** & **Lenke-3** & **Lenke-4** & **Lenke-5** & **Lenke-6** \\ \hline train & 7920 & 1800 & 1320 & 560 & 840 & 1800 & 1600 \\ test & 2140 & 520 & 300 & 200 & 200 & 520 & 400 \\ val & 2140 & 500 & 200 & 220 & 220 & 500 & 500 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Experimental dataset details. Figure 2: [PERSON] classification radiogram of scoliosis. The input to the model is image \(I\), and the sentence sequence corresponding to \(I\):\(L^{T}=\{l_{1},l_{2},l_{3}\cdots l_{t}\}\). First, image input \(I\) is convolved by ResNet50 feature encoder to extract image feature \(f_{i}\). Then, the CBAM module added in the residual path is used for compression, excitation and spatial attention operation, and different weight \(\alpha_{i}\) is assigned to the characteristic channels one by one, Finally, the output \(f^{\prime}_{i}=f_{i}\times\alpha_{i}\) is obtained by operation Scale, and \(f^{\prime}_{i}\) is input to the M-LSTM decoder as a new feature encoding vector. The mapping process is \(h_{-1}=w_{f}\,f^{\prime}_{i}+b_{f}\). \(w_{f}\) is the weight parameter that ResNet50 network needs to train, and \(b_{f}\) is the offset value. \(h_{-1}\) is the initial value input in the M-LSTM decoder. \(L^{T}\) is another input word vector of the model. It is encoded by the label word S of the training image through one hot encoding mode to obtain a word encoding vector \(m\) with a fixed length of 15 and multiplied by the word embedding matrix \(w_{emf}\) to obtain:  
\[L^{T}=w_{emf}\times m \tag{1}\]  
\[h_{t}=ExtLSTM(h_{t-1},L_{T}) \tag{2}\]  
\[p_{t}=Soft\max(w_{c}\times h_{t}+b_{c}) \tag{3}\]  
In Equations (2) and (3), \(h_{t}\) is the final output value of M-LSTM. \(w_{c}\) and \(b_{c}\) are the weight parameter and bias parameter of Softmax classifier, respectively, and \(p_{t}\) is the output of image description statement of Softmax classifier. In the training process of the model, input image is \(I\), output S = \(\{s_{1},s_{2},s_{3}\cdots s_{t}\}\), which corresponds to the description sentence \(I\), and the probability of describing output S is Equation (4). The logarithm of its likelihood function is taken to obtain logarithmic likelihood function Equation (5):  
\[P(S\mid I;\theta)=\prod_{t=0}^{N}P(S_{i}\mid S_{0},S_{1},\cdots,S_{t-1},I;\theta) \tag{4}\]  
\[\log P(S\mid I;\theta)=\sum_{t=0}^{N}\log P(S_{i}\mid S_{0},S_{1},\cdots,S_{t- 1},I;\theta) \tag{5}\]  
Figure 3: Overall illustration of our module. Image features are extracted by feature extraction model, processed by CBAM attention module, and then transmitted to M-LSTM combined with attention focusing image key parts, and finally prediction results are outputted.