Cobb Angle Measurement Method of Scoliosis Based on U-net Network


 The Cobb angle is an important indicator for judging the severity of scoliosis. However, the segmentation and corner marking methods based on deep learning have problems such as target area segmentation and corner detection blur in the X-ray Cobb angle measurement. In this paper, a new convex hull algorithm to detect the corners and a mask generation strategy are proposed to improve the accuracy of Cobb angle recognition. On this basis, the Cobb angle measurement method is presented to identify and segment the target area based on U-net network, and then combine the new convex hull algorithm to detect corners and mask generation strategies. A total of 68 corner points were marked on 17 vertebrae, and the corner points detected by the markers were used to calculate the Cobb angle. The experimental results have proved that the U-net based measurement method could effectively improve the corner detection accuracy on the basis of segmentation, thereby reducing the calculation error of the Cobb angle. The Cobb mean absolute error (AMAE) is 9.2832°, and the symmetric mean absolute percentage error (SMAPE) is 21.675%, which achieved a relatively good result compared with the measurement by professional orthopaedist in error.


Introduction
Scoliosis [1] refers to a three-dimensional spinal deformity in which one or more vertebrae of the spine deviate from the midline of the body on the coronal plane, resulting in the lateral bending of the spine and accompanied by rotation of the vertebral body, which is finally shown as a spinal deformity with abnormal curvature on X-ray. Adolescent idiopathic scoliosis (AIS) refers to scoliosis of unknown etiology in adolescence [2]. The incidence of AIS in scoliosis is as high as 80% [3]. According to research statistics, the overall incidence of AIS is 0.47%-5.2% [4], and the incidence of girls is more than that of boys among adolescents. These data vary greatly in different regions of the country, and have shown an upward trend in recent years. AIS has different degrees of negative effects on the patient's body and mind, which not only seriously affects the physical appearance of teenagers, but also easily causes psychological disorders and damages the overall quality of life. The diagnosis and treatment of AIS is mainly through naked eye and instrument observation, and physical brace. For patients with severe scoliosis, surgical treatment is required. In clinical medicine, Cobb angle is an important indicator to judge the severity of scoliosis [5], and the primary task of Cobb angle measurement is to analyze the spinal X-ray through the network model. In addition, domestic and foreign scholars have proposed some segmentation networks related to spinal images based on deep learning. Convolutional neural networks (CNN) [6] is the most classical deep learning model, and many excellent network models are based on CNN and extended on its basis. Long et al. applied fully convolutional network (FCN) [7] to medical images to achieve pixel-to-pixel feature extraction, that is, input an image and output the segmentation result of the target region. However, due to the lack of medical image data and the need of a large number of data sets for deep learning to make the training results more accurate, FCN model has the disadvantage of blurring image edge segmentation. Lei et al. [8] proposed SFCN-ML ·3· model by combining FCN network to learn and integrate the target region and non-target region respectively, and the segmentation result of this model was improved by 2%-10% compared with FCN. The U-net [9] model is improved on this basis, and the segmentation accuracy is improved by data enhancement and jump connection fusion of image feature information. Currently, Cobb angle [10], as the standard for clinicians to evaluate and diagnose scoliosis, is usually measured by selecting the most inclined vertebral body at the upper and lower ends of the spine according to the coronal X-ray [11,12]. Zhang et al. proposed an automatic calculation model of Cobb angle based on deep neural networks (DNN) [13], which combines artificial intelligence with medical spinal deformity. Due to the ambiguity and low contrast of scoliosis X-ray images, the segmentation effect of X-ray images with unclear details is not ideal, so the Cobb angle measurement is a challenging task [14]. The traditional Cobb angle measurement method relies on manual drawing and observation of the doctors on the coronal X-ray, which is divided into manual marking method and software marking method. The former uses oil pen and manual protractor for auxiliary measurement, while the latter relies on mimics, MB ruler, Cobb meter CE and other computer software. This leads to a large accumulation of errors. The main reasons are as follows. Firstly, the original error caused by the shooting position, shooting time, and the shooting methods of different personnel. Secondly, the measurement error caused by the cumbersome operation of the observer and the different measurement standards. The impact of the second type of error is often the greatest. Due to such disadvantages, the measurement error of Cobb angle will accumulate, and the credibility and repeatability of the measurement results will also decrease.
The premise of measuring Cobb angle is to recognize the corner points of each vertebra of the spine, and different corner point recognition methods also affect the accuracy of the Cobb angle measurement results. For vertebral corner recognition, the traditional Harris [15] corner detection algorithm will show multiple corner points tightly clustered into a cluster at some local positions of vertebrae. It is a phenomenon that several corner points will cluster together in some vertebrae. This is because the neighborhood pixels around the real corner are basically at the boundary of the edge line, which makes these interference points have very similar characteristics with the real corner points. However, because the number and distribution of cluster points at each corner are different it is impossible to use a single threshold to screen out all interference points, which leads to the clustering phenomenon of corners. At the same time, the computational complexity of this algorithm is relatively large, and the recognition speed is relatively slow. The average time it takes to recognition corners of each picture is about 8s. Although the method of maximum suppression is adopted to solve the problem of corner clustering, the mistake recognition still cannot be eliminated. The vertebral mask in the spinal image is essentially a convex quadrilateral, so its contour point set is the convex hull point set, and it is the four sharp points on the convex hull point set that need to be recognized. At least one edge of the minimum external rectangle of these mask profiles coincides with one of the convex edges, which means that at least two points in the corner of the rectangle exactly are the two corners in the target, that is, the distance between them should be 0. Analyzing the remaining two corner points, it is found that they are the closest points on the convex hull to the other two rectangular corner points. The reasons for this phenomenon are as follows: on the one hand, in the scoliosis of the spine, the inclination angle of each vertebra relative to the center of the respective vertebra cannot be too large. on the other hand, in any vertebra, the angle between the upper and lower end plates formed by the corners of the vertebrae is generally small, and the mask formed by the corners of a vertebra is generally close to a standard rectangle. Based on the above phenomenon, in this paper, a corner recognition method combined with convex hull algorithm is proposed. On the basis of contour recognition, the convex hull of vertebrae is identified first, and the smallest outer rectangle of its contour is marked. Then, four corner points on the rectangular frame are used to traverse the Euclidean distance between them and the position of the convex hull point respectively, and the minimum value is retrieved. The convex hull points corresponding to the four minimum values are the corner points on the vertebrae.
Aiming at the above problems, this study achieved the superior results of Cobb angle calculation in terms of time and error by building the U-net network architecture and combining the convex hull recognition corner point algorithm. Spinal segmentation and vertebral corner recognition are divided into two stages to complete the task, instead of directly calculating the Cobb angle on the X-ray according to the existing research. The details are as follows: The deep learning image segmentation network U-net is used to segment the spine coronal X-ray images. The new convex hull recognition algorithm is used to traversal the vertebrae corner points of the segmented binary image, and the Cobb angles are calculated by using the rules of the detected corner points. In this paper, the new convex hull recognition algorithm effectively avoids the corner cluster phenomenon, so that compared with other existing studies, it is more accurate for the identification of vertebral corner points, and thus greatly reduces the calculation error of Cobb angle. This research has great research significance in the practical application of calculating Cobb angle, and it has great application potential.

