Method, device and electronic device for measuring spinal Cobb angle
Through the combination of posture recognition, target detection and key point recognition models, the posture of spinal images can be automatically identified and the vertebrae can be accurately located, which solves the problems of low automation and poor accuracy in Cobb angle measurement and improves diagnostic efficiency and accuracy.
Patent Information
- Application Number
- CN202510199982.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-02-24
AI Technical Summary
The existing technology has a low degree of automation and poor detection accuracy in Cobb angle measurement, which results in a waste of time and effort for clinicians and large errors in the diagnostic results.
Through the combination of posture recognition model, target detection model and key point recognition model, the shooting posture of spinal images is automatically identified, the spinal area is extracted, each vertebra is accurately located, and the Cobb angle is calculated.
High-precision and robust Cobb angle calculation is achieved under a low-cost model, which reduces manual operation errors and improves diagnostic efficiency and accuracy.
Smart Images

Figure CN119693362B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical image processing technology, and in particular to a method, device, and electronic device for measuring the Cobb angle of the spine. Background Art
[0002] Scoliosis is a relatively common skeletal deformity that not only affects the normal physiological curvature of the spine, but can also cause asymmetry of the trunk, leading to a series of related health problems. In actual clinical applications, the Cobb angle is used as a standard measurement method to assess the severity of scoliosis, so accurate measurement of the Cobb angle is particularly important for the diagnosis and treatment of scoliosis. Usually, a clinician with rich theoretical knowledge and practical experience is required to measure the Cobb angle from the patient's CT (Computed Tomography) images, which is very time-consuming and energy-intensive for clinicians and inefficient. In addition, due to the influence of different physicians' knowledge accumulation, practical experience and subjective factors, the diagnostic results obtained by different physicians will also have large errors. Summary of the Invention
[0003] The present application provides a method, device and electronic device for measuring the Cobb angle of the spine, which can solve the technical problems of low automation and poor detection accuracy when measuring the Cobb angle in related technologies.
[0004] In a first aspect, an embodiment of the present application provides a method for measuring the Cobb angle of the spine, the method comprising:
[0005] Acquire a spinal image to be tested, input the spinal image to be tested into a body position recognition model, and obtain a spinal shooting position of the spinal image to be tested output by the body position recognition model;
[0006] Inputting the spinal column image to be tested into the target detection model to obtain a spinal column region image of the spinal column in the spinal column image to be tested output by the target detection model;
[0007] Inputting the spinal region image into a key point recognition model corresponding to the spinal shooting position to obtain position information output by the key point recognition model for each vertebra of the spine, the position information including at least positioning frame information, vertebral name, and corner point coordinates;
[0008] The spinal Cobb angle in the spinal column region image is calculated based on the position information of each vertebra.
[0009] In a second aspect, an embodiment of the present application provides a device for measuring the Cobb angle of the spine, the device comprising:
[0010] A body position recognition module is used to obtain a spinal image to be tested, input the spinal image to be tested into a body position recognition model, and obtain a spinal shooting position of the spinal image to be tested output by the body position recognition model;
[0011] A spinal region detection module, configured to input the spinal image to be tested into a target detection model, and obtain a spinal region image of the spine in the spinal image to be tested output by the target detection model;
[0012] A vertebral positioning module is used to input the spinal region image into the key point recognition model corresponding to the spinal shooting position, and obtain the position information output by the key point recognition model for each vertebra of the spine, wherein the position information includes at least positioning frame information, vertebral name and corner point coordinates;
[0013] The Cobb angle calculation module is used to calculate the spinal Cobb angle in the spinal region image according to the position information of each vertebra.
[0014] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the above method.
[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is suitable for being loaded by the processor and executing the steps of the above-mentioned method.
[0016] The beneficial effects of the technical solutions provided by some embodiments of the present application include at least:
[0017] The present application provides a method for measuring the Cobb angle of the spine, which includes obtaining an image of the spine to be measured, inputting the image of the spine to be measured into a posture recognition model, and obtaining the spine shooting posture of the image of the spine to be measured output by the posture recognition model; inputting the image of the spine to be measured into a target detection model, and obtaining the spinal region image of the spine in the image of the spine to be measured output by the target detection model; inputting the spinal region image into a key point recognition model corresponding to the spine shooting posture, and obtaining the position information output by the key point recognition model for each vertebra of the spine, wherein the position information at least includes positioning frame information, vertebral name and corner point coordinates; and calculating the spinal Cobb angle in the spinal region image according to the position information of each vertebra. By splitting and refining the complex vertebral recognition task, different lightweight models are trained and used to complete the tasks of each stage, including posture recognition, coarse positioning of the spine and key position recognition, and gradually completing the precise positioning of the vertebra from coarse to fine in each link, and finally completing the Cobb angle calculation based on the precise positioning of the vertebra in the image. This enables the application to identify vertebrae in images of different body positions without relying on a heavyweight segmentation model, achieving precise vertebral location calculation at a lower model cost, and the overall algorithm is highly robust. Ultimately, multiple positional information, including the positioning box, name, and corner coordinates, can be output for each vertebra simultaneously. These positional information acts as mutual constraints and connections during output, minimizing the error offset of each vertebral position and improving both algorithm accuracy and generalizability. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 An exemplary system architecture diagram of a spinal Cobb angle measurement method provided in an embodiment of the present application;
[0020] Figure 2 A schematic flow chart of a method for measuring the spinal Cobb angle provided in an embodiment of the present application;
[0021] Figure 3 A flowchart of a model training method for a body position recognition model provided in an embodiment of the present application;
[0022] Figure 4 A flowchart of a model training method for a target detection model provided in an embodiment of the present application;
[0023] Figure 5A flowchart of a model training method for a key point recognition model provided in an embodiment of the present application;
[0024] Figure 6 A schematic flow chart of a method for measuring the spinal Cobb angle provided in an embodiment of the present application;
[0025] Figure 7 A schematic diagram of a spinal region image recognition process provided in an embodiment of the present application;
[0026] Figure 8 A schematic diagram of the processing result of a vertebral positioning frame provided in an embodiment of the present application;
[0027] Figure 9 A schematic flow chart of a method for calculating the spinal Cobb angle provided in an embodiment of the present application;
[0028] Figure 10 A schematic diagram of the calculation results of the spinal Cobb angle provided in an embodiment of the present application;
[0029] Figure 11 A structural block diagram of a spinal Cobb angle measurement device provided in an embodiment of the present application;
[0030] Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] To make the features and advantages of the present application more apparent and understandable, the following will provide a clear and complete description of the technical solutions in the embodiments of the present application, in conjunction with the accompanying drawings. It should be understood that the described embodiments represent only a portion of the embodiments of the present application, and not all of them. All other embodiments derived by those skilled in the art based on the embodiments of the present application without inventive effort are within the scope of protection of the present application. In the following description of the drawings, unless otherwise indicated, identical numerals in different drawings represent identical or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of the present application, as detailed in the appended claims. Furthermore, in the description of the embodiments of the present application, unless otherwise indicated, " / " represents or. For example, A / B can represent either A or B. "And / or" in the text is merely a description of an association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, in the description of the embodiments of the present application, "multiple" refers to two or more. In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0032] Scoliosis is a relatively common skeletal deformity. The skeletal abnormalities it causes not only affect the patient's appearance, but may also cause compression on internal organs and even affect the nervous system. In order to accurately assess the severity of scoliosis, the Cobb angle is usually used as a standard measurement method in clinical practice. The Cobb angle, also known as the Cobb's angle, is an important indicator for measuring the angle of scoliosis through X-rays. When measuring the Cobb angle, you first need to determine the starting vertebra and the ending vertebra of the scoliotic spinal segment. These two vertebrae are usually the most inclined vertebrae in the scoliotic curvature. Then, by drawing the extension lines of the upper end plate of the starting vertebra and the lower end plate of the ending vertebra, the angle formed by the intersection of these two lines is the Cobb angle. The size of the Cobb angle directly reflects the severity of scoliosis. Generally, the larger the angle, the more severe the scoliosis.
[0033] Cobb angle measurement is not only fundamental for scoliosis diagnosis but also an important basis for treatment decisions. Therefore, accurate Cobb angle measurement is crucial for the diagnosis and treatment of scoliosis. Currently, Cobb angle measurement methods are mainly divided into three categories: manual measurement, semi-automatic measurement, and automatic measurement. Manual measurement is the traditional method for Cobb angle measurement and relies primarily on the physician's professional experience and skills. The physician selects the appropriate starting and ending vertebrae on an X-ray and then uses a protractor to measure the angle between the upper endplate of the starting vertebra and the lower endplate of the ending vertebra, which is the Cobb angle. However, the accuracy of this Cobb angle measurement method is highly dependent on the physician's subjective judgment. Furthermore, the manual measurement process is time-consuming, especially when dealing with a large number of cases. This inefficiency makes it difficult to meet the demands of modern medical efficiency. Semi-automatic measurement methods combine the advantages of manual judgment and computer algorithms to some extent. Typically, the physician manually selects the starting and ending vertebrae, and a computer algorithm automatically detects the inclination angles of these vertebrae and calculates the Cobb angle. This method improves work efficiency compared to manual measurement, but the selection of the starting and ending vertebrae still relies on the subjective judgment of the physician, so selection errors may still exist. Automatic measurement methods are mainly divided into two categories: traditional methods and deep learning methods. Traditional methods are usually based on image processing techniques, such as threshold segmentation and Hough transform. When faced with complex spinal deformities or poor image quality, the robustness of these methods will be significantly reduced. Deep learning methods face multiple problems such as high model annotation costs, complex post-processing algorithms, and adhesion of segmentation results, resulting in high computational difficulty and cost, and the final measurement accuracy is also unstable.
[0034] Therefore, an embodiment of the present application provides a method for measuring the Cobb angle of the spine to solve the above-mentioned technical problems of low automation and poor detection accuracy when measuring the Cobb angle.
[0035] See also Figure 1 , Figure 1 This is an exemplary system architecture diagram of a method for measuring the spinal Cobb angle provided in an embodiment of the present application.
[0036] like Figure 1 As shown, the system architecture may include an electronic device 101, a network 102, and a digital photography device 103. The network 102 is used to provide a medium for a communication link between the electronic device 101 and the digital photography device 103. The network 102 may include various types of wired communication links or wireless communication links. For example, the wired communication link may include an optical fiber, a twisted pair, or a coaxial cable, and the wireless communication link may include a Bluetooth communication link or a Wireless-Fidelity (Wi-Fi) communication link.
[0037] The electronic device 101 can interact with the digital photography device 103 via the network 102 to receive messages from the digital photography device 103 or send messages to the digital photography device 103. Alternatively, the electronic device 101 can interact with the digital photography device 103 via the network 102 to receive messages or data sent by other users to the digital photography device 103. In the embodiment of the present application, the electronic device 101 can be various computer terminals, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers. The digital photography device 103 can be a device that captures spinal images by emitting X-rays, thereby capturing spinal images and transmitting the spinal images to the electronic device 101 for Cobb angle measurement.
[0038] Specifically, in an embodiment of the present application, the electronic device 101 can obtain the image of the spine to be tested from the digital photography device 103, input the image of the spine to be tested into the posture recognition model, and obtain the spine shooting posture of the image of the spine to be tested output by the posture recognition model; then, the electronic device 101 inputs the image of the spine to be tested into the target detection model, and obtains the spinal region image of the spine in the image of the spine to be tested output by the target detection model; further, the electronic device 101 inputs the spinal region image into the key point recognition model corresponding to the spinal shooting posture, and obtains the position information output by the key point recognition model for each vertebra of the spine, and the position information includes at least positioning frame information, vertebral name and corner point coordinates; finally, the electronic device 101 calculates the spinal Cobb angle in the spinal region image based on the position information of each vertebra.
[0039] It should be understood that Figure 1 The number of electronic devices, networks and digital photography devices in the figure is only illustrative and can be any number of electronic devices, networks and digital photography devices according to implementation requirements.
[0040] See also Figure 2 , Figure 2 A flowchart of a spinal Cobb angle measurement method provided in an embodiment of the present application. The execution subject of the embodiment of the present application can be an electronic device that performs spinal Cobb angle measurement, a processor in an electronic device that performs the spinal Cobb angle measurement method, or a spinal Cobb angle measurement service in an electronic device that performs the spinal Cobb angle measurement method. For ease of description, the specific execution process of the spinal Cobb angle measurement method is described below, taking the execution subject as a processor in an electronic device as an example.
[0041] like Figure 2 As shown, the method for measuring the spinal Cobb angle may include at least:
[0042] S202 , obtaining a spinal column image to be measured, inputting the spinal column image to be measured into a body position recognition model, and obtaining a spinal column shooting body position of the spinal column image to be measured output by the body position recognition model.
[0043] Optionally, the diagnosis of scoliosis begins with obtaining full-spine DR images of the spine. These images are typically captured using digital imaging equipment, with the subject maintaining a specific posture to ensure the integrity and clarity of the spine. Generally speaking, considering scoliosis is a three-dimensional deformation of the spine (coronal, sagittal, and transverse planes), not a simple left-right curvature, the spine is often imaged in either the anteroposterior or lateral view to more accurately assess the curvature. The anteroposterior view primarily observes scoliosis in the coronal plane, demonstrating the horizontal alignment of the vertebrae; the lateral view, on the other hand, assesses sagittal curvature, such as whether the longitudinal structure of the spine exhibits kyphosis or lordosis. Image quality is crucial for subsequent analysis, so images are taken to ensure clarity, moderate contrast, and complete visualization of the spinal region.
[0044] Furthermore, spinal images in different postures will involve different spinal Cobb angle calculation methods. Therefore, after obtaining the spinal image to be tested, it is first necessary to determine the shooting posture of the image. In order to achieve automatic and accurate recognition of the shooting posture, this can be done through a pre-trained posture recognition model. The model is built based on a deep learning algorithm, which can automatically parse the image content, identify the shooting posture of the image, and accurately determine whether the shooting posture of the spinal image is anteroposterior or lateral. The training of the posture recognition model is usually based on a large number of annotated spinal image data sets. By learning the features in these data, the model can accurately distinguish between anteroposterior and lateral images. Then, by inputting the spinal image to be tested into the pre-trained posture recognition model, the spinal shooting posture of the spinal image to be tested output by the posture recognition model can be obtained.
[0045] S204 , inputting the spinal column image to be measured into the target detection model, and obtaining the spinal column region image of the spinal column in the spinal column image to be measured output by the target detection model.
[0046] Optionally, after determining the imaging position, the spinal vertebrae in the image can be specifically identified to facilitate the subsequent calculation of the Cobb angles between the vertebrae. In the initial spinal image, bones outside the spinal region may be captured to maintain the integrity of the spinal region. Therefore, it is necessary to first identify the spinal region in the spinal image to reduce interference from irrelevant information during the subsequent vertebral identification.
[0047] Specifically, automated spinal region identification can also be accomplished using a pre-trained object detection model. The object detection model's task is to identify and select the spinal region within the image and output the selected spinal region as a spinal region image. If the spinal image is an anteroposterior view, the target encompasses the thoracic and lumbar regions, with the upper bound starting at the level of the clavicle and the lower bound ending at the level of the inferior sacroiliac joint. The left and right bounds are the rib boundaries corresponding to the level of the lung base. If the spinal image is a lateral view, the target encompasses the thoracic, lumbar, and partial sacral regions. The upper bound starts at the level of the clavicle and the lower bound ends at the level of the inferior iliac bone. The left and right bounds are the body boundaries corresponding to the level of the lung base. This model, based on deep learning algorithms such as convolutional neural networks (CNNs), automatically detects the spinal boundaries and generates a rectangular box (i.e., a positioning box) encompassing the spinal region. This positioning box serves as the basis for subsequent vertebral identification, ensuring that subsequent analysis focuses solely on the spinal region, thereby minimizing interference from other tissues or organs. This step effectively eliminates interference from non-spinal areas of the image, allowing subsequent analysis to focus on key information.
[0048] S206: Input the spinal region image into the key point recognition model corresponding to the spinal shooting position to obtain the position information output by the key point recognition model for each vertebra of the spine, the position information at least including positioning frame information, vertebra name and corner point coordinates.
[0049] Optionally, after obtaining the spinal region image, the position, type, and key corner points of each vertebra in the spine can be identified based on the spinal region image. In the embodiment of the present application, considering that the key point features of the spine corresponding to different shooting positions (anteroposterior or lateral) are different, different key point recognition models are needed for positioning images of different positions. That is, a key point recognition model for recognizing anteroposterior images and a key point recognition model for recognizing lateral images are pre-trained based on a deep learning algorithm. The two models can respectively learn the spinal vertebra features of their respective positions for images of corresponding positions. Therefore, in actual application scenarios, the two models can be used to receive images of corresponding positions respectively, and more accurately identify each spinal vertebra in images of various positions.
[0050] Specifically, by inputting a spinal region image into a keypoint recognition model corresponding to the spinal position of the patient, the keypoint recognition model outputs positional information for each vertebra in the spine. This output includes at least the positioning frame, vertebral name, and corner coordinates.
[0051] The positioning frame information is the bounding box of each vertebra, used to identify the position and range of each vertebra. In the frontal image, there are at least 17 positioning frames, including 12 thoracic vertebrae and 5 lumbar vertebrae; in the lateral image, there are at least 18 positioning frames, including 12 thoracic vertebrae, 5 lumbar vertebrae, and 1 sacral vertebrae.
[0052] In addition, the model can output the corresponding vertebral name for each vertebra based on the position and arrangement of the vertebrae in the spine. This is also the name or number of each vertebra, used to identify the specific location of the vertebrae. For example, for the frontal view, there are 17 vertebral categories, including 12 thoracic vertebrae (T1-T12) and 5 lumbar vertebrae (L1-L5); for the lateral view, there are 18 vertebral categories, including 12 thoracic vertebrae (T1-T12), 5 lumbar vertebrae (L1-L5), and 1 sacral vertebrae (S1). The output of vertebral category names also greatly facilitates clinicians' reading and diagnosis.
[0053] Furthermore, the key point recognition model also outputs the coordinates of each vertebral corner point. Corner point coordinates refer to the specific location information that defines the key points of the vertebral boundary. The key corner point coordinates of each vertebra typically include the corner points of the superior and inferior endplates. These corner point coordinates form the basis for calculating the Cobb angle. They are typically expressed as coordinates in two or three-dimensional space and are often accurate to the pixel level. For an anteroposterior spinal image, a total of 68 corner points are output; for a lateral spinal image, a total of 70 corner points are output. The two additional points in the lateral view are the corner points of the superior endplate of the sacral vertebra S1. This positional information provides critical data support for spinal Cobb angle detection. Through this series of refined and automated processing steps, the system can automatically identify the spinal position, extract spinal regions, and further identify key point information for each vertebra from the spinal image under test. This significantly improves the efficiency and accuracy of scoliosis diagnosis, reduces errors caused by manual operation, and provides clinicians with more reliable diagnostic support.
[0054] S208. Calculate the spinal Cobb angle in the spinal column region image according to the position information of each vertebral body.
[0055] Optionally, after accurately detecting the position of each vertebra in the spine, the spinal Cobb angle in the spinal region image can be calculated based on the positioning frame and corner coordinates contained in the positional information. Accurate Cobb angle measurement helps doctors make accurate diagnosis of the condition and formulate appropriate treatment plans, thereby achieving excellent treatment results.
[0056] In an embodiment of the present application, a method for measuring the Cobb angle of the spine is provided, wherein an image of the spine to be measured is obtained, the image of the spine to be measured is input into a posture recognition model, and the spine shooting posture of the image of the spine to be measured outputted by the posture recognition model is obtained; the image of the spine to be measured is input into a target detection model, and the spinal region image of the spine in the image of the spine to be measured outputted by the target detection model is obtained; the spinal region image is input into a key point recognition model corresponding to the spine shooting posture, and the position information of each vertebra of the spine outputted by the key point recognition model is obtained, and the position information at least includes positioning frame information, vertebral name and corner point coordinates; the spinal Cobb angle in the spinal region image is calculated according to the position information of each vertebra. By splitting and refining the complex vertebral recognition task, different lightweight models are trained and used to complete the tasks of each stage, including posture recognition, coarse positioning of the spine and key position recognition, and gradually completing the precise positioning of the vertebra from coarse to fine in each link, and finally completing the Cobb angle calculation based on the precise positioning of the vertebra in the image. This enables the application to identify vertebrae in images of different body positions without relying on a heavyweight segmentation model, achieving precise vertebral location calculation at a lower model cost, and the overall algorithm is highly robust. Ultimately, multiple positional information, including the positioning box, name, and corner coordinates, can be output for each vertebra simultaneously. These positional information acts as mutual constraints and connections during output, minimizing the error offset of each vertebral position and improving both algorithm accuracy and generalizability.
[0057] In the method for measuring the spinal Cobb angle, this application also provides a feasible method for training a target detection model. For details, please refer to Figure 3 , Figure 3 A flow chart of a model training method for a posture recognition model provided in an embodiment of the present application. Figure 3 As shown, the model training method of the body position recognition model in step S202 may at least include:
[0058] S302 : Acquire multiple sample spinal images, where the multiple sample spinal images are all sample data with standard body position labels.
[0059] Optionally, multiple sample spinal images are first obtained for model training. Each of these sample spinal images is labeled with standard body positions. To construct the sample data, a sample set containing multiple anteroposterior or lateral images can be obtained. The collected data samples are then correctly classified and labeled with the correct anteroposterior and lateral positions, ensuring that the sample data has the correct anteroposterior and lateral positions as standard labels.
[0060] Furthermore, to enrich the sample set, existing samples can be translated, symmetrized, blurred, and contrast-enhanced to obtain new samples, thereby expanding the sample data and making the sample set more diverse. In the sample preparation stage, this application only requires a relatively low annotation cost to obtain a large number of rich sample spinal images, thus significantly saving labor costs during the model training process.
[0061] S304: Construct an initial body posture recognition model based on the first basic model.
[0062] Optionally, the posture recognition model needs to identify the shooting posture based on the feature information in the spinal image, then a suitable first basic model can be selected according to the characteristics of the detection task to construct the initial posture recognition model. In a feasible implementation, the first basic model can be a YOLO series model, such as the YOLOv8-Classify model, the YOLOv11-Classify model, etc., or it can be other CNN deep learning or SVM machine learning classification models, so that the initial posture recognition model constructed based on the first basic model can output prediction results for the predicted object based on the pixel features in the image. For the constructed initial posture recognition model, targeted training is also required to adjust the parameters in the model so that the model can meet the performance requirements in actual scenarios.
[0063] S306: Input a plurality of sample spinal column images into an initial body position recognition model to train the initial body position recognition model.
[0064] S308. During the training process of the initial posture recognition model, the initial posture recognition model is controlled to output predicted posture labels for multiple sample spinal images, and the parameters of the initial posture recognition model are adjusted according to the predicted posture labels and the standard posture labels of the multiple sample spinal images until convergence, thereby obtaining a trained posture recognition model.
[0065] Optionally, during the training process of the initial posture recognition model, the initial posture recognition model is controlled to output predicted posture labels for multiple sample spinal images. During the output process, the posture recognition model performs forward propagation calculations on the sample spinal images, that is, the output of the previous layer is used as the input of the next layer until the final posture classification label is output. These predicted posture labels are the predicted classification results of the initial posture recognition model for multiple sample spinal images. The gap between the predicted posture labels and the standard posture labels is the gap between the current state of the initial posture recognition model and the expected performance. Furthermore, the gradient descent method is used to calculate the training loss value of the model based on the predicted posture labels and the standard posture labels of multiple sample spinal images. The parameters in the initial posture recognition model are adjusted based on the training loss value until the initial posture recognition model converges to the expected performance to obtain a trained posture recognition model.
[0066] Optionally, the model training termination conditions of the model may include, for example, the loss function value being less than or equal to a preset loss function threshold, the number of iterations reaching a preset number threshold, etc. The specific model training termination conditions can be determined based on actual conditions and are not specifically limited here.
[0067] In an embodiment of the present application, a method for measuring the Cobb angle of the spine is provided, which includes a method for training a body position recognition model. The body position recognition model is constructed using a first basic model, and is trained in a body position classification and recognition scenario based on a set of sample spinal images with standard body position labels. This allows the body position recognition model to perform in-depth analysis of spinal images and accurately recognize the body position of the spinal image to be measured through precise region division, feature extraction, and other computational processes, thereby ensuring accuracy and reliability in subsequent identification of spinal vertebrae and measurement of the Cobb angle.
[0068] In the method for measuring the spinal Cobb angle, this application also provides a feasible method for training a target detection model. For details, please refer to Figure 4 , Figure 4 A flow chart of a method for training a target detection model provided in an embodiment of the present application. Figure 4 As shown, the model training method of the target detection model in step S204 may at least include:
[0069] S402 : Acquire multiple sample spinal column images, where the multiple sample spinal column images are all sample data with standard spinal column region labels.
[0070] S404: Construct an initial target detection model based on the second basic model.
[0071] S406: Input multiple sample spine images into the initial target detection model to train the initial target detection model.
[0072] S408. During the training process of the initial target detection model, the initial target detection model is controlled to output predicted spinal region labels for multiple sample spinal images, and the parameters of the initial target detection model are adjusted according to the predicted spinal region labels and the standard spinal region labels of multiple sample spinal images until convergence, thereby obtaining a trained target detection model.
[0073] Optionally, for the training of the target detection model, considering that there are significant differences between the spinal region and other regions in the frontal and lateral images, a single target detection model can be used to perform spinal region detection on all spinal images to save unnecessary training costs. Similar to the body position recognition model, when training the target detection model, it is also necessary to prepare multiple sample spinal images, and the multiple sample spinal images are all sample data with standard spinal region labels. The standard spinal region label can be a positioning box mark manually made on the collected data samples.
[0074] Furthermore, data expansion can be achieved by shifting, symmetrizing, blurring, adding noise, or contrast enhancement to samples, making the sample set richer and more diverse. A second base model can be used to construct the initial object detection model. This second base model can be an RCNN model, such as Fast RCNN or Faster RCNN, or a YOLO model, such as YOLOv5-Detect, YOLOv8-Detect, or YOLOv11-Detect, or other object detection algorithms.
[0075] Furthermore, during the model training process, the initial target detection model is controlled to output predicted spinal region labels for multiple sample spinal images. During the output process, the target detection model performs forward propagation calculations on the sample spinal images, that is, the output of the previous layer is used as the input of the next layer until the final spinal region is output. These predicted spinal region labels are the prediction results of the initial target detection model for multiple sample spinal images. The gap between the predicted spinal region labels and the standard spinal region labels is the gap between the current state of the initial target detection model and the expected performance. On this basis, the gradient descent method is used to calculate the training loss value of the model based on the predicted spinal region labels and the standard spinal region labels of multiple sample spinal images. The parameters in the initial target detection model are adjusted based on the training loss value until the initial target detection model converges to the expected performance to obtain the trained target detection model.
[0076] Similarly, the model's training termination conditions may include, for example, the loss function value being less than or equal to a preset loss function threshold, the number of iterations reaching a preset threshold, etc. The specific model training termination conditions can be determined based on actual conditions and are not specifically limited here. It should also be noted that two target detection models can also be trained to identify the spinal region in the frontal image and the lateral image, respectively. This application does not impose a single limitation on the number and function of the target detection models.
[0077] In an embodiment of the present application, a method for measuring the Cobb angle of the spine is provided, which includes a method for training a target detection model. A target detection model is constructed using a second basic model, and the target detection model is trained in a spinal region recognition scenario based on a set of sample spinal images with standard spinal region labels. This allows the target detection model to perform in-depth analysis of spinal images and ultimately output an accurate spinal region image for the spinal image to be measured, thereby ensuring accuracy and reliability in subsequent identification of spinal vertebrae and measurement of the Cobb angle.
[0078] In the method for measuring the spinal Cobb angle, this application also provides a feasible training method for the key point recognition model. For details, please refer to Figure 5 , Figure 5 A flow chart of a model training method for a key point recognition model provided in an embodiment of the present application. Figure 5 As shown, the model training method of the key point recognition model in step S206 may at least include:
[0079] S502 : Acquire multiple sample spinal region images, where the multiple sample spinal region images are all sample data with standard position information labels.
[0080] S504: Construct an initial key point recognition model based on the third basic model.
[0081] S506: Input a plurality of sample spinal region images into an initial key point recognition model to train the initial key point recognition model.
[0082] S508. During the training process of the initial key point recognition model, the initial key point recognition model is controlled to output predicted position information labels for multiple sample spinal region images, and the parameters of the initial key point recognition model are adjusted according to the predicted position information labels and the standard position information labels of multiple sample spinal region images until convergence, thereby obtaining the trained key point recognition model.
[0083] Training the keypoint recognition model relies on a large amount of annotated spinal image data, typically manually annotated by professional physicians to ensure the accuracy of the position and corner coordinates of each vertebra. By learning from this annotated data, the model can automatically identify the keypoints of each vertebra in the spine and output the corresponding location information.
[0084] Optionally, for the training of the key point recognition model, it is necessary to train two key point recognition models for the frontal image and the lateral image respectively. When training the key point recognition model, it is also necessary to prepare multiple sample spinal region images, and the multiple sample spinal region images are all sample data with standard position information labels. Among them, the position information label contains the positioning frame, name, and coordinate information of the corner points of each vertebra. The generation of labels can first be done by manually marking the key points in the order of the vertebrae. Then, the coordinate circumscribed rectangle of each vertebral key point is expanded by n pixels as the positioning frame. n is generally 5-30 and can be adjusted according to actual conditions.
[0085] Furthermore, data can be expanded by shifting, symmetrizing, blurring, adding noise, and enhancing contrast, making the sample set richer and more diverse. A third basic model can be used to construct the initial keypoint recognition model. The second basic model can be a YOLO series model, such as the YOLOv8-Pose model or the YOLOv11-Pose model, or other related model algorithms.
[0086] Furthermore, during the process of model training, the initial key point recognition model is controlled to output predicted position information labels for multiple sample spinal region images. During the output process, the key point recognition model performs forward propagation calculations on the sample spinal region images, that is, the output of the previous layer is used as the input of the next layer until the final position information is output. These predicted position information labels are the prediction results of the initial key point recognition model for multiple sample spinal region images. Then, the gradient descent method is used to calculate the training loss value of the model based on the predicted position information labels and the standard position information labels of multiple sample spinal region images. The parameters in the initial key point recognition model are adjusted based on the training loss value until the initial key point recognition model converges to the expected performance to obtain the trained key point recognition model. Similarly, the model training end conditions can also be determined based on actual conditions, which are not specifically limited here.
[0087] In an embodiment of the present application, a method for measuring the spinal Cobb angle is provided, which includes a method for training a key point recognition model. The key point recognition model is constructed using a third basic model, and is trained in a key point recognition scenario based on a set of sample spinal region images labeled with standard position information. This allows the key point recognition model to output accurate position information for the spinal region images, thereby ensuring accuracy and reliability in subsequent Cobb angle measurements.
[0088] See also Figure 6 , Figure 6 A schematic flow chart of a method for measuring the spinal Cobb angle provided in an embodiment of the present application.
[0089] like Figure 6 As shown, the method for measuring the spinal Cobb angle may include at least:
[0090] S602. Acquire an initial digital photographic image of the spine, adjust the pixel value of each pixel in the initial digital photographic image according to digital photographic parameters, and map the adjusted pixel values to grayscale pixel intervals to obtain an image of the spine to be measured; wherein the digital photographic parameters include at least one of window width and window position.
[0091] Optionally, the initial digital photographic image of the spine is usually a full-spine DR image obtained by a digital X-ray device (such as DR, Digital Radiography) or a CT scanner. The full-spine DR image is a full-spine anteroposterior or lateral image taken by full-frame DR or conventional DR stitching. These devices can record the patient's spinal structure in the form of a digital image and generate high-resolution two-dimensional or three-dimensional images. The initial digital photographic image contains rich spinal anatomical information, but due to differences in shooting conditions, equipment parameters and patient posture, the image may have problems such as insufficient contrast, uneven brightness or noise interference. Therefore, in a feasible implementation, the initial image can also be preprocessed to obtain the image of the spine to be tested, so as to optimize the image quality, so that the pixel features in the image of the spine to be tested are more suitable for analysis and recognition by the model, thereby improving the subsequent recognition accuracy.
[0092] Specifically, after acquiring the initial digital photographic image, the image is optimized according to the digital photographic parameters. The digital photographic parameters involved in the embodiments of the present application mainly include window width (Window Width) and window level (WindowLevel), which are commonly used adjustment parameters in medical image processing and are used to control the contrast and brightness of the image. The window width determines the range of grayscale values in the image. A wider window width will display more grayscale levels, but may reduce the contrast of the image; a narrower window width will enhance the contrast, but may lose some detail information. The window level determines the center point of the grayscale value in the image. Adjusting the window level can change the brightness of the image, making the structure within a specific grayscale range clearer. Adjusting the pixel values in the image based on the window width and window level can optimize the visual effect of the image, highlighting the key structures of the spine (such as vertebral bodies, intervertebral spaces, etc.), while suppressing irrelevant background information or noise. The specific pixel adjustment formula is as follows:
[0093] ;
[0094] in, WW Indicates the window width, WL Indicates the window level, p Represents the pixel value of the original image, Represents the pixel value adjusted based on the window width and window level. The window width and window level can be set based on the characteristics of the spinal image and diagnostic requirements. For example, a high contrast image may be required to clearly display the vertebral edges, while a wide grayscale range may be required to display the overall curvature of the spine in a lateral image. Based on the set window width and window level, the grayscale value of each pixel in the image is remapped to convert the original pixel value to a new grayscale range, thereby enhancing the contrast and clarity of the region of interest.
[0095] After adjusting the pixel values, you can further map the processed pixel values to a standard grayscale pixel range (usually 0-255, representing the grayscale range from pure black to pure white). This step can standardize the image and make it suitable for subsequent analysis and processing. The specific calculation formula is as follows:
[0096] ;
[0097] in, Represents the maximum pixel value of the original image, Represents the minimum pixel value of the original image, Represents the current original pixel value, The pixel mapping process scales the adjusted pixel values to a range of 0-255, ensuring uniform grayscale distribution and meeting display and storage standards, further improving image quality and detail. This process ultimately yields a high-quality spinal image with moderate contrast, uniform brightness, and suppressed noise. This preprocessing significantly improves the accuracy and reliability of subsequent image segmentation, key point identification, and Cobb angle calculation.
[0098] S604: Input the spinal column image to be measured into the body position recognition model, and obtain the spinal column shooting body position of the spinal column image to be measured output by the body position recognition model.
[0099] Regarding step S604, please refer to the detailed description in step S202, which will not be repeated here.
[0100] S606: Input the spinal column image to be measured into the target detection model to obtain the spinal column region image of the spinal column in the spinal column image to be measured output by the target detection model.
[0101] Regarding step S606, please refer to the detailed description in step S204, which will not be repeated here.
[0102] S608: Calculate an expansion ratio according to the initial size of the spine region image, and expand the boundary of the spine region image according to the expansion ratio.
[0103] Optionally, to prevent the loss of marginal vertebrae in the spinal region image output by the model from affecting the subsequent Cobb angle measurement results, the boundary can be expanded based on the spinal region results output by the target detection model. The expanded pixels can be calculated according to the image ratio, using the following formula:
[0104] ;
[0105] in, H is the height of the original spine region image, r To expand the ratio.
[0106] Furthermore, the expansion ratio can be adaptively calculated based on the initial size of the spinal region image, or the expansion ratio can be a preset fixed value, such as 0.03, 0.04, etc. The calculation method of the expansion ratio can be adjusted according to actual conditions and is not limited in this embodiment of the application.
[0107] In addition, the boundary to be expanded can be any one or more of the four boundaries. Figure 7 , Figure 7 This is a schematic diagram of a recognition process of a spinal region image provided in an embodiment of the present application. Figure 7 (A) shows the spine segmentation process for the frontal image, and (B) shows the spine segmentation process for the lateral image. Considering that cervical vertebrae are often missing in actual situations, the upper limit boundary can be expanded to ensure the integrity of the vertebrae and the accuracy of the spinal features.
[0108] S610: Input the expanded spinal region image into a key point recognition model corresponding to the spinal shooting position to obtain position information output by the key point recognition model for each vertebra of the spine, the position information including at least positioning frame information, vertebral name and corner point coordinates.
[0109] Regarding step S610 , please refer to the detailed description in step S206 , which will not be repeated here.
[0110] S612: The positioning frame information includes at least one candidate positioning frame and a confidence score for each candidate positioning frame. The candidate positioning frames are screened based on their confidence scores, and candidate positioning frames that meet a preset suppression condition are removed to obtain a vertebral positioning frame corresponding to each vertebra.
[0111] Optionally, based on the characteristics of the keypoint recognition model, it may output multiple possible candidate localization frames for each vertebra, each with different confidence scores to indicate its likelihood of being the correct localization frame. Therefore, based on the localization frame information output by the keypoint recognition model for each vertebra, it is necessary to screen the candidate localization frames and remove redundant ones.
[0112] Specifically, the Non-Maximum Suppression (NMS) algorithm can be used to process candidate bounding boxes. The NMS algorithm suppresses non-maximum elements, implementing a local maximum search. Its core concept is to find the local maximum within a neighborhood and suppress all other non-maximum elements. The NMS algorithm eliminates redundant bounding boxes by retaining the highest-scoring box and suppressing any other boxes that overlap with it, thereby improving detection accuracy. The NMS algorithm first sorts candidate boxes according to their confidence scores. The highest-confidence candidate box is then added to the final output list and removed from the candidate box list. The area of all remaining candidate boxes is then calculated, along with the Intersection over Union (IoU) ratio (IoU) between the highest-confidence candidate box and the other candidate boxes. Candidate boxes with an IoU greater than a preset threshold are removed. After each removal, the above process is repeated until the candidate box list is empty. The NMS algorithm effectively eliminates redundant candidate boxes, improving the accuracy and efficiency of vertebral body detection.
[0113] S614 , reordering the vertebral positioning frames according to their order on the longitudinal axis, and calculating the spinal Cobb angle in the spinal column region image based on the position information of each vertebra after reordering.
[0114] Optionally, after executing the NMS algorithm, the vertebral positioning frames are reordered according to their order on the vertical axis (Y axis), so as to obtain an arrangement of the positioning frames that conforms to the order of the vertebrae in the image. Specifically, the coordinates of the rectangular center points of all positioning frames can be calculated and reordered in the order of the center point coordinates from top to bottom on the y axis. Figure 8 , Figure 8 This is a schematic diagram of the processing result of a vertebral positioning frame provided in an embodiment of the present application, and the final result is as follows Figure 8 As shown in (A), for the frontal image, 17 positioning frames are output, including 12 thoracic vertebrae: T1-T12, and 5 lumbar vertebrae: L1-L5; Figure 8As shown in (B), for the lateral image, 18 localization frames are output, encompassing 12 thoracic vertebrae (T1-T12), five lumbar vertebrae (L1-L5), and one sacral vertebra (S1). Further, based on the reordered positional information of each vertebra, the spinal Cobb angle in the spinal region image can be accurately calculated.
[0115] In an embodiment of the present application, a method for measuring the Cobb angle of the spine is provided. For the initially acquired spine image, the grayscale value of each pixel in the image is remapped according to the set window width and window level to convert the original pixel value into a new grayscale range, thereby enhancing the contrast and clarity of the region of interest and improving the accuracy and reliability of subsequent image segmentation, key point identification, and Cobb angle calculation. Based on the spinal region results output by the target detection model, boundary expansion is performed to prevent the lack of edge vertebrae from affecting the subsequent Cobb angle measurement results. For the large number of candidate positioning frames output by the key point recognition model, a non-maximum suppression algorithm is performed based on the confidence score to effectively eliminate redundant candidate positioning frames, thereby improving the accuracy and efficiency of vertebral detection. Finally, the vertebral positioning frames are reordered according to their order on the vertical axis (Y axis), thereby obtaining the arrangement results of the positioning frames that conform to the order of the vertebrae in the image.
[0116] Different Cobb angle calculation methods are also required for images taken in the anteroposterior and lateral positions. Figure 9 , Figure 9 A flowchart of a method for calculating the spinal Cobb angle provided in an embodiment of the present application.
[0117] like Figure 9 As shown, the above step S208, calculating the spinal Cobb angle in the spinal column region image based on the position information of each vertebral body, may further include at least:
[0118] S902: When the spine is photographed in the anteroposterior position, the Cobb angle between every two vertebrae is calculated based on the position information of each vertebra to obtain the Cobb angle matrix of the spine.
[0119] Optionally, when calculating the spinal Cobb angle in the anteroposterior image, it is necessary to first calculate the Cobb angle between each two vertebrae based on the position information of each vertebra to obtain the spinal Cobb angle matrix. Specifically, the average coordinates of the two left points and the average coordinates of the two right points of the four corner points of each vertebra are taken to form the middle line segment. The left average point is the starting point, the right average point is the ending point, and the middle line segment vector is recorded as , the dimension is 17*2; then calculate the vector Length of mold , the dimension is 17*1, and the calculation formula of the modulus is as follows:
[0120] ;
[0121] Based on the modulus, the Cobb angle matrix of each vertebra with other vertebrae can be calculated using the cosine formula. The dimension is 17*17. The calculation formula is as follows:
[0122] ;
[0123] in, T Represents a matrix transpose operation.
[0124] S904: Determine the spinal curvature type according to the target Cobb angle in the Cobb angle matrix that meets the preset degree condition.
[0125] Furthermore, AP images include two types of curvature: straight or S-shaped. The curvature type determines the Cobb angle used in the AP image. Therefore, the largest Cobb angle is identified from the Cobb angle matrix, which is used as the target Cobb angle. The curvature of the target Cobb angle is then used to determine the spinal curvature type.
[0126] S906. Divide the spine into multiple spinal segments according to the curvature type, the Cobb angle matrix, and the upper and lower vertebrae corresponding to the target Cobb angle; and use the Cobb angle between the upper and lower vertebrae of each spinal segment as the spinal Cobb angle in the spinal region image.
[0127] Optionally, generally speaking, the anteroposterior image is generally divided into several spinal segments, namely: MT represents the main thoracic segment, PT represents the upper thoracic segment, L represents the lumbar segment, and TL represents the thoracolumbar segment. The three Cobb angles that need to be calculated and output are the main thoracic segment (MT area) Cobb angle, the upper thoracic segment (PT area) Cobb angle, and the thoracolumbar segment / lumbar segment (TL / L) Cobb angle.
[0128] Then, for a straight spine, the maximum target Cobb angle determined above is located in the middle of the spine. Figure 10 , Figure 10 This is a schematic diagram of the calculation results of the spinal Cobb angle provided in the embodiment of this application. Figure 10As shown in (A), in the anteroposterior image, the Cobb angle between vertebrae T5 and T12 is determined to be the largest, at 90.0 degrees. Vertebrae T5-T12 are therefore defined as the MT region. Therefore, the 90.0-degree target Cobb angle is also the MT region Cobb angle. Based on the target Cobb angle, vertebrae T5, which is at the upper end of the target Cobb angle, is located in the upper region, where vertebrae T1 forms the largest Cobb angle with T5. Vertebrae T1-T5 are therefore defined as the PT region. The 45.3-degree Cobb angle between these two vertebrae is also the PT region Cobb angle. Continuing this, vertebrae T12, which is at the lower end of the target Cobb angle, is located in the lower region, where vertebrae L5 forms the largest Cobb angle with T12. Vertebrae T12-L5 are therefore defined as the TL / L region. The 50.8-degree Cobb angle between these two vertebrae is also the TL / L region Cobb angle.
[0129] For S-shaped spines, the target Cobb angle is determined based on whether the target Cobb angle is located in the upper or lower spine. If the target Cobb angle is located in the upper spine, the target Cobb angle is determined to be the PT region Cobb angle. The maximum Cobb angle formed by the vertebral body at the lower end of the target Cobb angle and the other vertebrae below it is determined to be the MT region Cobb angle. The maximum Cobb angle formed by the vertebral body at the lower end of the MT region Cobb angle and the other vertebrae below it is determined to be the TL / L region Cobb angle.
[0130] Similarly, if the target Cobb angle is in the lower part of the spine, the target Cobb angle is determined to be the TL / L region Cobb angle. Then, the maximum Cobb angle formed by the upper end vertebra of the target Cobb angle and other vertebrae above it is determined to be the MT region Cobb angle. Finally, the maximum Cobb angle formed by the upper end vertebra of the MT region Cobb angle and other vertebrae above it is determined to be the PT region Cobb angle.
[0131] or,
[0132] S908: When the spine is photographed in a lateral position, the spine is divided into multiple spinal segments according to a preset vertebral body division rule.
[0133] Alternatively, as Figure 10 As shown in (B), when the spine is photographed in the lateral position, the spine can be divided according to the preset vertebral division rules. It is generally divided into five spinal segments: upper thoracic segment (T2-T5), main thoracic segment (T2-T10), lower thoracic segment (T5-T10), thoracolumbar segment (T10-L2) and lumbar segment (T12-S1).
[0134] S910 , calculating the Cobb angle between the upper vertebra and the lower vertebra of each spinal segment according to the position information of each vertebra, and obtaining the spinal Cobb angle in the spinal region image.
[0135] Optionally, the Cobb angle between the upper vertebra and the lower vertebra of each spinal segment is calculated according to the coordinates of the corner points of each vertebra, so as to obtain the degrees of the five Cobb angles in the lateral image.
[0136] In an embodiment of the present application, a method for measuring the Cobb angle of the spine is provided. Different Cobb angle calculation methods are adopted for different spinal features represented in the anteroposterior and lateral images, thereby flexibly and accurately realizing the automatic measurement and calculation of the Cobb angle in the anteroposterior and lateral images.
[0137] See also Figure 11 , Figure 11 This is a structural diagram of a spinal Cobb angle measurement device provided in an embodiment of the present application. Figure 11 As shown, the spinal Cobb angle measuring device 1100 includes:
[0138] The body position recognition module 1110 is used to obtain a spinal column image to be tested, input the spinal column image to be tested into a body position recognition model, and obtain a spinal column shooting position of the spinal column image to be tested output by the body position recognition model;
[0139] The spinal column region detection module 1120 is configured to input the spinal column image to be tested into the target detection model and obtain the spinal column region image of the spinal column in the spinal column image to be tested output by the target detection model;
[0140] The vertebral positioning module 1130 is used to input the spinal region image into the key point recognition model corresponding to the spinal shooting position, and obtain the position information output by the key point recognition model for each vertebra of the spine. The position information includes at least positioning frame information, vertebral name and corner point coordinates;
[0141] The Cobb angle calculation module 1140 is configured to calculate the spinal Cobb angle in the spinal column region image according to the position information of each vertebral body.
[0142] Optionally, the posture recognition module 1110 is also used to obtain an initial digital photographic image of the spine, adjust the pixel value of each pixel point in the initial digital photographic image according to the digital photographic parameters, and map the adjusted pixel values to the grayscale pixel interval to obtain the spinal image to be measured; wherein the digital photographic parameters include at least one of the window width and the window position.
[0143] Optionally, the vertebral positioning module 1130 is further configured to calculate an expansion ratio based on the initial size of the spinal region image, expand the boundary of the spinal region image according to the expansion ratio, and input the expanded spinal region image into a key point recognition model corresponding to the spinal shooting position.
[0144] Optionally, the positioning frame information includes at least one candidate positioning frame and a confidence score of each candidate positioning frame. The Cobb angle calculation module 1140 is further used to screen each candidate positioning frame based on the confidence score of each candidate positioning frame, remove the candidate positioning frames that meet the preset suppression conditions, and obtain the vertebral positioning frame corresponding to each vertebra; reorder each vertebral positioning frame according to the order of each vertebral positioning frame on the vertical axis, and calculate the spinal Cobb angle in the spinal region image based on the position information of each vertebra after reordering.
[0145] Optionally, the spine imaging position is anteroposterior or lateral.
[0146] Optionally, when the spine is photographed in the anteroposterior position, the Cobb angle calculation module 1140 is further used to calculate the Cobb angle between every two vertebrae based on the position information of each vertebra to obtain the Cobb angle matrix of the spine; determine the curvature type of the spine based on the target Cobb angle in the Cobb angle matrix that meets the preset degree conditions; divide the spine into multiple spinal segments according to the curvature type, the Cobb angle matrix, and the upper and lower vertebrae corresponding to the target Cobb angle; and use the Cobb angle between the upper and lower vertebrae of each spinal segment as the spinal Cobb angle in the spinal region image.
[0147] Optionally, when the spine is photographed in a lateral position, the Cobb angle calculation module 1140 is also used to divide the spine into multiple spinal segments according to a preset vertebral division rule; calculate the Cobb angle between the upper vertebra and the lower vertebra of each spinal segment based on the position information of each vertebra, and obtain the spinal Cobb angle in the spinal region image.
[0148] Optionally, the spinal Cobb angle measurement device 1100 also includes: a model training module, which is used to obtain multiple sample spinal images, each of which is sample data with a standard posture label; construct an initial posture recognition model based on the first basic model; input multiple sample spinal images into the initial posture recognition model to train the initial posture recognition model; during the training process of the initial posture recognition model, control the initial posture recognition model to output predicted posture labels for multiple sample spinal images, and adjust the parameters of the initial posture recognition model according to the predicted posture labels and the standard posture labels of multiple sample spinal images until convergence, to obtain a trained posture recognition model; and / or, obtain multiple sample spinal images, each of which is sample data with a standard spinal region label; construct an initial target detection model based on the second basic model; input multiple sample spinal images into the initial target detection model to train the initial target detection model; in the initial target detection model During the training process of the target detection model, the initial target detection model is controlled to output predicted spinal region labels for multiple sample spinal images, and the parameters of the initial target detection model are adjusted according to the predicted spinal region labels and the standard spinal region labels of the multiple sample spinal images until convergence, thereby obtaining a trained target detection model; and / or, multiple sample spinal region images are obtained, and the multiple sample spinal region images are all sample data with standard position information labels; an initial key point recognition model is constructed based on the third basic model; multiple sample spinal region images are input into the initial key point recognition model, and the initial key point recognition model is trained; during the training process of the initial key point recognition model, the initial key point recognition model is controlled to output predicted position information labels for multiple sample spinal region images, and the parameters of the initial key point recognition model are adjusted according to the predicted position information labels and the standard position information labels of the multiple sample spinal region images until convergence, thereby obtaining a trained key point recognition model.
[0149] The present application also provides a computer storage medium that can store multiple instructions suitable for being loaded by a processor and executing the steps of any of the methods in the above embodiments. Figure 12 , Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 12 As shown, the electronic device 1200 may include: at least one processor 1201 , at least one network interface 1204 , a user interface 1203 , a memory 1205 , and at least one communication bus 1202 .
[0150] The communication bus 1202 is used to enable communication between these components. The user interface 1203 may include a display and a camera. Optionally, the user interface 1203 may also include a standard wired interface or a wireless interface. The network interface 1204 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The processor 1201 may include one or more processing cores. The processor 1201 utilizes various interfaces and circuits to connect various components within the electronic device 1200. It executes instructions, programs, code sets, or instruction sets stored in the memory 1205 and accesses data stored in the memory 1205 to perform various functions of the electronic device 1200 and process data. Optionally, the processor 1201 may be implemented in hardware using at least one of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). Processor 1201 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing content displayed on the display screen; and the modem handles wireless communications. It is understood that the modem may not be integrated into processor 1201 but implemented as a separate chip. Memory 1205 may include random access memory (RAM) or read-only memory (ROM). Optionally, memory 1205 includes non-transitory computer-readable storage media. Memory 1205 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1205 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1205 may optionally be at least one storage device located away from the aforementioned processor 1201. Figure 12As shown, the memory 1205 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a spinal Cobb angle measurement program.
[0151] exist Figure 12 In the electronic device 1200 shown, the user interface 1203 is mainly used to provide an input interface for the user and obtain user input data; and the processor 1201 can be used to call the spinal Cobb angle measurement program stored in the memory 1205 and specifically perform the following operations:
[0152] Acquire a spinal image to be tested, input the spinal image to be tested into a body position recognition model, and obtain a spinal shooting position of the spinal image to be tested output by the body position recognition model;
[0153] Inputting the spinal column image to be tested into the target detection model, and obtaining the spinal column region image of the spinal column in the spinal column image to be tested output by the target detection model;
[0154] Inputting the spinal region image into the key point recognition model corresponding to the spinal shooting position to obtain the position information output by the key point recognition model for each vertebra of the spine, the position information at least including the positioning frame information, the vertebra name and the corner point coordinates;
[0155] The spinal Cobb angle in the spinal region image is calculated based on the position information of each vertebra.
[0156] In some embodiments, when the processor 1201 is executing the acquisition of the spinal image to be tested, it specifically performs the following steps: acquiring an initial digital photographic image of the spine, adjusting the pixel value of each pixel point in the initial digital photographic image according to the digital photographic parameters, and mapping the adjusted pixel values to the grayscale pixel interval to obtain the spinal image to be tested; wherein the digital photographic parameters include at least one of the window width and the window position.
[0157] In some embodiments, when the processor 1201 inputs the spinal region image into the key point recognition model corresponding to the spinal shooting position, it specifically performs the following steps: calculating the expansion ratio based on the initial size of the spinal region image, and expanding the boundary of the spinal region image according to the expansion ratio; and inputting the expanded spinal region image into the key point recognition model corresponding to the spinal shooting position.
[0158] In some embodiments, the positioning frame information includes at least one candidate positioning frame and a confidence score of each candidate positioning frame. When the processor 1201 calculates the spinal Cobb angle in the spinal region image based on the position information of each vertebral segment, it specifically performs the following steps: screening each candidate positioning frame based on the confidence score of each candidate positioning frame, removing the candidate positioning frame that meets the preset suppression condition, and obtaining the vertebral positioning frame corresponding to each vertebral segment; reordering each vertebral positioning frame according to the order of each vertebral positioning frame on the vertical axis, and calculating the spinal Cobb angle in the spinal region image based on the position information of each vertebral segment after reordering.
[0159] In some embodiments, the spinal imaging position is anteroposterior or lateral.
[0160] In some embodiments, when the spine is photographed in the upright position, the processor 1201 specifically performs the following steps when calculating the spinal Cobb angle in the spinal region image based on the position information of each vertebra: calculating the Cobb angle between every two vertebrae based on the position information of each vertebra to obtain the Cobb angle matrix of the spine; judging the curvature type of the spine based on the target Cobb angle in the Cobb angle matrix that meets the preset degree conditions; dividing the spine into multiple spinal segments according to the curvature type, the Cobb angle matrix, and the upper and lower vertebrae corresponding to the target Cobb angle; and using the Cobb angle between the upper and lower vertebrae of each spinal segment as the spinal Cobb angle in the spinal region image.
[0161] In some embodiments, when the spine is photographed in a lateral position, the processor 1201 specifically performs the following steps when calculating the spinal Cobb angle in the spinal region image based on the position information of each vertebra: dividing the spine into multiple spinal segments according to a preset vertebral division rule; calculating the Cobb angle between the upper vertebra and the lower vertebra of each spinal segment based on the position information of each vertebra, and obtaining the spinal Cobb angle in the spinal region image.
[0162] In some embodiments, the processor 1201 further specifically performs the following steps: obtaining a plurality of sample spinal images, wherein the plurality of sample spinal images are sample data with standard posture labels; constructing an initial posture recognition model based on a first basic model; inputting a plurality of sample spinal images into the initial posture recognition model, and training the initial posture recognition model; during the training process of the posture recognition model, controlling the posture recognition model to output predicted posture labels for a plurality of sample spinal images, and adjusting the parameters of the initial posture recognition model according to the predicted posture labels and the standard posture labels of the plurality of sample spinal images until convergence, thereby obtaining a trained posture recognition model; and / or obtaining a plurality of sample spinal images, wherein the plurality of sample spinal images are sample data with standard spinal region labels; constructing an initial target detection model based on a second basic model; inputting a plurality of sample spinal images into the initial target detection model, and training the initial target detection model; in the initial target detection model During the training process, the initial target detection model is controlled to output predicted spinal region labels for multiple sample spinal images, and the parameters of the initial target detection model are adjusted according to the predicted spinal region labels and the standard spinal region labels of the multiple sample spinal images until convergence, thereby obtaining a trained target detection model; and / or, multiple sample spinal region images are obtained, and the multiple sample spinal region images are all sample data with standard position information labels; an initial key point recognition model is constructed based on the third basic model; multiple sample spinal region images are input into the initial key point recognition model, and the initial key point recognition model is trained; during the training process of the initial key point recognition model, the initial key point recognition model is controlled to output predicted position information labels for multiple sample spinal region images, and the parameters of the initial key point recognition model are adjusted according to the predicted position information labels and the standard position information labels of the multiple sample spinal region images until convergence, thereby obtaining a trained key point recognition model.
[0163] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0164] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product comprises one or more computer instructions. When loaded and executed on a computer, the computer program instructions fully or partially perform the processes or functions described above in accordance with the embodiments of this specification. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium accessible by a computer or a data storage device such as a server or data center that integrates one or more available media. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVDs)), or semiconductor media (for example, solid state drives (SSDs)).
[0165] It should be noted that, for ease of description, the aforementioned method embodiments are presented as a series of combined actions. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, as certain steps may be performed in a different order or simultaneously, depending on the application. Furthermore, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for this application. Furthermore, it should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of the relevant data must comply with relevant laws, regulations, and standards in the relevant countries and regions. For example, the sample spinal images and spinal images to be tested involved in this application were obtained with full authorization. The above describes specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired results. In some implementations, multi-tasking and parallel processing are also possible or may be advantageous. In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in one embodiment, reference can be made to the relevant descriptions of other embodiments.
[0166] The above is a description of a spinal Cobb angle measurement method, device, and electronic device provided in this application. For those skilled in the art, based on the ideas of the embodiments of this application, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for measuring the Cobb angle of the spine, characterized in that: The method comprises: Acquire a spinal column image to be measured, input the spinal column image to be measured into a body position recognition model, and obtain a spinal column shooting body position of the spinal column image to be measured output by the body position recognition model; Inputting the spinal column image to be measured into a target detection model to obtain a spinal column region image of the spinal column in the spinal column image to be measured output by the target detection model; Expanding the upper boundary of the spinal region image according to a preset expansion ratio, inputting the expanded spinal region image into a key point recognition model corresponding to the spinal imaging position, and obtaining position information output by the key point recognition model for each vertebra of the spine, wherein the position information includes at least positioning frame information, vertebral name, and corner point coordinates; When the spine is photographed in the anteroposterior position, a connecting line segment of the average coordinates of the two left points and the average coordinates of the two right points of the four corner points of each vertebra is used as the middle line segment of each vertebra, the modulus of the middle line segment vector corresponding to the middle line segment of each vertebra is calculated, and based on each modulus, a Cobb angle matrix of each vertebra in the spine and other vertebrae is calculated using the cosine formula, the curvature type of the spine is determined according to each Cobb angle matrix, and the spinal Cobb angle in the spinal region image is calculated based on the curvature type; When the spine is photographed in a lateral position, the spine is divided into five spinal segments: the upper thoracic segment, the main thoracic segment, the lower thoracic segment, the thoracolumbar segment, and the lumbar segment. Based on the coordinates of the corner points of each vertebra in the spine, the Cobb angle between the upper and lower vertebrae of each spinal segment is calculated to obtain the spinal Cobb angle in the spinal region image.
2. The method according to claim 1, characterized in that The step of obtaining the spinal column image to be measured comprises: Acquiring an initial digital photographic image of the spine, adjusting the pixel value of each pixel in the initial digital photographic image according to digital photographic parameters, and mapping the adjusted pixel value to a grayscale pixel interval to obtain an image of the spine to be measured; The digital photography parameters include at least one of window width and window position.
3. The method according to claim 1, characterized in that The positioning frame information includes at least one candidate positioning frame and a confidence score of each candidate positioning frame. After obtaining the position information output by the key point recognition model for each vertebra of the spine, the method further includes: The candidate positioning frames are screened based on their confidence scores, and the candidate positioning frames that meet the preset suppression conditions are removed to obtain the vertebral positioning frames corresponding to each vertebra; Reordering the vertebral positioning frames according to their order on the vertical axis to obtain position information of each vertebral segment after reordering; Calculating the Cobb angle matrix of the spine according to the position information of each vertebral body includes: Calculating the spinal Cobb angle in the spinal region image according to the position information of each vertebra after reordering; The calculating of the spinal Cobb angle in the spinal column region image based on the position information of each vertebral body and the plurality of pre-divided spinal segments includes: According to the reordered position information of each vertebral body, the spinal Cobb angle in the spinal column region image is calculated based on a plurality of pre-divided spinal segments.
4. The method according to claim 1, characterized in that Calculating the Cobb angle matrix of the spine according to the position information of each vertebra, determining the curvature type of the spine according to the Cobb angle matrix, and calculating the Cobb angle of the spine in the spinal region image based on the curvature type, includes: Calculate the Cobb angle between every two vertebrae according to the position information of each vertebrae to obtain the Cobb angle matrix of the spine; determining the spinal curvature type according to a target Cobb angle in the Cobb angle matrix that satisfies a preset degree condition; Dividing the spinal column into a plurality of spinal segments according to the curvature type, the Cobb angle matrix, and the upper vertebral body and the lower vertebral body corresponding to the target Cobb angle; The Cobb angle between the upper vertebral body and the lower vertebral body of each spinal segment is used as the spinal Cobb angle in the spinal region image.
5. The method according to claim 1, characterized in that The calculating of the spinal Cobb angle in the spinal column region image based on the position information of each vertebral body and the plurality of pre-divided spinal segments includes: Dividing the spinal column into multiple spinal segments according to a preset vertebral division rule; The Cobb angle between the upper vertebra and the lower vertebra of each spinal segment is calculated according to the position information of each vertebra, so as to obtain the spinal Cobb angle in the spinal region image.
6. The method according to claim 1, characterized in that The method further comprises: Acquire a plurality of sample spinal images, wherein the plurality of sample spinal images are all sample data with standard body position labels; constructing an initial body position recognition model based on the first basic model; Inputting the plurality of sample spinal column images into the initial body position recognition model to train the initial body position recognition model; During the training process of the initial body position recognition model, the initial body position recognition model is controlled to output predicted body position labels for the multiple sample spinal images, and the parameters of the initial body position recognition model are adjusted according to the predicted body position labels and the standard body position labels of the multiple sample spinal images until convergence, thereby obtaining a trained body position recognition model; and / or, Acquire a plurality of sample spinal column images, wherein the plurality of sample spinal column images are all sample data with standard spinal column region labels; Building an initial target detection model based on the second basic model; Inputting the plurality of sample spine images into the initial target detection model to train the initial target detection model; During the training process of the initial target detection model, the initial target detection model is controlled to output predicted spinal region labels for the multiple sample spinal images, and the parameters of the initial target detection model are adjusted according to the predicted spinal region labels and the standard spinal region labels of the multiple sample spinal images until convergence, thereby obtaining a trained target detection model; and / or, Acquire a plurality of sample spinal region images, wherein the plurality of sample spinal region images are all sample data with standard position information labels; Construct an initial key point recognition model based on the third basic model; Inputting the plurality of sample spinal region images into the initial key point recognition model to train the initial key point recognition model; During the training process of the initial key point recognition model, the initial key point recognition model is controlled to output predicted position information labels for the multiple sample spinal region images, and the parameters of the initial key point recognition model are adjusted according to the predicted position information labels and the standard position information labels of the multiple sample spinal region images until convergence, thereby obtaining the trained key point recognition model.
7. A device for measuring the Cobb angle of the spine, characterized in that: The device comprises: A body position recognition module is used to obtain a spinal column image to be tested, input the spinal column image to be tested into a body position recognition model, and obtain a spinal column shooting position of the spinal column image to be tested output by the body position recognition model; A spinal column region detection module, configured to input the spinal column image to be measured into a target detection model, and obtain a spinal column region image of the spinal column in the spinal column image to be measured output by the target detection model; a vertebral positioning module, configured to expand the upper boundary of the spinal region image according to a preset expansion ratio, input the expanded spinal region image into a key point recognition model corresponding to the spinal imaging position, and obtain position information output by the key point recognition model for each vertebra of the spine, wherein the position information includes at least positioning frame information, vertebral name, and corner point coordinates; an anteroposterior Cobb angle calculation module, configured to, when the spinal imaging position is the anteroposterior position, use the connecting line segment of the average coordinates of the two left points and the average coordinates of the two right points of the four corner points of each vertebra as the middle line segment of each vertebra, calculate the modulus of the middle line segment vector corresponding to the middle line segment of each vertebra, calculate the Cobb angle matrix composed of each vertebra in the spine and other vertebrae using the cosine formula based on each modulus, determine the curvature type of the spine according to each Cobb angle matrix, and calculate the spinal Cobb angle in the spinal region image based on the curvature type; The lateral Cobb angle calculation module is used to divide the spine into five spinal segments, namely the upper thoracic segment, the main thoracic segment, the lower thoracic segment, the thoracolumbar segment and the lumbar segment, when the spine is photographed in the lateral position. According to the coordinates of the corner points of each vertebra in the spine, the Cobb angle between the upper and lower vertebrae of each spinal segment is calculated to obtain the spinal Cobb angle in the spinal region image.
8. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Image processing method and related equipment
CN110415291A
Lenke typing method based on spine AIS image
CN112802019A
Method and system for determining probability of occurrence of pulmonary arterial hypertension based on double-view chest radiography
CN117059263A