Lightweight image segmentation method and system based on neuralode neural network architecture

By employing separable convolutional layers, enhanced neural ordinary differential equation blocks, and decoupled knowledge distillation strategies, the problems of feature evolution stability and high-level parameter redundancy in the NeuralODE model are solved, achieving a lightweight image segmentation method with high efficiency and high accuracy on resource-constrained devices.

CN121999231BActive Publication Date: 2026-06-23SICHUAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SICHUAN UNIV
Filing Date
2026-04-09
Publication Date
2026-06-23

Smart Images

  • Figure CN121999231B_ABST
    Figure CN121999231B_ABST
Patent Text Reader

Abstract

The application discloses a lightweight image segmentation method and system based on a NeuralODE neural network architecture, comprising: obtaining image data to be segmented, extracting an initial feature map through an initial convolution layer, and generating an intermediate feature map through a separable convolution layer; inputting the intermediate feature map into an enhanced neural ordinary differential equation block, performing multi-step continuous feature evolution, introducing pre-sequence output feature weighted fusion at each step, and obtaining an evolved feature map; generating a main feature map and a derived feature map, splicing them in the channel dimension, and outputting a compressed feature map; adopting a decoupled knowledge distillation strategy, decoupling a teacher model probability distribution into two types of probability distributions, calculating corresponding losses, and constructing a total distillation loss to adjust network parameters; inputting the feature map output by the trained network model into a segmentation prediction head, performing a pixel-level prediction operation on the feature map through the segmentation prediction head, and generating a segmentation result of the image to be segmented. The application improves segmentation accuracy, and balances deployment efficiency and segmentation performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image segmentation technology, and in particular to a lightweight image segmentation method and system based on the NeuralODE neural network architecture. Background Technology

[0002] In image segmentation, with the increasing demands for model deployment efficiency in practical applications such as medical image analysis and intelligent monitoring, lightweight neural network architectures have become a key research focus. While traditional convolutional neural networks can achieve high segmentation accuracy, their large number of parameters and computational demands make them difficult to adapt to resource-constrained devices. Transformer-based architectures, while enhancing global feature modeling capabilities, further exacerbate computational resource consumption. Subsequent lightweight solutions often reduce parameters by simplifying convolutional structures, but this can easily lead to insufficient feature representation capabilities. In recent years, Neural ODEs have provided a new direction for lightweight design due to their continuous feature evolution characteristics. However, existing segmentation models still suffer from poor feature evolution stability and network parameter redundancy, failing to fully balance model lightweighting and segmentation performance. This has driven the development of new architectures that combine efficient feature processing and parameter optimization.

[0003] Existing technologies in this field suffer from two significant drawbacks. Firstly, feature evolution stability is insufficient. Some NeuralODE-based models fail to effectively incorporate output features from preceding steps during multi-step feature evolution operations, leading to easy loss or distortion of feature information during the evolution process. This makes it difficult to form continuous and robust feature representations, affecting the accuracy of the final segmentation results. Secondly, high-level parameter compression efficiency is low. Most lightweight models only simplify parameters at the lower layers of the network, while the higher layers still rely on traditional convolutional structures. They fail to achieve efficient parameter compression through the collaborative generation of main and derived features and channel concatenation, resulting in high-level parameter redundancy. This increases the model's storage and computational burden and restricts its deployment capability in resource-constrained scenarios. Summary of the Invention

[0004] To overcome the shortcomings and deficiencies of existing technologies, this invention provides a lightweight image segmentation method and system based on the NeuralODE neural network architecture.

[0005] The technical solution adopted in this invention is a lightweight image segmentation method based on the NeuralODE neural network architecture, comprising the following steps: S1, acquiring image data to be segmented, inputting the image data to be segmented into an initial convolutional layer, and extracting features from the image data to be segmented through the initial convolutional layer to obtain an initial feature map; S2, inputting the initial feature map into a separable convolutional layer, and performing feature deepening and downsampling processing on the initial feature map through the separable convolutional layer to generate an intermediate feature map; S3, inputting the intermediate feature map into an enhanced neural network constant differential equation block, the enhanced neural network constant differential equation block performing multi-step continuous feature evolution operations on the intermediate feature map, and in each step of feature evolution, introducing the output features of the previous step and performing weighted fusion to obtain an evolved feature map; S4, inputting the evolved feature map into a high-level parameter compression module, the high-level parameter compression module first passing through the main feature convolutional layer... The convolution unit performs convolution operations on the evolved feature map to generate a main feature map, and then the derived feature generation unit performs a linear transformation on the main feature map to generate a derived feature map. Finally, the feature concatenation unit concatenates the main feature map and the derived feature map in the channel dimension to output a compressed feature map; S5, the network model corresponding to the compressed feature map is trained using a decoupled knowledge distillation strategy, the probability distribution output by the teacher model is decoupled into a target class probability distribution and a non-target class probability distribution, the target class knowledge distillation loss and the non-target class knowledge distillation loss are calculated respectively, the total distillation loss is constructed based on the target class knowledge distillation loss and the non-target class knowledge distillation loss, and the network model parameters are adjusted according to the total distillation loss; S6, the feature map output by the trained network model is input into the segmentation prediction head, the segmentation prediction head performs upsampling and pixel-level classification on the feature map to generate a segmentation result with the same resolution as the image to be segmented.

[0006] Furthermore, the update rule for the enhanced neural ordinary differential equation block in S3 to perform multi-step continuous feature evolution operations on the intermediate feature map satisfies: ,in, Indicates the first Feature states in the step feature evolution process Indicates the first Feature states during feature evolution Indicates the first The learnable time step in the evolution of step features This represents the activation function. Indicates the first Learnable linear transformation matrix in the step feature evolution process. This represents the initial feature map. This indicates that feature extraction is performed on the input features to capture the semantic information of the image.

[0007] Furthermore, in S3, the calculation process of introducing the output features of the previous step and performing weighted fusion in each step of feature evolution satisfies: ,in, Indicates the first The activation values ​​after weighted fusion during the step feature evolution process This represents the activation function. Indicates the first Input features in the step feature evolution process, Indicates the weighting coefficient. Indicates the first The output features after being processed by the activation function during the step feature evolution process.

[0008] Furthermore, when the main feature convolution unit in S4 performs convolution operations on the evolved feature map to generate the main feature map, the number of channels of the main feature map satisfies: ,in, This represents the number of channels in the main feature map. This indicates the number of channels in the feature map output by the high-level parameter compression module. Indicates the compression ratio. This represents the function for rounding up.

[0009] Furthermore, the calculation process of constructing the total distillation loss based on the distillation loss of the target class knowledge and the distillation loss of the non-target class knowledge in S5 satisfies: ,in, Indicates total distillation loss. The weighting coefficients represent the loss of target class knowledge distillation. This represents the loss from distillation of target-type knowledge. The weighting coefficients represent the distillation loss of non-target knowledge. This represents the loss from distilling non-target knowledge.

[0010] Furthermore, in S5, when calculating the distillation loss of the target class knowledge, the calculation process of the distillation loss of the target class knowledge satisfies: ,in, This represents the loss from distillation of target-type knowledge. Represents a collection of target classes. The target class output by the teacher model represents the first... The probability value of the class. This represents the first element in the target class output by the student model. The probability value of the class.