Definition and Measurement method of Cobb Angle
Cobb angle is named after its inventor John Robert Cobb [16], which is used to measure the angle of scoliosis. Cobb angle measurement method [17] is a classical method to measure scoliosis angle on orthopedic X-ray. In the traditional measurement method, it is mainly divided into three steps: determine the marginal vertebrae of scoliosis, that is, the upper and lower vertebrae with the largest inclination angle in the spine. a straight line is drawn along the upper endplate of the upper vertebra and the lower endplate of the lower vertebra. calculate the angle formed by the two straight lines, which is the Cobb angle. If the lines formed by the two endplates are approximately parallel, perpendicular lines are made to them respectively and the resulting angles are calculated, as shown in Figure 1. Cobb angle calculation formula is as follows: arctan arctan The Cobb angle is used to determine whether the patient needs surgical treatment [18]. When the Cobb angle is less than 10°, it may be a slight bending due to the incorrect standing position during the examination, which is normal and the patient does not have scoliosis. When the Cobb angle is more than 10° and less than 25°, there is slight scoliosis, which can be diagnosed by external aids. When the Cobb angle is more than 25°, the patient has scoliosis and requires surgical treatment. The measurement of the Cobb angle have a certain degree of error due to the different methods of vertebra production and inaccurate detection of corner points. Barry F Jefferies [19] proposed that the artificial measurement error was about 5°. At present, various computer methods have good reproducibility for Cobb angle measurement, so the main goal of the research is to minimize the calculation error as much as possible.

