A method and system for automatic multi-segment segmentation and three-dimensional reconstruction of optic nerve in optic neuritis MRI based on deep learning
Patent Information
- Application Number
- CN202611067130.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-27
AI Technical Summary
[0006]针对现有技术的不足,本发明提供一种基于深度学习的视神经炎MRI视神经多段自动分割与三维重建方法及系统,以解决视神经小目标分割困难、分段定位不足、传统阈值重建不稳定以及形态学定量参数难以自动化输出的问题
[0017]与现有技术相比,本发明至少具有以下有益效果:(1)通过分段标签建模,使模型能够区分眼内段、眶内段、管内段、颅内段和视交叉,便于评价不同解剖节段的形态变化和受累范围;(2)借助脑部MRI分割任务预训练权重、Dice与交叉熵联合损失以及数据增强策略,缓解小样本、小目标和类别不平衡问题;(3)三维模型由网络识别得到的解剖标签生成,边界不再依赖单一灰度阈值,分割与重建连续性更好;(4)在一具体实施例中,以141例视神经相关疾病MRI数据建立样本库并由3D Slicer 5.8.0逐层标注,模型训练集Dice可达约0.92、验证集Dice可达约0.88,人工勾画和重建流程可由约30至60分钟缩短至5分钟以内;(5)可进一步输出长度、直径、体积、表面积和曲率等形态学定量参数,为视神经炎MRI影像形态学分析提供客观数据基础。
Smart Images