[0011] Further, S3 includes the following sub-steps: S31, inputting the intermediate feature map to the input interface of the enhanced neural ordinary differential equation block, starting the feature evolution function of the enhanced neural ordinary differential equation block, and setting the total number of feature evolution steps and the initial feature state; S32, in the... During the feature evolution process, based on the initial feature state and the preset learnable linear transformation matrix and learnable time step, the feature evolution update rule is used to calculate the first step. The feature state after the feature evolution of the first step, and at the same time the first step feature evolution. The output features processed by the activation function during the step feature evolution process are saved to a temporary buffer unit; S33, in the first step... During the evolution of step features, Retrieve the first from the temporary cache unit The output features processed by the activation function during the first step of feature evolution are compared with the first step. The input features of the first step feature evolution are weighted and fused according to preset weight coefficients, and then combined with the first step feature evolution. The learnable linear transformation matrix and learnable time step are used to calculate the 1st step through the feature evolution update rule. The feature state after the feature evolution of the first step, and the first step feature evolution. S34. The output features processed by the activation function during the feature evolution process are updated to the temporary cache unit; S35. Repeat step S36 until the feature evolution operation of the preset total number of steps is completed, and output the feature state after the last feature evolution as the evolved feature map.

[0012] Further, step S4 includes the following sub-steps: S41, inputting the evolved feature map into the main feature convolution unit, the main feature convolution unit determines the number and size of convolution kernels according to a preset compression ratio, and performs convolution operation on the evolved feature map. During the convolution operation, features are extracted from different regions of the evolved feature map by sliding the convolution kernel to generate the main feature map; S42, inputting the main feature map into the derived feature generation unit, the derived feature generation unit uses a linear transformation kernel of a preset size to perform a linear transformation operation on each channel of the main feature map, and in each channel... During the linear transformation process, the independence between channels is maintained, and cross-channel feature interaction is not performed to generate a derived feature map; S43, the main feature map and the derived feature map are input to the feature stitching unit, the feature stitching unit determines the stitching order of the channel dimension, and stacks the main feature map and the derived feature map in the channel dimension according to the order, so that the number of channels of the stitched feature map meets the preset output channel number requirement, and a compressed feature map is generated; S44, the channel dimension of the compressed feature map is verified, and after confirming that the number of channels meets the requirements of subsequent network processing, the compressed feature map is output to step S5.

[0013] Further, step S5 includes the following sub-steps: S51, obtaining the pre-trained teacher model and the student model to be trained, inputting the image data of the training dataset into the teacher model and the student model respectively, and obtaining the probability distributions output by the teacher model and the student model; S52, extracting the target class probability distribution and the non-target class probability distribution from the probability distributions output by the teacher model and the student model respectively, and normalizing the non-target class probability distribution so that the sum of the probabilities of the non-target class probability distribution is 1; S53, calculating the target class knowledge distillation loss using the cross-entropy loss function based on the target class probability distribution, and calculating the non-target class knowledge distillation loss using the same cross-entropy loss function based on the normalized non-target class probability distribution; S54, weighting and summing the target class knowledge distillation loss and the non-target class knowledge distillation loss according to the preset weight coefficients to obtain the total distillation loss, feeding the total distillation loss back to the student model using the backpropagation algorithm, adjusting the parameters of the student model, and repeating steps S51-S54 until the student model training reaches the preset number of iterations.

[0014] A lightweight image segmentation system based on the NeuralODE neural network architecture is proposed. This system, applied to a lightweight image segmentation method based on the NeuralODE neural network architecture, includes: an image data input and initial feature extraction unit, which receives externally input image data to be segmented, performs convolution operations on the image data through a built-in initial convolutional layer to extract basic image feature information, generates an initial feature map, and transmits the initial feature map to an intermediate feature enhancement and downsampling unit; and an intermediate feature enhancement and downsampling unit, which is connected to the image data input and initial feature extraction unit, receives the initial feature map, and performs convolution operations on the image data through a built-in initial convolutional layer to extract basic image feature information, generate an initial feature map, and transmits the initial feature map to an intermediate feature enhancement and downsampling unit; and an intermediate feature enhancement and downsampling unit, which receives the initial feature map and performs convolution operations on the image data to be segmented through a built-in convolutional layer. The separable convolutional layers perform multiple rounds of feature deepening processing on the initial feature map, while simultaneously performing downsampling operations to reduce the spatial resolution of the feature map, generating intermediate feature maps. These intermediate feature maps are then transmitted to a multi-step continuous feature evolution and fusion unit. This unit, connected to the intermediate feature deepening and downsampling unit, receives the intermediate feature map and performs multi-step continuous feature evolution operations through a built-in enhanced neural network differential equation block. In each evolution step, the output features from the previous step are retrieved and weighted to improve feature evolution stability, generating an evolved feature map. This evolved feature map is then transmitted to a high-level feature compression and splicing unit. The system comprises: a high-level feature compression and splicing unit, connected to a multi-step continuous feature evolution and fusion unit; a high-level feature compression and splicing unit, which receives the evolved feature map, generates a main feature map through a built-in main feature convolution subunit, generates a derived feature map through a derived feature generation subunit, and then splices the main feature map and the derived feature map along the channel dimension through a feature splicing subunit to generate a compressed feature map, which is then transmitted to the network model training and parameter adjustment unit; and a network model training and parameter adjustment unit, connected to the high-level feature compression and splicing unit, which receives the compressed feature map and employs a decoupling knowledge distillation strategy to decouple the teacher model output probability distribution into target class and non-target class. The target class probability distribution is calculated, two types of losses are calculated, and a total distillation loss is constructed. Based on the total distillation loss, the network model parameters are adjusted through backpropagation to obtain a trained network model. The trained network model is then transmitted to the segmentation result generation unit. The segmentation result generation unit is connected to the network model training and parameter adjustment unit. It receives the trained network model, inputs the feature map of the image to be segmented after processing by the preceding unit into the network model, and inputs the feature map output by the network model into the segmentation prediction head. The segmentation prediction head performs pixel-level prediction operations on the feature map to generate the segmentation result of the image to be segmented, and outputs the segmentation result to an external storage or display device.

[0015] Beneficial Effects: This invention proposes a lightweight image segmentation method and system based on the NeuralODE neural network architecture. The method utilizes a separable convolutional layer and a high-level parameter compression module. The former deepens features and downsamples them, while the latter compresses parameters through main and derived feature generation and channel concatenation, significantly reducing the number of model parameters and solving the problems of parameter redundancy and high resource consumption in existing technologies. An enhanced neural frequent differential equation block introduces weighted fusion of preceding output features in multi-step feature evolution, improving feature evolution stability and addressing the numerical instability and slow convergence of traditional NeuralODE models. A decoupled knowledge distillation strategy decouples the probability distribution into two classes and calculates the loss separately. The constructed total distillation loss can accurately adjust model parameters, improving segmentation accuracy. The system implements the method flow through corresponding functional units, which are sequentially connected to form a complete segmentation link. This ensures lightweight characteristics to adapt to resource-constrained devices while efficiently outputting high-quality segmentation results in scenarios such as medical imaging and intelligent monitoring through stable feature evolution and precise parameter adjustment, balancing deployment efficiency and segmentation performance. Attached Figure Description

[0016] Figure 1 This is a flowchart of the method steps of the present invention;

[0017] Figure 2 This is a diagram showing the system unit composition of the present invention. Detailed Implementation

[0018] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] like Figure 1 As shown, the lightweight image segmentation method based on the NeuralODE neural network architecture includes the following steps:

[0020] S1. Obtain image data to be segmented, input the image data to be segmented into an initial convolutional layer, and extract features from the image data to be segmented through the initial convolutional layer to obtain an initial feature map;