Figure 1 Cobb angle measurement
In fact, Cobb angle is determined according to the classification of Lenke [20]. After a general judgment of the degree of scoliosis, special orthopaedist will subdivide the types of scoliosis according to classification of Lenke. The entire vertebrae are marked from top to bottom as T1-T12 for the thoracic vertebrae, and L1-L5 for the lumbar vertebrae. A total of 17 vertebrae in the target area. The entire scoliosis can be divided into three segments of local scoliosis. According to the position of the upper vertebrae forming these local scoliosis, Lenke classifies them as the top vertebrae of proximal thoracic (PT) are located at T2-T5, the top vertebrae of main thoracic (MT) are located at T6-T11, and the top vertebrae of thoracic lumbar (TL) are located at T12-L5. The output image based on U-net has been reduced in different degrees in width and height, so in this paper, we redefine and calculate the Cobb angle based on the actual size and segmentation results. On the basis of corner recognition method, the center endplate vector of the upper vertebra is calculated by using the coordinate list of corner points. These center endplate vectors are combined in pairs and calculated by the cosine formula to obtain the suspected Where a is the pixel value after segmentation, which is 224 in this paper. W , H is the width and height of the original image. According to the cosine formula, the cosine of the  between any two center endplate vectors can be calculated.
 respectively to get the cosine value of the '  between the vertebrae after the corresponding segmentation.
After the above analysis, three Cobb angles were obtained for each spinal X-ray by traversal of proximal thoracic, main thoracic and thoracic lumbar respectively.

