# Lenke Classification of Scoliosis Based on Segmentation Network and Adaptive Shape Descriptor
## 2 Methods
### Segmentation of Vertebrae  
#### 2.2.1 Segmentation Networks  
In this section, we introduce Unet and Unet++ as the backbone segmentation networks.  
As shown in Figure 3a, the basic Unet architecture consists of two parts: the convolutional encoder and decoder. The encoder part has a classical convolutional network architecture in which the ReLU activation function and 2 \(\times\) 2 max pooling operations are performed for downsampling. Downsampling is beneficial for networks to improve their robustness to deal with image translation and rotation. In the decoder part, the deconvolution operations are performed to upsample the feature maps. More specifically, through the 3 \(\times\) 3 deconvolution in two layers with the ReLU activation function, the final layer is computed using the convolution of 1 \(\times\) 1 to obtain the segmentation results. Upsampling can retain the profile features and decode them to the original image's size, and the skip connection between the encoder and decoder prompts Unet to preserve the full context of the input images. This particular connection pattern provides U-net with an edge in medical image segmentation. Unet++ is an improved Unet model that combines long and short connections. As shown in Figure 3b, the Unet++ architecture consists of an encoder and a decoder connected with nested dense convolutional blocks. Unet++ redesigns the skip connections and provides the flexible feature fusion in the decoders. In addition, the deep supervision process of Unet++ can achieve a significant speedup with only a modest drop in performance. Two key technical details of Unet++ are introduced as follows.  
1. Connected domain. Suppose \(x^{i,j}\) denotes the output of the node \(\mathbf{X}^{i,j}\), where \(i\) represents the down-sampling layer along the encoder, while \(j\) represents the convolution layer of the dense block along the skip connection. Then, the feature maps denoted by \(x^{i,j}\) are calculated as follows: \[x^{i,j}=\begin{cases}\Phi(D(x^{i-1,j})),&j=0\\ \Phi([[x^{i}\cup x]]_{k=\omega}^{-1},U(x^{i+1,j-1})],&j>0\end{cases}\] (1) where function \(\Phi(\cdot)\) is a combination of the convolution layer and an activation function, \(D(\cdot)\) and \(U(\cdot)\) represent a downsampling layer and an up-sampling layer, respectively, and [] indicates the concatenation layer. In the Unet++ architecture, if level \(j=0\), the nodes only receive one input from the previous layer of the encoder; if level \(j=1\), the nodes receive two inputs from two consecutive levels of the encoder sub-network; if level \(j>1\), the nodes receive \(j+1\) inputs, including \(j\) inputs from the previous same skip connection, and one input from the lower skip connection.  
Figure 3: The deep network models for segmentation: (**a**) Unet architecture; (**b**) Unet++ architecture.  
2. Segmentation loss. The hybrid loss combined binary cross-entropy with a dice coefficient is employed as follows: \[\Gamma\left(Y,\widehat{Y}\right)=-\frac{1}{N}\sum_{b=1}^{N}\left(\frac{1}{2}\cdot Y _{b}\cdot\log\widehat{Y}_{b}+\frac{2\cdot Y_{b}\cdot\widehat{Y}_{b}}{Y_{b}+ \widehat{Y}_{b}}\right)\] (2) where \(\widehat{Y}_{b}\) and \(Y_{b}\) denote the flatten predicted probabilities and the flatten ground truths of the \(b^{th}\) image, respectively, and \(N\) is the batch size.  
The proposed Lenke classification framework of scoliosis can be applied to more segmentation networks, such as transformer-based models. We will perform a comprehensive evaluation for different segmentation methods in the later experiments.