[0021] Specifically, the implementation process of step S1 is as follows: First, image data to be segmented with a resolution ranging from 512×512 to 1024×1024 pixels is acquired through an image acquisition device. This image data can include different data types from various fields, such as CT images in medical imaging and scene images in intelligent monitoring scenarios. After acquisition, it is directly input into a preset initial convolutional layer. The core parameters of the initial convolutional layer are set as follows: the number of convolutional kernels is set to 16 to 32, the kernel size is 3×3 or 5×5, the stride is fixed at 1, the padding mode is selected as SamePadding to ensure that the input and output image sizes are consistent, and the activation function is the RelU6 function. In the specific operation process, the initial convolutional layer extracts features from each pixel region of the image data to be segmented by sliding the convolutional kernels. The convolutional kernels move on the image at a set stride, performing a weighted summation operation on the pixel values ​​within the covered area to generate feature values ​​at the corresponding positions, and finally obtaining an initial feature map with the same number of channels and convolutional kernels and the same spatial resolution as the input image. This step quickly extracts low-level features such as basic texture and edges of the image, providing original feature support for subsequent feature deepening processing. At the same time, by controlling the number and size of the convolutional kernels in the initial convolutional layer, the number of parameters in the initial stage is avoided to avoid being too large, which meets the requirements of lightweight architecture design.

[0022] S2. Input the initial feature map into a separable convolutional layer, and perform feature enhancement and downsampling on the initial feature map through the separable convolutional layer to generate an intermediate feature map;

[0023] Specifically, step S2 is implemented as follows: the initial feature map generated in step S1 is directly input into the separable convolutional layer, which consists of a depthwise convolutional sub-layer and a pointwise convolutional sub-layer. The parameters of the depthwise convolutional sub-layer are set as follows: the number of convolutional kernels is consistent with the number of channels in the initial feature map, each convolutional kernel corresponds to one input channel, the kernel size is 3×3, the stride is set to 2, and the padding mode is SamePadding; the parameters of the pointwise convolutional sub-layer are set as follows: the number of convolutional kernels is set to 32 to 64, the kernel size is 1×1, the stride is 1, the padding mode is SamePadding, and the RelU6 activation function is used to enhance model stability. In the feature enhancement stage, the deep convolutional sub-layer first performs convolution operations on each channel of the initial feature map individually to extract local features within each channel, enhancing details such as edges and textures in the initial feature map. In the downsampling stage, the spatial resolution of the feature map is compressed to half that of the initial feature map through convolution operations with a stride of 2 set by the deep convolutional sub-layer. Simultaneously, the pointwise convolutional sub-layer performs channel-dimensional feature recombination and fusion on the feature map output by the deep convolutional sub-layer, adjusting the number of channels in the feature map to a preset number. The final generated feature map has a spatial resolution of half that of the initial input feature map and has 32 to 64 channels. This step reduces the number of parameters and computational cost of traditional convolution to 1 / (kernel size × kernel size) through separable convolution. While achieving feature enhancement and downsampling, it significantly reduces the number of parameters, further enhancing the lightweight nature of the model. At the same time, the downsampling operation reduces the amount of data processed in subsequent steps, improving overall computational efficiency.

[0024] S3. Input the intermediate feature map into the enhanced neural ordinary differential equation block. The enhanced neural ordinary differential equation block performs a multi-step continuous feature evolution operation on the intermediate feature map. In each step of feature evolution, the output features of the previous step are introduced and weighted and fused to obtain the evolved feature map.

[0025] Specifically, step S3 is implemented as follows: The intermediate feature map generated in step S2 is input into the enhanced neural ordinary differential equation block. This module first presets the total number of feature evolution steps to 5 to 10 steps, and initializes the initial feature state of the first feature evolution step as the input intermediate feature map. In each feature evolution step, the module first calls the built-in learnable parameter generation unit to generate a dedicated learnable time step and learnable linear transformation matrix for the current step. The initial value of the learnable time step is set to 0.1 to 0.5, and is dynamically adjusted through training. The dimension of the learnable linear transformation matrix is ​​consistent with the number of channels in the current feature state, and the matrix elements are initialized using a random normal distribution. During the feature evolution operation phase, the module performs continuous feature evolution calculations based on the current feature state, the learnable time step, and the learnable linear transformation matrix. Simultaneously, during each evolution step, it retrieves the features output from the previous step from the module's built-in temporary cache unit. These features are then weighted and fused with the input features of the current step using a preset fixed weighting coefficient of 0.3 to 0.7. The fused data then participates in the feature evolution operation of the current step. After each evolution step, the module stores the output features of the current step, processed by the activation function, in the temporary cache unit, overwriting the feature data from the previous step, providing preceding feature support for the next evolution step. After completing the preset total number of feature evolution steps, the feature state generated by the final evolution step is output as the evolved feature map. This feature map maintains the same spatial resolution and channel number as the intermediate feature maps. This step achieves progressive feature optimization through multi-step continuous feature evolution, enhancing the global correlation and expressive power of features. At the same time, it introduces weighted fusion of features output from previous steps to avoid feature information loss caused by a single evolution step, improve the stability of the feature evolution process, and solve the numerical instability problem that is prone to occur in traditional neural network differential equation models. While ensuring feature quality, it avoids excessive increase in computation by controlling the number of evolution steps, meeting the requirements of balancing lightweight and high performance.

[0026] S4. The evolved feature map is input to the high-level parameter compression module. The high-level parameter compression module first performs convolution operation on the evolved feature map through the main feature convolution unit to generate the main feature map, then performs linear transformation on the main feature map through the derived feature generation unit to generate the derived feature map, and finally concatenates the main feature map and the derived feature map in the channel dimension through the feature concatenation unit to output the compressed feature map.

[0027] Specifically, the implementation process of step S4 is as follows: The evolved feature map generated in step S3 is input into the high-level parameter compression module, which includes three sub-modules: the main feature convolution unit, the derived feature generation unit, and the feature concatenation unit. First, the number of output feature map channels of the high-level parameter compression module is preset to be 64 to 128, and the compression ratio is determined to be 2 to 4 accordingly. The parameters of the main feature convolution unit are set as follows: the number of convolution kernels is calculated based on the compression ratio, that is, the number of output feature map channels divided by the compression ratio; the convolution kernel size is 3×3; the stride is 1; the padding mode is SamePadding; and the activation function is the RelU function. The parameters of the derived feature generation unit are set as follows: the dimension of the linear transformation kernel matches the number of channels of the main feature map and the number of channels of the output feature map, that is, the input dimension is the number of channels of the main feature map, and the output dimension is the number of channels of the output feature map minus the number of channels of the main feature map. No bias term is introduced during the linear transformation. The preset channel concatenation order of the feature concatenation unit is main feature map first, and derived feature map second. During the computation, the main feature convolution unit first performs convolution operations on the evolved feature map to extract high-level semantic features and generate a main feature map with the number of channels equal to the number of channels in the output feature map divided by the compression ratio. The derived feature generation unit then performs a linear transformation operation on the main feature map, linearly recombining the channel dimension features of the main feature map through matrix multiplication to generate a derived feature map with the number of channels equal to the number of channels in the output feature map minus the number of channels in the main feature map. Finally, the feature stitching unit stacks the main feature map and the derived feature map in the channel dimension according to a preset order, so that the number of channels in the stitched feature map reaches a preset 64 to 128. At the same time, the numerical verification of the channel dimension of the stitched feature map is performed to ensure that there are no missing or redundant channels, and finally the compressed feature map is output. This step, through the collaborative operation of main feature convolution and derived feature generation, compresses the number of parameters of traditional high-level convolution to 1 / compression ratio while ensuring the quality of high-level semantic feature extraction. This solves the problem of redundant parameters in traditional high-level networks. At the same time, the feature concatenation operation makes up for the lack of information in single feature generation, ensuring that the compressed features still have rich semantic information, thus achieving the dual goals of high-level feature extraction and parameter compression.