Structure model of U-net
The goal of spinal image segmentation is to segment 17 vertebrae independently from the original image for the convenience of subsequent corner detection. The essence of segmentation is actually a per-pixel intensive classification task, whose goal is to divide the image into two categories: vertebrae and background. Image segmentation algorithms are mainly divided into traditional segmentation algorithms and segmentation algorithms based on deep learning, and the primary task is to analyze the characteristics of the research object to decide which segmentation strategy to adopt. Figure 2 shows a typical coronal X-ray of scoliosis with a Unet network model for segmentation of the target area and the output of a binary image of the vertebra. On the whole， the grayscale of the upper part of the vertebra was lower, while the grayscale of the lower part is higher. Locally, the upper side of the vertebra is very vague except for the brightness at the corner points. The gray level of the central vertebra is similar to other tissues and the transverse distribution of the bone. The lower side of the vertebra has a clear outline with distinct boundaries. From the whole analysis, it can be concluded that as a unified segmentation category, the gray distribution of vertebrae will vary greatly with the change of spatial position, which is mainly due to the differences in the spatial distribution of human tissues. Therefore, when X-rays transmit tissues of different depths and materials, the attenuation degree of light intensity will be different, which will lead to the change of gray value of the research object. The traditional segmentation method finds one or more gray values as thresholds by analyzing the gray histogram of the image, using visual measurement or index calculation method, and divides the image into limited areas with the threshold value as the interval. The threshold is often the gray value corresponding to a certain trough between the two peaks in the histogram. However, according to the previous analysis, it can be known that the vertebral object does not meet the requirements of the threshold method [21]. Therefore, traditional image segmentation methods are not suitable for the segmentation of vertebrae. There are two major challenges in the segmentation of spinal images: on the one hand, precious medical images are often difficult to obtain, and the sample size available for training is generally very small. On the other hand, because the convolution kernel cannot align the center to the pixels close to the edge when scanning the picture, but can only detect the pixel area within the edge, which causes the important information of the image edge to be ignored in the conventional convolution operation.
Due to the low contrast of X-ray images and the small proportion of target pixels, X-rays segmentation of the spine has always been a difficult task, making network training more difficult. In [22], an automatic curvature estimation model was proposed to achieve spine segmentation. Since U-net shows excellent performance in the field of medical image processing, which is widely used in medical image processing. Many models are based on U-net, such as Dense U-net [23], Residual U-net [24] and Shape-Aware U-net [25]. In [26], DU-net was used to realize automatic segmentation of the spine, and the curvature of the centerline of the spine is expressed by a polynomial. In [27], a combined network model of LEN and CEN was proposed to segment the spine and calculate the angle. In [28], R-CNN was proposed to segment the vertebrae, and then the Cobb angle was calculated using the center points of the vertebrae. For the segmentation of spinal vertebrae, the segmented image is used to estimate the lordosis angle. U-net processing of medical images has two prominent advantages. On the one hand, the input image is filled with mirror image, so that the ·6· convolution kernel can be aligned to the pixel at the edge. The size of the convolution kernel in this paper is 3, and the image filling value is 1. On the other hand, a symmetrical Ushaped down-sampling and up-sampling framework is adopted, and a fusion mechanism is introduced in the upsampling process. In the down-sampling process, the image is reduced layer by layer through pooling, and low-level and high-level feature maps are generated at the same time by sacrificing image resolution. However, in the process of upsampling, the original spatial information in the image cannot be completely recovered by a single deconvolution and depooling operation, so the feature maps extracted in the previous down-sampling process need to be fused. Finally, an image with only two features is output through a 1×1 convolution, that is, the background and the target region. Due to the large gap between each vertebra in the spine image, the weighted cross-entropy cost function can be used to deal with the uneven sample of the spine edge. The formula is: where M is the number of sample categories, is the probability that the predicted sample belongs to c . In the weight c w , N is the total number of pixels, c N is the number of pixels of the category c .Dice similarity coefficient (DSC) [29] is used as the evaluation index of the model. Dice similarity coefficient is a measure of ensemble similarity, usually used to calculate the similarity of two samples, with a value range of 0 to 1. The closer the Dice value is to 1, the better the segmentation effect. Dice formula is: Where, GT is Ground Truth, PR is Prediction.

Convex recognition algorithm of corner points
Labeling the segmented spine region is also a difficult task. The scale of the data set and the quality of the labeling work will directly affect the Cobb angle measurement. The accuracy of the calculation result of the Cobb angle largely depends on the accuracy of the corner detection of the spine boundary. When the accuracy of boundary recognition is higher, the accuracy of angle measurement is also higher.

Definition of Convex hull algorithm
In this paper, there were 17 vertebrae in the target area of spinal X-ray images, including 12 thoracic vertebrae and 5 lumbar vertebrae, each vertebrae had four corner points, and each segmented spinal X-ray image had amount to 68 marked corner points (17×4). Before introducing the convex hull, the concept of convex polygon and concave polygon is introduced, both of which are closed polygon formed by discrete points on its contour in sequence. Convex polygon refers to a graph with all internal angles less than 180°, and its contour point set is the convex hull point set, that is, the convex hull of the plane points set A is the smallest convex set among all the sets containing A [30]. Concave polygon stated for a graph with one or more internal angles more than 180°, and its convex hull point set is the convex contour points set that form the smallest envelope on its contour points. The convex hull represents the smallest convex envelope of the graph. As shown in Figure 3(a), A is the pole, the ray AC is the polar axis,  is the polar diameter of point B, is the polar angle of point B. Graham sorting algorithm [31] is used to find the lowest left point as the pole, which must be on the convex hull. All other points are sorted according to the polar angle of this point, and use a stack structure to store the points on the convex hull. Then carry out the cross product operation in sequence, and determine the positive and negative values. The cross product formula is sin AB AC AB AC      uuu r uuur uuu r uuur , If the value is negative, it is added to the stack, otherwise popped. After the traversal, the points in the stack are the convex hull point set. Sequentially popping out of the stack can get all the points on the convex hull in a clockwise direction from the starting point. The worst time complexity of the algorithm is   n n O log ,and then combined with the convex optimization function, which input is the contour point set sequence of the vertebra, and the output is the convex hull of the contour.

