A myelin segmentation method and system based on hyperparameter update
By optimizing hyperparameters through an improved UNet network model and the Fireworks algorithm, the problems of poor adaptability and insufficient accuracy in traditional methods are solved, achieving efficient and accurate myelin segmentation that is adaptable to different scales and microscopic imaging modes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional axon and myelin segmentation methods are poorly adaptable, time-consuming, and lack sufficient segmentation accuracy when nerve fibers vary in size and shape or after nerve injury, thus failing to meet clinical needs.
An improved UNet network model is adopted, which combines attention-based feature modules and fireworks algorithm to optimize hyperparameters. By extracting layer features of myelin sheath between the encoder and decoder and continuously updating hyperparameter values, the model is optimized to improve segmentation accuracy.
Robust segmentation of myelin sheaths at different scales was achieved, reducing time costs, improving segmentation accuracy and automation, adapting to various microscopic imaging modes, and significantly improving the efficiency and accuracy of axon and myelin sheath image segmentation.
Smart Images

Figure CN116416512B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of myelin segmentation, and particularly relates to a myelin segmentation method and system based on super parameter updating. BACKGROUND
[0002] Myelin thickness and number are key indicators used by clinicians and researchers to analyze neuropathies; however, in common experimental rodent models, peripheral nerves comprise thousands of nerve fibers; time-consuming manual morphometric methods are still frequently applied; therefore, manual measurements are usually performed only on selected partial regions of interest and require subsequent extrapolation. Due to the uneven distribution of morphologically and functionally different nerve fiber populations in peripheral nerves, the size, number and location of the selected regions often introduce a relatively large bias.
[0003] The inventors found that in the segmentation of axons and myelin, the traditional image-based method is designed for a specific imaging method and often fails if another microscope imaging is used, and the adaptability is poor; and the commonly used method is not fully automatic, and needs pre-processing and manual selection of axon recognition features, etc., and the time cost is high; and due to the different sizes and shapes of nerve fibers, especially the small axons and thin myelin of regenerated axons after nerve injury, it is challenging to accurately detect and segment them, and the traditional axon and myelin segmentation method has low accuracy and cannot meet the requirements of segmentation accuracy after nerve injury. SUMMARY
[0004] To solve the above problems, the application provides a myelin segmentation method and system based on super parameter updating, which improves the UNet model for axon and myelin segmentation, and the model can achieve good results in axon and myelin segmentation.
[0005] To achieve the above purpose, the application is implemented by the following technical solutions:
[0006] In a first aspect, the application provides a myelin segmentation method based on super parameter updating, comprising:
[0007] obtaining an image containing axons and myelin;
[0008] obtaining the segmentation result of axons and myelin according to the obtained image and a preset segmentation network model;
[0009] The segmentation network model comprises an encoder and a decoder, and a feature module based on an attention mechanism added between the encoder and the decoder; the feature module extracts layer features of myelin using a hierarchical convolution group module; during training, the error is calculated according to the predicted value and the true value obtained by the segmentation network model, and the segmentation network model with the minimum error is obtained by continuously updating the super parameter value.
[0010] Further, the encoder comprises a plurality of down-sampling modules, and the number of feature maps is doubled after passing through each down-sampling module.
[0011] Further, the segmentation network model is a Unet network model, and the super parameter values optimized by the firework algorithm are used as the super parameter values of the Unet network model for model training and testing.
[0012] Further, the number of sparks generated is limited according to the range of values and the rounding principle.
[0013] Further, the position of the firework particle represents the super parameter set of the Unet network model in the current iteration, each firework particle moves in the selection space to search for the Unet network model corresponding to the minimum error, changes the speed and position of the Unet network model, and reduces the error between the true value and the predicted value.
[0014] Further, the explosion particles are randomly initialized in the preset feasible domain;
[0015] The position of the explosion spark generated by the explosion of each firework particle and the position of the variation spark generated by the variation of the plurality of firework particles are calculated;
[0016] The firework particle exceeding the preset feasible domain space is mapped into the feasible domain space, and the firework particle with the minimum fitness value is used as the initial firework of the next iteration;
[0017] After multiple iterations, the firework particle is saved according to the fitness value.
[0018] Further, the updating process of the super parameter value is:
[0019] The topological structure of the segmentation network model and the super parameters to be optimized are determined, and the value range of the super parameters is determined;
[0020] The population is initialized, and the related images of axons and myelin are input into the segmentation network model for training;
[0021] The error is calculated according to the predicted value and the true value obtained by the segmentation network model, the super parameter value is continuously updated by the firework algorithm, and the segmentation network model with the minimum error is obtained.
[0022] In a second aspect, the application further provides a myelin segmentation system based on super parameter updating, comprising:
[0023] The data acquisition module is configured to acquire related images containing axons and myelin;
[0024] The myelin sheath segmentation module is configured to obtain a segmentation result of axons and myelin sheaths according to the obtained image and a preset segmentation network model.
[0025] The segmentation network model comprises an encoder and a decoder, and a feature module based on an attention mechanism is added between the encoder and the decoder; the feature module extracts layer features of the myelin sheath by using a hierarchical convolution group module; during training, an error is calculated according to a predicted value and an actual value obtained by the segmentation network model, and the segmentation network model with the minimum error is obtained by continuously updating the hyperparameter value.
[0026] In a third aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the myelin sheath segmentation method based on hyperparameter updating according to the first aspect.
[0027] In a fourth aspect, the present application further provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the myelin sheath segmentation method based on hyperparameter updating according to the first aspect when executing the program.
[0028] Compared with the prior art, the present application has the following beneficial effects:
[0029] 1. By adding a feature module based on an attention mechanism between the encoder and the decoder of the segmentation network model, the feature module extracts higher layer features of the myelin sheath by using a hierarchical convolution group module, which can realize the robustness of myelin sheath segmentation of different scales, solve the problem of difficult myelin sheath segmentation caused by different sizes, has strong adaptability and low time cost; at the same time, during training, an error is calculated according to a predicted value and an actual value obtained by the segmentation network model, and the segmentation network model with the minimum error is obtained by continuously updating the hyperparameter value; the problem of manual adjustment of network hyperparameters during training is solved, the optimal combination of hyperparameters is ensured, and the segmentation precision is improved;
[0030] 2. The improved Unet network model is first proposed for axon and myelin sheath segmentation, which can achieve good results in axon and myelin sheath segmentation; the Unet network model optimized based on the fireworks algorithm is used for segmenting myelin sheath images, and compared with the traditional image segmentation algorithm: the automation level is improved, manual selection of related features is not required, hidden structure and texture features can be learned by itself, the adaptability is good, multiple microscopic imaging modes can be trained, the myelin sheath segmentation efficiency is improved, the axon and myelin sheath image segmentation accuracy is improved, and the segmentation accuracy is obviously improved;
[0031] 3、In the present application, in order to limit the position of the fireworks particle with good fitness value from generating too many explosion sparks, and at the same time, the position of the fireworks particle with poor fitness value from generating too few spark particles, the number of sparks generated is limited. BRIEF DESCRIPTION OF DRAWINGS
[0032] The drawings constituting a part of this embodiment are used to provide further understanding of the present embodiment, the illustrative embodiments of the present embodiment and the description thereof are used to explain the present embodiment, and do not constitute improper limitation on the present embodiment.
[0033] Figure 1 The Unet network model structure of embodiment 1 of the present application is shown in the figure.
[0034] Figure 2 The schematic diagram of the feature module based on the attention mechanism of embodiment 1 of the present application is shown in the figure.
[0035] Figure 3 The FWA-Unet flowchart of embodiment 1 of the present application is shown in the figure.
[0036] Figure 4 The segmentation result of embodiment 1 of the present application is shown in the figure. DETAILED DESCRIPTION
[0037] The present application will be further described below in combination with the drawings and embodiments.
[0038] It should be pointed out that the following detailed description is exemplary and is intended to provide further description of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as generally understood by those skilled in the art to which the present application belongs.
[0039] Embodiment 1:
[0040] The size and shape of nerve fibers are different, especially the regenerated axons after nerve injury are small and the myelin sheath is thin, which makes it challenging to detect and segment accurately. The traditional axon and myelin sheath segmentation method has low accuracy and cannot meet the requirements of the size and shape of nerve fibers and the segmentation accuracy after nerve injury. In view of the above problems, the present embodiment provides a myelin sheath segmentation method based on super parameter updating, comprising:
[0041] Obtaining an image containing axons and myelin sheaths;
[0042] According to the obtained image and the preset segmentation network model, the segmentation result of the axon and the myelin sheath is obtained.
[0043] The segmentation network model comprises an encoder and a decoder, and a feature module based on an attention mechanism is added between the encoder and the decoder; the feature module extracts layer features of the myelin sheath by using a hierarchical convolution group module; during training, an error is calculated according to a predicted value and an actual value obtained by the segmentation network model, and the segmentation network model with the minimum error is obtained by continuously updating the hyperparameter value.
[0044] By adding a feature module based on an attention mechanism between the encoder and the decoder of the segmentation network model, the feature module extracts higher layer features of the myelin sheath by using a hierarchical convolution group module, the robustness of myelin sheath segmentation of different scales can be realized, the problem of difficult myelin sheath segmentation caused by different sizes is solved, and the different sizes and shapes of nerve fibers and the segmentation accuracy requirements after nerve injury can be met.
[0045] Optionally, the segmentation network model is a Unet network model, and the hyperparameter value optimized by the firework algorithm is used as the hyperparameter value of the Unet network model for model training and testing.
[0046] The deep learning method has become the latest technology in the field of computer vision; the Unet network model architecture is applied to many kinds of medical image segmentation and shows excellent performance; however, the hyperparameters of the network need to be manually adjusted during the training of the UNet network model, such as manually adjusting the initial learning rate and the number of iterations of the network, and it is difficult to determine whether the combination of the manually adjusted hyperparameters is the optimal combination; in order to solve this problem, in the embodiment, an error is calculated according to a predicted value and an actual value obtained by the segmentation network model, and the segmentation network model with the minimum error is obtained by continuously updating the hyperparameter value; optionally, the firework algorithm in the swarm intelligence algorithm is introduced for global random search, the Unet network model with the minimum loss function can be found, and the hyperparameter configuration of the Unet network model can be obtained.
[0047] Optionally, a myelin sheath segmentation method based on hyperparameter updating comprises:
[0048] As Figure 1As shown, the UNet network model includes three parts, the left is a feature extraction network as an encoder, and the right is a feature fusion network as a decoder. An attention mechanism-based feature module is added between the encoder and the decoder. The feature module can extract higher layer features of myelin by using a hierarchical convolution group module. Optionally, the feature extraction network includes 4 down-sampling modules, each of which includes two 3x3 convolution layers and a 2x2 max-pooling layer. After passing through each down-sampling module, the number of feature maps becomes 2 times the original number. For example, an image with a size of 572x572 is finally outputted as a feature map with a size of 28x28 and a channel number of 1024 after passing through the feature extraction network. The feature fusion network refers to a process of recovering the original image size by using the abstract features encoded in the front, and finally obtaining a segmentation result. First, the feature map (28x28x1024) outputted by the encoder is processed by using deconvolution to output a feature map with a size of 56x56x512. Then, the corresponding feature map of the encoding layer is combined to transmit it to the decoding structure for splicing by using copying and cutting operations to obtain a feature map with a size of 56x56x1024. This operation is performed four times in total, and then a feature map with a size of 388x388x64 is outputted. Finally, a 1x1 convolution layer is connected to perform dimension reduction processing, i.e., reducing the channel number to a specific number to obtain a target image. Figure 2 As shown, the information weight of the target region is strengthened by the attention mechanism-based feature module (Attention Gate, AG). At the same time, different convolution kernels are used in the attention mechanism-based feature module to extract higher layer features, which can realize the robustness of myelin segmentation of different scales and solve the problem of difficult myelin segmentation caused by different sizes.
[0049] The basic idea of the firework algorithm-optimized Unet network model hyperparameter (FWA-UNet) is to use the hyperparameter value optimized by the firework algorithm as the hyperparameter value of the UNet network model for model training and testing. The method of optimizing the UNet network hyperparameter by the firework algorithm is as shown in Figure 3 The optimization and updating process of the hyperparameter value can be as follows:
[0050] First, the topology structure of the Unet network model and the hyperparameters to be optimized and the value range of these hyperparameters are determined. The network structure of the Unet network model and the selection and value range of the hyperparameters are as follows:
[0051] Optimizer: Optimizers are needed to optimize the parameters of machine learning algorithms, including SGD, Momentum, and Adam. Iterations: The number of iterations determines the degree of loss function descent and model convergence, with a range of [50, 100]. Activation function: In neural networks, networks can fit complex nonlinear functions to solve complex problems more efficiently. Common activation functions include sigmoid, relu, and tanh. Learning rate: The learning rate refers to the magnitude of updating network weights in the optimization algorithm; a large learning rate may lead to model divergence; a small learning rate may lead to slow convergence of the model, requiring longer training time; the learning rate is usually in the range of [0.0001, 0.01]. Convolution kernel size: The convolution kernel size of Conv1, Conv2, and Conv3 is also a hyperparameter; the convolution kernel size is determined by the optimization algorithm, and the value can be [1x1], [3x3], [5x5], and [7x7].
[0052] Secondly, initialize the population, and input the preprocessed myelin image data into the Unet network model for training; calculate the error between the predicted value and the true value obtained from the UNet network model, and use the fireworks algorithm to continuously update the hyperparameter value to obtain the model with the minimum error.
[0053] The number of fireworks generation formula is:
[0054]
[0055] The explosion radius formula is:
[0056]
[0057] Y min = min(f(xi)), (i = 1, 2, …, N) is the minimum value of the fitness of the current fireworks population, f(x i ) is the fitness value of x i individual, x i is the i-th fireworks; Y max = max(f(x i )), (i = 1, 2, …, N) is the maximum fitness value in the current population; is a constant used to adjust the explosion radius size; m is a constant used to adjust the number of sparks generated by explosion; ε is a minimum amount to avoid division by zero.
[0058] In order to limit the position of fireworks with good fitness value from generating too many explosion sparks, and the position of fireworks with poor fitness value from generating too few spark particles, the number of generated sparks is limited according to the range of value limitation and the rounding principle. Specifically, the number of generated sparks is limited as follows:
[0059]
[0060] wherein a, b and m are constants; round(·) is an integral function according to the rounding principle.
[0061] The embodiment also introduces t-distribution variant sparks, and the mutation operation is as follows:
[0062] x i = x i + F(a)
[0063] wherein F(a) is a t-distribution function with iteration number i as a parameter. The value of a is small in the initial iteration, which is similar to the Gaussian function distribution, and has strong local optimization ability. With the increase of iteration number, the global optimization ability is strong. Each time the individual with the optimal fitness value is inherited to the next explosion of fireworks, and the remaining fireworks individuals are randomly selected.
[0064] Next, the super parameter optimization method of the fireworks algorithm is introduced, and the optimization process is as follows:
[0065] Randomly initialize explosion particles N i in the n-dimensional feasible region, wherein n is an integer greater than 0;
[0066] Calculate the position S j of the explosion sparks generated by the explosion of each fireworks particle, the explosion radius of each fireworks particle j , and the position of the variant sparks generated by the mutation of the p fireworks particles;
[0067] Map the particles exceeding the feasible region space into the feasible region space, and the N fireworks particles with the minimum fitness value are used as the initial fireworks of the next iteration;
[0068] After multiple iterations, define save the optimal fireworks particle with good fitness value, and stop iteration when the maximum iteration number T is exceeded;
[0069] Output the fitness value and position information of the fireworks particle.
[0070] In the fireworks algorithm for optimizing the hyperparameters of the UNet network model, the position of a fireworks particle refers to the hyperparameter set of the UNet network model in the current iteration, the dimension n of each particle is determined by the nature of the hyperparameters to be optimized by the UNet, and the error of the UNet network model with a given training sample set is used as the fitness function of the UNet network model training problem. In the method of optimizing the hyperparameters of the UNet network model using the fireworks algorithm, the fitness function is represented by the loss function, and the fitness value is the loss function value, which also represents the error value between the predicted value and the true value. Each fireworks particle moves in the search space to find the UNet network model corresponding to the minimum error, and the speed and position of the fireworks particle are updated, that is, the hyperparameters of the UNet network model are updated. The purpose of updating the extreme value of the fireworks particle is to reduce the error between the true value and the predicted value and improve the performance of the UNet network model.
[0071] Optionally, the loss function is:
[0072]
[0073] where N represents the number of pixels; p(k, i) e [0, 1] represents the prediction probability of class k; g(k, i) e [0, 1] represents the true label of class k, and k is the number of classes; W k represents the weight of the pixel; and the evaluation index is When the loss function value is 0, it means that the model is perfect. In an actual model, the smaller the loss function value, the better.
[0074] The algorithm steps of the FWA-UNet network model hyperparameters for myelin image segmentation are as follows:
[0075] S1, input the related images including axons and myelin, and pre-process the images. The image pre-processing can be cropping, enhancement or background removal, etc., which can be realized by conventional techniques and will not be described in detail here;
[0076] S2, define the FWA-UNet network model structure, set the hyperparameters to be optimized and the value range of the hyperparameters;
[0077] S3, set the parameters, including the maximum number of iterations Iter and the minimum error e, etc.;
[0078] S4, initialize the population, and randomly assign values to the hyperparameters to be optimized of the FWA-UNet network model, etc.
[0079] S5, train the FWA-Unet network model using the training set of myelin images, and test the FWA-Unet network model using the test set of images, and calculate the error between the predicted value and the true value;
[0080] S6, run the fireworks algorithm, update the FWA-Unet network model hyperparameter settings;
[0081] S7, judge the end condition, if it is less than the set minimum error e or the current iteration number is greater than Iter, end the training of the FWA-Unet network model, otherwise go to step S5 for next training;
[0082] S8, output the FWA-UNet network model with the smallest error at the end of training, and segment the myelin on the image.
[0083] The embodiment first proposes to use the Unet network model based on fireworks algorithm optimization for segmenting myelin images, which has significant advantages in axon and myelin segmentation compared with traditional image segmentation algorithms; Specifically, the automation level is improved, and there is no need to manually select related features, the Unet network model can learn hidden structure and texture features by itself; Improve algorithm adaptability, the network can train multiple microscopic imaging modes; Improve the efficiency of myelin image segmentation, once the training is completed, compared with more traditional image processing methods, it is faster in the prediction step; Improve the accuracy of axon and myelin image segmentation, and the image segmentation accuracy is obviously improved.
[0084] Embodiment 2:
[0085] The embodiment provides a myelin segmentation system based on hyperparameter updating, comprising:
[0086] The data acquisition module is configured to obtain related images containing axons and myelin;
[0087] The myelin segmentation module is configured to obtain the segmentation results of axons and myelin according to the obtained images and a preset segmentation network model;
[0088] The segmentation network model comprises an encoder and a decoder, and a feature module based on an attention mechanism added between the encoder and the decoder; The feature module extracts layer features of myelin by using a hierarchical convolution group module; During training, the error is calculated according to the predicted value and the true value obtained by the segmentation network model, and the segmentation network model with the smallest error is obtained by continuously updating the hyperparameter value.
[0089] The working method of the system is the same as the myelin segmentation method based on hyperparameter updating in embodiment 1, which will not be repeated here.
[0090] Embodiment 3:
[0091] The embodiment provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the myelin segmentation method based on hyperparameter updating in embodiment 1.
[0092] Example 4:
[0093] The embodiment provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the myelin segmentation method based on hyperparameter updating according to the embodiment 1 when executing the program.
[0094] The above merely provides preferred embodiments of the embodiment, but is not intended to limit the embodiment. For those skilled in the field, the embodiment can have various modifications and changes. Any modified, equivalent replaced, improved, etc. within the spirit and principle of the embodiment shall be included in the protection scope of the embodiment.
Claims
1. A myelin segmentation method based on hyperparameter update, characterized in that, include: Obtain relevant images containing axons and myelin sheaths; Based on the acquired images and the pre-defined segmentation network model, the segmentation results of axons and myelin sheaths are obtained; The segmentation network model is the Unet network model. The hyperparameter values optimized by the fireworks algorithm are used as the hyperparameter values of the Unet network model for model training and testing. The position of the fireworks particle represents the set of hyperparameters of the Unet network model in the current iteration. Each fireworks particle moves and searches within the selection space to find the Unet network model with the minimum error. The speed and position of the Unet network model are changed to reduce the error between the true value and the predicted value. Randomly initialize the explosion particles within the preset feasible region; Calculate the location and radius of the explosion spark produced by each firework particle explosion, as well as the location of the mutated spark produced by mutating multiple firework particles; Firework particles that exceed the preset feasible region space are mapped into the feasible region space, and the firework particle with the smallest fitness value is used as the initial firework for the next iteration. After multiple iterations, the firework particles are saved based on the fitness value; The segmentation network model includes an encoder and a decoder, as well as a feature module based on an attention mechanism added between the encoder and decoder. The feature module uses a hierarchical convolutional group module to extract layer features of the myelin sheath. During training, the error is calculated based on the predicted and true values obtained from the segmentation network model. By continuously updating the hyperparameter values, the segmentation network model with the smallest error is obtained.
2. The myelin segmentation method based on hyperparameter update as described in claim 1, characterized in that, The encoder includes multiple downsampling modules, and the number of feature maps increases exponentially with each downsampling module.
3. The myelin segmentation method based on hyperparameter update as described in claim 1, characterized in that, The number of sparks generated is limited based on the range of values and the rounding principle.
4. The myelin segmentation method based on hyperparameter update as described in claim 1, characterized in that, The process of updating hyperparameter values is as follows: Determine the topology of the segmentation network model, the hyperparameters to be optimized, and the range of values for the hyperparameters; Initialize the population and input relevant images of axons and myelin sheaths into the segmentation network model for training; The error is calculated based on the predicted and actual values obtained from the segmentation network model. The hyperparameter values are continuously updated using the fireworks algorithm to obtain the segmentation network model with the smallest error.
5. A myelin segmentation system based on hyperparameter updating, characterized in that, include: The data acquisition module is configured to acquire relevant images containing axons and myelin sheaths; The myelin segmentation module is configured to obtain the segmentation results of axons and myelin sheaths based on the acquired images and a preset segmentation network model. The segmentation network model is the Unet network model. The hyperparameter values optimized by the fireworks algorithm are used as the hyperparameter values of the Unet network model for model training and testing. The position of the fireworks particle represents the set of hyperparameters of the Unet network model in the current iteration. Each fireworks particle moves and searches within the selection space to find the Unet network model with the minimum error. The speed and position of the Unet network model are changed to reduce the error between the true value and the predicted value. Randomly initialize the explosion particles within the preset feasible region; Calculate the location and radius of the explosion spark produced by each firework particle explosion, as well as the location of the mutated spark produced by mutating multiple firework particles; Firework particles that exceed the preset feasible region space are mapped into the feasible region space, and the firework particle with the smallest fitness value is used as the initial firework for the next iteration. After multiple iterations, the firework particles are saved based on the fitness value; The segmentation network model includes an encoder and a decoder, as well as a feature module based on an attention mechanism added between the encoder and decoder. The feature module uses a hierarchical convolutional group module to extract layer features of the myelin sheath. During training, the error is calculated based on the predicted and true values obtained from the segmentation network model. By continuously updating the hyperparameter values, the segmentation network model with the smallest error is obtained.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the hyperparameter-updated myelin segmentation method as described in any one of claims 1-4.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the hyperparameter-updated myelin segmentation method as described in any one of claims 1-4.
Citation Information
Patent Citations
Seawater three-dimensional prediction method and system based on improved firework algorithm optimization network
CN115828758A
Pulmonary nodule segmentation method and system based on improved 3D-UNet network
CN115984553A