[0028] S5. The network model corresponding to the compressed feature map is trained using a decoupled knowledge distillation strategy. The probability distribution output by the teacher model is decoupled into a target class probability distribution and a non-target class probability distribution. The target class knowledge distillation loss and the non-target class knowledge distillation loss are calculated respectively. The total distillation loss is constructed based on the target class knowledge distillation loss and the non-target class knowledge distillation loss. The network model parameters are adjusted according to the total distillation loss.

[0029] Specifically, step S5 is implemented as follows: First, the pre-trained teacher model and the student model to be trained are obtained. The teacher model uses the U-Net++ model with a large number of parameters, while the student model is the current lightweight model based on NeuralODE. A training dataset of 5000 to 10000 labeled images is prepared, with image annotations including pixel-level classification results for target and non-target classes. During model training, the image data in the training dataset is input to the teacher and student models in batches, with batch sizes set to 8 to 16. The teacher and student models perform feature processing on the input images, outputting pixel-level probability distributions for the corresponding images. Then, a decoupling strategy is used to process the output probability distributions. From the probability distributions of the teacher and student models, based on the preset target class labels, the probability distributions corresponding to the target class and non-target classes are extracted respectively. Normalization is performed on the non-target class probability distributions by dividing each non-target class probability value by the sum of all non-target class probability values, ensuring that the sum of the probabilities of the non-target class probability distributions is 1. Next, the losses are calculated. Based on the target class probability distribution, the difference between the target class probability distributions of the teacher model and the student model is calculated using the cross-entropy loss function to obtain the target class knowledge distillation loss. Based on the normalized non-target class probability distribution, the difference between the non-target class probability distributions of the two models is also calculated using the cross-entropy loss function to obtain the non-target class knowledge distillation loss. Then, the weight coefficients for the target class knowledge distillation loss and the non-target class knowledge distillation loss are preset to 1.0 and 8.0, respectively. The two losses are then weighted and summed to construct the total distillation loss. Finally, a stochastic gradient descent optimizer is used, with an initial learning rate of 0.001, which decays to 0.1 every 10 epochs. Based on the total distillation loss, all learnable parameters of the student model, including convolutional layer weights and learnable time steps, are adjusted using the backpropagation algorithm. This training process is repeated until the student model has been trained for the preset 100 to 200 epochs. This step decouples the knowledge distillation strategy, focusing on the knowledge transfer of target class and non-target class separately. This avoids the problem of insufficient transfer of target class knowledge caused by class imbalance in traditional knowledge distillation, thus improving the segmentation accuracy of the student model. At the same time, guided by the teacher model with a large number of parameters, the lightweight student model can achieve performance close to that of the teacher model while maintaining its lightweight characteristics, thus achieving a balance between lightweight and high accuracy.

[0030] S6. Input the feature map output by the trained network model into the segmentation prediction head, and use the segmentation prediction head to upsample and classify the feature map at the pixel level to generate a segmentation result with the same resolution as the image to be segmented.

[0031] Specifically, step S6 is implemented as follows: First, the network model trained in step S5 is loaded. This model includes an initial convolutional layer, a separable convolutional layer, an enhanced neural network (NLM) block, a high-level parameter compression module, and a segmentation prediction head module connected to it. The image to be segmented is then processed sequentially according to steps S1 to S4, performing initial feature extraction, separable convolutional feature deepening and downsampling, enhanced NLM feature evolution, and high-level parameter compression operations to obtain the compressed feature map corresponding to the image to be segmented.

[0032] The segmentation prediction head module is used to perform pixel-by-pixel classification and spatial resolution restoration on the compressed feature map. Preferably, the segmentation prediction head module includes several convolutional layers and upsampling layers. First, one or more convolutional layers are used to perform channel transformation and semantic enhancement on the compressed feature map. Then, upsampling operations such as bilinear interpolation or deconvolution are used to restore the spatial resolution of the feature map to the same level as the input image or a predetermined ratio. Subsequently, a 1×1 convolutional layer is used to generate the response value of each pixel for each target category, and the class response of each pixel is normalized using the Softmax or Sigmoid function to obtain the pixel-level class probability distribution.

[0033] In the output stage, the category with the highest probability is selected as the final label for each pixel based on its category probability distribution. Alternatively, the foreground and background are binarized according to a preset probability threshold to generate a segmentation mask with the same spatial resolution as the image to be segmented, where each pixel corresponds to a category label. This mask serves as the final segmentation result. This step transforms the high-level semantic features learned by the network model into pixel-level semantic segmentation results through the segmentation prediction head module, achieving a mapping from continuous features to the segmentation mask. Simultaneously, pixel-by-pixel classification and upsampling operations balance segmentation accuracy and spatial detail.

[0034] In a preferred embodiment, the segmentation prediction head module can adopt an existing lightweight semantic segmentation framework structure, such as the dilated spatial pyramid pooling structure based on DeeplabV3. It uses the lightweight network of the present invention as the backbone feature extraction network, concatenates dilated convolutions and 1×1 convolutions on the compressed feature map and performs upsampling operations, thereby achieving high semantic segmentation performance while maintaining the lightweight nature of the model.

[0035] Preferably, the update rule for the enhanced neural network differential equation block in S3 to perform multi-step continuous feature evolution operations on the intermediate feature map satisfies: ,in, Indicates the first Feature states in the step feature evolution process Indicates the first Feature states during feature evolution Indicates the first The learnable time step in the evolution of step features This represents the activation function. Indicates the first Learnable linear transformation matrix in the step feature evolution process. This represents the initial feature map. This indicates that feature extraction is performed on the input features to capture the semantic information of the image.

[0036] Specifically, the multi-step continuous feature evolution update rule for the enhanced neural network differential equation block in step S3 requires parameter settings based on the dynamic adjustment needs of feature evolution. In practice, the feature state of the l-th step feature evolution needs to be initialized based on the intermediate feature map of the preceding processing. The initial value range of the initial state is usually controlled between 0 and 1 to ensure the stability of subsequent operations. The initial value of the learnable time step is set to 0.1 to 0.5. This parameter will be dynamically adjusted according to the feature evolution effect during model training. For example, when the feature evolution shows numerical oscillations, the time step will automatically shrink to improve stability. The dimension of the learnable linear transformation matrix needs to be strictly matched with the number of channels of the current feature state. The matrix elements are initialized using a random normal distribution, with the mean set to 0 and the standard deviation set to 0.01 to ensure that the initial matrix has a moderate transformation amplitude for the features. The activation function is either the modified linear unit or the sigmoid function. The former is suitable for scenarios with large feature values ​​to avoid gradient vanishing, while the latter is suitable for scenarios where feature values ​​need to be mapped to the 0 to 1 range. In each evolutionary calculation step, the current feature state is first linearly transformed using a linear transformation matrix. This transformed feature value is then superimposed on the current feature state and input into an activation function to obtain a nonlinearly transformed feature value. This value is then added to the inverted result of the current feature state. Finally, it is multiplied by a learnable time step and superimposed on the current feature state to obtain the next feature state. By using a learnable time step and a linear transformation matrix, the feature evolution process can adapt to the feature distribution of different image data. Simultaneously, the introduction of the activation function enhances the nonlinear expressive power of the features, solving the problem of poor adaptability in traditional fixed-parameter evolution rules and improving the accuracy and flexibility of feature evolution.

[0037] Preferably, in step S3, the calculation process of introducing the output features of the previous step and performing weighted fusion in each feature evolution step satisfies the following: ,in, Indicates the first The activation values ​​after weighted fusion during the step feature evolution process This represents the activation function. Indicates the first Input features in the step feature evolution process, Indicates the weighting coefficient. Indicates the first The output features after being processed by the activation function during the step feature evolution process.