Figure CN122990098A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical image processing and medical imaging artificial intelligence, specifically to a method and system for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI for optic neuritis based on deep learning. Background Technology
[0002] Optic neuritis is a neuro-ophthalmic emergency characterized by inflammatory demyelination of the optic nerve. Some patients may be associated with central demyelinating diseases such as multiple sclerosis and neuromyelitis optica spectrum disorders. If lesion activity and axonal damage are not observed in time, permanent optic nerve atrophy or long-term visual impairment may occur.
[0003] Magnetic resonance imaging (MRI) is an important non-invasive method for evaluating optic neuritis. It can identify lesions through features such as high signal intensity on T2-weighted images, thickening of the optic nerve, enhancement on contrast-enhanced scans, and lesion visualization in fat-suppressed sequences. The optic nerve is usually only about 3 to 4 millimeters in diameter, with a tortuous course, and is adjacent to structures such as extraocular muscles, blood vessels, cerebrospinal fluid, and orbital fat. Conventional two-dimensional imaging is insufficient to comprehensively and stably express the spatial extent of the lesion and the involvement of each anatomical segment.
[0004] In current clinical practice, regions of interest in the optic nerve usually rely on physicians to delineate layer by layer, which takes a long time to process a single case and the consistency between observers is affected by experience. Three-dimensional reconstruction based on grayscale thresholds is also easily affected by sequence differences, signal inhomogeneity, noise and artificial thresholding, resulting in missed segmentation, over-segmentation and boundary breaks in the small and curved optic nerve region.
[0005] Deep learning has been widely used in medical image segmentation, but it still has two shortcomings for optic neuritis MRI: First, existing methods mostly treat the optic nerve as a whole target, making it difficult to provide fine segmentation information such as intraocular, intraorbital, intracanal, intracranial, and optic chiasm segments; second, the foreground voxels of the optic nerve in cranial and orbital MRI are extremely small, and direct training is easily affected by foreground-background class imbalance. Therefore, how to obtain stable optic nerve segmentation results under conditions of small samples, small targets, and class imbalance, and further generate continuous segmented 3D models, is a technical problem that needs to be solved in this field. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method and system for automatic segmentation and three-dimensional reconstruction of optic nerve segments in MRI for optic neuritis based on deep learning, in order to solve the problems of difficulty in segmenting small targets in the optic nerve, insufficient segmentation localization, instability of traditional threshold reconstruction, and difficulty in automatically outputting morphological quantitative parameters.
[0007] To achieve the above objectives, the technical solution of the present invention is: a method for automatic multi-segment segmentation and three-dimensional reconstruction of the optic nerve in optic neuritis based on deep learning, characterized by comprising the following steps: S1. Steps for MRI preprocessing of subjects to be treated: Multiple sequences of magnetic resonance imaging data of the subjects were acquired, and spatial registration, resampling and intensity normalization were performed on each sequence. The processed images of each sequence were used as multi-channel input data for the optic nerve. S2. Steps for building and training a multi-label segmentation model: The segmentation model employs a 3D fully convolutional network with an encoder-decoder structure. During the training phase, preprocessed multi-channel 3D image blocks are used as network input, and artificial gold standard labels are used as supervision labels for paired training. The model output is a multi-channel probability map that corresponds one-to-one with the input voxel space. The multi-channel probability map includes six channels: background, intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. After the maximum probability category selection, a multi-label 3D segmentation mask is formed. The artificial gold standard label includes at least the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm of the optic nerve; among which the optic disc serves as the starting point of the intraocular segment and the left and right lateral positioning constraint. After the multi-label segmentation model is trained, skip step S2 and execute step S3 when using it. S3. Multi-label segmentation model usage steps: During the model usage phase, input the MRI of the subject to be processed into the trained multi-label segmentation model, and the model outputs a six-channel probability map; select the label with the highest probability for each voxel as the initial segmentation result; for isolated voxels with a probability lower than the preset confidence threshold, remove or merge adjacent high-confidence labels based on neighborhood consistency, thereby obtaining an automatically generated layer-by-layer three-dimensional segmentation mask. When the trained multi-label segmentation model outputs segmentation labels for each anatomical segment, it uses the differentiated segmentation rules established during the training phase: For intraocular segments, the optic disc and posterior pole of the eyeball are used as the initial localization region, and the boundary is identified along the origin of the optic nerve on T2-weighted sequences or oblique coronal images; for intraorbital segments with an S-shaped curve and surrounded by orbital fat, the distinction between them and the surrounding fat is enhanced on fat-suppressed sequences, and the robustness of the curvature is improved by elastic deformation data; for intracanal segments located within the bony optic canal, adjacent to cerebrospinal fluid, and with low contrast, the nerve-cerebrospinal fluid interface is segmented using thin-slice T2-weighted sequences or steady-state free precession sequences; for intracranial segments located between the outlet of the optic canal and the anterior margin of the optic chiasm, the boundaries at both ends are determined using T1-enhanced sequences, thin-slice T2-weighted sequences, or multiplanar reconstructed views; for the optic chiasm located in the suprasellar cistern with an X-shaped crossing structure, the segment is segmented according to the crossing structure on coronal or multiplanar reconstructed views and distinguished from the intracranial segments; S4. Perform connected component filtering, hole filling and boundary smoothing on the three-dimensional segmentation mask; Connected component filtering includes retaining candidate regions that satisfy the volume threshold or the maximum connected component rule according to the anatomical label, and the boundary smoothing includes morphological closing operation and / or Gaussian smoothing; S5. Based on the post-processed voxel labels, extract the isosurface mesh. The specific process is as follows: extract the isosurface mesh for each label according to the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm; the isosurface extraction adopts the moving cube algorithm; then, perform triangular patch simplification, Laplacian smoothing, and small isolated patch removal on the surface mesh of each label, and then assign different display attributes according to the label number to generate a continuous segmented 3D model of the optic nerve and optic chiasm.
[0008] According to the above-described deep learning-based automatic segmentation and 3D reconstruction method for multi-segment optic nerve in MRI for optic neuritis, the training process of the multi-label segmentation model is characterized by the following: In step S21, based on artificial gold standard labels, the multi-label segmentation model is trained using a weighted combination of Dice loss and cross-entropy loss as the objective function, and outputs a layer-by-layer 3D segmentation mask containing the segmentation labels; the Dice loss and cross-entropy loss are weighted at a ratio of 1:1 or according to preset dynamic weights, the Dice loss is used to optimize the degree of overlap of segmented regions, and the cross-entropy loss is used to enhance the voxel-level classification accuracy; First, data augmentation is performed on the multi-channel input data. This data augmentation includes random rotation, random flipping, and elastic deformation. The random rotation angle range is ±15 degrees, and the elastic deformation parameters include σ=10 and α=20. During training, the data is divided into training, test, and validation sets. The loss function is a weighted sum of the Dice loss and the cross-entropy loss. During training, at least one of the following is used to prevent overfitting: AdamW optimizer, learning rate decay, L2 regularization, Dropout, and early stopping strategy, with the validation set Dice coefficient as the monitoring metric. Step S22 is the initialization training step for transfer learning, which specifically includes: acquiring a brain tumor MRI segmentation dataset containing sequences such as T1, T1 enhancement, T2, and FLAIR; processing the dataset according to registration, resampling, and intensity normalization rules; and training a brain tumor-related segmentation task using a three-dimensional fully convolutional network with an encoder-decoder structure. When the pre-training task reaches a stable Dice coefficient or the loss no longer decreases on the validation set, the convolutional kernel weights of the network encoder part are saved as pre-training weights. During model training, the pre-training weights are loaded into the encoder part of the multi-label segmentation model, and the decoder and the final classification layer are initialized with random weights. In the early stage of training, the shallow layer of the encoder is frozen, and only the parameters of the decoder, bottleneck layer, and output layer are updated, so that the model first learns the mapping relationship between the five segments of the optic nerve and the output channel. After the training loss continuously decreases and tends to stabilize, the middle and shallow layers of the encoder are gradually unfrozen, and the overall fine-tuning is performed with a small learning rate to adapt the pre-training features to small targets, multiple segments, and low contrast boundaries of the optic nerve.
[0009] According to the above-described deep learning-based automatic segmentation and 3D reconstruction method for optic nerve multi-segmentation in optic neuritis MRI, the method is characterized in that: the pre-training weights are obtained through a brain tumor MRI segmentation task, specifically: a brain tumor MRI segmentation dataset containing T1, T1-enhanced, T2, and FLAIR sequences is acquired, processed according to the same registration, resampling, and intensity normalization rules, and then a 3D fully convolutional network with an encoder-decoder structure is used to train the brain tumor-related segmentation task; when the pre-training task reaches a stable Dice coefficient or the loss no longer decreases on the validation set, the convolutional kernel weights of the network encoder part are saved as initial weights for transfer learning.
[0010] According to the above-described deep learning-based automatic segmentation and three-dimensional reconstruction method for optic nerve multi-segmentation in optic neuritis MRI, the method is characterized by the following steps: in step S4, the steps are performed in the order of connected component screening, hole filling, and boundary smoothing; during connected component screening, the three-dimensional connected components of the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm are calculated first, and the connected components that are closest to the endpoints of adjacent anatomical segments and satisfy the continuity of anatomical course are retained; when there are multiple candidate regions for the same label, the largest connected component or the candidate region whose volume is greater than the lower limit threshold of the volume distribution of the training set for that label is retained, wherein the lower limit threshold is taken as the 5th percentile of the corresponding label volume in the training set or the preset minimum number of voxels; hole filling is used to fill small cavities inside the mask, and boundary smoothing adopts morphological closing operation and / or Gaussian smoothing.
[0011] According to the above-described deep learning-based automatic segmentation and three-dimensional reconstruction method for optic nerve multi-segmentation in optic neuritis MRI, the characteristic feature is that: in step S5, the isosurface threshold is taken as 0.5 of the label mask.
[0012] According to the above-described deep learning-based MRI method for automatic segmentation and three-dimensional reconstruction of optic nerve segments in optic neuritis, the method is characterized in that: in step S1, the multi-sequence magnetic resonance imaging includes at least a T2-weighted imaging sequence, a T1-weighted enhanced imaging sequence, and a fat suppression sequence, wherein the fat suppression sequence includes a short-time inversion recovery sequence.
[0013] According to the above-described deep learning-based automatic segmentation and three-dimensional reconstruction method for optic nerve multi-segmentation in optic neuritis MRI, the method is characterized in that: in step S1: spatial registration is to register each sequence to the same reference sequence space, resampling is to resample to isotropic voxels, and intensity normalization is to perform zero-mean unit variance normalization on each sequence.
[0014] According to the above-described deep learning-based automatic segmentation and three-dimensional reconstruction method for optic nerve multi-segmentation in optic neuritis MRI, the method is characterized in that: in step S1, non-target tissues in multi-sequence magnetic resonance images are cropped.
[0015] According to the above-described deep learning-based MRI method for automatic segmentation and three-dimensional reconstruction of optic nerve multi-segment in optic neuritis, the method is characterized by further including the step of extracting anatomical segment parameters: extracting at least one morphological quantitative parameter of an anatomical segment based on the segmented three-dimensional model, wherein the morphological quantitative parameter includes at least one of length, average diameter, volume, surface area, thickness, shape irregularity or curvature.
[0016] This invention also provides a deep learning-based automatic segmentation and 3D reconstruction system for multi-segment optic nerve in optic neuritis MRI, characterized by comprising an image acquisition module, a segmentation module, a transfer training module, and a 3D reconstruction module; the image acquisition module acquires multiple MRI sequences and performs registration, resampling, intensity normalization, and region of interest clipping; the transfer training module loads pre-trained encoder weights from brain MRI during the training phase, performs freeze-training and thawing fine-tuning, and outputs a trained multi-label segmentation model; the segmentation module calls the trained multi-label segmentation model during the model usage phase and outputs a 3D segmentation including the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. The 3D reconstruction module is responsible for post-processing of the segmentation mask, surface mesh generation, and output of quantitative morphological parameters. During use, if in the training phase, the transfer training module works with the segmentation module to load pre-training weights, freeze training, thaw fine-tuning, and save model parameters. If in the model usage phase, the system does not start the transfer training module; instead, the image acquisition module generates multi-channel input data consistent with the training phase, and the segmentation module calls the pre-trained multi-label segmentation model to generate the initial multi-label mask. The 3D reconstruction module performs connected component filtering, hole filling, boundary smoothing, isosurface extraction, and mesh smoothing according to the labels, outputting a segmented 3D model and morphological parameters.
[0017] Compared with the prior art, the present invention has at least the following beneficial effects: (1) By segmented label modeling, the model can distinguish the intraocular segment, intraorbital segment, intracanal segment, intracranial segment and optic chiasm, which is convenient for evaluating the morphological changes and affected range of different anatomical segments; (2) By using the pre-training weights of brain MRI segmentation task, the joint loss of Dice and cross-entropy and data augmentation strategy, the problems of small sample, small target and class imbalance are alleviated; (3) The three-dimensional model is generated by the anatomical labels obtained by the network recognition, and the boundary no longer depends on a single gray threshold, and the continuity of segmentation and reconstruction is better; (4) In a specific embodiment, a sample library is established with MRI data of 141 cases of optic nerve-related diseases and labeled layer by layer by 3D Slicer 5.8.0. The Dice of the model training set can reach about 0.92 and the Dice of the validation set can reach about 0.88. The manual delineation and reconstruction process can be shortened from about 30 to 60 minutes to less than 5 minutes; (5) It can further output morphological quantitative parameters such as length, diameter, volume, surface area and curvature, providing an objective data basis for morphological analysis of optic neuritis MRI images. Attached Figure Description
[0018] Figure 1 This is a graph showing the loss and Dice coefficient curves of the training and validation sets in one embodiment of the present invention.
[0019] Figure 2 This is a schematic diagram of the anatomical segmentation of the optic nerve and optic chiasm according to the present invention.
[0020] Figure 3 This is a schematic diagram of the overall process of one embodiment of the method of the present invention.
[0021] Figure 4 This is a structural block diagram of one embodiment of the system of the present invention.
[0022] Figure 5 This is a schematic diagram of the reconstruction process of generating segmented 3D models from segmented masks according to the present invention.
[0023] Figure 6 This is a schematic diagram of the network structure and transfer learning initialization of the segmentation model of this invention.
[0024] Figure labeling: Eyeball 10, intraocular segment or optic disc origin region 11, intraorbital segment 12, intracanal segment 13, intracranial segment 14, optic chiasm 15; multi-sequence image input 20, segmentation label output 23, pre-training weights 24, 30 to 33 represent the relevant stages of 3D reconstruction, 40 to 44 represent system functional modules. Detailed Implementation
[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments. The following embodiments are used to explain the technical solutions of the present invention and do not limit the scope of protection of the present invention.
[0026] This invention includes a model training phase and a model usage phase. In the training phase, a human gold standard label is used as a supervisory signal to train a multi-label segmentation model. In the model usage phase, there is no need for manual layer-by-layer delineation. After inputting preprocessed multi-sequence MRI of the subject, the trained model automatically outputs a three-dimensional segmentation mask containing the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. Post-processing, three-dimensional reconstruction, and morphological parameter output are then performed based on this segmentation mask.
[0027] like Figure 3 As shown, the present invention provides a method for automatic multi-segment segmentation and three-dimensional reconstruction of the optic nerve in optic neuritis MRI based on deep learning, comprising the following steps: S1. Steps for MRI preprocessing of subjects to be treated: Multiple sequences of magnetic resonance imaging data of the subjects were acquired, and spatial registration, resampling and intensity normalization were performed on each sequence. The processed images of each sequence were used as multi-channel input data for the optic nerve. The multi-sequence magnetic resonance imaging in this step includes at least a T2-weighted imaging sequence, a T1-weighted enhanced imaging sequence, and a fat suppression sequence, wherein the fat suppression sequence includes a short-time inversion recovery sequence.
[0028] The spatial registration in this step is to register each sequence to the same reference sequence space. The resampling is to resample to isotropic voxels. The intensity normalization is to perform zero-mean unit variance normalization on each sequence.
[0029] The preprocessed image sequences are stacked along the channel dimension in the same voxel coordinate system to form multi-channel input data. To reduce interference from non-target tissues, a three-dimensional region of interest containing both optic nerves and the optic chiasm can be cropped based on the location of the bilateral eyeballs, orbital apex, optic canal, and suprasellar cistern. The cropped image blocks preserve the affine transformation relationship with the original spatial coordinates so that the segmentation mask output by the model can be mapped back to the original MRI space.
[0030] S2. Steps for constructing and training the multi-label segmentation model: Using the optic disc as the initial localization constraint, the optic nerve is divided along its course into intraocular, intraorbital, intracanal, intracranial, and optic chiasm segments. Each of these anatomical structures is used as an independent segmentation label to construct a multi-label segmentation model. After the multi-label segmentation model is constructed and trained, the model and parameters can be used directly. That is, after the multi-label segmentation model is trained, step S2 is skipped and step S3 is executed. Step S21: During the model training phase, artificial gold standard labels are created based on multi-channel input data. These artificial gold standard labels are drawn layer by layer using 3D medical image processing software. Each artificial gold standard label includes at least the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm of the optic nerve; the optic disc serves as the starting point of the intraocular segment and provides left-right lateral positioning constraints. The artificial gold standard labels are used only as training supervision signals and do not require manual layer-by-layer drawing during the model usage phase.
[0031] Based on artificial gold standard labels, the multi-label segmentation model is trained using a weighted combination of Dice loss and cross-entropy loss as the objective function, outputting a layer-by-layer 3D segmentation mask containing the segmentation labels. In this step, the Dice loss and cross-entropy loss are weighted at a 1:1 ratio or by preset dynamic weights. The Dice loss optimizes the overlap of segmented regions, while the cross-entropy loss enhances voxel-level classification accuracy. First, data augmentation is performed on the multi-channel input data, including random rotation, random flipping, and elastic deformation. The random rotation angle ranges from ±15 degrees, and the elastic deformation parameters include σ=10 and α=20 to simulate the bending morphology of the intraorbital segment of the optic nerve and individual anatomical variations. During training, at least one of the following strategies is used to prevent overfitting: AdamW optimizer, learning rate decay, L2 regularization, Dropout, and early stopping. The early stopping strategy uses the validation set Dice coefficient as a monitoring indicator.
[0032] The segmentation model can employ a 3D fully convolutional network with an encoder-decoder structure, and its specific implementation may include, but is not limited to, nnUNet, 3D U-Net, or U-Net++. See also Figure 1 During the training phase, preprocessed multi-channel 3D image blocks are used as network input, and artificial gold standard labels are used as supervised labels for paired training. The model output is a multi-channel probability map that corresponds one-to-one with the input voxel space. The multi-channel probability map includes six channels: background, intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. After selection of the highest probability category, a multi-label 3D segmentation mask is formed.
[0033] Pre-training weights can be obtained through brain tumor MRI segmentation tasks. Specifically, a brain tumor MRI segmentation dataset containing T1, T1-enhanced, T2, and FLAIR sequences is acquired. After processing the dataset according to the same registration, resampling, and intensity normalization rules, a 3D fully convolutional network with an encoder-decoder structure is used to train the brain tumor-related segmentation task. When the pre-training task reaches a stable Dice coefficient or the loss no longer decreases on the validation set, the convolutional kernel weights of the network encoder are saved as initial weights for transfer learning. Since brain tumor MRI and optic nerve MRI both belong to cranial magnetic resonance imaging, the pre-trained encoder can provide low- and mid-level image features such as edges, tissue interfaces, and small-volume abnormal regions.
[0034] During the training of the model in this application, multi-channel input data and artificial gold standard labels are paired to form training samples. The pre-trained encoder weights are loaded into the encoder part of the multi-label segmentation model, and the decoder and final classification layer are initialized with random weights. In the early stage of training, the shallow layer of the encoder is frozen, and only the parameters of the decoder, bottleneck layer and output layer are updated, so that the model first learns the mapping relationship between the five segments of the optic nerve and the output channel. After the training loss continuously decreases and tends to stabilize, the middle and shallow layers of the encoder are gradually unfrozen, and the overall fine-tuning is carried out with a small learning rate to adapt the pre-trained features to small targets, multi-segment labels and low contrast boundaries of the optic nerve.
[0035] During training, the data is divided into training, testing, and validation sets, for example, in a 7:2:1 ratio. The loss function is a weighted sum of the Dice loss and the cross-entropy loss, with a preferred weight ratio of 1:1. Higher class weights can also be assigned to small volume labels such as intra-tube and intra-eye segments to reduce missed segmentation caused by insufficient foreground voxels. The optimizer can be AdamW, with an initial learning rate of 1e. -4 The learning rate can be reduced to 1e during the unfreezing and fine-tuning phase. -5 This is combined with cosine annealing or other learning rate decay strategies.
[0036] To improve the model's robustness to different scanning angles and individual anatomical variations, data augmentation is performed on the multi-channel input data and corresponding labels during training using the same spatial transformation, including random rotation, random flipping, random scaling, intensity perturbation, and elastic deformation. The random rotation angle can be ±15 degrees, and the elastic deformation parameters can be set to σ=10 and α=20. This augmentation is particularly useful for simulating the S-shaped curvature of the intraorbital segment, the narrow course of the optic canal, and differences in optic chiasm morphology, enabling the model to maintain stable segmentation across different anatomical segments.
[0037] Step S22, Transfer Learning Initialization Training Step: During the model training phase, the encoder weights obtained from the pre-training of the brain MRI segmentation task are acquired and used to initialize the encoder part of the multi-label segmentation model. Transfer learning is used during the model training phase to improve the convergence speed and stability of small target segmentation of the optic nerve by utilizing the edge, tissue interface, and small volume abnormality region features learned from the brain MRI task; transfer learning training is not performed during the model usage phase.
[0038] The transfer learning initialization training in step S22 includes: acquiring a brain tumor MRI segmentation dataset containing T1, T1-enhanced, T2, and FLAIR sequences; processing the dataset according to registration, resampling, and intensity normalization rules; and training a brain tumor-related segmentation task using a three-dimensional fully convolutional network with an encoder-decoder structure. When the pre-training task reaches a stable Dice coefficient or the loss no longer decreases on the validation set, the convolutional kernel weights of the encoder part of the network are saved as pre-training weights. When training the model of this application, the pre-training weights are loaded into the encoder part of the multi-label segmentation model, and the decoder and the final classification layer are initialized with random weights. In the early stage of training, the shallow layer of the encoder is frozen, and only the parameters of the decoder, bottleneck layer, and output layer are updated, so that the model first learns the mapping relationship between the five-segment labels of the optic nerve and the output channel. After the training loss continuously decreases and tends to stabilize, the middle and shallow layers of the encoder are gradually unfrozen, and the overall fine-tuning is performed with a small learning rate to adapt the pre-training features to small targets, multiple segments, and low contrast boundaries of the optic nerve.
[0039] S3. Steps for using the multi-label segmentation model: Input the MRI of the subject to be processed into the trained multi-label segmentation model and automatically output the multi-label 3D segmentation mask.
[0040] During the model usage phase, the MRI scans of the subjects to be processed undergo the same preprocessing as in step S1 and are input into the trained multi-label segmentation model. The model outputs a six-channel probability map. For each voxel, the label with the highest probability is selected as the initial segmentation result. For isolated voxels with probabilities lower than a preset confidence threshold, neighbor consistency is considered to remove or incorporate adjacent high-confidence labels, thereby obtaining an automatically generated layer-by-layer 3D segmentation mask. During the model usage phase, manual annotation, pre-training weight acquisition, or transfer training are no longer performed; only the trained multi-label segmentation model is called for inference segmentation.
[0041] When the trained multi-label segmentation model outputs segmentation labels for each anatomical segment, it uses the differentiated segmentation rules established during the training phase: For intraocular segments, the optic disc and posterior pole of the eyeball are used as the initial localization region, and the boundary is identified along the origin of the optic nerve on T2-weighted sequences or oblique coronal images; for intraorbital segments with an S-shaped curve and surrounded by orbital fat, the distinction between them and the surrounding fat is enhanced on fat-suppressed sequences, and the robustness of the curvature is improved by elastic deformation data; for intracanal segments located within the bony optic canal, adjacent to cerebrospinal fluid, and with low contrast, the nerve-cerebrospinal fluid interface is segmented using thin-slice T2-weighted sequences or steady-state free precession sequences; for intracranial segments located between the outlet of the optic canal and the anterior margin of the optic chiasm, the boundaries at both ends are determined using T1-enhanced sequences, thin-slice T2-weighted sequences, or multiplanar reconstructed views; for the optic chiasm located in the suprasellar cistern with an X-shaped crossing structure, the segment is segmented according to the crossing structure on coronal or multiplanar reconstructed views and distinguished from the intracranial segments. Using the differentiated segmentation rules of this invention, the boundaries no longer depend on a single grayscale threshold, resulting in better continuity between segmentation and reconstruction. In a specific embodiment, the Dice coefficient of the training set is approximately 0.92, the Dice coefficient of the validation set is approximately 0.88, and the segment endpoint positioning error is less than or equal to 0.9 mm.
[0042] S4. Perform connected component filtering, hole filling and boundary smoothing on the three-dimensional segmentation mask; The connected component screening in this step includes retaining candidate regions that meet the volume threshold or the maximum connected component rule according to the anatomical label, and the boundary smoothing includes morphological closing operation and / or Gaussian smoothing.
[0043] Post-processing is performed separately for each label, following the order of connected component filtering, hole filling, and boundary smoothing. During connected component filtering, three-dimensional connected components are first calculated for the intraocular, intraorbital, intracanal, intracranial, and optic chiasm segments. Connected components that are closest to the endpoints of adjacent anatomical segments and satisfy anatomical continuity are preferentially retained. When multiple candidate regions exist for the same label, the largest connected component or the candidate region with a volume greater than the lower limit threshold of the training set volume distribution for that label is retained. The lower limit threshold can be the 5th percentile of the corresponding label volume in the training set or a preset minimum number of voxels. Hole filling is used to fill small voids inside the mask. Boundary smoothing can employ morphological closing operations and / or Gaussian smoothing to reduce jagged boundaries and maintain spatial continuity between segments.
[0044] S5. Based on the post-processed voxel labels, extract the isosurface mesh to generate a continuous 3D model of the optic nerve and optic chiasm segments.
[0045] Based on the post-processed voxel labels, isosurface surface meshes are extracted label by label for the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. The isosurface extraction can be performed using the moving cube algorithm, and the isosurface threshold can be set to 0.5 of the label mask. Subsequently, the surface mesh of each label is simplified by triangular patches, smoothed by Laplacian, and small isolated patches are removed. Then, different display attributes are assigned according to the label number, and combined to generate a continuous segmented 3D model of the optic nerve and optic chiasm.
[0046] It also includes the step of extracting anatomical segment parameters: extracting at least one morphological quantitative parameter of an anatomical segment based on a segmented three-dimensional model, wherein the morphological quantitative parameter includes at least one of length, average diameter, volume, surface area, thickness, shape irregularity or curvature.
[0047] This invention also discloses a deep learning-based automatic segmentation and 3D reconstruction system for optic nerve multi-segmentation in optic neuritis MRI, comprising: an image acquisition module for acquiring multi-sequence magnetic resonance images and performing registration, resampling, and intensity normalization; a segmentation module for performing multi-label segmentation of the optic nerve and optic chiasm based on independent anatomical labels and outputting a layer-by-layer 3D segmentation mask; a transfer training module for acquiring pre-training weights and training a multi-label segmentation model; and a 3D reconstruction module for performing post-processing on the segmentation mask and extracting surface meshes to generate a segmented 3D model.
[0048] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the preceding claims.
[0049] Example 1: Data Acquisition, Labeling, and Preprocessing See Figure 3 MRI data of patients with optic neuritis or optic nerve-related diseases who meet the inclusion criteria will be collected and stored in DICOM format. Inclusion criteria may include: age 18 to 65 years, completion of orbital and cranial MRI scans for clinical reasons, complete preservation of image data, and signing of informed consent; exclusion criteria may include blurred images, missing sequences, or other circumstances deemed unsuitable for inclusion by the investigator.
[0050] MRI preprocessing of subjects to be processed: In one specific embodiment, the sample library includes MRI data of 141 patients with optic nerve-related diseases. The sequences include at least T2-weighted imaging sequences, T1-weighted enhanced imaging sequences, and fat-suppressed sequences, wherein the fat-suppressed sequences can be short-time inversion recovery sequences. DICOM images of each sequence are imported on a patient-by-patient basis. A thin-slice T2-weighted sequence or the sequence with the highest spatial resolution is selected as the reference sequence. The remaining sequences are transformed to the reference sequence space through rigid or affine registration, and then resampled to isotropic voxels, for example, 0.5 mm × 0.5 mm × 0.5 mm. Each sequence is then normalized to zero mean and unit variance or to percentile truncation.
[0051] The preprocessed image sequences are stacked along the channel dimension in the same voxel coordinate system to form multi-channel input data. To reduce interference from non-target tissues, a three-dimensional region of interest containing both optic nerves and the optic chiasm can be cropped based on the location of the bilateral eyeballs, orbital apex, optic canal, and suprasellar cistern. The cropped image blocks preserve the affine transformation relationship with the original spatial coordinates so that the segmentation mask output by the model can be mapped back to the original MRI space.
[0052] An independent multi-label system was established, with the background label denoted as 0, the intraocular segment or optic disc origin region as 1, the intraorbital segment as 2, the intracanal segment as 3, the intracranial segment as 4, and the optic chiasm as 5. Experienced neuro-ophthalmologists and radiologists used 3D medical image processing software such as 3D Slicer to delineate these labels layer by layer on the training samples, obtaining artificial gold standard labels. These artificial gold standard labels were only used to provide supervisory signals during the training phase; during model usage, the subject's MRI scans, after similar preprocessing, were directly input into the trained model, which automatically output segmentation labels for each anatomical segment.
[0053] Independent segmentation labels are first used to determine the output category of the model and supervised training objectives. Differential segmentation then configures annotation boundaries, input sequence weights, and data augmentation strategies based on the imaging characteristics of each label. The two are related as a co-operation process within the same segmentation workflow. Specifically, the intraocular segment is located starting from the optic disc and the posterior pole of the eyeball, and its boundary is determined along the origin of the optic nerve on T2-weighted images or oblique coronal images; the intraorbital segment is S-shaped and surrounded by orbital fat, and is preferably marked on fat-suppressed sequences, with robustness to the curvature enhanced by elastic deformation during training; the intracanal segment is located within the bony optic canal, adjacent to cerebrospinal fluid and with low contrast, and its boundary is preferably determined by combining thin-slice T2-weighted sequences or steady-state free-precession sequences such as CISS and FIESTA to display the neuro-cerebrospinal fluid interface; the intracranial segment is located between the optic canal outlet and the anterior edge of the optic chiasm, and its boundaries are preferably determined by combining T1-enhanced sequences, thin-slice T2-weighted sequences, and multiplanar reconstructed views, according to the optic canal outlet and the anterior edge of the optic chiasm; the optic chiasm is located in the suprasellar cistern and has an X-shaped crossing structure, and is preferably segmented according to the crossing structure on coronal or multiplanar reconstructed views, and distinguished from the boundary of the intracranial segment.
[0054] Optic disc / intraocular segment The intraocular segment from the optic disc to the posterior pole of the eyeball is approximately 1 mm long. On T2-weighted images, the visual disc shows a relatively low signal, contrasted by the high signal in the surrounding vitreous humor. Tracing the origin of the optic nerve in the sagittal or oblique coronal plane. Intraorbital segment The longest distance from the posterior pole of the eyeball to the entrance of the optic nerve canal is approximately 25-30 mm. In fat-suppressed sequences, the signal from the surrounding orbital fat is suppressed, and the optic nerve shows isointense or abnormal signals. It has an S-shaped curve and needs to be distinguished from the extraocular muscles. Pipeline section Inside the optic nerve canal, approximately 5-9 mm in length The neuro-cerebrospinal fluid interface can be seen on thin-layer T2 or CISS / FIESTA sequences. Axial tracking of the location where the optic nerve enters the bony optic canal Intracranial segment The optic nerve canal extends approximately 10 mm from its exit point to the anterior margin of the optic chiasm. The bifurcation relationship of the anterior edge of the optic chiasm is visible on the T1-weighted image. Located above the bifurcation of the internal carotid artery and medial to the anterior clinoid process. optic chiasm The front part of the suprasellar pool, about 10×8×3 mm On coronal T2-weighted images, it can appear as an X-shaped cross structure. The upper part is the floor of the third ventricle, and the lower part is the pituitary stalk. Example 2: Segmentation Model Training and 3D Reconstruction The segmentation model can employ a 3D fully convolutional network with an encoder-decoder structure, and its specific implementation may include, but is not limited to, nnUNet, 3D U-Net, or U-Net++. See also Figure 6 The network input is a three-dimensional image block composed of multiple sequence image channels, and the output is a multi-channel probability map that corresponds one-to-one with the input voxel space. The multi-channel probability map includes six channels: background, intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. After the maximum probability category is selected, a multi-label three-dimensional segmentation mask is formed.
[0055] Pre-training weights can be obtained through brain tumor MRI segmentation tasks. Specifically, a brain tumor MRI segmentation dataset containing T1, T1-enhanced, T2, and FLAIR sequences is acquired. After processing the dataset according to the same registration, resampling, and intensity normalization rules, a 3D fully convolutional network with an encoder-decoder structure is used to train the brain tumor-related segmentation task. When the pre-training task reaches a stable Dice coefficient or the loss no longer decreases on the validation set, the convolutional kernel weights of the network encoder are saved as initial weights for transfer learning. Since brain tumor MRI and optic nerve MRI both belong to cranial magnetic resonance imaging, the pre-trained encoder can provide low- and mid-level image features such as edges, tissue interfaces, and small-volume abnormal regions.
[0056] During the training of the model in this application, multi-channel input data and artificial gold standard labels are paired to form training samples. The pre-trained encoder weights are loaded into the encoder part of the multi-label segmentation model, and the decoder and final classification layer are initialized with random weights. In the early stage of training, the shallow layer of the encoder is frozen, and only the parameters of the decoder, bottleneck layer and output layer are updated, so that the model first learns the mapping relationship between the five segments of the optic nerve and the output channel. After the training loss continuously decreases and tends to stabilize, the middle and shallow layers of the encoder are gradually unfrozen, and the overall fine-tuning is carried out with a small learning rate to adapt the pre-trained features to small targets, multi-segment labels and low contrast boundaries of the optic nerve.
[0057] During training, the data is divided into training, testing, and validation sets, for example, in a 7:2:1 ratio. The loss function is a weighted sum of the Dice loss and the cross-entropy loss, with a preferred weight ratio of 1:1. Higher class weights can also be assigned to small volume labels such as intra-tube and intra-eye segments to reduce missed segmentation caused by insufficient foreground voxels. The optimizer can be AdamW, with an initial learning rate of 1e. -4 The learning rate can be reduced to 1e during the unfreezing and fine-tuning phase. -5 This is combined with cosine annealing or other learning rate decay strategies.
[0058] To improve the model's robustness to different scanning angles and individual anatomical variations, data augmentation is performed on the multi-channel input data and corresponding labels during training using the same spatial transformation, including random rotation, random flipping, random scaling, intensity perturbation, and elastic deformation. The random rotation angle can be ±15 degrees, and the elastic deformation parameters can be set to σ=10 and α=20. This augmentation is particularly useful for simulating the S-shaped curvature of the intraorbital segment, the narrow course of the optic canal, and differences in optic chiasm morphology, enabling the model to maintain stable segmentation across different anatomical segments.
[0059] After training, during the model usage phase, the MRI scans of the subjects to be processed are preprocessed using the same steps as the MRI preprocessing for the subjects to be processed, and then input into the model. The model outputs a six-channel probability map. For each voxel, the label with the highest probability is selected as the initial segmentation result. For isolated voxels with probabilities lower than a preset confidence threshold, neighborhood consistency can be used to remove them or incorporate adjacent high-confidence labels, thus obtaining an automatically generated layer-by-layer 3D segmentation mask. During training, the Dice coefficient on the validation set is used as an early stopping monitoring indicator, and L2 regularization and Dropout can be used to suppress overfitting. In a specific embodiment, the final Dice coefficient on the training set is approximately 0.92, and the Dice coefficient on the validation set is approximately 0.88. The training curve is shown below. Figure 1 As shown.
[0060] See Figure 5Post-processing is performed separately for each label, following the order of connected component filtering, hole filling, and boundary smoothing. During connected component filtering, three-dimensional connected components are first calculated for the intraocular, intraorbital, intracanal, intracranial, and optic chiasm segments. Connected components that are closest to the endpoints of adjacent anatomical segments and satisfy anatomical continuity are preferentially retained. When multiple candidate regions exist for the same label, the largest connected component or the candidate region with a volume greater than the lower limit threshold of the training set volume distribution for that label is retained. The lower limit threshold can be the 5th percentile of the corresponding label volume in the training set or a preset minimum number of voxels. Hole filling is used to fill small voids inside the mask. Boundary smoothing can employ morphological closing operations and / or Gaussian smoothing to reduce jagged boundaries and maintain spatial continuity between segments.
[0061] Based on the post-processed voxel labels, isosurface surface meshes are extracted label-by-label for the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. The isosurface extraction can employ the moving cube algorithm, with the isosurface threshold set to 0.5 of the label mask. Subsequently, the surface mesh of each label undergoes triangular patch simplification, Laplacian smoothing, and small isolated patches removal. Different display attributes are then assigned according to the label number, and these are combined to generate a continuous segmented 3D model of the optic nerve and optic chiasm. Since the boundaries of the 3D model originate from the anatomical labels learned by the model, rather than a single grayscale threshold, the impact of grayscale differences between different sequences and manual thresholding on the continuity of the reconstruction can be reduced.
[0062] Architecture selection A three-dimensional fully convolutional network with an encoder-decoder structure; specific implementations may include nnUNet or a three-dimensional U-shaped network. Automated configuration of network depth, preprocessing, and enhancement strategies Pre-trained weights BraTS brain tumor MRI segmentation task Improve the generalization ability of medical image features and the convergence speed with small samples. Optimizer AdamW Combining adaptive optimization and weight decay Initial learning rate 1e-4 To avoid initial fluctuations, refine the optimization process by incorporating learning rate decay. Batch size For example, 4, adjust based on GPU memory. Balancing memory usage and training stability loss function Dice + Cross-Entropy, with 1:1 or dynamic weights Mitigating imbalances in small goals and categories Data Augmentation Random rotation ±15°, elastic deformation σ=10 / α=20, random flipping Simulating optic nerve curvature and anatomical variations Training cycle 100-200 epochs, patience=30, stop early Ensure convergence and control overfitting Regularization L2=1e-5, Dropout=0.2 Improve generalization ability Example 3: Quantitative Morphological Output of Segmented 3D Models Based on a segmented 3D model, morphological quantitative parameters such as length, average diameter, volume, surface area, thickness, shape irregularity, and curvature can be calculated segment by segment. These parameters can be output separately for intraocular segments, intraorbital segments, intracanal segments, intracranial segments, and optic chiasm, or separately for the left and right optic nerves.
[0063] In one specific embodiment, the length can be calculated based on the segment centerline or skeleton line; the average diameter can be estimated by the segment volume and the centerline length, or statistically analyzed on a section perpendicular to the centerline; the volume can be obtained by multiplying the number of label voxels by the voxel volume; the surface area can be obtained by summing the areas of the triangular facets of the surface mesh; and the curvature can be obtained by calculating the local tangent vector change along the centerline.
[0064] The aforementioned quantitative morphological parameters, along with the segmented 3D model, are output as image processing results for subsequent viewing, measurement, quality control, or statistical analysis. This output does not include disease diagnostic conclusions.
[0065] length Integrating along the segment centerline or skeleton line Quantifying the length of each anatomical segment average diameter Estimated from volume and centerline length or based on cross-sectional statistics Describe the variation in thickness of the tubular structure volume Tag voxel count multiplied by monomer volume Quantitative segmentation space ratio Surface area Summation of the area of triangular facets of the surface mesh Evaluation of the surface extent of the reconstructed model curvature Calculate local directional changes along the centerline Describe the curved structures such as the intraorbital segment. Example 4: System and Storage Media See Figure 4The system includes an image acquisition module, a segmentation module, a transfer training module, and a 3D reconstruction module. The image acquisition module acquires multiple MRI sequences and performs registration, resampling, intensity normalization, and region-of-interest (ROI) cropping. The transfer training module loads pre-trained encoder weights from brain MRI during the training phase, performs freeze-training and thaw-fine-tuning, and outputs a trained multi-label segmentation model. The segmentation module calls the trained multi-label segmentation model during the model usage phase and outputs a 3D segmentation mask containing intraocular, intraorbital, intracanal, intracranial, and optic chiasm segments. The 3D reconstruction module is responsible for post-processing of the segmentation mask, surface mesh generation, and output of quantitative morphological parameters.
[0066] During use, if in the training phase, the transfer training module works with the segmentation module to load pre-training weights, freeze training, thaw fine-tuning, and save model parameters. If in the model usage phase, the system does not start the transfer training module. Instead, the image acquisition module generates multi-channel input data consistent with the training phase, and the segmentation module calls the pre-trained multi-label segmentation model to generate the initial multi-label mask. The 3D reconstruction module performs connected component filtering, hole filling, boundary smoothing, isosurface extraction, and mesh smoothing according to the labels, and finally outputs a segmented 3D model and morphological parameters. The data passed between the above modules are, in order, multi-channel MRI images, six-channel probability maps, multi-label 3D segmentation masks, post-processing label masks, surface mesh models, and quantitative parameter tables.
[0067] The present invention also provides a computer-readable storage medium on which a computer program stored is executed by a processor to implement the method steps of any of the above embodiments. The storage medium includes, but is not limited to, a USB flash drive, a portable hard drive, a read-only memory, a random access memory, a magnetic disk, an optical disk, or a server storage medium.
[0068] The above embodiments are merely preferred embodiments of the present invention. Any equivalent substitutions, modifications, or combinations made within the spirit and principles of the present invention should fall within the protection scope of the present invention.
[0069] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A deep learning-based method for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI for optic neuritis, characterized in that: Includes the following steps: S1. Steps for MRI preprocessing of subjects to be treated: Multiple sequences of magnetic resonance imaging data of the subjects were acquired, and spatial registration, resampling and intensity normalization were performed on each sequence. The processed images of each sequence were used as multi-channel input data for the optic nerve. S2. Steps for building and training a multi-label segmentation model: The segmentation model employs a 3D fully convolutional network with an encoder-decoder structure. During the training phase, preprocessed multi-channel 3D image blocks are used as network input, and artificial gold standard labels are used as supervision labels for paired training. The model output is a multi-channel probability map that corresponds one-to-one with the input voxel space. The multi-channel probability map includes six channels: background, intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm. After the maximum probability category selection, a multi-label 3D segmentation mask is formed. The artificial gold standard label includes at least the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm of the optic nerve; among which the optic disc serves as the starting point of the intraocular segment and the left and right lateral positioning constraint. After the multi-label segmentation model is trained, skip step S2 and execute step S3 when using it. S3. Steps for using the multi-label segmentation model: During the model usage phase, input the MRI of the subject to be processed into the trained multi-label segmentation model, and the model outputs a six-channel probability map; select the label with the highest probability for each voxel as the initial segmentation result; For isolated voxels with a probability lower than the preset confidence threshold, the neighbor consistency is used to remove or incorporate adjacent high-confidence labels, thereby obtaining an automatically generated layer-by-layer 3D segmentation mask. When the trained multi-label segmentation model outputs segmentation labels for each anatomical segment, it uses the differentiated segmentation rules established during the training phase: For intraocular segments, the optic disc and posterior pole of the eyeball are used as the initial localization region, and the boundary is identified along the origin of the optic nerve on T2-weighted sequences or oblique coronal images; for intraorbital segments with an S-shaped curve and surrounded by orbital fat, the distinction between them and the surrounding fat is enhanced on fat-suppressed sequences, and the robustness of the curvature is improved by elastic deformation data; for intracanal segments located within the bony optic canal, adjacent to cerebrospinal fluid, and with low contrast, the nerve-cerebrospinal fluid interface is segmented using thin-slice T2-weighted sequences or steady-state free precession sequences; for intracranial segments located between the outlet of the optic canal and the anterior margin of the optic chiasm, the boundaries at both ends are determined using T1-enhanced sequences, thin-slice T2-weighted sequences, or multiplanar reconstructed views; for the optic chiasm located in the suprasellar cistern with an X-shaped crossing structure, the segment is segmented according to the crossing structure on coronal or multiplanar reconstructed views and distinguished from the intracranial segments; S4. Perform connected component filtering, hole filling and boundary smoothing on the three-dimensional segmentation mask; Connected component filtering includes retaining candidate regions that satisfy the volume threshold or the maximum connected component rule according to the anatomical label, and the boundary smoothing includes morphological closing operation and / or Gaussian smoothing; S5. Based on the post-processed voxel labels, extract the isosurface mesh. The specific process is as follows: extract the isosurface mesh for each label according to the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm; the isosurface extraction adopts the moving cube algorithm; then, perform triangular patch simplification, Laplacian smoothing, and small isolated patch removal on the surface mesh of each label, and then assign different display attributes according to the label number to generate a continuous segmented 3D model of the optic nerve and optic chiasm.
2. The method for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI based on deep learning as described in claim 1, characterized in that: The training process of the multi-label segmentation model is as follows: In step S21, based on the artificial gold standard labels, the multi-label segmentation model is trained with a weighted combination of Dice loss and cross-entropy loss as the objective function, and the output is a layer-by-layer three-dimensional segmentation mask containing the segmentation labels; the Dice loss and cross-entropy loss are weighted at a ratio of 1:1 or according to a preset dynamic weight, the Dice loss is used to optimize the degree of overlap of segmentation regions, and the cross-entropy loss is used to enhance the voxel-level classification accuracy; First, data augmentation is performed on the multi-channel input data. This data augmentation includes random rotation, random flipping, and elastic deformation. The random rotation angle range is ±15 degrees, and the elastic deformation parameters include σ=10 and α=20. During training, the data is divided into training, test, and validation sets. The loss function is a weighted sum of the Dice loss and the cross-entropy loss. During training, at least one of the following is used to prevent overfitting: AdamW optimizer, learning rate decay, L2 regularization, Dropout, and early stopping strategy, with the validation set Dice coefficient as the monitoring metric. Step S22 is the initialization training step for transfer learning, which specifically includes: acquiring a brain tumor MRI segmentation dataset containing sequences such as T1, T1 enhancement, T2, and FLAIR; processing the dataset according to registration, resampling, and intensity normalization rules; and training a brain tumor-related segmentation task using a three-dimensional fully convolutional network with an encoder-decoder structure. When the pre-training task reaches a stable Dice coefficient or the loss no longer decreases on the validation set, the convolutional kernel weights of the network encoder part are saved as pre-training weights. During model training, the pre-training weights are loaded into the encoder part of the multi-label segmentation model, and the decoder and the final classification layer are initialized with random weights. In the early stage of training, the shallow layer of the encoder is frozen, and only the parameters of the decoder, bottleneck layer, and output layer are updated, so that the model first learns the mapping relationship between the five segments of the optic nerve and the output channel. After the training loss continuously decreases and tends to stabilize, the middle and shallow layers of the encoder are gradually unfrozen, and the overall fine-tuning is performed with a small learning rate to adapt the pre-training features to small targets, multiple segments, and low contrast boundaries of the optic nerve.
3. The method for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI based on deep learning according to claim 2, characterized in that: The pre-training weights were obtained through a brain tumor MRI segmentation task. Specifically, a brain tumor MRI segmentation dataset containing T1, T1-enhanced, T2, and FLAIR sequences was acquired. After processing the dataset according to the same registration, resampling, and intensity normalization rules, a 3D fully convolutional network with an encoder-decoder structure was used to train the brain tumor-related segmentation task. When the pre-training task reached a stable Dice coefficient or the loss no longer decreased on the validation set, the convolutional kernel weights of the network encoder were saved as initial weights for transfer learning.
4. A method for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI based on deep learning, as described in claim 1 or 2, characterized in that: In step S4, the process is performed in the order of connected component screening, hole filling, and boundary smoothing. During connected component screening, the three-dimensional connected components of the intraocular segment, intraorbital segment, intracanal segment, intracranial segment, and optic chiasm are calculated first, and the connected components that are closest to the endpoints of the adjacent anatomical segments and satisfy the continuity of the anatomical course are retained. When there are multiple candidate regions for the same label, the largest connected component or the candidate region whose volume is greater than the lower limit threshold of the volume distribution of the training set for that label is retained. The lower limit threshold is taken as the 5th percentile of the volume of the corresponding label in the training set or the preset minimum number of voxels. Hole filling is used to fill small holes inside the mask, and boundary smoothing adopts morphological closing operation and / or Gaussian smoothing.
5. A method for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI based on deep learning, as described in claim 1 or 2, characterized in that: In step S5, the isosurface threshold is set to 0.5 of the label mask.
6. A method for automatic multi-segment segmentation and three-dimensional reconstruction of the optic nerve in optic neuritis based on deep learning, as described in claim 1 or 2, characterized in that: In step S1: the multi-sequence magnetic resonance imaging includes at least a T2-weighted imaging sequence, a T1-weighted enhanced imaging sequence, and a fat suppression sequence, wherein the fat suppression sequence includes a short-time inversion recovery sequence.
7. A method for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI based on deep learning, as described in claim 1 or 2, characterized in that: In step S1: spatial registration is to register each sequence to the same reference sequence space; resampling is to resample to isotropic voxels; and intensity normalization is to perform zero-mean unit variance normalization on each sequence.
8. A method for automatic multi-segment segmentation and three-dimensional reconstruction of the optic nerve in optic neuritis based on deep learning, as described in claim 1 or 2, characterized in that: In step S1: Non-target tissues are cropped from multi-sequence magnetic resonance images.
9. A method for automatic segmentation and three-dimensional reconstruction of the optic nerve in MRI based on deep learning, as described in claim 1 or 2, characterized in that: It also includes the step of extracting anatomical segment parameters: extracting at least one morphological quantitative parameter of an anatomical segment based on a segmented three-dimensional model, wherein the morphological quantitative parameter includes at least one of length, average diameter, volume, surface area, thickness, shape irregularity or curvature.
10. A deep learning-based automatic segmentation and three-dimensional reconstruction system for multi-segment optic nerve in optic neuritis MRI, characterized in that: The system comprises an image acquisition module, a segmentation module, a transfer training module, and a 3D reconstruction module. The image acquisition module acquires multiple MRI sequences and performs registration, resampling, intensity normalization, and region-of-interest (ROI) cropping. The transfer training module loads pre-trained encoder weights from brain MRI during the training phase, performs freeze-training and thaw-fine-tuning, and outputs a trained multi-label segmentation model. The segmentation module calls the trained multi-label segmentation model during the model usage phase and outputs a 3D segmentation mask containing intraocular, intraorbital, intracanal, intracranial, and optic chiasm segments. The 3D reconstruction module is responsible for post-processing of the segmentation mask and surface meshing. The system generates and outputs quantitative morphological parameters. During use, if in the training phase, the transfer training module works with the segmentation module to load pre-training weights, freeze training, thaw fine-tuning, and save model parameters. If in the model usage phase, the system does not start the transfer training module. Instead, the image acquisition module generates multi-channel input data consistent with the training phase, and the segmentation module calls the pre-trained multi-label segmentation model to generate the initial multi-label mask. The 3D reconstruction module performs connected component filtering, hole filling, boundary smoothing, isosurface extraction, and mesh smoothing according to the labels, outputting a segmented 3D model and morphological parameters.