Method and system for grading relationship between lumbar disc herniation and nerve root compression based on visual transformer
The method of grading the relationship between lumbar disc herniation and nerve root compression based on visual Transformer solves the problems of low efficiency and inconsistent results in the traditional diagnosis of lumbar spine diseases, and realizes rapid and accurate automatic grading, reducing the diagnostic burden on doctors.
Patent Information
- Application Number
- CN202310192008.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2043-03-02
AI Technical Summary
Traditional methods for diagnosing lumbar spine diseases are inefficient, rely on specialized doctors, and produce inconsistent results, failing to meet the rapidly growing demand for medical imaging data.
A visual Transformer-based method for classifying the relationship between lumbar disc herniation and nerve root compression was adopted, including ROI extraction, data augmentation, dilated convolution embedding, Swing Transformer network training, deformable attention Transformer module, and Softmax classification, to achieve automatic classification of the relationship between lumbar disc herniation and nerve root compression.
It improves the accuracy and efficiency of classifying the relationship between lumbar disc herniation and nerve root compression, reduces the diagnostic burden on doctors, and enhances the automation level of the diagnostic system.
Smart Images

Figure CN116310523B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of deep learning and computer vision, and in particular to a method and system for classifying the relationship between lumbar disc herniation and nerve root compression based on a visual Transformer. Background Technology
[0002] Lumbar spine diseases are very common and have a high incidence rate in clinical practice. Clinically, lumbar spine diseases are mainly detected through lumbar spine X-rays, CT scans, and magnetic resonance imaging (MRI). Among these, MRI does not cause ionizing radiation damage to the human body. By imaging soft tissues such as nerves and muscles, it can clearly show the degree of lumbar intervertebral disc degeneration, the degree and direction of disc herniation, and the compression of nerves within the spinal canal. It can also rule out intraspinal tumors, making it highly valuable for the diagnosis of lumbar spine diseases. Lumbar disc herniation is a chronic lumbar spine disease that initially goes unnoticed and can lead to sequelae such as lumbar muscle strain, lower limb muscle atrophy, and other complications. Lumbar disc herniation can also irritate or compress the spinal cord and spinal nerve roots, causing corresponding neurological symptoms. Studying the relationship between lumbar disc herniation and nerve root compression can help doctors understand the severity of a patient's condition and provide a reference for developing a treatment plan.
[0003] Traditional diagnostic methods primarily rely on medical image scanning and interpretation by specialist physicians. This process is extremely slow, and the rapid increase in medical image data, coupled with the slow pace of physician training, leads to mounting diagnostic pressure on doctors. Deep learning-based diagnostic methods enable data-driven automatic feature extraction, achieving automated disease diagnosis. Furthermore, deep learning-based intelligent assisted diagnostic systems are widely used in the medical field, and their diagnostic accuracy for many diseases has surpassed that of clinicians. Developing a deep learning-based automated diagnostic system for lumbar spine diseases can not only reduce the ever-increasing workload of radiologists but also enhance the utilization value of medical image data, holding significant importance for clinical applications. Summary of the Invention
[0004] This invention addresses the challenges of grading the relationship between lumbar disc herniation and nerve root compression, which requires a high level of clinical experience from physicians. It also addresses the issues of rapidly increasing medical imaging data coupled with a relative shortage of qualified physicians, leading to increased diagnostic pressure and inconsistent diagnostic results. The invention proposes a visual Transformer-based method and system for grading the relationship between lumbar disc herniation and nerve root compression. This system can accurately, efficiently, and quickly grade the relationship between lumbar disc herniation and nerve root compression, reducing diagnostic pressure on physicians while simultaneously improving diagnostic efficiency and accuracy.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] This invention proposes a grading method for the relationship between lumbar disc herniation and nerve root compression based on visual Transformer, comprising the following five steps:
[0007] Step (1): First, the region of interest is extracted from the lumbar MRI image of the T2 axis using the ROI box marked by the doctor. The region of interest image is then extracted, and data enhancement and normalization are performed to finally obtain an image of size 224×224×3.
[0008] Step (2): Then, the image normalized in step (1) is subjected to dilated convolution embedding operation. The feature image changes from 224×224×3 to 56×56×D, where D is the embedding dimension. Next, the feature image is divided into windows and flattened into a feature sequence and fed into the Swing Transformer network for training.
[0009] Step (3): When training the Swing Transformer network, deep dilated convolutional mapping is used to generate query, key and value, and then multi-head self-attention is calculated.
[0010] Step (4): When training the network, add a deformable attention Transformer module for training. Insert the deformable attention Transformer module into different stages of the Swin Transformer model and obtain new attention features through training the deformable attention Transformer module.
[0011] Step (5): The final feature vector is fed into the classification head of the two fully connected layers, and then Softmax classification is performed to obtain the grading results of the relationship between lumbar disc herniation and nerve root compression.
[0012] Further, step (1) includes:
[0013] After extracting the region of interest from the original grayscale image, the region of interest image is converted into an RGB image, and then data augmentation is performed, including random cropping, random horizontal flipping, random vertical flipping, random rotation from -10 to 10 degrees, rotation of 180 degrees, contrast enhancement of 1 to 1.5 times, and brightness change of 0.7 to 1.3. Then, normalization is performed to convert the region of interest image into an image of size 224×224×3.
[0014] Furthermore, the dilated convolution embedding operation described in step (2) is implemented by designing an overlapping stack of dilated convolution layers. After the dilated convolution embedding operation, the feature map size changes from 224×224×3 to 56×56×D.
[0015] Furthermore, the dilated convolution embedding operation is designed as follows: First, the 224×224×3 image is passed through a first-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 2 to obtain a feature map of size 112×112×D / 2, which is then batch normalized and ReLU activated. The 112×112×D / 2 feature map is then fed into a second-layer ordinary convolution with a kernel size of 3×3 and a stride of 1 to obtain a new feature map with the same size, which is also batch normalized and ReLU activated. Finally, the new feature map is fed into a third-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 1 to obtain a feature map of size 56×56×D as the output.
[0016] The Swin Transformer divides the original image into blocks and windows, transforming these blocks into sequences of tokens through linear embedding. Attention is then calculated to enable information exchange between these tokens. This method replaces the original linear embedding with dilated convolutional embedding. This aims to introduce the advantages of CNNs, such as translation, scaling, and rotation invariance, into the Transformer, giving it the ability to model local spatial context information similar to CNNs, while retaining the Transformer's advantage in modeling global context information. This allows the model to better focus on both global and local information, improving network performance.
[0017] Furthermore, in step (3), the deep dilated convolution mapping operation is designed by first flattening the feature map based on the window size, then performing a deep dilated convolution mapping operation with a kernel size of 3×3, an expansion rate of 2, and group convolution to generate a sequence of query, kay, and value, and then performing self-attention calculation to obtain a new attention feature map.
[0018] In window-based attention computation, a sequence of query, key, and value is first generated by performing a depthwise dilated convolution mapping operation with a 3×3 kernel and a dilation rate of 2. Finally, self-attention is calculated to obtain the attention feature map. The advantage of this approach is that it improves the self-attention computation of the original model. By introducing local convolution into the Transformer, it further enhances the information interaction within the tokens, thereby improving the performance of the visual Swing Transformer.
[0019] Furthermore, the deformable attention Transformer module described in step (4) mainly uses the query features as input through the position offset network when calculating attention, and generates corresponding position offsets for all reference points. Then, the features are mapped to the key and value values. When training the Swin Transformer network in four stages, the deformable attention Transformer module is added in the second and third stages. New attention features are obtained through training the deformable attention Transformer module.
[0020] A deformable attention Transformer module is added to the Swing Transformer. For each deformable attention Transformer module, when performing attention calculation through the layer normalization layer, the reference points are first generated as a uniform grid, which is the same in the input data. Then, the position offset network takes the query features as input and generates corresponding position offsets for all reference points. Then, bilinear interpolation is used for feature sampling, and the sampled features are mapped to key and value. In this way, the candidate key and value are transferred to the important region, thereby enhancing the flexibility and efficiency of the self-attention module and capturing more information features.
[0021] Another aspect of this invention proposes a grading system for the relationship between lumbar disc herniation and nerve root compression based on a visual Transformer, comprising:
[0022] The image preprocessing unit is used to extract the region of interest from the T2-axis lumbar MRI image using the labeled ROI box, extract the ROI image, and then perform data augmentation and normalization processing.
[0023] The dilated convolution embedding unit is used to perform dilated convolution embedding operation on the image normalized by the image preprocessing unit, projecting the feature image onto the embedding dimension D. Next, the feature image is divided into windows and fed into the Swing Transformer network for training.
[0024] The deep dilated convolution mapping unit is used to perform deep dilated convolution mapping within a divided window during the training of the Swing Transformer network, and then to calculate multi-head self-attention.
[0025] The deformable attention computation unit is used to add a deformable attention Transformer module during network training to obtain new attention features;
[0026] The grading result unit is used to feed the finally obtained feature vector into the classification head, and then obtain the grading result of the relationship between lumbar disc herniation and nerve root compression through Softmax classification.
[0027] Furthermore, the image preprocessing unit is specifically used for:
[0028] After extracting the region of interest from the original grayscale image, the region of interest image is converted into an RGB image, and then data augmentation is performed, including random cropping, random horizontal flipping, random vertical flipping, random rotation, 180-degree rotation, contrast enhancement, and brightness variation. Then, normalization is performed to convert the region of interest image into a 224×224×3 image.
[0029] Furthermore, the dilated convolution embedding operation is implemented by designing an overlapping stack of dilated convolutional layers. After the dilated convolution embedding operation, the feature map size changes from 224×224×3 to 56×56×D.
[0030] Furthermore, the dilated convolution embedding operation includes:
[0031] First, the 224×224×3 image is passed through a first-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 2 to obtain a feature map of size 112×112×D / 2, which is then batch normalized and ReLU activated. The 112×112×D / 2 feature map is then fed into a second-layer ordinary convolution with a kernel size of 3×3 and a stride of 1 to obtain a new feature map with the same size, which is also batch normalized and ReLU activated. The new feature map is then fed into a third-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 1 to obtain a feature map of size 56×56×D as the output.
[0032] Furthermore, the depthwise dilated convolutional mapping unit is specifically used for:
[0033] The 56×56×D feature map obtained by the dilated convolution embedding unit is divided into windows, and query, key, and value are generated through a deep dilated convolution mapping layer. Attention is then obtained based on the window and the shifted window.
[0034] Furthermore, the deformable attention calculation unit is specifically used for:
[0035] Deformable attention Transformer modules are inserted at different training stages of the network model, and new attention features are obtained through training with the deformable attention Transformer modules.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] 1. The dilated convolution embedding proposed in this invention uses overlapping dilated convolutional layers for embedding at the network input. The advantage of this approach is that it introduces the advantages of CNNs, such as translation, scaling, and rotation invariance, into the Transformer, enabling the Transformer to also have the ability to model local spatial context information similar to CNNs, while retaining the advantages of the Transformer, allowing the model to better focus on global and local information and improve network performance.
[0038] 2. The deep dilated convolutional mapping proposed in this invention. In window-based attention calculation, a sequence of query, key, and value is first generated through deep dilated convolutional mapping, and finally self-attention is calculated to obtain the attention feature map. The advantage of this approach is that it improves the self-attention calculation of the original model. By introducing local convolution into the Transformer, it further improves the information interaction within the tokens, thereby improving the performance of the visual Swing Transformer.
[0039] 3. The Deformable Attention Transformer Module introduced in this invention. The Deformable Attention Transformer Module mainly uses a position offset network to take query features as input and generate corresponding position offsets for all reference points. Then, the features are mapped to key and value, thus transferring candidate key and value to important regions, thereby enhancing the flexibility and efficiency of the self-attention module and enabling it to capture more information features. Attached Figure Description
[0040] Figure 1 This is a flowchart of a method for grading the relationship between lumbar disc herniation and nerve root compression based on visual Transformer, according to an embodiment of the present invention.
[0041] Figure 2 This is a schematic diagram of dilated convolution embedding according to an embodiment of the present invention;
[0042] Figure 3 This is a schematic diagram of depth-dilated convolution mapping according to an embodiment of the present invention;
[0043] Figure 4 This is a schematic diagram of the deformable attention Transformer module in an embodiment of the present invention.
[0044] Figure 5 This is a schematic diagram of the architecture of a grading system for the relationship between lumbar disc herniation and nerve root compression based on a visual Transformer, according to an embodiment of the present invention. Detailed Implementation
[0045] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:
[0046] like Figure 1 As shown, a grading method for the relationship between lumbar disc herniation and nerve root compression based on visual Transformer includes:
[0047] Step S101: First, the doctor marks the ROI box on the entire lumbar spine MRI T2 axial image, and then extracts the region of interest according to the doctor's markings, and cuts out the region of interest image to reduce the interference of irrelevant background factors.
[0048] Specifically, in practical applications, lumbar MRI images captured by the equipment contain a large amount of background information unrelated to the grading process, in addition to the lumbar region itself. This irrelevant information introduces interference, further increasing the difficulty of grading the relationship between lumbar disc herniation and nerve root compression. Therefore, image preprocessing is essential before network training, as it directly affects the accuracy of the grading results.
[0049] Given the limited amount of existing medical data, it is difficult to train a model with good generalization performance. Therefore, it is necessary to augment the data. The main methods are as follows:
[0050] The extracted region of interest image is augmented with data including random cropping, random horizontal flipping, random vertical flipping, random rotation from -10 to 10 degrees, random rotation of 180 degrees, contrast enhancement of 1 to 1.5 times, brightness variation from 0.7 to 1.3, and finally normalization to obtain an image of size 224×224×3.
[0051] Step S102: Then, the image normalized in step S101 is subjected to dilated convolution embedding operation, and the feature image is changed from 224×224×3 to 56×56×D, where D is the embedding dimension. Next, the feature image is divided into windows and flattened into a feature sequence and fed into the Swing Transformer network for training.
[0052] Specifically, overlapping dilated convolutions are used to extract low-level feature information. The purpose of this is to introduce the advantages of CNNs, such as translation, scaling, and rotation invariance, into Transformer, so that Transformer also has the ability to model local spatial context information similar to CNN, while retaining the advantages of Transformer, enabling the model to better focus on global and local information and improve network performance.
[0053] Furthermore, such as Figure 2 As shown, the dilated convolution embedding operation includes:
[0054] First, the 224×224×3 image is passed through a first-layer dilated convolution with a 3×3 kernel and a dilation rate of 2 to obtain a feature map of size 112×112×D / 2, which is then batch normalized and ReLU activated. The 112×112×D / 2 feature map is then fed into a second-layer ordinary convolution with a 3×3 kernel to obtain a new feature map with the same size, which is also batch normalized and ReLU activated. The new feature map is then fed into a third-layer dilated convolution with a 3×3 kernel and a dilation rate of 2 to obtain a feature map of size 56×56×D as the output.
[0055] Step S103: When training the Swin Transformer network, deep dilated convolutional mapping is used to generate query, key and value, and then multi-head self-attention is calculated.
[0056] Specifically, the Swin Transformer focuses more on the information interaction between serialized tokens within the window during attention calculation. To further improve the information interaction within tokens, the local context modeling of deep dilated convolutional mapping proposed in this invention solves the problem of lack of information interaction within tokens during attention calculation.
[0057] Furthermore, such as Figure 3 As shown, in window-based attention computation, the sequence of query, key, and value is first generated by a depthwise dilated convolution mapping operation with a 3×3 kernel and an expansion rate of 2. Then, self-attention is calculated to obtain a new attention feature map.
[0058] Step S104: During network training, add a deformable attention Transformer module for training to obtain new attention features.
[0059] Furthermore, such as Figure 1 As shown, a deformable attention Transformer module is added to the Swing Transformer because the resolution of each stage of the model decreases sequentially, and the fourth stage is located at the last stage of the entire feature extraction. Considering that the influence of deformable attention will be weakened, and that deformable attention has a large memory and computational cost, it is only added to stages 2 and 3.
[0060] Furthermore, such as Figure 4As shown, for each deformable attention Transformer module, when performing attention calculation through the layer normalization layer, the reference points are first generated as a uniform grid, which is the same in the input data. Then, the position offset network takes the query features as input and generates corresponding position offsets for all reference points. Then, bilinear interpolation is used for feature sampling, and the sampled features are mapped to key and value. In this way, the candidate key and value are transferred to the important region, thereby enhancing the flexibility and efficiency of the self-attention module and capturing more information features.
[0061] Step S105: Input the finally obtained feature vector into the classification head, and then obtain the grading results of the relationship between lumbar disc herniation and nerve root compression through Softmax classification.
[0062] Based on the above embodiments, such as Figure 5 As shown, this invention also proposes a grading system for the relationship between lumbar disc herniation and nerve root compression based on a visual Transformer, comprising:
[0063] The image preprocessing unit is used to extract the region of interest from the T2-axis lumbar MRI image using the labeled ROI box, extract the ROI image, and then perform data augmentation and normalization processing.
[0064] The dilated convolution embedding unit is used to perform dilated convolution embedding operation on the image normalized by the image preprocessing unit, projecting the feature image onto the embedding dimension D. Next, the feature image is divided into windows and fed into the Swing Transformer network for training.
[0065] The deep dilated convolution mapping unit is used to perform deep dilated convolution mapping within a divided window during the training of the Swing Transformer network, and then to calculate multi-head self-attention.
[0066] The deformable attention computation unit is used to add a deformable attention Transformer module during network training to obtain new attention features;
[0067] The grading result unit is used to feed the finally obtained feature vector into the classification head, and then obtain the grading result of the relationship between lumbar disc herniation and nerve root compression through Softmax classification.
[0068] Furthermore, the image preprocessing unit is specifically used for:
[0069] After extracting the region of interest from the original grayscale image, the region of interest image is converted into an RGB image, and then data augmentation is performed, including random cropping, random horizontal flipping, random vertical flipping, random rotation, 180-degree rotation, contrast enhancement, and brightness variation. Then, normalization is performed to convert the region of interest image into a 224×224×3 image.
[0070] Furthermore, the dilated convolution embedding operation is implemented by designing an overlapping stack of dilated convolutional layers. After the dilated convolution embedding operation, the feature map size changes from 224×224×3 to 56×56×D.
[0071] Furthermore, the dilated convolution embedding operation includes:
[0072] First, the 224×224×3 image is passed through a first-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 2 to obtain a feature map of size 112×112×D / 2, which is then batch normalized and ReLU activated. The 112×112×D / 2 feature map is then fed into a second-layer ordinary convolution with a kernel size of 3×3 and a stride of 1 to obtain a new feature map with the same size, which is also batch normalized and ReLU activated. The new feature map is then fed into a third-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 1 to obtain a feature map of size 56×56×D as the output.
[0073] Furthermore, the depthwise dilated convolutional mapping unit is specifically used for:
[0074] The 56×56×D feature map obtained by the dilated convolution embedding unit is divided into windows, and query, key, and value are generated through a deep dilated convolution mapping layer. Attention is then obtained based on the window and the shifted window.
[0075] Furthermore, the deformable attention calculation unit is specifically used for:
[0076] Deformable attention Transformer modules are inserted at different training stages of the network model, and new attention features are obtained through training with the deformable attention Transformer modules.
[0077] In summary, the present invention has the following advantages:
[0078] 1. The dilated convolution embedding proposed in this invention uses overlapping dilated convolutional layers for embedding at the network input. The advantage of this approach is that it introduces the advantages of CNNs, such as translation, scaling, and rotation invariance, into the Transformer, enabling the Transformer to also have the ability to model local spatial context information similar to CNNs, while retaining the advantages of the Transformer, allowing the model to better focus on global and local information and improve network performance.
[0079] 2. The deep dilated convolutional mapping proposed in this invention. In window-based attention calculation, a sequence of query, key, and value is first generated through deep dilated convolutional mapping, and finally self-attention is calculated to obtain the attention feature map. The advantage of this approach is that it improves the self-attention calculation of the original model. By introducing local convolution into the Transformer, it further improves the information interaction within the tokens, thereby improving the performance of the visual Swing Transformer.
[0080] 3. The Deformable Attention Transformer Module introduced in this invention. The Deformable Attention Transformer Module mainly uses a position offset network to take query features as input and generate corresponding position offsets for all reference points. Then, the features are mapped to key and value, thus transferring candidate key and value to important regions, thereby enhancing the flexibility and efficiency of the self-attention module and enabling it to capture more information features.
[0081] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A grading method for the relationship between lumbar disc herniation and nerve root compression based on visual Transformer, characterized in that, include: Step 1: Extract the region of interest from the T2 axial lumbar MRI image using the marked ROI box, crop the ROI image, and then perform data augmentation and normalization processing; Step 2: Perform dilated convolution embedding on the normalized image from Step 1, project the feature image onto the embedding dimension D, and then divide the feature image into windows and feed them into the Swing Transformer network for training. Step 3: When training the Swing Transformer network, deep dilated convolution is used for mapping within the divided window, and then multi-head self-attention is calculated. Step 4: During network training, add a deformable attention Transformer module to obtain new attention features; Step 5: Input the finally obtained feature vector into the classification head, and then use Softmax classification to obtain the grading results of the relationship between lumbar disc herniation and nerve root compression; The dilated convolution embedding operation includes: First, the 224×224×3 image is passed through a first-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 2 to obtain a feature map of size 112×112×D / 2, which is then batch normalized and ReLU activated. This 112×112×D / 2 feature map is then fed into a second-layer ordinary convolution with a kernel size of 3×3 and a stride of 1 to obtain a new feature map with the same size, which is also batch normalized and ReLU activated. Finally, this new feature map is fed into a third-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 1 to obtain a feature map of size 56×56×D as the output. Step 3 includes: The 56×56×D feature map obtained in step 2 is divided into windows, and query, key, and value are generated through a deep dilated convolutional mapping layer. Then, attention is obtained based on the window and the shifted window.
2. The method for grading the relationship between lumbar disc herniation and nerve root compression based on visual Transformer according to claim 1, characterized in that, Step 1 includes: After extracting the region of interest from the original grayscale image, the region of interest image is converted into an RGB image, and then data augmentation is performed, including random cropping, random horizontal flipping, random vertical flipping, random rotation, 180-degree rotation, contrast enhancement, and brightness variation. Then, normalization is performed to convert the region of interest image into a 224×224×3 image.
3. The method for grading the relationship between lumbar disc herniation and nerve root compression based on visual Transformer according to claim 2, characterized in that, The dilated convolution embedding operation is implemented by designing an overlapping stack of dilated convolutional layers. After the dilated convolution embedding operation, the feature map size changes from 224×224×3 to 56×56×D.
4. The method for grading the relationship between lumbar disc herniation and nerve root compression based on visual Transformer according to claim 1, characterized in that, Step 4 includes: Deformable attention Transformer modules are inserted at different training stages of the network model, and new attention features are obtained through training with the deformable attention Transformer modules.
5. A grading system for the relationship between lumbar disc herniation and nerve root compression based on visual Transformer, characterized in that, include: The image preprocessing unit is used to extract the region of interest from the T2-axis lumbar MRI image using the labeled ROI box, extract the ROI image, and then perform data augmentation and normalization processing. The dilated convolution embedding unit is used to perform dilated convolution embedding operation on the image normalized by the image preprocessing unit, projecting the feature image onto the embedding dimension D. Next, the feature image is divided into windows and fed into the Swing Transformer network for training. The deep dilated convolution mapping unit is used to perform deep dilated convolution mapping within a divided window during the training of the Swing Transformer network, and then to calculate multi-head self-attention. The deformable attention computation unit is used to add a deformable attention Transformer module during network training to obtain new attention features; The grading result unit is used to send the finally obtained feature vector into the classification head, and then obtain the grading result of the relationship between lumbar disc herniation and nerve root compression through Softmax classification; The dilated convolution embedding operation includes: First, the 224×224×3 image is passed through a first-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 2 to obtain a feature map of size 112×112×D / 2, which is then batch normalized and ReLU activated. This 112×112×D / 2 feature map is then fed into a second-layer ordinary convolution with a kernel size of 3×3 and a stride of 1 to obtain a new feature map with the same size, which is also batch normalized and ReLU activated. Finally, this new feature map is fed into a third-layer dilated convolution with a kernel size of 3×3, a dilation rate of 2, and a stride of 1 to obtain a feature map of size 56×56×D as the output. The deep-dilated convolutional mapping unit is specifically used for: The 56×56×D feature map obtained by the dilated convolution embedding unit is divided into windows, and query, key, and value are generated through a deep dilated convolution mapping layer. Attention is then obtained based on the window and the shifted window.
6. The grading system for the relationship between lumbar disc herniation and nerve root compression based on visual Transformer as described in claim 5, characterized in that, The image preprocessing unit is specifically used for: After extracting the region of interest from the original grayscale image, the region of interest image is converted into an RGB image, and then data augmentation is performed, including random cropping, random horizontal flipping, random vertical flipping, random rotation, 180-degree rotation, contrast enhancement, and brightness variation. Then, normalization is performed to convert the region of interest image into a 224×224×3 image.
7. The grading system for the relationship between lumbar disc herniation and nerve root compression based on visual Transformer as described in claim 6, characterized in that, The dilated convolution embedding operation is implemented by designing an overlapping stack of dilated convolutional layers. After the dilated convolution embedding operation, the feature map size changes from 224×224×3 to 56×56×D.
8. The grading system for the relationship between lumbar disc herniation and nerve root compression based on visual Transformer as described in claim 5, characterized in that, The deformable attention calculation unit is specifically used for: Deformable attention Transformer modules are inserted at different training stages of the network model, and new attention features are obtained through training with the deformable attention Transformer modules.