[0038] Specifically, in step S3, the weighted fusion calculation of the output features from each feature evolution step requires precise control of the fusion parameters to ensure the effectiveness of feature transfer. Regarding parameter settings, the initial value of the weight coefficient is set to 0.3 to 0.7. This coefficient is dynamically adjusted based on the correlation between the preceding features and the current input features. For example, when the current input feature has a high similarity to the preceding output feature, the weight coefficient is increased to strengthen the guiding role of the preceding feature; when the similarity is low, it is decreased to avoid interference from invalid features. The choice of activation function must be consistent with the activation function in step S3 for feature evolution to ensure a uniform range of feature values. A modified linear unit is typically used, with its threshold set to 0. That is, when the input value is less than 0, the output is 0; when it is greater than 0, the input value remains unchanged to filter out invalid feature information. The input features for the first step of feature evolution are directly taken from the processing results of the previous step. Numerical verification is required to ensure there are no outliers before they are included in the fusion operation; The output features processed by the activation function need to be retrieved from the temporary buffer unit. After retrieval, they need to be matched and verified with the dimension of the current input features to ensure that the number of channels and spatial resolution are completely consistent. In the fusion operation stage, the preceding output features are first multiplied by the weight coefficients to obtain the weighted preceding features, which are then added to the current input features to obtain the fused feature value. Finally, the fused feature value is input into the activation function to generate the weighted fused activation value, which serves as the key input for the feature evolution of the current step. By introducing the weighted fusion of preceding output features, the temporal correlation of feature evolution is established, avoiding feature information gaps caused by single-step evolution. At the same time, the dynamic adjustment of the weight coefficients allows the fusion process to adapt to the needs of different feature evolution stages, improving the continuity and stability of feature evolution and providing a better feature foundation for subsequent feature processing.

[0039] Preferably, when the main feature convolution unit in S4 performs convolution operation on the evolved feature map to generate the main feature map, the number of channels of the main feature map satisfies: ,in, This represents the number of channels in the main feature map. This indicates the number of channels in the feature map output by the high-level parameter compression module. Indicates the compression ratio. This represents the function for rounding up.

[0040] Specifically, the logic for calculating the number of channels in the main feature map generated by the main feature convolution unit in step S4 needs to be implemented in conjunction with the overall requirements of high-level parameter compression to determine key parameters. Regarding parameter settings, the number of channels in the output feature map of the high-level parameter compression module needs to be determined based on the complexity of the subsequent classification task, typically set to 64 to 128. For example, 128 is set in complex scenarios such as medical image segmentation, while 64 is set in simple scenario segmentation. The compression ratio needs to balance the parameter compression effect with feature information preservation, generally set to 2 to 4. A compression ratio of 2 results in a smaller parameter compression amplitude, preserving more feature details; a compression ratio of 4 results in a larger parameter compression amplitude, better meeting lightweight requirements. The rounding function needs to be executed when calculating the number of channels in the main feature map. For example, when the number of channels in the output feature map is 65 and the compression ratio is 2, 65 divided by 2 results in 32.5. After rounding up, the number of channels in the main feature map is 33, ensuring that the number of channels is an integer to meet the requirements of convolution operations. In actual calculations, the preset number of output channels and compression ratio of the high-level parameter compression module are first determined. Then, the initial number of channels is obtained by dividing the two. If the result is a decimal, it is rounded up to obtain the final number of channels in the main feature map. The main feature convolution unit determines the number of convolution kernels based on this number of channels. For example, when the number of channels in the main feature map is 32, the number of convolution kernels is set to 32. At the same time, the kernel size is set to 3×3 or 5×5, with a stride of 1, based on the feature extraction requirements. The main feature map with the specified number of channels is generated through convolution operations. Through the explicit channel number calculation logic, it is ensured that the number of channels in the main feature map accurately matches the high-level parameter compression requirements. This achieves effective compression of high-level features, reducing the number of parameters and computational load, and avoids calculation errors caused by decimal channel numbers through the rounding function, ensuring the normal execution of convolution operations and laying the foundation for subsequent derived feature generation and feature concatenation.

[0041] Preferably, the calculation process of constructing the total distillation loss based on the distillation loss of the target class knowledge and the distillation loss of the non-target class knowledge in S5 satisfies: ,in, Indicates total distillation loss. The weighting coefficients represent the loss of target class knowledge distillation. This represents the loss from distillation of target-type knowledge. The weighting coefficients represent the distillation loss of non-target knowledge. This represents the loss from distilling non-target knowledge.

[0042] Specifically, in step S5, the construction of the total distillation loss requires setting key parameters in conjunction with the training objectives of knowledge distillation. The weight coefficient for the target class knowledge distillation loss is preset to 1.0, and the weight coefficient for the non-target class knowledge distillation loss is preset to 8.0. The two types of losses are weighted and summed to construct the total distillation loss. The weight allocation is determined based on the importance of the target class in the segmentation task. The target class knowledge distillation loss is obtained by calculating the difference in the target class probability distribution output by the teacher model and the student model, typically using the cross-entropy loss function, which accurately quantifies the difference between the two probability distributions. The non-target class knowledge distillation loss is obtained by calculating the difference in the non-target class probability distribution output by the two models, also using the cross-entropy loss function, but the non-target class probability distribution must first be normalized to ensure the sum of probabilities is 1. When constructing the total distillation loss, the target class knowledge distillation loss and the non-target class knowledge distillation loss are calculated separately. Then, the target class knowledge distillation loss is multiplied by its weight coefficient, and the non-target class knowledge distillation loss is multiplied by its weight coefficient. Finally, the two weighted loss values ​​are summed to obtain the total distillation loss. The total distillation loss serves as the core basis for model parameter adjustment. It is propagated to each layer of the network via backpropagation, adjusting parameters such as convolutional layer weights and learnable time steps. For example, a larger total distillation loss leads to a larger parameter adjustment range, accelerating model convergence. Through reasonable weight allocation and loss fusion, the total distillation loss can simultaneously address the knowledge transfer between target and non-target classes, avoiding the problem of insufficient target class knowledge learning caused by traditional single loss functions. This improves the segmentation accuracy of the student model and provides a clear and reasonable loss basis for model parameter adjustment, ensuring the effectiveness and stability of model training.

[0043] Preferably, in step S5, when calculating the distillation loss of the target class knowledge, the calculation process of the distillation loss of the target class knowledge satisfies the following: ,in, This represents the loss from distillation of target-type knowledge. Represents a collection of target classes. The target class output by the teacher model represents the first... The probability value of the class. This represents the first element in the target class output by the student model. The probability value of the class.

