Spine three-dimensional imaging and scoliosis angle calculation method based on AI vision algorithm
By combining AI vision algorithms and energy balance optimization algorithms, high-precision reconstruction of the spine from back images to a 3D spine model and automatic calculation of the Cobb angle are achieved. This solves the problems of radiation risk, high cost and subjective error in existing spinal detection technologies, and provides a safe and efficient scoliosis detection solution.
Patent Information
- Application Number
- CN202511788726.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-01-23
AI Technical Summary
Existing methods for detecting spinal deformities suffer from high radiation risks, high costs, insufficient imaging accuracy, and large subjective errors, making it difficult to achieve radiation-free, high-precision 3D modeling of the spine and Cobb angle measurement.
A three-dimensional imaging method for the spine based on AI vision algorithms is adopted. Key points of the spine are accurately detected through back images. The energy balance principle and optimization algorithm are combined to achieve high-precision reconstruction from two-dimensional to three-dimensional. The Cobb angle is automatically calculated, and the vertebral rotation angle is optimized by using the energy balance system and LM algorithm to realize the three-dimensional reconstruction of the spine and the measurement of the Cobb angle.
It achieves radiation-free, low-cost, and fully automated scoliosis detection, lowers the operational threshold, significantly improves the accuracy and consistency of detection, and provides a safe and efficient scoliosis screening and diagnosis solution.
Smart Images