Traversal recognition of vertebra corner
Before convex hull recognition, contour identification should be carried out, which reduces the scope of convex hull recognition to the edge pixel. Compared with the pixel block composed of the entire vertebra, the computational effort is reduced. The purpose of calculating the minimum circumscribed rectangle of the contour is to roughly calculate the length and width of the object, and to correct the oblique object. In this paper, the outline of the vertebral mask is roughly rectangular. The smallest circumscribed rectangle is a height approximation of its contour. In addition, since the actual vertebral mask is not a true rectangle, the coordinates of the four corner points of the rectangle must be obtained through the minimum bounding rectangle algorithm for subsequent calculation of the actual corner points. Calculate the minimum bounding rectangle of the input contour point set by the minimum area rectangle function, and use the point set formed by all the points on the rectangle as the output of the function. Then process the output rectangle point set to obtain the four corner points of the rectangle, which output a coordinate list with 4 rows and 2 columns. Finally, through the corner traversal algorithm, the algorithm integrates the results of the previous rectangle recognition algorithm and the convex hull detection algorithm to complete the final corner detection. Specifically, the Euclidean distance between the four corners of the rectangle and the position of the convex hull is calculated first. The formula is

Experimentation
According to the above analysis, this paper used U-net network to segment the vertebral coronal X-ray images of the spine, and combined with the convex hull recognition algorithm to input the segmented binary images into the Cobb angle calculation program to realize the angle calculation. The research process is shown in Figure 5, and the details are as follows: (1) Data set production: Input the original image data set and its corresponding corner point list into the mask automatic generation program. Through each data-label pair, the program will generate a picture with 17 vertebrae masks Labels. These data-label pairs are the training set and the validation set.
(2) Data enhancement: Synchronously expand the training set and its labels through horizontal flipping, random clipping and other methods.
(3) Spine segmentation: Input the enhanced training set and its labels into U-net segmentation network for training, and use the validation set and its labels to test the trained model to obtain a binary segmentation image about the validation set.  Figure 5 Research process

Manual marking mask
As the number of points as a pixel in the image is too small, and belong to the same or different spinal vertebrae, there are great differences in size and shape, so it is impossible to establish a universal principle of feature extraction. Therefore, this paper adopts the method of segmentation first and corner recognition later. Therefore, the corner recognition is limited to a reasonable range, which can achieve higher accuracy, and the stability and adaptability of the model are much higher than that of the direct recognition method. Common open source image labeling tools, such as Labelme and MATLAB toolkit Image Labeler, etc., all support point-by-point polygon labeling, so as to help users complete the task of making semantic segmentation sample sets.

Figure 6 Manual marking process
In the semantic segmentation task [32], the idea of replacing curve by straight lines is very critical, because what we usually care about is not the similarity between the marked contour and the original contour, but the coincidence degree between the marked region and the actual region area. This makes the process of making sample set labels can be simplified to the identification of a few feature points. Therefore, the time and labor cost of the labeling task are greatly reduced. This makes deep learning more involved, and everyone can make a dedicated segmented data set according to their own needs, instead of being restricted to not having a suitable public data set. The process of manual labeling is shown in Figure 6. The specific operations are: According to the image in the data set and the corner point matrix file, synthesize the image with corner mark, compare the synthesized image, and mark the corresponding original image in the mark tool.
Marking the vertebrae, take the corner point of the lower left corner as the starting point, find the other three corner points of the vertebra in a clockwise direction and form a closed contour. Finally, a quadrilateral mask is automatically generated by the marking tool. Figure 7(a) shows a typical coronal X-ray of a scoliosis case where the corners of the vertebrae are manually marked. When you focus on any one of the vertebrae, you can observe that each vertebra is marked with four corner points. The connection of the two upper corner points constitutes the upper endplate of the vertebra, and the two lower corner points constitutes the lower endplate. The inner region formed by four corner points summarizes the semantic information of the vertebrae. Therefore, these four points can be used as key points on the contour of the vertebrae to generate image masks. The generated mask is shown in Figure 7 (b).
(a) Corner map (b) Mask map Figure 7 Manually marking corner points of generating mask map