[0044] Specifically, in step S5, the calculation of the target class knowledge distillation loss requires precise definition of the target class range and quantification of probability distribution differences. Regarding parameter and process settings, the target class set needs to be predefined according to the specific segmentation task. For example, in a vehicle segmentation task, the target class set includes specific categories such as sedans and trucks, with each category corresponding to a clearly defined pixel label range. The target class probability values ​​output by both the teacher model and the student model need to be extracted from the overall probability distribution of the two models. The extraction process must strictly match the categories in the target class set to ensure that no non-target class probability values ​​are mixed in, and the probability values ​​must be normalized, with the range controlled between 0 and 1. The calculation of the cross-entropy loss function needs to be performed separately for each target class. For example, when the target class set includes 3 categories, the cross-entropy of the teacher model probability value and the student model probability value under each category is calculated separately, and then the cross-entropy of all categories is summed to obtain the target class knowledge distillation loss. In the specific calculation, the probability values ​​of each category in the target class set are first selected from the output probability distributions of the teacher and student models to obtain the target class probability distributions of the two models. Then, for each target class, the logarithm of the probability value of that class in the teacher model is multiplied by the probability value of that class in the student model to obtain the cross-entropy component of that class. Finally, the cross-entropy components of all target classes are summed and negative (since the cross-entropy calculation result is usually negative, taking the negative value makes the loss value positive, which is convenient for subsequent processing) to obtain the final target class knowledge distillation loss. Through the clear logic of target class probability distribution extraction and cross-entropy calculation, the gap between the teacher model and the student model in target class knowledge is accurately quantified, ensuring that the student model can fully learn from the target class segmentation experience of the teacher model, improve the accuracy of the student model in segmenting target classes, provide key target class loss components for the subsequent construction of the total distillation loss, and ensure the effectiveness of knowledge distillation.

[0045] Preferably, step S3 includes the following sub-steps: S31, inputting the intermediate feature map to the input interface of the enhanced neural ordinary differential equation block, starting the feature evolution function of the enhanced neural ordinary differential equation block, and setting the total number of feature evolution steps and the initial feature state; S32, in the first... During the feature evolution process, based on the initial feature state and the preset learnable linear transformation matrix and learnable time step, the feature evolution update rule is used to calculate the first step. The feature state after the feature evolution of the first step, and at the same time the first step feature evolution. The output features processed by the activation function during the step feature evolution process are saved to a temporary buffer unit; S33, in the first step... During the evolution of step features, Retrieve the first from the temporary cache unit The output features processed by the activation function during the first step of feature evolution are compared with the first step. The input features of the first step feature evolution are weighted and fused according to preset weight coefficients, and then combined with the first step feature evolution. The learnable linear transformation matrix and learnable time step are used to calculate the 1st step through the feature evolution update rule. The feature state after the feature evolution of the first step, and the first step feature evolution. S34. The output features processed by the activation function during the feature evolution process are updated to the temporary cache unit; S35. Repeat step S36 until the feature evolution operation of the preset total number of steps is completed, and output the feature state after the last feature evolution as the evolved feature map.

[0046] Specifically, the multi-step continuous feature evolution operation in step S3 requires precise control of parameters and procedures step by step. In S31, after inputting the intermediate feature map into the enhanced neural network differential equation block, the total number of feature evolution steps is set to 5 to 10. The initial feature state directly uses the feature data from the intermediate feature map, and its values ​​need to be verified to ensure they are within the range of 0 to 1 to avoid numerical anomalies in subsequent evolution. S32 executes the... During the first evolution step, the dimension of the learnable linear transformation matrix is ​​preset to be the same as the number of channels in the intermediate feature map. The matrix elements are initialized using a random normal distribution with a mean of 0 and a standard deviation of 0.01. The initial value of the learnable time step is set to 0.1 to 0.5. Subsequently, the first evolution step is calculated according to the feature evolution update rule. After each evolution step, the feature state is processed, and the output features, after being processed by an activation function (using a modified linear unit with a threshold of 0), are stored in a temporary buffer unit. The storage capacity of the buffer unit must match the number of channels and spatial resolution of the feature map to ensure complete data preservation. In step S33, when processing the second step and subsequent evolution steps, the output features from the previous step are retrieved from the buffer unit and weighted and fused with the current input features using preset weighting coefficients of 0.3 to 0.7. After fusion, the new feature state is calculated by combining the linear transformation matrix of the current step with the time step size, and the buffer unit data is updated. Step S34 repeats step S33 until the preset number of steps is completed, and the evolved feature map is output. By clearly defining the step-by-step operations and parameter ranges, the orderliness and stability of feature evolution are ensured, solving the feature distortion problem caused by the lack of a clear process in traditional evolution processes.

[0047] Preferably, step S4 includes the following sub-steps: S41, inputting the evolved feature map into the main feature convolution unit, the main feature convolution unit determining the number and size of convolution kernels according to a preset compression ratio, performing convolution operations on the evolved feature map, and extracting features from different regions of the evolved feature map by sliding the convolution kernel during the convolution operation to generate the main feature map; S42, inputting the main feature map into the derived feature generation unit, the derived feature generation unit using a linear transformation kernel of a preset size, performing a linear transformation operation on each channel of the main feature map, and in each channel... During the linear transformation process, the independence between channels is maintained, and cross-channel feature interaction is not performed to generate a derived feature map; S43, the main feature map and the derived feature map are input to the feature stitching unit, the feature stitching unit determines the stitching order of the channel dimension, and stacks the main feature map and the derived feature map in the channel dimension according to the order, so that the number of channels of the stitched feature map meets the preset output channel number requirement, and a compressed feature map is generated; S44, the channel dimension of the compressed feature map is verified, and after confirming that the number of channels meets the requirements of subsequent network processing, the compressed feature map is output to step S5.

[0048] Specifically, the high-level parameter compression process in step S4 requires feature extraction, transformation, and concatenation to be implemented step by step. In S41, the main feature convolution unit first determines the number of convolution kernels based on a preset compression ratio of 2 to 4. For example, when the compression ratio is 2, the number of convolution kernels is set to half the number of output channels of the high-level parameter compression module, the kernel size is 3×3, the stride is set to 1, and the padding mode is set to SamePadding. By sliding the convolution kernel, convolution operations are performed on each pixel region of the evolved feature map to extract high-level semantic features and generate the main feature map. During the operation, the feature values ​​need to be controlled within the range of 0 to 1 to avoid numerical overflow. In S42, the derived feature generation unit uses a linear transformation kernel. Its input dimension is the number of channels in the main feature map, and its output dimension is the difference between the number of output channels of the high-level module and the number of channels in the main feature map. A linear transformation is performed on each channel of the main feature map separately without cross-channel interaction to ensure the independence of each channel's features and generate the derived feature map. In step S43, the feature stitching unit pre-sets a stitching order of main feature map first, followed by derived feature map, stacking the two types of feature maps along the channel dimension to achieve a preset number of channels of 64 to 128 after stitching, generating a compressed feature map. Step S44 verifies the number of channels in the compressed feature map and outputs it after confirming that it matches the preset value. Through step-by-step parameter compression operations, the number of parameters is significantly reduced while ensuring feature quality, meeting the requirements of a lightweight architecture.

[0049] Preferably, step S5 includes the following sub-steps: S51, obtaining the pre-trained teacher model and the student model to be trained, inputting the image data of the training dataset into the teacher model and the student model respectively, and obtaining the probability distributions output by the teacher model and the student model; S52, extracting the target class probability distribution and the non-target class probability distribution from the probability distributions output by the teacher model and the student model respectively, and normalizing the non-target class probability distribution so that the sum of the probabilities of the non-target class probability distribution is 1; S53, calculating the target class knowledge distillation loss using the cross-entropy loss function based on the target class probability distribution, and calculating the non-target class knowledge distillation loss using the same cross-entropy loss function based on the normalized non-target class probability distribution; S54, weighting and summing the target class knowledge distillation loss and the non-target class knowledge distillation loss according to the preset weight coefficients to obtain the total distillation loss, feeding the total distillation loss back to the student model using the backpropagation algorithm, adjusting the parameters of the student model, and repeating steps S51-S54 until the student model training reaches the preset number of iterations.

