Trifurcation neural segmentation and neurovascular conflict assessment method based on 3D hybrid attention mechanism
Patent Information
- Application Number
- CN202610838647.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-06-11
AI Technical Summary
[0011]本发明针对现有技术在三叉神经分割及神经血管冲突评估领域所存在的主观依赖性强、量化标准缺失、分割精度不足、效率低下及结果可重复性差等技术缺陷,提供基于3D混合注意力机制的三叉神经分割及神经血管冲突评估方法
1、显著降低主观依赖性:采用深度学习模型自动完成三叉神经及毗邻血管分割,避免人工阅片的经验差异,消除医师主观判断偏差,使分割结果与冲突判定具备统一、客观、可重复的量化标准,大幅提升不同医师、不同时间的诊断一致性。
Smart Images

Figure CN122416036B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and in particular relates to a method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism. Background Technology
[0002] Trigeminal neuralgia, one of the most representative intractable pain syndromes in craniofacial pain, has an increasing incidence rate in adults, severely impacting patients' quality of life and work capacity. In modern medical imaging, magnetic resonance imaging (MRI), with its superior soft tissue contrast and three-dimensional spatial resolution, has become the preferred diagnostic tool for preoperative evaluation and etiological diagnosis of trigeminal neuralgia. T2-weighted MRI sequences of the skull base can clearly visualize the course, signal characteristics, and adjacent relationships of the trigeminal nerve with surrounding blood vessels and soft tissues, providing crucial anatomical information for neurosurgeons to develop surgical plans.
[0003] However, existing MRI diagnostic methods for the trigeminal nerve still have significant limitations in terms of technical implementation. In traditional clinical practice, the imaging assessment of the trigeminal nerve relies heavily on manual interpretation by neurosurgeons and radiologists based on their individual professional knowledge. The specific procedure involves physicians browsing T2-weighted MRI images layer by layer on a workstation, identifying the course of the trigeminal nerve in consecutive transverse, coronal, and sagittal images based on their anatomical experience, observing its morphological changes, signal intensity, and contact relationships with surrounding vascular structures such as the superior cerebellar artery, anterior inferior cerebellar artery, and basilar artery, and then making a qualitative assessment of the degree of nerve compression and the extent of the lesion. While this diagnostic process can provide some clinical reference value when performed by experienced physicians, its inherent technical shortcomings are becoming increasingly apparent.
[0004] First, manual interpretation is highly subjective and lacks unified, objective, and repeatable quantitative standards. Different physicians often have significantly different judgments on the morphology and neurovascular relationships of the trigeminal nerve in the same case; even the same physician may yield inconsistencies in their assessments of the same case at different times. This inconsistency directly leads to insufficient comparability of diagnostic results, severely impacting the accuracy and reliability of treatment planning. Second, traditional manual interpretation methods are extremely inefficient. From loading the original MRI image, layer-by-layer identification of the trigeminal nerve and adjacent vessels, edge delineation, to completing a full neurovascular relationship assessment, a single case typically takes more than 60 minutes. This efficiency bottleneck is particularly pronounced when facing large-scale screening needs, precise preoperative planning, and long-term dynamic follow-up in clinical scenarios. Furthermore, the stability of manual delineation results is insufficient; the segmentation results between different operators and at different times by the same operator are inconsistent, failing to provide stable and repeatable objective data support for clinical practice.
[0005] To overcome the technical bottlenecks of manual interpretation, those skilled in the art have attempted to introduce general medical image segmentation tools to assist in the automatic segmentation of the trigeminal nerve. However, these general solutions have revealed serious limitations in technical adaptability when dealing with specific anatomical structures like the trigeminal nerve.
[0006] The trigeminal nerve has the following unique anatomical features: Firstly, nerve structures are delicate, typically only a few millimeters in diameter, resulting in low contrast with surrounding tissues in MRI images. Secondly, the nerve pathways are tortuous, forming a complex, three-dimensional winding path from the brainstem to the face; Third, the nerve is closely related to the adjacent blood vessels throughout its course, and it is necessary to accurately segment both the nerve and the blood vessels simultaneously to conduct effective conflict assessment.
[0007] Existing general segmentation algorithms are significantly inaccurate when faced with the above features. They cannot fully preserve the details of the entire course of the nerve, nor can they accurately distinguish the boundary between the nerve and adjacent blood vessels. They are far from meeting the accuracy required for preoperative clinical planning.
[0008] Furthermore, existing segmentation models fail to adequately consider the unique characteristics of trigeminal nerve segmentation in their training strategies and loss function designs. Because the trigeminal nerve occupies a very small percentage of pixels in a 3D MRI volume, it represents a typical foreground-background imbalance task. Traditional segmentation networks, when dealing with such small object segmentation problems, often tend to allocate a large amount of prediction power to the background region, resulting in insufficient recall in the neural region. In addition, general network architectures lack specific optimizations for the anatomical features of the trigeminal nerve, exhibiting inherent limitations in capturing its fine branches and tortuous course.
[0009] Meanwhile, even with relatively accurate trigeminal nerve segmentation results, achieving objective assessment of neurovascular conflict remains a technical challenge in this field. Current neurovascular conflict assessments primarily rely on visual examination of the segmentation results by physicians, lacking automated, quantitative conflict detection mechanisms. This semi-automated assessment method is not only inefficient but also subject to subjective influences, failing to meet the urgent clinical need for standardized diagnostic reports.
[0010] Therefore, existing technologies for precise trigeminal nerve segmentation and neurovascular conflict assessment generally suffer from drawbacks such as strong subjectivity, lack of quantitative standards, insufficient segmentation accuracy, low efficiency, and poor reproducibility. This invention aims to provide a trigeminal nerve segmentation and neurovascular conflict assessment method based on a 3D hybrid attention mechanism to achieve automated, high-precision trigeminal nerve segmentation, and objectively assess neurovascular conflict on this basis, providing stable and quantifiable neuromorphological and adjacency relationship data. Summary of the Invention
[0011] This invention addresses the shortcomings of existing technologies in the fields of trigeminal nerve segmentation and neurovascular conflict assessment, such as strong subjectivity, lack of quantitative standards, insufficient segmentation accuracy, low efficiency, and poor reproducibility of results. It provides a method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism.
[0012] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism includes the following steps: S1: Obtain T2-weighted MRI images of the skull base and perform bias field correction to eliminate image grayscale deviation caused by magnetic field inhomogeneity. Use anisotropic diffusion filtering or nonlocal mean filtering for denoising to suppress thermal noise and motion artifacts.
[0013] S2: Implement quantile-based intensity standardization to eliminate dimensional differences caused by different scanning devices and parameters, perform spatial resampling and registration to unify images from different sources to the same three-dimensional coordinate system and resolution system, and execute medical image enhancement procedures to improve the contrast between neural structures and surrounding tissues.
[0014] Step S1 first performs basic preprocessing, including bias field correction on the input raw skull base T2-weighted MRI images to eliminate image grayscale deviations caused by magnetic field inhomogeneity, anisotropic diffusion filtering or nonlocal mean filtering for denoising to suppress thermal noise and motion artifacts, quantile-based intensity standardization to eliminate dimensional differences caused by different scanning equipment and parameters, and spatial resampling and registration to unify images from different sources to the same three-dimensional coordinate system and resolution system. After completing the basic preprocessing, step S2 executes a medical image enhancement process to improve the contrast between neural structures and surrounding tissues, specifically including sequentially performing intensity normalization, gamma correction and gain adjustment, three-dimensional limited contrast adaptive histogram equalization, bilateral filtering, and desharpening mask processing; combining data enhancement strategies such as rotation, scaling, noise perturbation, and random adjustment of brightness and contrast to expand the diversity of training samples and construct a high-quality standardized dataset; and having senior radiologists perform artificial segmentation of the trigeminal nerve and adjacent superior cerebellar artery, anterior inferior cerebellar artery, and basilar artery in the MRI images of healthy volunteers based on the standardized images to establish a gold standard dataset.
[0015] S3: 3D Segmentation: High-precision automatic segmentation of the trigeminal nerve and adjacent blood vessels is achieved based on an improved VNet network architecture. The network structure employs an encoder-decoder design, including five levels of downsampling and upsampling paths. Each downsampling level halves the spatial resolution through a 2-stride 3D convolution, while each upsampling level doubles the spatial resolution through a 3D transposed convolution. Skip connections are established between corresponding layers of the encoder and decoder to preserve multi-scale feature information. In each feature extraction residual block, group normalization, ReLU activation, and 3D convolution kernels are sequentially executed to achieve feature standardization and nonlinear transformation. The number of groups for group normalization is set to a value adapted to the number of channels to ensure normalization stability under small batch training sample conditions. A 3D hybrid attention mechanism is embedded within the network. The mechanism aims to enhance the model's responsiveness to key feature channels and spatial locations. The channel attention branch compresses the feature map along the spatial dimension using global average pooling and global max pooling to obtain global statistical information. Then, it learns the importance weights of each channel through a multilayer perceptron and multiplies them element-wise with the original feature map to achieve feature recalibration along the channel dimension. The spatial attention branch first performs average pooling and max pooling on the feature map along the channel dimension to generate two single-channel feature maps. Then, it generates a spatial attention map through convolution with a 7×7×7 three-dimensional convolution kernel and normalizes it to the 0-1 range using the Sigmoid activation function. Finally, it multiplies the spatial attention map element-wise with the original feature map to achieve feature recalibration along the spatial dimension. The output layer uses the Sigmoid activation function to output a single-channel probability map.
[0016] The 3D segmentation module employs a block-based training strategy to address the technical challenges of high GPU memory consumption and sparse foreground regions in 3D medical images. The 3D image is segmented into fixed-size cubic blocks for training, preferably with a patch size of 96×96×96 or 128×128×128 voxels. A foreground-background balanced sampling mechanism is used to ensure the model fully learns the segmentation ability of small target neurons. Specifically, patches containing neural regions are extracted from the center point of random perturbation in the foreground labeled region with a 70% probability, and patches are randomly sampled and extracted from the entire image with a 30% probability. Within each training iteration cycle, a dynamic patch generator extracts patches in batches with a fixed number of steps for forward propagation and weight updates. The batch size per step is set to 2 to 6 patches to effectively control GPU memory usage and maintain training efficiency. The loss function adopted is the combined loss function to simultaneously optimize the segmentation accuracy and recall. Its mathematical expression is combined_loss=α×BCE+β×TverskyLoss, where the weight coefficient α of the binary cross-entropy loss BCE in TverskyLoss is set to 0.3 and the weight coefficient β of TverskyLoss is set to 0.7 to emphasize recall and reduce the false negative probability of neural regions. During model training, the probability domain Dice coefficient is used as a real-time monitoring indicator to evaluate the model's learning status, the thresholded binary Dice coefficient is used as a quantitative evaluation indicator of the model's final segmentation accuracy, and the full-volume inference binary Dice is used as the final evaluation indicator of global inference on the validation set to select the optimal model weights.
[0017] S4: Perform neurovascular conflict detection: Based on the trigeminal nerve binary mask and adjacent blood vessel binary mask output by 3D segmentation, perform spatial overlap analysis. Generate the overlapping region mask by multiplying the nerve mask and blood vessel mask element by element, and determine whether the neurovascular relationship is normal based on whether there are non-zero voxel values in the overlapping region mask. In step S4, the neural mask and the vascular mask are first aligned in a three-dimensional coordinate system to ensure that they are in the same spatial reference frame. Then, a voxel-by-voxel logical AND operation is performed on the two aligned masks, that is, the overlapping region mask is generated by multiplying the neural mask and the vascular mask element by element. If there is a non-zero voxel value in the overlapping region mask, it is determined that there is an abnormality in neural-vascular contact; otherwise, it is determined that the neural-vascular relationship is normal. When an abnormality is detected, the degree of abnormality is further classified based on the morphological characteristics of the segmented regions of nerves and blood vessels. If the overlapping region only shows slight contact between the nerve and blood vessel boundary without obvious compression deformation, it is determined to be a slight contact abnormality. If the nerve course shows obvious curvature or the cross-sectional shape shows compression deformation, it is determined to be a compression deformation abnormality.
[0018] S5: Generate structured reports.
[0019] Preferably, the specific process of step S1 is as follows: The purpose of performing bias field correction is to eliminate the gradual changes in MRI grayscale caused by magnetic field inhomogeneity, and to ensure consistent grayscale within the same tissue. S11: Perform bias field correction: The principle of bias field correction is as follows: Bias field model: I ( x )= T ( x )⋅ B ( x )+ N ( x ); in, I ( x (This refers to the original MRI image.) x =( x,y,z () represents three-dimensional voxel coordinates; T ( x The image is a true tissue image (without bias or noise). B ( x ) is the bias field (low-frequency smooth field). B ( x )>0; N ( x This is additive Gaussian noise; based on I estimate B The corrected image is obtained: I corr ( x )= I ( x ) / B ( x ); S12: Noise denoising based on anisotropic diffusion filtering: ; Wherein, diffusion coefficient c ( g ) =exp ( − ( g / K 1) 2 ); g= |∇ I | represents the gradient magnitude; c ( g () is the diffusion coefficient; K 1 = 0.05 is the gradient threshold; ∇I: image gradient; Perform discrete iterations: ; Output:I diff =I Niter ; Where t is the iteration time step; I t Image at step t; I t+1 : Image at step t+1; Δt=0.125 is the time step; Niter=5 is the number of iterations; I diff Image after diffusion denoising.
[0020] Preferably, the specific process of step S11 is as follows: S111: Perform grayscale histogram fitting (B-spline smoothing), and model the bias field using third-order B-splines: ; in, B ( x ) represents the bias field; ϕ k ( x ) represents a third-order B-spline basis function; c k Here, K represents the B-spline coefficients; K is the number of control points, which can be set to K=50. S112: Iterative minimization of entropy based on the N4 algorithm: ; in, p (·) represents the gray-level probability density; λ is the smoothing regularization coefficient, which can be set to λ=0.1; ∇B: bias field gradient; S113: Output corrected image I corr ( x ): I corr ( x )= I ( x ) / B ( x ).
[0021] Preferably, the specific process of step S2 is as follows: S21: Intensity normalization based on quantiles to eliminate device differences and obtain intensity-normalized images. I norm : Different MRI devices or sequences can cause inconsistencies in grayscale range. We use 2% / 98th percentile truncation and normalization to remove outliers and unify intensity distribution. The specific process of step S21 is as follows: S211: Calculate the upper and lower quantiles: p 2= Q 0.02 ( I diff ); p 98 = Q 0.98 ( I diff ); Among them, Q α (·): Image α quantile; I diff Image after diffusion denoising; S212: Perform extreme value truncation: I clip ( x )= max ( p 2, minutes ( I diff ( x ), p 98 )); in, I clip The image after truncation for extreme values; p 2 represents the 2% grayscale quantile; p 98 98th percentile grayscale value; S213: Normalize to [0,1]: I norm ( x )= p 98 - p 2 I clip ( x )− p 2; in, I norm This is the intensity-normalized image.
[0022] S22: Perform spatial resampling and registration processing: S221: Spatial resampling processing: Set the target resolution to s target =(1.0, 1.0, 1.0) mm ; Interpolation processing: ; in,x' Target voxel coordinates; x k Original 8-neighbor voxel coordinates; w k : Trilinear interpolation weights (determined by spatial distance); S222: Perform rigid body registration processing to obtain the registered image. I align : The target reference template, i.e., the standard skull base MRI template, is... T ref ( x ); Mutual information (MI) similarity measure is: MI( I resamp ,T ref )=H( I resamp )+H( T ref )−H( I resamp ,T ref ); Where H(·) is the information entropy; H(·,·) is the joint entropy; Perform rigid body transformation: x ′= R ( i )· x + t 1; in, R ( i ): Rotation matrix i =( i x , i y , i z ); t 1=( t x ,t y ,t z ): Translation vector for rigid body transformation in three-dimensional space; t x ,t y ,t z These are the translation components along the X, Y, and Z axes in the three-dimensional coordinate system, used to translate the entire image to a standard spatial position; Output registered image Ialign ; S23: Perform image enhancement processing to obtain the final enhanced image. I enhance : S231: Intensity normalization treatment: I 1( x )=( I align ( x )− minutes ( I align )) / ( max ( I align )− min(I align )); S232: Gamma correction enhances shadow detail. I2(x)=I1(x) γ The Gamma parameter γ = 0.75; S233: Adjust the gain to achieve overall brightness: I3( x )= gain ·I2( x Gain coefficient gain =1.4; S234: Perform local contrast enhancement processing to suppress noise amplification. Histogram cropping: h clip ( k )= minutes ( h ( k ), 0.02· N pix ; in, h ( k ): Local 8×8×8 grid histogram; N pix Local grid volume prime number; k Grayscale level, 0-255; Grayscale mapping: ; I4( x )= T (I3( x )); S235: Perform bilateral filtering: ; ; s s =2.0: Spatial standard deviation of the bilateral filter; s r =0.1: Standard deviation of bilateral filter strength; S236: Perform unsharpening mask: I blur =I5· G σ=1.0 ; I enhance ( x )=I5( x )+ α ·(I5( x )−I blur ( x )), α =1.3; in, G σ Gaussian kernel; α Sharpening factor; s =1.0: Gaussian blur standard deviation; I 1 ~I 5: Enhance images at each stage; I enhance Final enhanced image.
[0023] Preferably, the specific process of step S3 is as follows: S31: Input the final enhanced image I enhance Multi-scale 3D features are extracted through a five-level encoder, and the output is... X 5; enter: I enhance → X 0(1, 96, 96, 96); Encoder 1: Residual block + downsampling → X 1(32, 48, 48, 48); Encoder 2: Residual block + downsampling → X2(64, 24, 24, 24); Encoder 3: Residual block + downsampling → X3(128, 12, 12, 12); Encoder 4: Residual block + downsampling → X4(256, 6, 6, 6); Encoder 5: Residual block + downsampling → X5(512, 3, 3, 3); S32: Output based on 3D hybrid attention-enhanced key features. X att ; X att = X 5⊙ M c ( X 5)⊙ M s ( X 5); Where ⊙: element-wise multiplication; M c Channel attention weights; M s Spatial attention weights; The channel attention weight calculation process is as follows: F avg =(1 / D·H·W)∑ d,h,w X 5( d,h,w ); F max =max d,h,w X 5( d,h,w ); M c =s ( MLP ( F avg ) +MLP ( F max )); in, F avg Global average pooling characteristics; F max : Global max pooling features; MLP: Two-layer perceptron, with an intermediate dimension of C / 4; s Sigmoid activation; M c Channel weights, dimension (512, 1, 1, 1); The spatial attention weight calculation process is as follows: F c-avg =(1 / C )∑ c X 5( c ,:,:,:); F c-max = maxcX 5 ( c ,:,:,:); F cat =Concat ( F c-avg ,F c-max ) ; M s = σ( Conv 3D ( F cat ,w s ,k =7, p =3)); in, F c-avg Channel average pooling characteristics; F c-max Channel max pooling characteristics; F cat : splicing characteristics; w s Spatial convolution kernel; k =7: Convolution kernel size; p =3: Fill; M s Spatial weights; S33: Based on a five-level decoder, upsampling and skip connection fusion are performed to output Y0; enter: X att ; Decoder 5: Upsampling + splicing X 4 + residual block → Y4(256, 6, 6, 6); Decoder 4: Upsampling + splicing X 3+ residual block → Y3(128, 12, 12, 12); Decoder 3: Upsampling + splicing X 2+ residual block → Y2(64, 24, 24, 24); Decoder 2: Upsampling + splicing X 1 + residual block → Y1(32, 48, 48, 48); Decoder 1: Upsampling + splicing X 0+ residual block → Y0(1, 96, 96, 96); Upsampling: X up =Conv3DTranspose( X,w u ,s =2,p =1); w u : Transpose convolution kernel; s=2: stride; p =1: Fill; X up Upsampling features; Jump connection splicing: Y concat =Concat ( X up , X skip ); in, X skip : Encoder corresponding layer features; Y concat Features after splicing; S34: Output probability map of nerves or blood vessels through the output layer: P ( x )= s (Conv3D( Y 0, w out , k =1)); w out Output convolution kernel; P ( x ): Segmentation probability graph.
[0024] Preferably, the specific process of step S4 is as follows: S41: Perform threshold binarization on the neural or vascular probability map output from step S34: like P ( x If )≥0.5, then M ( x )=1; like P ( x If ) < 0.5, then M ( x )=0; in, M ( x () is a three-dimensional binary mask with a value range of {0,1}, integer, where 1 represents the target (nerve or blood vessel) and 0 represents the background; S42: Perform mask space alignment to ensure that the neural mask and the vascular mask are in the same 3D coordinate system and the same voxel mesh, as shown in the following formula: M' n (x' )= M n ( R ( i ) x' + t ); M' v ( x' )= M v ( R ( i ) x' + t ); in, x = (x,y,z) ): Primitive voxel coordinates; x' =( x',y',z' ): Target-aligned coordinate system voxel coordinates; : 3D rotation matrix i =( i x ,i y ,i z ); t =( t x ,t y ,t z ): Three-dimensional translation vector (unit: mm); M n ( x ): Original trigeminal nerve binary mask, 1 = nerve, 0 = background; M v ( x ): Original binary mask for blood vessels, 1 = blood vessel, 0 = background; M' n ( x' Aligned neural mask; M' v ( x' ): Aligned blood vessel mask; S43: Element-by-element multiplication generates an overlap mask: M ov ( x )= M n ( x )⊙ M v ( x ); Among them, ⊙: element-wise logical AND, that is, element-wise multiplication; Mov ( x ): Overlapping region mask, 1 = overlap, 0 = no overlap; Only voxels where both nerve and blood vessel values are 1 are marked as overlapping; S44: Perform overlap determination: Overlapping voxel count: N ov =∑ x M ov ( x ); in, N ov The total number of overlapping voxels; The judgment rules are as follows: N ov =0 Neurovascular relationship: normal; N ov >0 There is an abnormal contact. S45: Classify abnormalities, including minor contact or compression deformation; Quantization overlap volume V ov : V ov =N ov ×v res ; in, v res Voxel volume; Quantify contact area A ov : A ov =∑ x ∇ M ov ( x ); Among them, ∇ M ov Surface gradient of overlapping region (edge voxel count); The grading rules are as follows: like 0<V ov ≤V th If so, it is determined to be a minor contact abnormality; like V ov >V thIf so, it is determined to be abnormal compression deformation; in, V th The threshold for overlapping volume classification can be set to... V th =5mm 3 .
[0025] Preferably, the structured report in step S5 includes basic patient information, examination information, and neurovascular conflict detection results; The examination information includes MRI sequences and scanning parameters; the neurovascular conflict detection results include overlap volume. V ov Contact area A ov , grading results.
[0026] The beneficial effects of this invention include: 1. Significantly reduces subjective dependence: The deep learning model is used to automatically segment the trigeminal nerve and adjacent blood vessels, avoiding the experience differences of manual image interpretation, eliminating the bias of physicians' subjective judgment, and making the segmentation results and conflict determination have a unified, objective, and repeatable quantitative standard, which greatly improves the consistency of diagnosis among different physicians at different times.
[0027] 2. Effectively improve segmentation accuracy: By improving the VNet network and 3D hybrid attention mechanism, it can accurately capture the delicate, low-contrast, and tortuous trigeminal nerve structure, significantly reducing missed detections and false detections. The segmentation accuracy is significantly better than that of general medical image segmentation methods, meeting the high-precision requirements of clinical preoperative planning.
[0028] 3. Achieve automated and quantitative detection of neurovascular conflict: Based on element-by-element overlap analysis using a three-dimensional binary mask, it can automatically identify neurovascular contact and quantitatively calculate the overlap volume and contact area. It can further distinguish between two types of abnormalities: slight contact or compression deformation. The detection results are objective, quantitative, and traceable, solving the shortcomings of traditional visual assessment, which is highly subjective and cannot be quantified.
[0029] 3. Improve diagnostic and treatment efficiency and reduce labor costs: The entire process from image acquisition to structured report generation is automated, eliminating the need for senior radiologists to review each image individually. This significantly improves the efficiency of large-scale screening, preoperative planning, and postoperative follow-up, and reduces labor costs for medical institutions.
[0030] 4. End-to-end quality control ensures stable and reliable results: Preprocessing techniques such as bias field correction, denoising, quantile standardization, spatial resampling registration, and medical enhancement suppress noise, eliminate device differences, and unify spatial resolution. Combined with sliding window inference and overlapping fusion, the results are stable, robust, and reproducible under different devices and different sequence inputs. Attached Figure Description
[0031] Figure 1 This is a flowchart illustrating the trigeminal nerve segmentation and neurovascular conflict assessment method based on a 3D hybrid attention mechanism of the present invention.
[0032] Figure 2 This is a schematic diagram illustrating the principle of three-dimensional segmentation in this invention.
[0033] Figure 3 The detection flowchart of the neurovascular conflict detection module of the present invention. Detailed Implementation
[0034] The following is in conjunction with the appendix Figure 1~Figure 3 The present invention will be further described in detail below: Example 1 See appendix Figure 1-Figure 3 As shown, the trigeminal nerve segmentation and neurovascular conflict assessment method based on a 3D hybrid attention mechanism includes the following steps: S1: Obtain T2-weighted MRI images of the skull base and perform bias field correction to eliminate image grayscale deviation caused by magnetic field inhomogeneity. Use anisotropic diffusion filtering or nonlocal mean filtering for denoising to suppress thermal noise and motion artifacts.
[0035] Raw T2-weighted MRI images of the skull base often exhibit grayscale gradation during acquisition due to magnetic field inhomogeneity. This image degradation caused by the bias field affects the performance of subsequent segmentation algorithms. To address this issue, bias field correction is performed. This method assumes that the observed image can be represented as the product of the real tissue image and a smoothly gradation bias field, and iteratively solves for the bias field parameters using a maximum a posteriori estimation framework. In practice, the original image is first downsampled to reduce computational complexity. Then, the expectation-maximization algorithm is used to estimate the low-frequency components of the bias field, and the estimated bias field is divided from the original image to eliminate the grayscale gradation effect. As another preferred embodiment of the invention, a frequency domain filtering method based on low-frequency component separation can also be used to achieve bias field correction. This method separates the low-frequency and high-frequency components in the frequency domain to extract the bias field component, and then subtracts it from the original image to achieve the correction purpose.
[0036] Denoising is a core step in the basic preprocessing stage. This invention employs anisotropic diffusion filtering or nonlocal mean filtering to suppress thermal noise and motion artifacts. The implementation of nonlocal mean filtering involves constructing a search window centered on the current voxel in the image, with a search window size of 21×21×21 voxels and a similarity window size of 7×7×7 voxels. Denoising is achieved by calculating the similarity weights of pixels within the two windows and then performing a weighted average.
[0037] The purpose of intensity normalization is to eliminate dimensional differences caused by different scanning devices and parameters. This invention employs a quantile-based intensity normalization strategy, the specific implementation of which involves first calculating the 2% quantile Q of image I. 0.02 and the 98th percentile Q 0.98 This method excludes extreme anomalies. Compared to traditional mean-standard deviation normalization, this quantile normalization method is more robust and can effectively address the common gray-level distribution skew problem in MRI images.
[0038] The spatial resampling and registration unit unifies images from different sources to the same three-dimensional coordinate system and resolution system. In practice, the spatial resolution information of the original image is first extracted from the DICOM file header, and then a cubic spline interpolation algorithm is used to resample the image to the standard resolution system. The target resolution for resampling is set to 1mm × 1mm × 1mm to ensure isotropy. For cases requiring multi-sequence registration, a mutual information-based registration algorithm is used to perform rigid body transformation registration, aligning images from different sequences to a unified anatomical spatial coordinate system.
[0039] S2: Implement quantile-based intensity standardization to eliminate dimensional differences caused by different scanning devices and parameters, perform spatial resampling and registration to unify images from different sources to the same three-dimensional coordinate system and resolution system, and execute medical image enhancement procedures to improve the contrast between neural structures and surrounding tissues. S3: Perform 3D segmentation: Achieve high-precision automatic segmentation of the trigeminal nerve and adjacent blood vessels based on the improved VNet network architecture. The network adopts an encoder-decoder design, which includes five-level downsampling paths and five-level upsampling paths. Skip connections are established between corresponding levels of the encoder and decoder to retain multi-scale feature information. A 3D hybrid attention mechanism is embedded in the network to enhance the model's responsiveness to key feature channels and spatial locations. S4: Perform neurovascular conflict detection: Based on the trigeminal nerve binary mask and adjacent blood vessel binary mask output by 3D segmentation, perform spatial overlap analysis. Generate the overlapping region mask by multiplying the nerve mask and blood vessel mask element by element, and determine whether the neurovascular relationship is normal based on whether there are non-zero voxel values in the overlapping region mask. S5: Generate structured reports.
[0040] Example 2 Based on Example 1, the specific process of step S1 is as follows: The purpose of performing bias field correction is to eliminate the gradation of MRI grayscale caused by magnetic field inhomogeneity, and to ensure consistent grayscale within the same tissue. S11: Perform bias field correction: The principle of bias field correction is as follows: Bias field model: I ( x )= T ( x )⋅ B ( x )+ N ( x ); in, I ( x (This refers to the original MRI image.) x =( x,y,z () represents three-dimensional voxel coordinates; T ( x The image represents a true tissue image (without bias or noise). B ( x ) is the bias field (low-frequency smooth field). B ( x )>0; N ( x This is additive Gaussian noise; based on I estimate B The corrected image is obtained: I corr ( x )= I ( x ) / B ( x ); S111: Perform grayscale histogram fitting (B-spline smoothing), and model the bias field using third-order B-splines: ; in, B ( x ) represents the bias field; ϕ k ( x ) represents a third-order B-spline basis function; c k Here, K represents the B-spline coefficients; K is the number of control points, which can be set to K=50. S112: Iterative minimization of entropy based on the N4 algorithm: ; in, p (·) represents the gray-level probability density; λ is the smoothing regularization coefficient, which can be set to λ=0.1; ∇B: bias field gradient; S113: Output corrected image I corr ( x ): I corr ( x )=I ( x ) / B ( x ).
[0041] S12: Noise denoising based on anisotropic diffusion filtering: ; Wherein, diffusion coefficient c ( g ) =exp ( − ( g / K 1) 2 ); g= |∇ I | represents the gradient magnitude; c ( g () is the diffusion coefficient; K 1 = 0.05 is the gradient threshold; ∇I: image gradient; Perform discrete iterations: ; Output: I diff =I Niter ; Where t is the iteration time step; I t Image at step t; I t+1 : Image at step t+1; Δt=0.125 is the time step; Niter=5 is the number of iterations; I diff Image after diffusion denoising.
[0042] In another embodiment of this invention, after basic preprocessing, the image needs to undergo a medical image enhancement process to improve the contrast between neural structures and surrounding tissues. This enhancement process includes five sequentially executed steps: intensity normalization, gamma correction and gain adjustment, three-dimensional limited contrast adaptive histogram equalization, bilateral filtering, and desharpening mask processing.
[0043] The intensity normalization step first performs extremum normalization on the denoised image, mapping the image grayscale to the 0-1 range to facilitate parameter settings in subsequent processing steps. Gamma correction uses a non-linear transformation of the gamma curve with parameter γ=0.75 to enhance the visibility of details in the dark areas of the image. Then, a linear contrast enhancement with a gain coefficient of gain=1.4 is applied to the gamma-corrected image to improve overall brightness. Finally, extremum normalization maps the processed image back to the 0-1 range. The value of γ=0.75 enhances the neural structures in the dark areas while avoiding oversaturation in the bright areas, while the parameter setting of gain=1.4 achieves a good balance between contrast enhancement and noise amplification.
[0044] The implementation of 3D limited contrast adaptive histogram equalization involves dividing the 3D image into an 8×8×8 local grid. The pixel intensity histogram within each local grid is then cropped to limit the maximum height and prevent noise amplification. The cropping threshold is set to 2% of the total number of pixels in the local region. Subsequently, a grayscale mapping function is calculated based on the cropped histogram to map the original grayscale values to new grayscale values, thereby enhancing local contrast and suppressing excessive noise amplification.
[0045] Bilateral filtering employs a filtering strategy that simultaneously considers spatial distance weights and gray-level similarity weights to achieve edge-preserving denoising.
[0046] The implementation method of desharpening mask processing is to first perform a Gaussian blur with a standard deviation σ = 1.0 on image I to obtain... I blur , and then through I enhance ( x )=I5( x )+ α ·(I5( x )−I blur ( x )), α =1.3; This achieves sharpening enhancement, where 1.3 is the sharpening enhancement coefficient. s A Gaussian kernel of 1.0 can extract high-frequency components at medium frequencies, while an enhancement factor of 1.3 can improve edge discernibility while avoiding ringing artifacts.
[0047] The specific process of step S2 is as follows: S21: Intensity normalization based on quantiles to eliminate device differences and obtain intensity-normalized images. I norm : Different MRI devices or sequences can cause inconsistencies in grayscale range. We use 2% / 98th percentile truncation and normalization to remove outliers and unify intensity distribution. S211: Calculate the upper and lower quantiles: p 2= Q 0.02 ( I diff ); p 98 = Q 0.98 ( I diff ); Among them, Q α (·): Image α quantile; I diffImage after diffusion denoising; S212: Perform extreme value truncation: I clip ( x )= max ( p 2, minutes ( I diff ( x ), p 98 )); in, I clip The image after truncation for extreme values; p 2 represents the 2% grayscale quantile; p 98 98th percentile grayscale value; S213: Normalize to [0,1]: I norm ( x )= p 98 - p 2 I clip ( x )− p 2; in, I norm This is the intensity-normalized image.
[0048] S22: Perform spatial resampling and registration processing: S221: Spatial resampling processing: Set the target resolution to s target =(1.0, 1.0, 1.0) mm ; Interpolation processing: ; in, x' Target voxel coordinates; x k Original 8-neighbor voxel coordinates; w k : Trilinear interpolation weights (determined by spatial distance); S222: Perform rigid body registration processing to obtain the registered image. I align : The target reference template, i.e., the standard skull base MRI template, is... T ref ( x ); Mutual information (MI) similarity measure is: MI( I resamp ,T ref )=H( I resamp )+H( T ref )−H( I resamp ,T ref ); Where H(·) is the information entropy; H(·,·) is the joint entropy; Perform rigid body transformation: x ′= R ( i )· x + t 1; in, R ( i ): Rotation matrix i =( i x , i y , i z ); t 1=( t x ,t y ,t z ): Translation vector for rigid body transformation in three-dimensional space; t x ,t y ,t z These are the translation components along the X, Y, and Z axes in the three-dimensional coordinate system, used to translate the entire image to a standard spatial position; Output registered image I align ; S23: Perform image enhancement processing to obtain the final enhanced image. I enhance : S231: Intensity normalization treatment: I 1( x )=( I align ( x )− minutes ( I align )) / ( max( I align )− min(I align )); S232: Gamma correction enhances shadow detail. I2(x)=I1(x) γ The Gamma parameter γ = 0.75; S233: Adjust the gain to achieve overall brightness: I3( x )= gain ·I2( x Gain coefficient gain =1.4; S234: Perform local contrast enhancement processing to suppress noise amplification. Histogram cropping: h clip ( k )= minutes ( h ( k ), 0.02· N pix ; in, h ( k ): Local 8×8×8 grid histogram; N pix Local grid volume prime number; k Grayscale level, 0-255; Grayscale mapping: ; I4( x )= T (I3( x )); S235: Perform bilateral filtering: ; ; s s =2.0: Spatial standard deviation of the bilateral filter; s r =0.1: Standard deviation of bilateral filter strength; S236: Perform unsharpening mask: I blur =I5· G σ=1.0 ; I enhance ( x )=I5( x )+ α·(I5( x )−I blur ( x )), α =1.3; in, G σ Gaussian kernel; α Sharpening factor; s =1.0: Gaussian blur standard deviation; I 1 ~I 5: Enhance images at each stage; I enhance Final enhanced image.
[0049] Example 3 Based on Example 1 or Example 2, the 3D segmentation module achieves high-precision automatic segmentation of the trigeminal nerve and adjacent blood vessels using an improved VNet network architecture. The network structure of this module adopts a classic encoder-decoder design, including five levels of downsampling paths and five levels of upsampling paths. The embedded 3D hybrid attention mechanism within the network includes two parallel branches: a channel attention branch and a spatial attention branch, which respectively implement feature recalibration in the channel and spatial dimensions.
[0050] The implementation process of the channel attention branch is as follows: First, global average pooling and global max pooling are performed on the input feature map along the spatial dimension to obtain two one-dimensional feature vectors with C channels. Global average pooling obtains global statistical information by calculating the average value of all voxels in each channel, while global max pooling obtains significant response features by extracting the maximum value of all voxels in each channel. These two one-dimensional feature vectors are then transformed through a multilayer perceptron network with shared weights. The multilayer perceptron contains one hidden layer with C / 4 neurons and uses the ReLU activation function, and the output layer has C neurons and uses the Sigmoid activation function. The two channel attention weight vectors output by the multilayer perceptron are averaged and then multiplied element-wise with the original feature map to achieve feature recalibration in the channel dimension.
[0051] The implementation process of the spatial attention branch is as follows: First, average pooling and max pooling are performed on the input feature map along the channel dimension to generate two single-channel feature maps. These two single-channel feature maps are concatenated along the channel dimension, and then convolved using a 7×7×7 three-dimensional convolution kernel, with the output channel number set to 1. The convolution result is normalized to the 0-1 range using the sigmoid activation function to generate a spatial attention map. The spatial attention map is then multiplied element-wise with the original feature map to achieve feature recalibration in the spatial dimension. The large 7×7×7 convolution kernel can capture sufficiently large spatial context information, ensuring that the spatial attention map can effectively distinguish neural structures from surrounding tissues.
[0052] The output layer uses the Sigmoid activation function to output a single-channel probability map, and the output data type is set to float32 to ensure numerical stability under mixed-precision computing conditions. During the inference phase, the probability map is converted into a binary segmentation mask by setting a threshold of 0.5.
[0053] The specific process of step S3 is as follows: S31: Input the final enhanced image I enhance Multi-scale 3D features are extracted through a five-level encoder, and the output is... X 5; enter: I enhance → X 0(1, 96, 96, 96); Encoder 1: Residual block + downsampling → X 1(32, 48, 48, 48); Encoder 2: Residual block + downsampling → X2(64, 24, 24, 24); Encoder 3: Residual block + downsampling → X3(128, 12, 12, 12); Encoder 4: Residual block + downsampling → X4(256, 6, 6, 6); Encoder 5: Residual block + downsampling → X5(512, 3, 3, 3); S32: Output based on 3D hybrid attention-enhanced key features. X att ; X att = X 5⊙ M c ( X 5)⊙ M s ( X 5); Where ⊙: element-wise multiplication; M c Channel attention weights; M s Spatial attention weights; The channel attention weight calculation process is as follows: F avg =(1 / D·H·W)∑ d,h,w X 5( d,h,w ); F max =max d,h,w X 5( d,h,w ); M c =s ( MLP ( F avg ) +MLP ( F max )); in, F avg Global average pooling characteristics; F max : Global max pooling features; MLP: Two-layer perceptron, with an intermediate dimension of C / 4; s Sigmoid activation; M c Channel weights, dimension (512, 1, 1, 1); The spatial attention weight calculation process is as follows: F c-avg =(1 / C )∑ c X 5( c ,:,:,:); F c-max = maxcX 5 ( c ,:,:,:); F cat =Concat ( F c-avg ,F c-max ) ; M s = σ( Conv 3D ( F cat ,w s ,k =7, p =3)); in, F c-avg Channel average pooling characteristics; F c-max Channel max pooling characteristics; F cat : splicing characteristics; ws Spatial convolution kernel; k =7: Convolution kernel size; p =3: Fill; M s Spatial weights; S33: Based on a five-level decoder, upsampling and skip connection fusion are performed to output Y0; enter: X att ; Decoder 5: Upsampling + splicing X 4 + residual block → Y4(256, 6, 6, 6); Decoder 4: Upsampling + splicing X 3+ residual block → Y3(128, 12, 12, 12); Decoder 3: Upsampling + splicing X 2+ residual block → Y2(64, 24, 24, 24); Decoder 2: Upsampling + splicing X 1 + residual block → Y1(32, 48, 48, 48); Decoder 1: Upsampling + splicing X 0+ residual block → Y0(1, 96, 96, 96); Upsampling: X up =Conv3DTranspose( X,w u ,s =2, p =1); w u : Transpose convolution kernel; s=2: stride; p =1: Fill; X up Upsampling features; Jump connection splicing: Y concat =Concat ( X up , X skip ); in, X skip : Encoder corresponding layer features; Y concat Features after splicing; S34: Output probability map of nerves or blood vessels through the output layer: P (x )= s (Conv3D( Y 0, w out , k =1)); w out Output convolution kernel; P ( x ): Segmentation probability graph.
[0054] The neurovascular conflict detection method performs spatial overlap analysis based on the trigeminal nerve binary mask and adjacent blood vessel binary mask output by 3D segmentation, thereby achieving automated detection of neurovascular conflicts.
[0055] Mask alignment and overlap detection: Mask alignment: Since the segmentation module independently processes nerve and blood vessel targets, it is necessary to ensure that both are in the same spatial reference frame in the 3D coordinate system. Specifically, this involves checking whether the spatial metadata of the two masks is consistent, including the image origin, pixel spacing, and coordinate axis orientation. If differences exist, one mask is resampled to the same spatial coordinate system as the other through an affine transformation.
[0056] Overlap detection: After mask alignment, a voxel-by-voxel logical AND operation is performed. Specifically, this is achieved by multiplying the neural mask and the vascular mask element-by-element to generate an overlapping region mask. If a non-zero voxel value exists in the overlapping region mask, it is determined that there is an abnormal neural-vascular contact; otherwise, it is determined that the neural-vascular relationship is normal.
[0057] Anomaly Classification: When anomalies are detected, the degree of abnormality is further classified based on the morphological characteristics of the segmented nerve and blood vessel regions. The criterion for minor contact anomalies is that the overlapping area only shows slight contact between the nerve and blood vessel boundaries without significant compression or deformation. Specifically, the edge voxels of the nerve mask are first extracted, and the overlap ratio between the edge voxels and the blood vessel mask is calculated. If the overlap ratio is less than 20% and the diameter and cross-sectional morphology of the nerve do not change significantly, it is judged as a minor contact anomaly.
[0058] The criteria for determining abnormal compression deformation are obvious bending of the nerve course or compression deformation of the cross-sectional shape. Specifically, the nerve's centerline is obtained by extracting the skeleton from the nerve mask, and changes in the curvature of the centerline are detected. If the local curvature exceeds a threshold or the ratio of the nerve's minor axis to its major axis is less than 0.5, it is determined to be abnormal compression deformation.
[0059] Quantitative indicator calculation: The neurovascular conflict detection module also calculates quantitative indicators such as neurovascular overlap volume, contact area, and length of the compressed nerve segment to support clinicians in conducting accurate preoperative assessments and postoperative follow-up comparisons. The overlap volume is calculated by counting the total number of non-zero voxels in the overlap region mask and multiplying it by the voxel resolution. The contact area is calculated by triangulating the neurovascular interface and calculating the surface area. The length of the compressed nerve segment is calculated by extracting the path length of the compressed region along the neuroskeleton.
[0060] The specific process of step S4 is as follows: S41: Perform threshold binarization on the neural or vascular probability map output from step S34: like P ( x If )≥0.5, then M ( x )=1; like P ( x If ) < 0.5, then M ( x )=0; in, M ( x () is a three-dimensional binary mask with a value range of {0,1}, integer, where 1 represents the target (nerve or blood vessel) and 0 represents the background; S42: Perform mask space alignment to ensure that the neural mask and the vascular mask are in the same 3D coordinate system and the same voxel mesh, as shown in the following formula: M' n ( x' )= M n ( R ( i ) x' + t ); M' v ( x' )= M v ( R ( i ) x' + t ); in, x = (x,y,z) ): Primitive voxel coordinates; x' =( x',y',z' ): Target-aligned coordinate system voxel coordinates; : 3D rotation matrix i =( i x ,i y ,i z ); t =( t x ,t y ,t z ): Three-dimensional translation vector (unit: mm); M n ( x ): Original trigeminal nerve binary mask, 1 = nerve, 0 = background; M v ( x ): Original binary mask for blood vessels, 1 = blood vessel, 0 = background; M' n ( x' Aligned neural mask; M' v ( x' ): Aligned blood vessel mask; S43: Element-by-element multiplication generates an overlap mask: M ov ( x )= M n ( x )⊙ M v ( x ); Among them, ⊙: element-wise logical AND, that is, element-wise multiplication; M ov ( x ): Overlapping region mask, 1 = overlap, 0 = no overlap; Only voxels where both nerve and blood vessel values are 1 are marked as overlapping; S44: Perform overlap determination: Overlapping voxel count: N ov =∑ x M ov ( x ); in, N ov The total number of overlapping voxels; The judgment rules are as follows: N ov =0 Neurovascular relationship: normal; N ov >0 There is an abnormal contact. S45: Classify abnormalities, including minor contact or compression deformation; Quantization overlap volume V ov : V ov =N ov ×v res ; in, v res Voxel volume; Quantify contact area A ov : A ov =∑ x ∇ M ov ( x ); Among them, ∇ M ov Surface gradient of overlapping region (edge voxel count); The grading rules are as follows: like 0<V ov ≤V th If so, it is determined to be a minor contact abnormality; like V ov >V th If so, it is determined to be abnormal compression deformation; in, V th The threshold for overlapping volume classification can be set to... V th =5mm 3 .
[0061] Preferably, the structured report in step S5 includes basic patient information, examination information, and neurovascular conflict detection results; The examination information includes MRI sequences and scanning parameters; the neurovascular conflict detection results include overlap volume. V ov Contact area A ov , grading results.
Claims
1. A method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism, characterized in that, Includes the following steps: S1: Obtain T2-weighted MRI images of the skull base, perform bias field correction, and use anisotropic diffusion filtering or nonlocal mean filtering for denoising to suppress thermal noise and motion artifacts; S2: Implement quantile-based intensity normalization, perform spatial resampling and registration to unify images from different sources to the same three-dimensional coordinate system and resolution system, and perform medical image enhancement; S3: Perform 3D segmentation: Segment the trigeminal nerve and adjacent blood vessels based on the improved VNet network architecture. The network adopts an encoder-decoder design, which includes five-level downsampling paths and five-level upsampling paths. Skip connections are established between corresponding levels of the encoder and decoder to retain multi-scale feature information, and a 3D hybrid attention mechanism is embedded in the network. S4: Perform neurovascular conflict detection: Based on the trigeminal nerve binary mask and adjacent blood vessel binary mask output by 3D segmentation, perform spatial overlap analysis. Generate the overlapping region mask by multiplying the nerve mask and blood vessel mask element by element, and determine whether the neurovascular relationship is normal based on whether there are non-zero voxel values in the overlapping region mask. S5: Generate structured reports; The specific process of step S3 is as follows: S31: Input the final enhanced image I enhance Multi-scale 3D features are extracted through a five-level encoder, and the output is... X 5; enter : I enhance → X 0 (1, 96, 96, 96); Encoder 1: Residual block + downsampling → X 1 (32, 48, 48, 48); Encoder 2: Residual block + downsampling → X2 (64, 24, 24, 24); Encoder 3: Residual block + downsampling → X3 (128, 12, 12, 12); Encoder 4: Residual block + downsampling → X4 (256, 6, 6, 6); Encoder 5: Residual block + downsampling → X5 (512, 3, 3, 3); S32: Output based on 3D hybrid attention-enhanced key features. X att ; X att = X 5⊙ M c ( X 5)⊙ M s ( X 5); Where ⊙: element-wise multiplication; M c Channel attention weights; M s Spatial attention weights; S33: Based on a five-level decoder, upsampling and skip connection fusion are performed to output Y0; enter: X att ; Decoder 5: Upsampling + splicing X 4 + residual block → Y4 (256, 6, 6, 6); Decoder 4: Upsampling + splicing X 3 + residual block → Y3(128, 12, 12, 12); Decoder 3: Upsampling + splicing X 2 + residual block → Y2 (64, 24, 24, 24); Decoder 2: Upsampling + splicing X 1 + residual block → Y1 (32, 48, 48, 48); Decoder 1: Upsampling + splicing X 0 + residual block → Y0 (1, 96, 96, 96); Upsampling: X up =Conv3DTranspose( X,w u ,s =2, p =1); w u : Transpose convolution kernel; s=2: stride; p =1: Fill; X up Upsampling features; Jump connection splicing: Y concat =Concat ( X up , X skip ); in, X skip : Encoder corresponding layer features; Y concat Features after splicing; S34: Output probability map of nerves or blood vessels through the output layer: P ( x )= σ (Conv3D( Y 0, w out , k =1)); w out Output convolution kernel; P ( x ): Segmentation probability graph; Furthermore, the loss function used during training is the combined loss function, which is expressed as: combined_loss=α×BCE+β×TverskyLoss; Where α is the weight coefficient of the binary cross-entropy loss (BCE) of Tversky Loss; β is the weight coefficient of Tversky loss. The specific process of step S4 is as follows: S41: Perform threshold binarization on the neural or vascular probability map output from step S34: like P ( x If )≥0.5, then M ( x )=1; like P ( x If ) < 0.5, then M ( x )=0; in, M ( x () is a three-dimensional binary mask with a value range of {0,1}, integer, where 1 represents the target, nerve, or blood vessel, and 0 represents the background; S42: Perform mask space alignment to ensure that the neural mask and the vascular mask are in the same 3D coordinate system and the same voxel mesh, as shown in the following formula: M' n ( x' )= M n ( R ( θ ) x' + t ); M' v ( x' )= M v ( R ( θ ) x' + t ); in, x = (x,y,z ): Primitive voxel coordinates; x' =( x',y',z' ): Target-aligned coordinate system voxel coordinates; R ( θ ): Three-dimensional rotation matrix θ =( θ x ,θ y ,θ z ); t =( t x ,t y ,t z ): Three-dimensional translation vector; M n ( x ): Original trigeminal nerve binary mask, 1 = nerve, 0 = background; M v ( x ): Original binary mask for blood vessels, 1 = blood vessel, 0 = background; M' n ( x' ): Aligned neural mask; M' v ( x' ): Aligned blood vessel mask; S43: Element-by-element multiplication generates an overlap mask: M ov ( x )= M n ( x )⊙ M v ( x ); Among them, ⊙: element-wise logical AND, that is, element-wise multiplication; M ov ( x ): Overlapping region mask, 1 = overlap, 0 = no overlap; Only voxels where both nerve and blood vessel values are 1 are marked as overlapping; S44: Perform overlap determination: Overlapping voxel count: N ov =∑ x M ov ( x ); in, N ov The total number of overlapping voxels; The judgment rules are as follows: N ov =0 Neurovascular relationship: normal; N ov >0 There is an abnormal contact. S45: Classify abnormalities, including minor contact or compression deformation; Quantization overlap volume V ov : V ov =N ov ×v res ; in, v res Voxel volume; Quantify contact area A ov : A ov =∑ x ∇ M ov ( x ); Among them, ∇ M ov Surface gradient in overlapping regions; The grading rules are as follows: like 0<V ov ≤V th If so, it is determined to be a minor contact abnormality; like V ov >V th If so, it is determined to be abnormal compression deformation; in, V th The threshold for overlapping volume classification.
2. The method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism according to claim 1, characterized in that, The specific process of step S2 is as follows: S21: Intensity normalization based on quantiles to eliminate device differences and obtain intensity-normalized images. I norm : S22: Perform spatial resampling and registration processing: S221: Spatial resampling processing: Set the target resolution to s target =(1.0, 1.0, 1.0) mm ; Interpolation processing: ; in, x' Target voxel coordinates; x k Original 8-neighbor voxel coordinates; w k Trilinear interpolation weights; S222: Perform rigid body registration processing to obtain the registered image. I align : The target reference template is as follows T ref ( x ); Mutual information similarity is measured as follows: MI( I resamp ,T ref )=H( I resamp )+H( T ref )−H( I resamp ,T ref ); Where H(·) is the information entropy; H(·,·) is the joint entropy; Perform rigid body transformation: x ′= R ( θ )· x + t 1; in, R ( θ ): Rotation matrix θ =( θ x , θ y , θ z ); t 1=( t x ,t y ,t z ): Translation vector for rigid body transformation in three-dimensional space; t x ,t y ,t z These are the translation components along the X, Y, and Z axes in the three-dimensional coordinate system, respectively. Output registered image I align ; S23: Perform image enhancement processing to obtain the final enhanced image. I enhance .
3. The method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism according to claim 2, characterized in that, The specific process of step S21 is as follows: S211: Calculate the upper and lower quantiles: p 2= Q 0.02 ( I diff ); p 98 = Q 0.98 ( I diff ); Among them, Q α (·): Image α quantile; I diff Image after diffusion denoising; S212: Perform extreme value truncation: I clip ( x )= max ( p 2, min ( I diff ( x ), p 98 )); in, I clip The image after truncation for extreme values; p 2 represents the 2% grayscale quantile; p 98 98th percentile grayscale quantile; S213: Normalize to [0,1]: I norm ( x )= p 98 − p 2 I clip ( x )− p 2; in, I norm This is the intensity-normalized image.
4. The method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism according to claim 3, characterized in that, The specific process of step S23 is as follows: S231: Intensity normalization treatment: I 1( x )=( I align ( x )− min ( I align )) / ( max ( I align )− min(I align )); S232: Gamma correction: I2(x)=I1(x) γ γ is the Gamma parameter; S233: Perform gain adjustment: I3( x )= gain ·I2( x Gain coefficient gain =1.4; S234: Perform local contrast enhancement processing: Histogram cropping: h clip ( k )= min ( h ( k ), 0.02· N pix ; in, h ( k ): Local 8×8×8 grid histogram; N pix Local grid volume prime number; k Gray level; Grayscale mapping: ; I4( x )= T (I3( x )); S235: Perform bilateral filtering: ; ; σ s : Spatial standard deviation of bilateral filter; σ r Standard deviation of bilateral filter strength; S236: Perform unsharpening mask: I blur =I5· G σ=1.0 ; I enhance ( x )=I5( x )+ α ·(I5( x )−I blur ( x )), α =1.3; in, G σ Gaussian kernel; α Sharpening factor; σ =1.0: Gaussian blur standard deviation; I 1 ~I 5: Enhance images at each stage; I enhance Final enhanced image.
5. The method for trigeminal nerve segmentation and neurovascular conflict assessment based on a 3D hybrid attention mechanism according to claim 1, characterized in that, The structured report in step S5 includes basic patient information, examination information, and neurovascular conflict detection results; The examination information includes MRI sequences and scanning parameters; the neurovascular conflict detection results include overlap volume. V ov Contact area A ov , grading results.