Generating strategy of automatic marking mask
From the above analysis, it is clear that the manual labeling method has great problems. On the one hand, it is difficult to achieve accurate marking effect. The labeling task ultimately serves for Cobb angle calculation, and angle calculation requires the calculation of endplate slope, so more important than ensuring the regional coincidence degree is to ensure that the inclination of the upper and lower endplates of the vertebra is consistent with the inclination in the original marker. When marking a small target, that is, a pixel point in the image, the slight shaking of the hand will cause a deviation of several pixel units. Due to the small size of the vertebra itself, this will largely affect the subsequent slope calculation, which will lead to a large error in the calculation of the Cobb angle. On the other hand, the marking task is very heavy. First of all, it is difficult to identify the corner points due to the unevenness of the muscle tissue of the chest and waist. Secondly, there are 68 points to be marked in an image, and the entire data set is composed of 609 images. It is conceivable that the amount of work is huge.
In this paper, we propose a new idea of mask generation, it tries to import the coordinate information of corner points directly into the source code of the marking tool, and relies on its internal program to generate image mask automatically. This tool only supports manual mask generation after marking, and does not support mask generation directly based on the corner coordinate list. The marking tool will receive an X-ray and generates an intermediate file based on the user operations, which is eventually converted into a series of image masks in a python program. The information of each vertebra mask is recorded in the intermediate file. In addition to shared information such as the version of the marking tool and the image category (one is the background and the other is the vertebrae). There are two other types of information that are unique to each image. One is the image name and size information represented by the image path, image height, and image width, which are composed of character strings and integers, and belong to the inherent attributes of the original image. The other is corner coordinate information, which is a two-dimensional array, and the corner coordinates stored in the array start from the lower left corner of the closure, and store the coordinates of each point clockwise. However, the coordinate information stored in our data set is stored in the order of 'Z' shape. To integrate it into the order of storage, we only need to exchange the list position of the fourth point with that of the third point. Therefore, the storage order of corner information is very critical.

Figure 8 Automatic marking process
It can be seen that the next task is to build a program to generate standardized information for the identification of intermediate files for each picture. Mainly divided into three types of information. For the shared information of each picture, write it directly into the program and wait for the final export. For the inherent attribute information containing the original picture, which is read through Opencv. For corner point information, rearrange the corner point matrix, taking the four points of each vertebra as a unit. After reading the coordinates of the first two rows in turn, read the coordinates of the fourth row first, and then read the coordinates of the third row, looping 17 times. Finally, the above three types of information are written into a new file in a standardized order, and all file task conversions are completed. The automatic marking process is shown in Figure 8.

Verification of experimental
This experimental model is on Win 10.0 version system, GPU: QuadroP2000, RAM: 48GB. The experimental model code is implemented based on the Pytorch framework in Python. The data set in the experiment uses the public data of the MICCAI 2019 Challenge [33]. This data set is provided by two professional doctors from the London Health Science Center, including a total of 609 original images of spine X-rays, which are divided into 128 training sets and 481 validation sets. In this paper, the open source data enhancement library is used to randomly expand the training set to 5772 cases.

Analysis of segmentation model verification results
The construction of the segmentation network is based on the Pytorch, a deep learning framework. Iterative training is performed on the original data set and the processed data set with labels through the U-net network.

Figure 9
Loss function curve Figure 9 shows the loss function curve, the abscissa represents the number of training iterations, and the ordinate represents the loss function value. The blue line represents the loss function curve of the training set, and the orange line represents the loss function curve of the validation set. It can be concluded from the Figure 9 that the loss function value of the training set always shows a 0.03 ·11· downward trend as the number of iterations increases. The loss function value of the validation set is cut-off point of 4000 iterations. Before the cut-off point, the loss function fluctuates greatly, but generally presents a downward trend. After the cut-off point, the fluctuation degree of the loss function decreases, and its value oscillates around 0.03 and eventually tends to be flat. Figure 10 shows the Dice similarity coefficient curve, the abscissa represents the number of training iterations, and the ordinate represents the Dice similarity coefficient value. The blue line represents the Dice similarity function curve of the training set, and the orange line represents the Dice similarity function curve of the validation set. It can be concluded from the Figure 10 that the Dice value of the training set increases as the number of iterations increases, which almost approaches 1. The Dice value of the validation set still fluctuates greatly before 4000 iterations, and increases to about 0.78. after 4000 iterations, although the Dice value is accompanied by small fluctuations, the overall value tends to stabilize.

