# Lenke Classification of Scoliosis Based on Segmentation Network and Adaptive Shape Descriptor
## 2 Methods
### Segmentation of Vertebrae
#### 2.2.2 Automatic Post-Processing for Segmentation  
Vertebrae tend to have low contrast in X-ray images, which may cause segmentation errors with deep networks, such as adhesion and speckle. These errors will further affect the Lenke classification performance. Therefore, we propose a simple post-processing approach to reduce this segmentation error by using adaptive geometric calculation; the computational flow is shown in Figure 4. Specifically, suppose \(I_{1}=I_{b}\cup I_{f}\) is the segmented spine X-ray image created by segmentation networks, where \(I_{b}\) and \(I_{f}\) denote the back- and foreground regions, respectively, then the post-processing can be divided into four steps.  
Step 1: performing the opening operation, i.e., erosion followed by dilation, for \(I_{b}\) and \(I_{f}\), respectively. Then, \(I_{2}\) can be obtained as follows.  
\[I_{2}=\left(\left(I_{b}\ominus B_{b}\right)\oplus B_{b}\right)\cup\left(\left( I_{f}\ominus B_{f}\right)\oplus B_{f}\right) \tag{3}\]  
where \(\ominus\) and \(\oplus\) denote the dilation and erosion operation, respectively; \(B_{b}\) and \(B_{f}\) denote the convolution kernels. With this operation, some simple segmentation errors can be effectively eliminated, such as holes in the foreground and speckles in the background.  
Step 2: identifying the adhesive vertebrae and impurity vertebrae. Specifically, traversing each verteb from top to bottom, starting from the second verteb, if the current verteb is \(C_{1}\) times larger than the previous one, then it is identified as an adhesive verteb; if the current verteb is \(C_{2}\) times less than the previous one, it can be considered as an impurity verteb. In case the first verteb is abnormal, we repeat it again in the same manner from bottom to top. During the processing, the adhesive vertebrae are separately  
Figure 4: The post-processing for segmentation result.  
extracted as \(I_{3}\), and the remaining vertebrae are marked as \(I_{4}\). Any impurity vertebrae in \(I_{4}\) are directly removed, and the output result is denoted as \(I_{5}\). Based on the analysis of the segmentation effect, \(C_{1}\) and \(C_{2}\) were set as 1.8 and 0.5, respectively, in our experiments.  
Step 3: segmenting the adhesive vertebrae, i.e., \(I_{3}\). We first traverse the left and right boundaries of the adhesion vertebrae and search the left and right inflection points. If both can be determined, then the two inflection points are connected as the segmenting line of the two vertebrae; if one of them cannot be identified, then a parallel line is drawn as the segmenting line through the only inflection point. This parallel line is the intermediate result relative to the upper and lower boundaries of the adhesion vertebrae. If there is no obvious inflection point, then the entire adhesion vertebrae are equally segmented according to the size compared to its neighbors. In fact, in the experiments, we found that obvious inflection points can be searched in the most original segmentation results by using deep networks. The output of this step is denoted as \(I_{6}\).  
Step 4. the final post-processing result can be obtained by combining \(I_{5}\) and \(I_{6}\) as shown in Figure 4.  
In fact, the post-processing is proposed in an unsupervised manner, which is simply calculated and can be used to alleviate the influence of segmentation error on the Lenke classification of scoliosis.