[0050] Specifically, the network model training process in step S5 requires step-by-step completion of model input, probability distribution processing, loss calculation, and parameter adjustment. In S51, a pre-trained teacher model (using the U-Net++ model with a large number of parameters) and a student model to be trained (a lightweight model based on NeuralODE) are obtained. A training dataset of 5000 to 10000 labeled images is prepared. Images are input into the two models in batches (batch size 8 to 16) to obtain probability distribution outputs. The output probability values ​​need to be normalized to the range of 0 to 1. In S52, from the probability distributions of the two models, the probability distributions of the target class and non-target class are extracted according to the preset target class label. The probability distribution of the non-target class is normalized so that the sum of the probabilities is 1, ensuring the accuracy of subsequent loss calculations. In S53, the cross-entropy loss function is used to calculate the knowledge distillation loss for the target class and non-target class respectively. During calculation, it is necessary to ensure that the loss value for each class is between 0 and 5 to avoid abnormal losses affecting training. The S54 model has a predefined target class loss weight coefficient α of 1 and a non-target class loss weight coefficient β of 8. The total distillation loss is obtained by weighted summation. A stochastic gradient descent optimizer (initial learning rate 0.001, decaying to 0.1 every 10 epochs) is used to adjust the student model parameters through backpropagation, and training is repeated for 100 to 200 epochs. This step-by-step training process and parameter control ensure effective knowledge distillation, improving the segmentation accuracy of the lightweight model.

[0051] like Figure 2As shown, a lightweight image segmentation system based on the NeuralODE neural network architecture is implemented. This system is applied to a lightweight image segmentation method based on the NeuralODE neural network architecture and includes: an image data input and initial feature extraction unit, which receives externally input image data to be segmented, performs convolution operations on the image data to be segmented through a built-in initial convolutional layer to extract basic feature information of the image, generates an initial feature map, and transmits the initial feature map to an intermediate feature deepening and downsampling unit; and an intermediate feature deepening and downsampling unit, which is connected to the image data input and initial feature extraction unit, receives the initial feature map, and then... The built-in separable convolutional layers perform multiple rounds of feature deepening processing on the initial feature map, while simultaneously performing downsampling operations to reduce the spatial resolution of the feature map, generating intermediate feature maps. These intermediate feature maps are then transmitted to a multi-step continuous feature evolution and fusion unit. This unit, connected to the intermediate feature deepening and downsampling unit, receives the intermediate feature map and performs multi-step continuous feature evolution operations through a built-in enhanced neural network differential equation block. In each evolution step, the output features from the previous step are retrieved and weighted to improve feature evolution stability, generating an evolved feature map. This evolved feature map is then transmitted to a high-level feature compression and stitching layer. The network model training and parameter tuning unit is connected to the high-level feature compression and splicing unit. It receives the evolved feature map, generates a main feature map through a built-in main feature convolution subunit, generates a derived feature map through a derived feature generation subunit, and then splices the main and derived feature maps along the channel dimension through a feature splicing subunit to generate a compressed feature map. This compressed feature map is then transmitted to the network model training and parameter tuning unit. The network model training and parameter tuning unit, also connected to the high-level feature compression and splicing unit, receives the compressed feature map and employs a decoupling knowledge distillation strategy to decouple the teacher model's output probability distribution into the target class and... The non-target class probability distribution is used to calculate the two-class loss and construct the total distillation loss. Based on the total distillation loss, the network model parameters are adjusted through backpropagation to obtain the trained network model. The trained network model is then transmitted to the segmentation result generation unit. The segmentation result generation unit is connected to the network model training and parameter adjustment unit. It receives the trained network model, inputs the feature map of the image to be segmented after processing by the preceding unit into the network model, and inputs the feature map output by the network model into the segmentation prediction head. The segmentation prediction head performs pixel-level prediction operations on the feature map to generate the segmentation result of the image to be segmented, and outputs the segmentation result to an external storage or display device.

[0052] A lightweight image segmentation method and system based on the NeuralODE neural network architecture addresses the issues of numerical instability and feature loss during the evolution process of traditional neural ODE models by performing multi-step continuous feature evolution through an enhanced neural ODE block. Each step incorporates weighted fusion of preceding output features, improving the continuity and robustness of feature representation. The high-level parameter compression module significantly reduces the number of high-level network parameters through principal feature convolution, derived feature generation, and channel concatenation, overcoming the bottleneck of redundant high-level parameters in traditional lightweight models and achieving a balance between model lightweighting and performance. Simultaneously, a decoupled knowledge distillation strategy decouples the probability distribution into target and non-target classes, calculates the loss separately, and constructs a total distillation loss to precisely adjust model parameters. This avoids training bias caused by a single loss function, improves the accuracy of traditional distillation methods, and further enhances segmentation performance.

[0053] The corresponding image segmentation system enhances its advantages through modular design. Units within the system are sequentially connected to form a complete link. The multi-step continuous feature evolution and fusion unit incorporates an enhanced neural network constant differential equation block, maintaining the stability advantage of feature evolution in the method and overcoming the evolutionary disorder problems that easily occur in the feature processing modules of traditional systems. The high-level feature compression and stitching unit integrates the generation and stitching functions of main and derived features, efficiently compressing parameters and solving the problem of excessive resource consumption during deployment in traditional systems, adapting to more resource-constrained scenarios. Furthermore, the network model training and parameter adjustment unit implements a decoupled knowledge distillation strategy, ensuring model training efficiency and accuracy through precise loss calculation and parameter adjustment, compensating for the slow convergence and large performance fluctuations of traditional system training modules. The segmentation result generation unit collaborates with the preceding units to ensure efficient output of the final segmentation result, comprehensively improving the system's practicality.

[0054] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," "link," and "fix" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0055] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A lightweight image segmentation method based on the NeuralODE neural network architecture, characterized in that, Includes the following steps: S1. Obtain image data to be segmented, input the image data to be segmented into an initial convolutional layer, and extract features from the image data to be segmented through the initial convolutional layer to obtain an initial feature map; S2. Input the initial feature map into a separable convolutional layer, and perform feature enhancement and downsampling on the initial feature map through the separable convolutional layer to generate an intermediate feature map; S3. Input the intermediate feature map into the enhanced neural ordinary differential equation block. The enhanced neural ordinary differential equation block performs a multi-step continuous feature evolution operation on the intermediate feature map. Starting from the second step, in each feature evolution process, the output features of the previous step are introduced and weighted and fused to obtain the evolved feature map. S4. The evolved feature map is input to the high-level parameter compression module. The high-level parameter compression module first performs convolution operation on the evolved feature map through the main feature convolution unit to generate the main feature map, then performs linear transformation on the main feature map through the derived feature generation unit to generate the derived feature map, and finally concatenates the main feature map and the derived feature map in the channel dimension through the feature concatenation unit to output the compressed feature map. The high-level parameter compression module replaces the standard point convolution operation in the network by reducing the number of parameters. S5. The network model corresponding to the compressed feature map is trained using a decoupled knowledge distillation strategy. The probability distribution output by the teacher model is decoupled into a target class probability distribution and a non-target class probability distribution. The target class knowledge distillation loss and the non-target class knowledge distillation loss are calculated respectively. The total distillation loss is constructed based on the target class knowledge distillation loss and the non-target class knowledge distillation loss. The network model parameters are adjusted according to the total distillation loss. S6. Input the feature map output by the trained network model into the segmentation prediction head, and use the segmentation prediction head to upsample and classify the feature map at the pixel level to generate a segmentation result with the same resolution as the image to be segmented.

2. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, The update rule for the enhanced neural ordinary differential equation block in S3 to perform multi-step continuous feature evolution operations on the intermediate feature map satisfies: ,in, Indicates the first Feature states in the step feature evolution process Indicates the first Feature states in the step feature evolution process Indicates the first The learnable time step in the evolution of step features This represents the activation function. Indicates the first Learnable linear transformation matrix in the step feature evolution process. This represents the initial feature map. This indicates that feature extraction is performed on the input features to capture the semantic information of the image.

3. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, In step S3, starting from the second step, the calculation process of introducing the output features of the previous step and performing weighted fusion in each feature evolution step satisfies the following: ,in, Indicates the first The activation values ​​after weighted fusion during the step feature evolution process This represents the activation function. Indicates the first Input features in the step feature evolution process, Indicates the weighting coefficient. Indicates the first The output features after being processed by the activation function during the step feature evolution process.

4. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, When the main feature convolution unit in S4 performs convolution operation on the evolved feature map to generate the main feature map, the number of channels of the main feature map satisfies: ,in, This represents the number of channels in the main feature map. This indicates the number of channels in the feature map output by the high-level parameter compression module. Indicates the compression ratio. This represents the function for rounding up.

5. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, The calculation process of constructing the total distillation loss based on the distillation loss of the target class knowledge and the distillation loss of the non-target class knowledge in S5 satisfies the following: ,in, Indicates total distillation loss. The weighting coefficients represent the loss of target class knowledge distillation. This represents the loss from distillation of target-type knowledge. The weighting coefficients represent the distillation loss of non-target knowledge. This represents the loss from distilling non-target knowledge.

6. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, When calculating the distillation loss of the target class knowledge in S5, the calculation process of the distillation loss of the target class knowledge satisfies the following: ,in, This represents the loss from distillation of target-type knowledge. Represents a collection of target classes. The target class output by the teacher model represents the first... The probability value of the class. This represents the first element in the target class output by the student model. The probability value of the class.

7. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, S3 includes the following steps: S31. Input the intermediate feature map to the input interface of the enhanced neural ordinary differential equation block, start the feature evolution function of the enhanced neural ordinary differential equation block, and set the total number of feature evolution steps and the initial feature state. S32, in the During the feature evolution process, based on the initial feature state and the preset learnable linear transformation matrix and learnable time step, the feature evolution update rule is used to calculate the first step. The feature state after the feature evolution of the first step, and at the same time the first step feature evolution. The output features processed by the activation function during the step feature evolution process are saved to a temporary cache unit; S33, in the During the evolution of step features, Retrieve the first from the temporary cache unit The output features processed by the activation function during the first step of feature evolution are compared with the first step. The input features of the first step feature evolution are weighted and fused according to preset weight coefficients, and then combined with the first step feature evolution. The learnable linear transformation matrix and learnable time step are used to calculate the 1st step through the feature evolution update rule. The feature state after the feature evolution of the first step, and the first step feature evolution. The output features processed by the activation function during the step feature evolution process are updated to the temporary cache unit; S34. Repeat step S33 until the preset total number of feature evolution operations are completed, and output the feature state after the last feature evolution as the evolved feature map.

8. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, S4 includes the following steps: S41. The evolved feature map is input into the main feature convolution unit. The main feature convolution unit determines the number and size of convolution kernels according to the preset compression ratio, and performs convolution operation on the evolved feature map. During the convolution operation, the sliding convolution kernel is used to extract features from different regions of the evolved feature map to generate the main feature map. S42. The main feature map is input to the derived feature generation unit. The derived feature generation unit uses a linear transformation kernel of a preset size to perform a linear transformation operation on each channel of the main feature map. During the linear transformation of each channel, no cross-channel feature interaction is performed to generate the derived feature map. S43. Input the main feature map and the derived feature map into the feature stitching unit. The feature stitching unit determines the stitching order of the channel dimension and stacks the main feature map and the derived feature map in the channel dimension according to the order, so that the number of channels of the stitched feature map meets the preset output channel number requirement and generates a compressed feature map. S44. Verify the channel dimension of the compressed feature map. After confirming that the number of channels meets the requirements of subsequent network processing, output the compressed feature map to step S5.

9. The lightweight image segmentation method based on the NeuralODE neural network architecture according to claim 1, characterized in that, S5 includes the following steps: S51. Obtain the pre-trained teacher model and the student model to be trained. Input the image data of the training dataset into the teacher model and the student model respectively to obtain the probability distribution output by the teacher model and the probability distribution output by the student model. S52. Extract the target class probability distribution and the non-target class probability distribution from the probability distribution output by the teacher model and the probability distribution output by the student model, respectively. Normalize the non-target class probability distribution so that the sum of the probabilities of the non-target class probability distribution is 1. S53. Based on the probability distribution of the target class, the cross-entropy loss function is used to calculate the knowledge distillation loss of the target class. Based on the normalized probability distribution of the non-target class, the cross-entropy loss function is also used to calculate the knowledge distillation loss of the non-target class. S54. Based on the preset weight coefficients, the distillation loss of the target class knowledge and the distillation loss of the non-target class knowledge are weighted and summed to obtain the total distillation loss. The total distillation loss is fed back to the student model using the backpropagation algorithm. The parameters of the student model are adjusted, and steps S51-S54 are repeated until the student model training reaches the preset number of iterations.

10. A lightweight image segmentation system based on the NeuralODE neural network architecture, characterized in that, This system is applied to the lightweight image segmentation method based on the NeuralODE neural network architecture as described in claim 1, comprising: an image data input and initial feature extraction unit, which receives externally input image data to be segmented, performs convolution operations on the image data to be segmented through a built-in initial convolutional layer to extract basic feature information of the image, generates an initial feature map, and transmits the initial feature map to an intermediate feature deepening and downsampling unit; and an intermediate feature deepening and downsampling unit, which is connected to the image data input and initial feature extraction unit, receives the initial feature map, and performs convolution operations on the initial feature map through a built-in separable convolutional layer. Multiple rounds of feature deepening processing are performed, along with downsampling to reduce the spatial resolution of the feature map, generating an intermediate feature map. This intermediate feature map is then transmitted to a multi-step continuous feature evolution and fusion unit. This unit, connected to the intermediate feature deepening and downsampling unit, receives the intermediate feature map and performs multi-step continuous feature evolution operations through a built-in enhanced neural network differential equation block. From the second step onwards, in each feature evolution step, the output features of the previous step are introduced and weighted fused to generate an evolved feature map. This evolved feature map is then transmitted to a high-level feature compression and stitching unit. The unit, connected to the multi-step continuous feature evolution and fusion unit, receives the evolved feature map, generates a main feature map through a built-in main feature convolution subunit, generates a derived feature map through a derived feature generation subunit, and then concatenates the main feature map and the derived feature map along the channel dimension through a feature concatenation subunit to generate a compressed feature map. The compressed feature map is then transmitted to the network model training and parameter tuning unit. The network model training and parameter tuning unit, connected to the high-level feature compression and concatenation unit, receives the compressed feature map and employs a decoupled knowledge distillation strategy to decouple the teacher model's output probability distribution into target class and non-target class probability distributions. The system calculates two types of losses and constructs a total distillation loss. Based on the total distillation loss, it adjusts the network model parameters through backpropagation to obtain a trained network model. The trained network model is then transmitted to the segmentation result generation unit. The segmentation result generation unit, which is connected to the network model training and parameter adjustment unit, receives the trained network model, inputs the feature map of the image to be segmented after processing by the preceding unit into the network model, and then inputs the feature map output by the network model into the segmentation prediction head. The segmentation prediction head performs pixel-level prediction operations on the feature map to generate the segmentation result of the image to be segmented, and outputs the segmentation result to an external storage or display device.

Citation Information

Patent Citations

  • Medical image classification method based on Shenchang differential equation and multi-instance learning

    CN118351359A

  • Thyroid cancer auxiliary diagnosis and metastasis risk prediction method based on deep learning

    CN121460163A