Figure 10 Dice similarity coefficient curve
The above analysis of the loss function and the Dice similarity coefficient curve shows that the segmentation network model used in this paper combined with the convex hull algorithm for corner recognition has good actual results, the image is clear, and there is almost no noise interference outside the vertebra mask.

Cobb angle calculation verification
Statistically compare the 3 Cobb angle detection values of all 128 training sets of spine images with the standard value of the manual labeling value, and obtain the error value of the detection angle. The Angle Mean Absolute Error (AMAE) was obtained by averaging the absolute value of the detection angle error. In addition, the Cobb angle error of this experiment was analyzed by Symmetric Mean Absolute Percentage Error (SMAPE). Symmetric means that when there is a difference between the estimate value and the true value, the calculated results will be the same no matter which is larger, which ensures the fairness of the error calculation for positive and negative samples. In Table 1, the average error angle is 2.998°, and the maximum error angle is 4.689°, which is within the standard error range proposed above. According to the angle error analysis of the whole sample set in this study, AMAE=9.2832°, SMAPE=21.675%, which is better than the final result of Tencent YouTu Lab, the winner of the AASCE 2019 competition, SMAPE=21.71% [34].
The experimental results show that the model measurement method proposed in this paper has relatively high detection accuracy. However, there is still a certain error between the angle calculated by the algorithm and the manual standard. The main reasons are as follows. On the one hand, due to the limited accuracy of the segmentation algorithm itself, the segmentation pixels at the edge tend to be jagged, which reduces the stability of the model. On the other hand, in order to train U-net in this study, the size of the original input image needs to be scaled down to not exceed the memory limit. However, due to the change of the image size, the amount of data contained in the new image will inevitably change. This change is often irreversible, so it will cause local information confusion. Corner points in the original image after resizing operation do not necessarily coincide with the position of the corner points obtained after segmentation. Moreover, due to the large shrinkage scale, the size of the image is shrunk from the original 1000 to 2000 pixels, and finally to 224 pixels. After shrinkage, Cobb angle calculation will become very sensitive due to the change of corner position.

Conclusions
Cobb angle is an important index to measure adolescent idiopathic scoliosis (AIS). However, due to the complicated operation and different measurement standards of surveyors, the manual marking method adopted by major hospitals will lead to large measurement errors, and reduce the credibility and repeatability of measurement results. In this paper, we propose convex recognition algorithm of corner points based on U-net image segmentation network, which is used to complete the Cobb angle recognition task on the coronal X-ray of the deformed spine. The algorithm has high real-time performance. The specific work is summarized as follows.
(1) Combined with image marking tool, an automatic labeling algorithm of vertebral mask label is designed. The automatic mask marking of 609 images data was completed in 30 minutes, which saved a lot of time and energy.
(2) For rare spinal images, this paper uses data enhancement method to expand the image data and tags in the training set, and finally gets 5772 spinal training samples, which provides strong support for the subsequent model training.
(3) Using U-net medical image segmentation network to segment the spine image, the loss value of the model on the validation set is reduced to about 0.03, and the Dice is maintained at about 0.78. (4) A corner recognition method based on convex hull algorithm is designed and implemented. Compared with the traditional Harris corner recognition method, this method can effectively recognize corners on the vertebral mask image, and has high real-time performance. The average recognize time is less than 3 seconds. (5) For the processed binary segmentation image, the Cobb angle recognize algorithm is used to calculate the AMAE and SMAPE index with the measured values of Cobb angle. The calculation results show that the measurement accuracy of the algorithm proposed in this paper is better than that of AASCE 2019 in the experimental samples.