Figure CN121392154A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of spinal morphology detection, and particularly relates to a spinal three-dimensional imaging and lateral curvature angle calculation method based on an AI vision algorithm. BACKGROUND
[0002] Current spinal deformity, especially early detection and accurate assessment of adolescent idiopathic scoliosis (AIS), has become a key problem in orthopedic diagnosis and treatment. Existing detection methods mainly include X-ray, CT and MRI medical imaging methods, but these methods generally have the following limitations: X-ray and CT imaging have high spatial resolution, but there is an unavoidable ionizing radiation risk, which is not suitable for mass screening and dynamic monitoring; MRI imaging is expensive, large in size, slow in imaging speed and easily affected by patient posture; optical three-dimensional reconstruction technology is limited by external light and skin texture blocking, which easily leads to loss of key features and imaging accuracy cannot meet clinical needs; the traditional measurement method of Cobb angle relies on the subjective judgment of doctors and manual selection of points, which has the problems of poor repeatability and large error; although some studies have explored the application of millimeter wave radar or other non-contact technologies in medical treatment, they have not been involved in three-dimensional modeling and Cobb angle measurement of the spine.
[0003] Therefore, there is an urgent need for a new method of three-dimensional spinal modeling and Cobb angle measurement that is radiation-free, high-precision and can be automatically executed to realize early, quantitative and non-invasive detection of spinal deformity. SUMMARY
[0004] To solve the above problems in the prior art, the application provides a spinal three-dimensional imaging and lateral curvature angle calculation method based on an AI vision algorithm, which accurately detects key points of the spine through back image data, realizes high-precision reconstruction from two-dimensional to three-dimensional by combining energy balance principle and optimization algorithm, and automatically calculates clinical Cobb angle, thereby solving the problems of radiation risk, high cost and subjective error in traditional detection, and providing a safe, efficient and objective solution for scoliosis screening.
[0005] The object of the application can be achieved by the following technical solutions: The present disclosure provides a spinal three-dimensional imaging and lateral curvature angle calculation method based on an AI vision algorithm, comprising the following steps: S1, back key point detection: collecting back image data, and positioning a plurality of key points of the spine from the back image by inputting a constructed key point detection model; S2, construct an energy balance spine model: represent the spine model as an energy balance system, where each vertebral body is represented as a mass G, and each intervertebral disc is represented as an elastic body A, with the connection point of the elastic body A located at the geometric center of the vertebral body; then map the key points of the spine to the spine model to establish the energy balance equation of gravity and elastic potential energy; S3, energy balance equation optimization: use the LM algorithm to iteratively optimize the energy balance equation, including the energy balance equation of the spine model in the sagittal plane and the cross-sectional plane; S4, obtain three-dimensional coordinates: based on the cross-sectional and sagittal plane rotation angles of the center of gravity of each vertebral body obtained by the total potential energy tending to zero, the three-dimensional coordinates of the center of gravity of each vertebral body are calculated by combining the rotation matrix; S5, calculate the Cobb angle: calculate the Cobb angle according to the three-dimensional coordinates of the center of gravity of each vertebral body obtained.
[0006] Further, the back key point detection comprises the following steps: S11, construct a data set: collect back images of different body types, ages, and genders, including image samples of scoliosis patients and normal people, then label the key points of the spine according to anatomical standards by professionals, and pre-process the labeled sample data to construct a data set; S12, key point detection model construction: select a model infrastructure, introduce adaptive feature enhancement and multi-scale information fusion mechanism, and complete model construction using progressive learning strategy; S13, input the collected back image data into the trained key point detection model, obtain the prediction result and perform anatomically guided post-processing optimization on the prediction result.
[0007] Further, the pre-processing comprises: perform multi-level data enhancement on the original image samples, including geometric transformation, photometric transformation, and simulation transformation, then uniformly scale all images to a predetermined pixel and complete normalization processing; The anatomically guided post-processing optimization comprises: Firstly, apply the spine midline fitting based on B-spline curve to smooth the predicted points and eliminate jumping abnormal points; then implement key point sequence verification to ensure spatial sequence consistency from top to bottom, and reorder the points with abnormal sequence; finally, perform adjacent key point distance rationality check, and correct the points with abnormal distance through linear interpolation.
[0008] Further, the key point detection model construction comprises the following steps: Architecture design: based on the YOLOv8-pose architecture, a key point detection model is constructed, a spatial attention module is added to the feature extraction network, and a higher weight is given to the back spine area through learnable parameters; a multi-scale feature pyramid is constructed to fuse deep semantic features and shallow detail features; the output layer structure is adjusted to support the simultaneous detection of 21 key points; Loss function design: the key point coordinate loss uses the smooth L1 loss function to regress the position of each key point; the key point visibility loss uses the binary cross-entropy loss to handle occlusion and blur; the curvature consistency loss calculates the second-order difference of the curve formed by the predicted key points to punish abnormal predictions that do not conform to the physiological curvature of the spine; Model training: based on the constructed dataset, the first stage uses a large-scale general human key point dataset for pre-training; the second stage fine-tunes on the back image dataset, focusing on learning back-specific features; the third stage introduces difficult sample mining and curriculum learning, first training easily distinguishable key points, and gradually adding intermediate key points.
[0009] Further, the representation of the spine model as an energy balance system comprises the following steps: The spine model is constructed by building n vertebral bodies and n-1 intervertebral discs from G1 to Gn; In the energy balance system, the elastic coefficient ki of the elastic body is defined by an anatomical constant, and the initial size of the elastic body is equal to the height of the corresponding intervertebral disc; Based on the deformation of the elastic body caused by the gravity of the vertebral body, the energy balance equation of gravity and elastic potential energy is established.
[0010] Further, the mapping of the spine key points to the spine model comprises the following steps: A global coordinate system is established with the center point of the vertebral body G1 as the origin, the X-axis horizontal forward, the Y-axis vertical right, and the Z-axis vertical upward; The spine key points correspond to the center projection positions of the vertebral bodies in the coronal plane; The obtained several spine key points are used as initial point cloud coordinates to build the spine model on the coronal plane.
[0011] Further, the energy balance equation of the spine model in the sagittal plane and the cross-sectional plane, wherein the energy balance equation of the spine model in the sagittal plane is represented as: ; In the formula, E o is the total potential energy, E g is the gravitational potential energy; E t is the elastic potential energy; m i is the mass of the vertebral body; h i is the height of the vertebral body center of gravity; k j is the elastic potential energy; δj is the disc deformation amount; θ is the sagittal plane rotation angle; and the sagittal plane rotation angles of the vertebral bodies G1 and Gn are preset. The LM algorithm is used to optimize the sagittal plane rotation angle of each vertebral body, and the constraint condition is set as the maximum rotation angle θ of the sagittal plane being ±45°. The energy balance equation of the spinal column model on the cross section is expressed as: ; In the formula, φ is the cross section rotation angle, and the gravitational potential energy of the sagittal plane is the same as that of the cross section.
[0012] Further, the iterative optimization of the energy balance equation using the LM algorithm comprises the following steps: S31, the total potential energy minimization optimization process of the energy balance equation is converted into a least squares problem; S32, the gradient value of the total potential energy with respect to each rotation angle is calculated using the Jacobian matrix analysis; S33, the gradient value is updated using the gradient value, the gradient is increased when the residual is greater than the set range, and the gradient is decreased when the residual is reduced to the set range, and the formula for updating the gradient value is: ; ; denotes the learning rate for controlling the update step size; X denotes the sagittal plane rotation angle θ or the cross section rotation angle φ, denotes the gradient value; S34, the above steps are repeated until the total potential energy approaches zero or the rotation angle increment no longer changes.
[0013] Further, the three-dimensional coordinates are obtained by the following steps: A global coordinate system is established, the origin is the center point of the vertebral body G1, the X axis is horizontal forward, the Y axis is vertical right, and the Z axis is vertical upward; A sequential rotation matrix of Z-X-Y is established, wherein the rotation matrix of the X axis is: ; The rotation matrix of the Y axis is: ; In the formula, is the sagittal plane rotation angle of the i-th vertebral body; is the cross section rotation angle of the i-th vertebral body; After conversion by the sequential rotation matrix of Z-X-Y, the three-dimensional coordinates of the initial point cloud are output.
[0014] Further, the Cobb angle is calculated by the following steps: S51, coronal plane projection extraction: project the three-dimensional coordinates of the center of gravity of each vertebral body onto the coronal plane, only keep the Y-axis and Z-axis coordinate values, and form a two-dimensional trajectory point set of the spine on the coronal plane; S52, spinal curvature segmentation identification: on the coronal plane projection, the angle change of the direction of the connecting line of adjacent vertebral bodies is calculated to automatically identify each segment of the spinal curvature: The direction angle of the connecting line of the continuous vertebral bodies from C7 to the sacrum is calculated; the inflection point of the change of the bending direction is identified by the first-order difference of the direction angle; and the spine is divided into a plurality of continuous bending segments according to the inflection point; S53, automatic positioning of key vertebral bodies: for each identified bending segment, three key vertebral bodies required for calculating the Cobb angle are automatically determined: Upper end vertebra: the most inclined vertebral body at the top of the bending segment; Lower end vertebra: the most inclined vertebral body at the bottom of the bending segment; Top vertebra: the vertebral body with the maximum lateral displacement in the bending segment; S54, end plate plane estimation: based on the coordinates of the center of gravity of the vertebral body in three-dimensional space, the direction of the end plate plane of each key vertebral body is estimated: For each key vertebral body, take the center of gravity coordinates of itself and each of the adjacent upper and lower vertebral bodies, obtain a fitting plane through the three center of gravity coordinates, and the normal vector of the fitting plane represents the direction of the end plate; on the coronal plane projection, the end plate line is the intersection line of the fitting plane and the coronal plane; S55, Cobb angle calculation: for each bending segment, its Cobb angle is calculated respectively: A vertical line is made on the upper end plate of the upper end vertebra, and a vertical line is made on the lower end plate of the lower end vertebra; The included angle between the two vertical lines is measured, which is the Cobb angle; S56, multi-bending processing and main bending identification: when there are multiple bends in the spine, the Cobb angle of each bending segment is calculated, the bending angles are compared, the main bending and compensatory bending are identified, the Cobb angle measurement results of all bends are output, and the main bending position is marked; S57, result verification and optimization: based on anatomical constraints, the calculation results are verified, it is checked whether the calculated Cobb angle is within a reasonable physiological range, the logical consistency of the positioning of the key vertebral bodies is verified, and abnormal results are marked.
[0015] The beneficial effects of the present application are: The application first realizes accurate positioning of key points of the spine from a common back image by using an AI vision algorithm, ensures the robustness and medical rationality of two-dimensional information extraction by introducing mechanisms such as spatial attention, multi-scale fusion and curvature consistency loss, and combining anatomical post-processing. Then the spine is abstracted into an energy balance physical model, and the three-dimensional rotation angle of the vertebral body is solved by the LM algorithm optimization, realizing accurate reconstruction of three-dimensional spine morphology from a single two-dimensional image. Finally, based on the three-dimensional model, the bending segmentation, key vertebral body positioning and Cobb angle calculation are automatically completed. The application avoids radiation exposure, significantly reduces the cost and operation threshold, and effectively eliminates subjective errors through full automation, providing a safe, efficient and accurate solution for the screening, diagnosis and follow-up of scoliosis. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to facilitate the understanding of those skilled in the art, the application will be further described below with reference to the accompanying drawings.
[0017] Figure 1 A step schematic diagram of a spine three-dimensional imaging and scoliosis angle calculation method based on an AI vision algorithm provided for an embodiment of the application is shown in Figure 2 A step schematic diagram of back key point detection provided for an embodiment of the application is shown in Figure 3 A step schematic diagram of iterative optimization of an energy balance equation by using an LM algorithm provided for an embodiment of the application is shown in Figure 4 A step schematic diagram of calculating a Cobb angle provided for an embodiment of the application is shown in DETAILED DESCRIPTION
[0018] In order to further illustrate the technical means and effects adopted by the application to achieve the predetermined application purpose, the specific embodiments, structures, features and effects thereof according to the application are described in detail below with reference to the accompanying drawings and preferred embodiments.
[0019] The embodiment provides a spine three-dimensional imaging and scoliosis angle calculation method based on an AI vision algorithm, as shown in Figure 1 The method comprises the following steps: S1, back key point detection: collecting back image data, accurately positioning a plurality of key points of the spine from the back image by inputting a constructed key point detection model, as shown in Figure 2 The method comprises the following steps: S11, constructing a data set: collecting back images of different body types, ages and genders, including image samples of scoliosis patients and normal people, then accurately labeling the key points of the spine according to the anatomical standard by professional personnel, and constructing a data set by preprocessing the labeled sample data.
[0020] The preprocessing includes: The original image samples are subjected to multi-level data enhancement, including geometric transformation, photometric transformation and simulation transformation, and then all the images are uniformly scaled to a predetermined pixel and normalized.
[0021] Specifically, the geometric transformation includes random rotation (±15 degrees), horizontal flip and scale zoom (0.8-1.2 times); the photometric transformation includes brightness, contrast and saturation adjustment; the simulation transformation includes random occlusion and Gaussian noise addition. It can be understood that through rotation and mirroring, more suitable back image samples are generated, and through simulation of various real imaging conditions, the robustness and generalization ability of the model are significantly improved.
[0022] In the embodiment, each image is accurately labeled by professional annotators according to strict anatomical standards, with 21 key points of the spine (numbered 0-20). The labeling order starts from the 7th cervical vertebra (C7) as key point 0, and then along the spinal midline, the thoracic vertebrae T1-T12 (key points 1-12), the lumbar vertebrae L1-L5 (key points 13-17) are labeled in turn, and finally the sacrum region is labeled as key points 18-20. Each key point not only needs to mark the coordinate position, but also needs to mark the visibility state, and special marks are made for the key points that are occluded or blurred.
[0023] S12, key point detection model construction: select the model basic architecture, introduce adaptive feature enhancement and multi-scale information fusion mechanism, adopt progressive learning strategy to complete model construction, including the following steps: Architecture design: based on YOLOv8-pose architecture to build key point detection model, add spatial attention module in feature extraction network, give higher weight to back spine area through learnable parameters; build multi-scale feature pyramid to fuse deep semantic features and shallow detail features; adjust the output layer structure to support simultaneous detection of 21 key points.
[0024] Loss function design: the key point coordinate loss uses smooth L1 loss function to accurately regress the position of each key point; the key point visibility loss uses binary cross entropy loss to handle occlusion and blur; the curvature consistency loss calculates the second difference of the curve formed by the predicted key points to punish abnormal predictions that do not conform to the physiological curvature of the spine. Specifically, the weight ratio of the three losses is 1.0:0.5:0.3.
[0025] Model training: Based on the constructed dataset, the first stage uses a large-scale general human keypoint dataset for pre-training, allowing the model to learn basic human structure and keypoint detection capabilities; the second stage fine-tunes on the back image dataset, focusing on learning back-specific features; the third stage introduces difficult sample mining and curriculum learning, first training easily distinguishable key points (such as C7 and sacrum), and gradually adding intermediate key points. The learning rate uses a warm-up start and cosine annealing strategy, and the batch size is dynamically adjusted according to GPU memory.
[0026] It can be understood that the design of the model architecture, the spatial attention module enables the model to focus on the spine area and suppress background interference; multi-scale feature fusion ensures that key points of different sizes can be accurately detected; the overall architecture maintains the efficiency of YOLO while enhancing the professionalism of spine keypoint detection. The loss function design introduces curvature consistency loss, which uses the natural smoothness of the spine to correct unreasonable predictions. In model training, a total of three stages are performed, and the data division idea to avoid overfitting is adopted through progressive training, and the model is ensured to adapt to the professional field smoothly through phased fine-tuning; curriculum learning simulates the thinking process of doctors diagnosing by first locating obvious markers and then refining confirmation.
[0027] S13, input the collected back image data into the trained keypoint detection model, obtain the prediction result, and perform post-processing optimization based on anatomical guidance.
[0028] Among them, the post-processing optimization based on anatomical guidance includes: Triple post-processing optimization is performed on the model's original prediction: first, apply B-spline curve-based spine midline fitting to smooth the predicted points and eliminate jump abnormal points; second, implement keypoint order verification to ensure spatial order consistency from top to bottom, and reorder points with abnormal order; finally, perform adjacent keypoint distance reasonableness check and correct points with abnormal distance through linear interpolation.
[0029] It can be understood that the anatomical constraint is equivalent to adding "medical common sense" to the model's prediction, ensuring that even in some inaccurate keypoint predictions, the overall spine curve still conforms to the physiological law. This post-processing significantly improves the clinical usability of the results.
[0030] The back key point detection automatically and accurately locates the anatomical key points of the spine in a two-dimensional back image through an AI model. By constructing a professional data set, designing a special model architecture combining spatial attention and multi-scale feature fusion, and introducing mechanisms such as curvature consistency loss, the accuracy of key point detection and the robustness to complex situations such as occlusion are ensured. Finally, through post-processing optimization based on anatomical knowledge, the prediction results are further corrected to conform to the physiological curvature rules of the spine. The standardized and high-precision spine contour data is extracted from ordinary images, laying a reliable data foundation for subsequent three-dimensional reconstruction.
[0031] S2, construct an energy balance spine model: represent the entire spine model as an energy balance system, wherein each vertebral body is represented as a mass G, and each intervertebral disc is represented as an elastic body A, and the connection point of the elastic body A is located at the geometric center of the vertebral body; then map the spine key points to the spine model to establish the energy balance equation of gravity and elastic potential energy.
[0032] The entire spine model is represented as an energy balance system, comprising the following steps: The spine model is constructed by constructing n (20) vertebral bodies and n-1 (19) intervertebral discs between G1 and Gn; (the first vertebral body is denoted as G1, and the last vertebral body is denoted as Gn; the first elastic body A1 represents the intervertebral disc between the vertebral bodies G1 and G2, and the same applies to the subsequent elastic bodies).
[0033] In the energy balance system, the elastic coefficient ki of the elastic body is defined by the anatomical constant, and the initial size of the elastic body is equal to the height of the corresponding intervertebral disc; Based on the deformation (compression or stretching) of the elastic body caused by the gravity of the vertebral body, the energy balance equation of gravity and elastic potential energy is established.
[0034] It should be noted that the spine model represents the spine as an elastic geometric transformation between a vertebral body, an intervertebral disc, and another vertebral body. In the energy balance system, the elastic body deforms (compresses or stretches) under the action of the gravity of the vertebral body, and the gravity and the elastic potential energy can offset each other to achieve energy balance. The spine model incorporates average anatomical information such as vertebral endplate width, depth, vertebral height, and also includes intervertebral disc height and elastic coefficient (ki). The elastic coefficient ki of the intervertebral disc is the same for the elastic body A of the same intervertebral disc, and the initial size of the elastic body is equal to the height of the corresponding intervertebral disc. The core assumption of the spine model is that when the spine is arranged along the vertebral body, the biological stretch posture will grow in the direction of least body effort, i.e. the gravity and the elastic potential energy tend to balance or the total potential energy is minimized.
[0035] The mapping of the spine key points to the spine model comprises the following steps: A global coordinate system is established, with the origin being the center point of the vertebral body G1, the X-axis being horizontal and forward (sagittal plane forward), the Y-axis being vertical and right (coronal plane right), and the Z-axis being vertical and upward (spinal line); The spinal key points correspond to the center projection positions of the vertebral bodies on the coronal plane (numbered 0-20), that is, the coordinates of the Y-axis (coronal plane right) and the Z-axis (spinal line); The obtained several spinal key points are used as initial point cloud coordinates to build a spinal model on the coronal plane.
[0036] This step maps the identified two-dimensional key points to a simplified three-dimensional physical model that conforms to the principles of biomechanics. The model abstracts the spine as a chain system composed of vertebral bodies (mass blocks) and intervertebral discs (elastic bodies), and establishes an energy balance equation based on the core assumption that the gravitational potential energy of the spine in the relaxed posture and the elastic potential energy of the intervertebral disc tend to be balanced. By using the key points as the initial projection of the model on the coronal plane and injecting average anatomical constants such as vertebral body size, intervertebral disc height and elastic coefficient into the model, the two-dimensional information is given three-dimensional physical meaning, and the visual problem is converted into a solvable physical energy optimization problem.
[0037] S3, energy balance equation optimization: the LM algorithm is used to iteratively optimize the energy balance equation, including the energy balance equation of the spinal model on the sagittal plane and the cross section, wherein: The energy balance equation of the spinal model on the sagittal plane is represented as: ; In the formula, E o is the total potential energy, E g is the gravitational potential energy; E t is the elastic potential energy; m i is the mass of the vertebral body; h i is the height of the center of gravity of the vertebral body; k j is the elastic potential energy; δ j is the deformation of the intervertebral disc; θ is the sagittal plane rotation angle; and the sagittal plane rotation angles of the vertebral bodies G1 and Gn are preset. The LM algorithm is used to optimize the sagittal plane rotation angle of each vertebral body, and the constraint condition is that the maximum rotation angle θ of the sagittal plane is ±45°. The energy balance equation of the spinal model on the cross section is represented as: ; In the formula, φ is the cross section rotation angle, and the gravitational potential energy of the sagittal plane is the same as that of the cross section.
[0038] The LM algorithm is used to optimize the rotation angle of each vertebral body on the cross section, and the constraint condition is that the maximum rotation angle φ of the cross section is ±25°.
[0039] It should be noted that the goal of the energy balance equation optimization is to find the way of building the center of gravity of the vertebrae along the spine line, so that the whole spine model tends to energy balance, that is, the total potential energy is minimized. In this step, the vertebrae G1 and Gn are not forced to be fixed at a certain rotation angle (their initial rotation is 0°), because the rotation of the cross section is usually not as obvious as the sagittal plane. During the iterative optimization process of the LM algorithm, preset constraints are applied, including the maximum rotation angle of the vertebrae in the sagittal plane ± 45° and the maximum rotation angle of the vertebrae in the cross section ± 25°, which are considered to be sufficient extreme but include all possible rotation ranges.
[0040] In this embodiment, the sagittal plane rotation angle of the vertebrae G1 is , and the sagittal plane rotation angle of the vertebrae Gn is ; these angles are based on the data values obtained from human anatomy statistics, the pelvic tilt angle of the vertebrae G1 is , and the cervical curvature of the vertebrae Gn is .
[0041] The iterative optimization of the energy balance equation using the LM algorithm, as shown in Figure 3 , includes the following steps: S31, converting the total potential energy minimization optimization process of the energy balance equation into a least squares problem; S32, using the Jacobian matrix to analyze and calculate the gradient value of the total potential energy with respect to each rotation angle to guide the optimization direction; S33, using the gradient value to update the independent variable data, increasing the gradient when the residual error is greater than the set range (stabilizing iteration), and decreasing the gradient when the residual error is reduced to the set range (accelerating accuracy), the formula for updating the gradient value is: ; ; X represents the sagittal plane rotation angle θ or the cross section rotation angle φ, represents the gradient value; S34, repeat the above steps until the total potential energy approaches zero or the rotation angle increment no longer changes.
[0042] The energy balance equation optimization aims to solve the three-dimensional spatial posture of each vertebra that minimizes the total potential energy of the spine model through a numerical optimization algorithm. It writes the energy balance equations on the sagittal plane and cross section, and uses the Levenberg-Marquardt (LM) algorithm for iterative optimization. Under the condition of meeting the physiological limits of the human body (such as rotation angle constraints), the rotation angles of each vertebra in the sagittal plane and cross section are calculated. This process achieves the "inference" of dynamic three-dimensional spine morphology from static two-dimensional images and physical assumptions, realizing the conversion from 2D to 3D.
[0043] S4, obtaining three-dimensional coordinates: based on the sagittal and cross-sectional rotation angles of the center of gravity of each vertebra obtained by approaching the total potential energy, the three-dimensional coordinates of the center of gravity of each vertebra are calculated by combining and rotating the matrix, including the following steps: A global coordinate system is established, with the origin being the center point of vertebra G1, the X-axis being horizontal and forward (sagittal plane forward), the Y-axis being vertical and right (cross-sectional plane right), and the Z-axis being vertical and upward (spine line); A Z-X-Y sequential rotation matrix is established, wherein the rotation matrix of the X-axis (sagittal plane) is: ; The rotation matrix of the Y-axis (cross-sectional plane) is: ; In the formula, is the sagittal plane rotation angle of the i-th vertebra; is the cross-sectional plane rotation angle of the i-th vertebra; After Z-X-Y sequential rotation matrix conversion, the three-dimensional coordinates of the initial point cloud are output.
[0044] Obtaining three-dimensional coordinates converts the vertebra rotation angles obtained by optimization into three-dimensional coordinates of the center of gravity of each vertebra in the global coordinate system through strict coordinate transformation. By defining a Z-X-Y sequential rotation matrix and sequentially applying the sagittal and cross-sectional rotation angles of each vertebra, the complete three-dimensional point cloud data of the spine is finally output, which realizes the specificization of abstract rotation angle parameters into three-dimensional spatial coordinates with clear geometric meaning, and generates a three-dimensional spine model that can be used for further analysis and visualization.
[0045] S5, calculating the Cobb angle: calculating the Cobb angle according to the three-dimensional coordinates of the center of gravity of each vertebra, as shown in the formula: Figure 4 including the following steps: S51, coronal plane projection extraction: projecting the three-dimensional coordinates of the center of gravity of each vertebra onto the coronal plane (Y-Z plane), retaining only the Y-axis (left-right direction) and Z-axis (up-down direction) coordinate values, forming a two-dimensional trajectory point set of the spine on the coronal plane; It can be understood that the projection plane here is completely consistent with the global coordinate system established in S2 (the Y-axis coronal plane faces right, and the Z-axis spinal line is vertically upward), ensuring the uniformity of the data coordinate system throughout the process.
[0046] S52, Spine bending segment identification: On the coronal plane projection, by calculating the angle change of the direction of the adjacent vertebrae connecting line, the bending segments of the spine are automatically identified: Calculate the direction angle of the connecting line between the continuous vertebrae from C7 (key point 0) to the sacrum (key point 20); identify the inflection point of the bending direction change by the first-order difference of the direction angle; divide the spine into multiple continuous bending segments (such as thoracic bending, lumbar bending) according to the inflection point.
[0047] S53, Automatic positioning of key vertebrae: For each identified bending segment, automatically determine the three key vertebrae required for calculating the Cobb angle: Upper end vertebra: the most inclined vertebra at the top of the bending segment; Lower end vertebra: the most inclined vertebra at the bottom of the bending segment; Top vertebra: the vertebra with the maximum lateral displacement in the bending segment.
[0048] It should be noted that the positioning criteria for key vertebrae are: Upper end vertebra: the inclination direction of the vertebra above it begins to reverse; Lower end vertebra: the inclination direction of the vertebra below it begins to reverse; Top vertebra: the vertebra with the maximum absolute value of Y coordinate in the bending segment.
[0049] S54, End plate plane estimation: Based on the coordinates of the center of gravity of the vertebrae in three-dimensional space, estimate the direction of the end plate plane of each key vertebra: For each key vertebra, take the center of gravity coordinates of itself and its adjacent upper and lower vertebrae, obtain a fitting plane through the three center of gravity coordinates, and the normal vector of the fitting plane represents the direction of the end plate; on the coronal plane projection, the end plate line is the intersection line of the fitting plane and the coronal plane.
[0050] S55, Cobb angle calculation: For each bending segment, calculate its Cobb angle respectively: Draw a vertical line on the upper end plate of the upper end vertebra, and draw a vertical line on the lower end plate of the lower end vertebra; Measure the included angle between the two vertical lines, which is the Cobb angle of the bending.
[0051] S56, Multi-bending processing and main bending identification: When there are multiple bends in the spine, calculate the Cobb angle of each bending segment respectively, compare the bending angle sizes, identify the main bending (the bending with the largest angle) and the compensatory bending, output the Cobb angle measurement results of all bends, and mark the main bending position.
[0052] S57, result verification and optimization: based on anatomical constraints, the calculation result is verified, it is checked whether the calculated Cobb angle is in the reasonable physiological range, the logical consistency of key vertebra positioning is verified, and abnormal results are marked.
[0053] It should be noted that the Cobb angle is used to evaluate the degree of coronal scoliosis (the larger the angle, the more serious the lateral curvature); in the evaluation of scoliosis, the coronal plane is used to observe the left and right lateral curvature of the spine (Cobb angle measurement); the sagittal plane of the spine is used to evaluate the physiological curvature of the spine, including cervical lordosis, thoracic kyphosis, lumbar lordosis and sacral kyphosis; the trunk rotation angle (ATR) is used to quantify the degree of rotation of the spine in the horizontal plane (cross section).
[0054] Based on the generated three-dimensional spine model, the Cobb angle measurement is automatically completed, the three-dimensional coordinates are projected to the coronal plane, the curved segment is automatically identified, the key vertebrae (upper end vertebra, lower end vertebra, top vertebra) are positioned, and the end plate plane direction is estimated, and finally the Cobb angle of each curvature is calculated and verified, realizing the quantitative, objective and repeatable evaluation of the degree of scoliosis.
[0055] The present application first realizes the accurate positioning of the key points of the spine from the ordinary back image by using the AI vision algorithm, introduces the spatial attention, multi-scale fusion and curvature consistency loss mechanism, and combines the anatomical post-processing, to ensure the robustness and medical rationality of the two-dimensional information extraction. Then the spine is abstracted as an energy balance physical model, and the three-dimensional rotation angle of the vertebra is solved by the LM algorithm optimization, realizing the accurate reconstruction of the three-dimensional spine shape from a single two-dimensional image. Finally, the bending segmentation, key vertebra positioning and Cobb angle calculation are automatically completed based on the three-dimensional model. This method avoids radiation exposure, significantly reduces the cost and operation threshold, and effectively eliminates the subjective error in the whole process of automation, providing a safe, efficient and accurate solution for the screening, diagnosis and follow-up of scoliosis.
[0056] The application trains an AI vision model dedicated to back images to accurately detect a series of key points distributed along the midline of the spine from a single two-dimensional back image; then maps these two-dimensional key points as initial constraints to a physical model that abstracts the spine as a "vertebral body-intervertebral disc" mass-elastic body chain, and establishes an energy balance equation based on the biomechanical principle that "the total potential energy of the spine in the relaxed posture is minimum"; then uses an optimization algorithm to solve the equation to inverse the rotation angle of each vertebral body in the sagittal plane and cross section, thereby reasoning the three-dimensional space posture conforming to the physical law from the two-dimensional information; finally, based on the reconstructed three-dimensional model, the Cobb angle is measured automatically and objectively by automatic projection, identification of curved segments, positioning of key vertebral bodies and calculation of the included angle of the endplate line.
[0057] The above is only a preferred embodiment of the present application, and does not limit the present application in any form. Although the present application has been disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any person skilled in the art can make some changes or modifications to the above disclosed technical content without departing from the scope of the present application, and any equivalent embodiments with equivalent changes are also within the scope of the present application. Any modification, change, equivalent change and modification of the above embodiments, which do not depart from the technical essence of the present application, are still within the scope of the present application.
Claims
1. A spine three-dimensional imaging and lateral curvature angle calculation method based on an AI vision algorithm, characterized in that: The method comprises the following steps: Back key point detection: collect back image data, and locate a plurality of spine key points from the back image by inputting a constructed key point detection model; Construct an energy balance spine model: represent the spine model as an energy balance system, wherein each vertebral body is represented as a mass G, and each intervertebral disc is represented as an elastic body A, and the connection point of the elastic body A is located at the geometric center of the vertebral body; then map the spine key points to the spine model to establish an energy balance equation of gravity and elastic potential energy; Energy balance equation optimization: iteratively optimize the energy balance equation using the LM algorithm, including the energy balance equation of the spine model in the sagittal plane and the cross-sectional plane; Obtain three-dimensional coordinates: based on the cross-sectional and sagittal plane rotation angles of the center of gravity of each vertebral body obtained by the total potential energy tending to zero, the three-dimensional coordinates of the center of gravity of each vertebral body are calculated by combining the rotation matrix; Calculate the Cobb angle: calculate the Cobb angle according to the three-dimensional coordinates of the center of gravity of each vertebral body.
2. The AI vision algorithm-based spine three-dimensional imaging and lateral curvature angle calculation method according to claim 1, characterized in that: The back key point detection comprises the following steps: Construct a data set: collect back images of different body types, ages, and genders, including image samples of scoliosis patients and normal people, then label the spine key points according to anatomical standards by professional personnel, and pre-process the labeled sample data to construct a data set; Key point detection model construction: select a model base architecture, introduce adaptive feature enhancement and multi-scale information fusion mechanism, and complete model construction using a progressive learning strategy; Input the collected back image data into the trained key point detection model, obtain the prediction result, and perform post-processing optimization based on anatomical guidance on the prediction result.
3. The AI vision algorithm-based spine three-dimensional imaging and lateral curvature angle calculation method according to claim 2, characterized in that: The pre-processing comprises: Perform multi-level data enhancement on the original image samples, including geometric transformation, photometric transformation, and simulation transformation, then uniformly scale all images to a predetermined pixel and complete normalization processing; The post-processing optimization based on anatomical guidance comprises: Firstly, apply a spine midline fitting based on a B-spline curve to smooth the predicted points and eliminate abnormal points; then implement key point sequence verification to ensure spatial sequence consistency from top to bottom, and reorder the points with abnormal sequence; finally, perform adjacent key point distance rationality check, and correct the points with abnormal distance through linear interpolation.
4. The AI vision algorithm-based spine three-dimensional imaging and lateral curvature angle calculation method according to claim 3, characterized in that: The key point detection model construction comprises the following steps: Architecture design: construct a key point detection model based on YOLOv8-pose architecture, add a spatial attention module to the feature extraction network to give higher weight to the back spine area through learnable parameters; construct a multi-scale feature pyramid to fuse deep semantic features and shallow detail features; adjust the output layer structure to support simultaneous detection of 21 key points; Loss function design: use a smooth L1 loss function for key point coordinate loss to regress the position of each key point; use a binary cross-entropy loss for key point visibility loss to handle occlusion and blur; calculate the second-order difference of the curve formed by the predicted key points to punish abnormal predictions that do not conform to the physiological curvature of the spine. Model training: Based on the constructed dataset, the first stage uses a large-scale general human key point dataset for pre-training; the second stage fine-tunes on the back image dataset, focusing on learning back-specific features; the third stage introduces difficult sample mining and curriculum learning, first training easily distinguishable key points, and gradually adding intermediate key points.
5. The AI vision algorithm-based spine three-dimensional imaging and lateral curvature angle calculation method according to claim 1, characterized in that: The step of representing the spine model as an energy balance system comprises the following steps: The spine model is constructed by building n vertebral bodies and n-1 intervertebral discs between G1 and Gn; In the energy balance system, the elastic coefficient ki of the elastic body is defined by the anatomical constant, and the initial size of the elastic body is equal to the height of the corresponding intervertebral disc; Based on the deformation of the elastic body caused by the gravity of the vertebral body, the energy balance equation of gravity and elastic potential energy is established.
6. The AI vision algorithm-based spine three-dimensional imaging and lateral curvature angle calculation method according to claim 1, characterized in that: The step of mapping the spine key points to the spine model comprises the following steps: A global coordinate system is established, with the origin being the center point of the vertebral body G1, the X-axis being horizontal and forward, the Y-axis being vertical and right, and the Z-axis being vertical and upward; The spine key points correspond to the center projection position of the vertebral body on the coronal plane; The obtained several spine key points are used as initial point cloud coordinates to build the spine model on the coronal plane.
7. The AI vision algorithm-based spine three-dimensional imaging and lateral curvature angle calculation method according to claim 1, characterized in that: The energy balance equation of the spine model on the sagittal plane and the cross section, wherein the energy balance equation of the spine model on the sagittal plane is represented as: ; where E o is the total potential energy, E g is the gravitational potential energy; E t is the elastic potential energy; m i is the mass of the vertebral body; h i is the height of the center of gravity of the vertebral body; k j is the elastic potential energy; δ j is the deformation of the intervertebral disc; θ is the sagittal rotation angle; and the sagittal rotation angles of the vertebral bodies G1 and Gn are preset. The LM algorithm is used to optimize the sagittal plane rotation angle of each vertebral body, and the constraint condition is set as the maximum rotation angle θ of the sagittal plane being ±45°; The energy balance equation of the spine model on the cross section is represented as: ; In the formula, φ is the cross section rotation angle, and the gravity potential energy of the sagittal plane is the same as that of the cross section.
8. The AI vision algorithm-based spine three-dimensional imaging and lateral curvature angle calculation method according to claim 1, characterized in that: The step of iteratively optimizing the energy balance equation using the LM algorithm comprises the following steps: The total potential energy minimization optimization process of the energy balance equation is converted into a least squares problem; The gradient value of the total potential energy with respect to each rotation angle is calculated using the Jacobian matrix analysis; The gradient value is updated using the formula: ; ; denotes a learning rate for controlling an update step size; X denotes a sagittal plane rotation angle θ or a transverse plane rotation angle φ, denotes a gradient value; The above steps are repeated until the total potential energy tends to zero or the rotation angle increment no longer changes. 9.The AI vision algorithm-based spine three-dimensional imaging and lateral bending angle calculation method according to claim 1, characterized in that: The step of obtaining three-dimensional coordinates comprises the following steps: A global coordinate system is established, with the origin being the center point of the vertebral body G1, the X-axis being horizontal and forward, the Y-axis being vertical and right, and the Z-axis being vertical and upward; A sequential rotation matrix Z-X-Y is established, wherein the rotation matrix of the X-axis is: ; The rotation matrix of the Y-axis is: ; wherein is the sagittal plane rotation angle of the i-th vertebral body; is the cross-sectional rotation angle of the i-th vertebral body; After conversion by the sequential rotation matrix Z-X-Y, the three-dimensional coordinates of the initial point cloud are output.
10. The AI vision algorithm-based spinal three-dimensional imaging and lateral curvature angle calculation method according to claim 1, characterized in that: The step of calculating the Cobb angle comprises the following steps: Coronal plane projection extraction: Projecting the three-dimensional coordinates of the center of gravity of each vertebral body onto the coronal plane, retaining only the Y-axis and Z-axis coordinate values, and forming a two-dimensional trajectory point set of the spine on the coronal plane; Spine curvature segmentation identification: On the coronal plane projection, the direction angle change of the connecting line of adjacent vertebral bodies is calculated to automatically identify each segment of the spine curvature: The direction angle of the connecting line between consecutive vertebral bodies from C7 to the sacrum is calculated; the inflection point of the change in curvature direction is identified by first-order difference of the direction angle; and the spine is divided into multiple continuous curvature segments according to the inflection point. Key vertebrae automatic positioning: For each identified curved segment, automatically determine the three vertebrae needed to calculate the Cobb angle: Upper end vertebra: the most tilted vertebra at the top of the curved segment; Lower end vertebra: the most tilted vertebra at the bottom of the curved segment; Apex vertebra: the vertebra with the largest lateral displacement in the curved segment; Endplate plane estimation: Based on the coordinates of the center of gravity of the vertebrae in three-dimensional space, estimate the direction of the endplate plane of each key vertebra: For each key vertebra, take the center of gravity coordinates of itself and its adjacent upper and lower vertebrae, obtain a fitting plane through the three center of gravity coordinates, and the normal vector of the fitting plane represents the direction of the endplate; On the coronal projection, the endplate line is the intersection line of the fitting plane and the coronal plane; Cobb angle calculation: For each curved segment, calculate its Cobb angle respectively: Draw a vertical line on the upper endplate of the upper end vertebra, and draw a vertical line on the lower endplate of the lower end vertebra; Measure the included angle between the two vertical lines, which is the Cobb angle; Multiple curve processing and main curve identification: When there are multiple curves in the spine, calculate the Cobb angle of each curved segment respectively, compare the angles of each curve, identify the main curve and compensatory curve, output the Cobb angle measurement results of all curves, and mark the position of the main curve; Result verification and optimization: Based on anatomical constraints, verify the calculation results, check whether the calculated Cobb angle is within the reasonable physiological range, verify the logical consistency of the key vertebra positioning, and mark the abnormal results.