A vehicle image segmentation method based on edge guidance and dynamic pruning

CN118823343BActive Publication Date: 2026-10-27CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410869826.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2026-10-27
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

同时,车辆图像质量会受到光照不足、阴影、雨水等外部条件的影响,使得车辆的边界模糊或难以分割

Benefits of technology

[0057]本发明的其他优点、目标和特征在某种程度上将在随后的说明书中进行阐述,并且在某种程度上,基于对下文的考察研究对本领域技术人员而言将是显而易见的,或者可以从本发明的实践中得到教导。本发明的目标和其他优点可以通过下面的说明书来实现和获得。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823343B_ABST
    Figure CN118823343B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of vehicle image segmentation method based on edge guide and dynamic pruning, belong to image processing field.Utilize the extraction and recovery of image shallow layer and deep layer semantic feature based on the hybrid perception coding and decoding network of state space model.Mixed state space module is built by the encoder consisting of state space model branch and mixed convolution branch, in mixed convolution branch, the receptive field of convolution kernel is expanded by dilated convolution.Multiple scale edge guide branch inputs the encoding feature of shrinkage path, the high-frequency feature of high-level decoding prediction feature in expansion path and Gaussian Laplacian operation.Through dynamic joint pruning algorithm, model weight is learned jointly, the change of pruning accuracy reward function is dynamically modeled by constructing recursive network, and the optimal segmentation model of model layer compression rate and pruning accuracy trade-off is obtained.The present application can not only accurately segment vehicle image in complex environment, but also can be efficiently deployed and run on limited resource device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing and relates to a vehicle image segmentation method based on edge guidance and dynamic pruning. Background Technology

[0002] Image segmentation is a crucial preprocessing technique in image recognition and computer vision, and a vital component of many visual understanding systems. Semantic image segmentation involves predicting the label of each pixel in an image so that pixels with the same label are associated with semantic entities within the image. Based on static 2D images, videos, or 3D volumetric data, semantic segmentation is applied to prediction tasks such as pedestrian and vehicle segmentation in autonomous driving scenarios and medical image segmentation. Vehicle segmentation involves dividing vehicles in images or videos, achieving pixel-level differentiation between the vehicle body and background, and extracting key information such as the vehicle's shape, size, and color to enable functions like vehicle tracking, detection, and statistics. It is one of the fundamental tasks in scene understanding within the autonomous driving field. However, vehicle segmentation in complex environments is more challenging due to the color and texture similarities caused by various backgrounds such as roads, buildings, and pedestrians. Occlusion by non-target vehicles, pedestrians, or other obstacles further complicates recognition and segmentation. Vehicles may deform or be affected by perspective effects, causing their shape and size to change in the image. Various application scenarios also place demands on the efficiency and computational resources required for vehicle segmentation. Therefore, it is necessary to design network models suitable for vehicle segmentation tasks in complex environments. On the one hand, autonomous driving applications require real-time perception of the surrounding environment, including the identification and tracking of other vehicles. To help autonomous driving systems accurately detect and identify vehicles on the road, thereby better planning driving paths and avoiding collisions, the sensitivity and accuracy of the model need to be improved to ensure driving safety and efficiency. On the other hand, in resource-constrained vehicle devices such as embedded systems, mobile devices, or edge computing nodes, due to limitations in processor performance, memory size, or storage capacity, a trade-off between speed and performance is necessary to maximize vehicle safety and operational efficiency. Simultaneously, vehicle image quality is affected by external conditions such as insufficient lighting, shadows, and rain, making vehicle boundaries blurred or difficult to segment. To alleviate these problems, this patent proposes a vehicle image segmentation method based on edge guidance and dynamic pruning, which mainly includes three modules: a hybrid perception encoding / decoding network based on a state-space model, multi-scale edge guidance branching, and a dynamic joint pruning algorithm. The hybrid sensing codec network based on the state-space model consists of a patch embedding layer, a hybrid state-space module, and a patch merging layer, enabling the extraction and recovery of shallow and deep semantic features of images. In the hybrid state-space module, features generated by dilated convolutions are fed into the state-space model, leveraging the state transition capabilities of the state-space model to enhance the spatial correlation between features, thereby compensating for discontinuities introduced by gaps. The state-space model branch and the hybrid convolution branch of the hybrid state-space module respectively process the two sub-inputs generated from the channel segmentation operation.Multi-directional feature capture is achieved by extending the core SS2D block of the state-space model. The selective mechanism in the S6 block is used to select parameters of the state-space model, accurately identifying and extracting useful information while filtering out redundant information. A hybrid convolutional branch uses dilated convolution and depthwise separable convolution to perceive image detail features while reducing the number of parameters. A multi-scale edge-guided branch takes into account the encoded features of the contraction path, the decoded prediction features of higher layers in the expansion path, and high-frequency features from the Gaussian-Laplacian operation. Edge detection is achieved using Gaussian filters and the Laplacian operator, preserving high-frequency details. An edge loss function is designed to supervise edge information learning. Then, spatial channel attention fuses deep semantic features and edge features, feeding the output into the expansion path. Finally, a dynamic joint pruning algorithm is used to jointly learn model weights. A reinforcement learning agent is used for filter pruning, and the pruning model accuracy is used as the agent's reward function. A recursive network is constructed to dynamically model the changes in the reward function, iteratively training the model weights and agent policy to obtain the optimal segmentation model that balances model layer compression rate and pruning accuracy. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a vehicle image segmentation method based on edge guidance and dynamic pruning. A hybrid sensing encoder-decoder network is used to learn the contextual feature representation of the vehicle image. The hybrid sensing encoder is composed of a state-space model fused with hybrid convolutions. The deep detail features in the image information are enhanced through a dual-branch approach of the state-space model and hybrid convolutions, and then input into the decoder for feature recovery. A multi-scale edge guidance network is input to the hybrid sensing encoder at different stages to extract features to process and refine the associated boundary shape information. An edge loss function is designed to supervise edge information learning. A dynamic joint pruning algorithm is used to learn model weights and implement structured pruning, enabling lightweight deployment of the vehicle image segmentation model in complex environments on resource-constrained devices.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] A vehicle image segmentation method based on edge guidance and dynamic pruning includes the following steps:

[0006] S1: Data Preprocessing: Considering that images may be affected by factors such as lighting, noise, and blurring due to differences in acquisition equipment and external conditions during the acquisition process, resulting in inconsistent image sizes or poor quality, data preprocessing is used to adjust image size and improve image quality, thereby enhancing the stability and accuracy of the model. First, images are resized to a uniform size to ensure consistency in the input model. Color space conversion and brightness / contrast adjustment are used to modify image brightness and contrast to reduce the impact of external conditions on the model. Histogram equalization, blurring, and sharpening techniques are used to enhance image features. High-quality, diverse vehicle segmentation image datasets are obtained through data augmentation techniques such as translation, rotation, scaling, mirroring, and random cropping.

[0007] S2: To address the issues of reduced image resolution and information loss during downsampling, a hybrid perceptual encoding / decoding network, consisting of a patch embedding layer, a hybrid state space module, and a patch merging layer, is used to extract and restore shallow and deep semantic features of the image. In the state space module, features generated by dilated convolutions are passed to the state space model. This leverages the state transition capabilities of the state space model to enhance the spatial correlation between features, thereby compensating for discontinuities introduced by gaps. Simultaneously, hybrid convolutions capture contextual information, improving the model's ability to perceive the structure of the image at different scales without losing image details.

[0008] S21: First, input the baseline dataset sequence I into the patch embedding layer, with the input image X∈R. H×W×3 The image is divided into non-overlapping blocks of size 4×4, and its dimension is linearly mapped to C dimensions to obtain the embedded image X'∈R. H×W×C The embedded image is normalized by layer normalization and then input into an encoder constructed by a hybrid state space module.

[0009] S22: The encoder constructed by the hybrid state-space module consists of a state-space model branch and a hybrid convolution branch. The embedded image is segmented into two sub-inputs of equal size through a channel segmentation operation, and the sub-inputs are respectively sent to the two branch modules. As shown in Equation (1), the state-space model uses the implicit latent state h(t)∈R... N Map a one-dimensional input function or sequence x(t)∈R to y(t)≥R.

[0010]

[0011] Where A∈R N×N It is a state matrix, and B∈R N×1 and ε∈R N×1 This represents the projection parameters. To discretize a continuous system, a time scale parameter or step size Δ is introduced, and A and B are converted into discrete parameters using a fixed discretization rule. and

[0012]

[0013] After discretization, the state-space model can be computed via linear recursion:

[0014]

[0015] This can also be achieved through global convolution:

[0016]

[0017] Where K∈R L represents the structured convolution kernel, and L represents the length of the input sequence x.

[0018] In the state-space model branch, the input undergoes layer normalization, followed by dimensionality enhancement through linear mapping, and then a convolutional layer with depthwise separable convolutions. This convolutional layer preserves the dimensionality while improving feature localization by grouping features. A non-linear transformation using the SiLU activation function is then applied before entering the SS2D module for feature extraction and processing. Finally, the processed features are remapped back to the original feature space to obtain the output of the state-space model branch.

[0019] The SS2D module comprises scan expansion, S6 blocks, and scan merging. Scan expansion decomposes the input image into independent sequences along the four directions (up, down, left, and right), ensuring broad spatial coverage and enabling multi-directional feature capture. The S6 block uses a selective mechanism to choose the parameters of the state-space model to accurately identify and extract useful information while filtering out redundant information. Specifically, this block takes a feature format of [B, L, D] as input, where B is the batch size, L is the sequence length, and D is the feature dimension. The features are first transformed through a linear layer, and then the update and output equations in the state-space model are applied to produce the final output features. Finally, the scan and merge operations reconfigure the sequence of these transformations to produce an output image with dimensions matching the original input image.

[0020] S23: In the hybrid convolution branch, the receptive field of the convolution kernel is expanded by dilating the convolution to capture a wider range of contextual information, perceiving the structure of the image at different scales without losing image details. To avoid the gridding effect caused by discontinuous data, an expansion strategy with expansion rates of 1, 2, 3, and 1 is used to refocus local features after multi-scale feature extraction while maintaining the continuity of the feature space. At the end of the strategy, a smaller expansion rate is used to focus on smaller regions that may contain important information. Finally, the outputs of the two branches are merged along the channel dimension of the feature map, and a parameterless channel shuffling operation is used to facilitate information exchange between the two sub-input channels.

[0021] S24: The hybrid sensing encoder consists of four stages. At the end of the first three stages, a patch merging operation is applied to reduce the height and width of the input features while increasing the number of channels. A hybrid state-space module is used in the four stages, with a channel count of [C, 2C, 4C, 8C] for each stage. The decoder, which has a symmetric structure with the encoder, also has four stages. At the beginning of the last three stages, four upsampling operations are performed via patch expansion to recover the height and width of the features. A final projection layer is used before output to recover the size of the features to match the segmentation target.

[0022] S3: To address the challenge of segmenting vehicle images with complex background distributions and blurred boundaries, a multi-scale edge-guided branch is used to preserve edge information at different resolution levels. Simultaneously, a hybrid sensing encoder extracts features, and a decoder predicts features. Gaussian filters and Laplacian operators are used to achieve edge detection and preserve high-frequency details, while gated convolutional blocks are used to process and refine edge-related information.

[0023] S31: In encoding stage i, multi-scale edge-guided branches input encoded features. Predicted features in stage i+1 and high-frequency features obtained from Gaussian Laplace operations The Laplacian of Gaussian operator initially smooths the original image using a Gaussian filter, and then applies the Laplacian operator to perform edge detection. The Laplacian operation achieves key detail extraction through a cascaded approximation sequence of Laplacian of Gaussian operators.

[0024]

[0025] Where I is the input image, g is the convolution operator with a Gaussian filter, and d represents the 2× downsampling operation. Each level λ of the Gaussian Laplacian operation... k By starting from the current level I k Subtract the smaller level I k+1 The upsampled version (u) is obtained from the Gaussian pyramid.

[0026] λ k =I k -u(I k+1 (6)

[0027] The Laplacian operator captures second-order transformations in the input image, extracting high-frequency details such as edges and contours, corresponding to the i-th level of the first-order image in the Gaussian Laplacian operation. The high-frequency features are provided to the i-th edge detection module, denoted as f. p =λ1(I). As in formula (7), in order to preserve high-frequency information f at each level ip From the basic level f0 p Export f i p This effectively preserves high-frequency information.

[0028]

[0029] Where d represents the 2× downsampling operation, (d(f) p )) i It is 2 × i times the upsampling, i.e., d(d(...d(f) p ))).

[0030] S32: Forecast diagram for the next stage Decomposed into reverse attention map and edge attention map The reverse attention map is calculated as follows This allows for the re-evaluation and refinement of imprecise prediction maps from higher layers. The edge attention map is obtained via the Laplacian operator. As shown in formula (8), the combined features are obtained by multiplying the three attention maps element by element.

[0031]

[0032] Where [.] denotes cascading. To guide the model's attention to important regions while suppressing background noise and redundant information, an attention mask, denoted as Ψ, is introduced at level i. i The attention feature map f of the i-th layer i a The calculation is as follows:

[0033]

[0034] Here, σ represents the sigmoid function. To process and refine edge-related information, the attention features are recalibrated using gated convolutional blocks.

[0035] S33: To effectively supervise edge information learning, binary cross-entropy loss L is used. BCE And the loss of dice L Dice Combining as edge functions for training:

[0036]

[0037] Where D is the number of stages in the decoder, which is 4. f is the predicted feature map of the i-th decoding layer. i It is the segmentation of the i-th level scale, Groundtruth.

[0038] S4: To balance the high performance and lightweight nature of the model, a dynamic joint pruning algorithm is used to jointly learn the model weights. A reinforcement learning agent is used to prune the filters, and the accuracy of the pruned model is used as the agent's reward function. A recursive network is constructed to provide a representation of the current state and dynamically model the changes in the reward function. The model weights and agent policies are trained iteratively.

[0039] S41: First, in each iteration, train the model weights once on the training dataset, while fixing the reinforcement learning agent and keeping the model weights frozen. Let l represent the number of layers in the convolution, and use... This represents the weight of its l-th convolutional layer. C l+1 C l This indicates the number of output and input channels of the layer, W. l and H l It is the spatial dimension of its kernel, stride l This displays the stride of the l-th layer, where FLOPs[l] represents the FLOPs value.

[0040] S42: To prune a model using a reinforcement learning agent, the agent is defined as the state accessed in the environment, the operations that can be performed, and the reward function given the state and operations. The agent's state depends on the index of the layer the agent is currently pruning, the layer kernel size, the number of FLOPs, and the number of FLOPs already pruned. The agent is currently pruning layer l, and the state of the environment is defined as follows:

[0041] Φ l =[l,C l C l+1 stride l ,k l ,FLOPs[l],FLOPs 1:l-1 FLOPs l+1 ,a l-1 (11)

[0042] Where k l This refers to the kernel size of the layer. (FLOPs) 1:l-1 This represents the number of FLOPs in previous layers of a given model that are currently performing operations on it. l+1 Show the next layer of untrimmed FLOPs, a l-1 It is the agent's operation on the upper layer.

[0043] The actions performed by the agent are based on the state Φ of layer l. l Determine its pruning rate a l , making a l ∈[0,1). Given the predicted pruning rate a l Remove the channel at that time. (Based on FLOPs) 1:l-1FLOPs[l] FLOPs l+1:L Calculate the minimum and maximum practically feasible pruning rates for the current layer, along with the required budget FLOPs. Then, perform the prediction operation a. l Limited to [a l,min ,a l,max Within the range of ].

[0044] The reward function is set as the accuracy of the pruned model on a subset of the training dataset, serving as a proxy for its final performance. Since the proxy prunes one layer of the model at a time, computing the proxy value after each action of the proxy would be very time-consuming. To reduce computational memory, a single pass of the proxy across all layers of the model is treated as a plot trajectory. The accuracy of the final pruned model on the subset at the end of the trajectory is then computed and used as the reward value for all state-action pairs seen during the trajectory.

[0045] S43: During iterative training of the model weights and agent policy, the weights of the convolutional layers on which the agent performs operations change continuously, and the reward function changes dynamically accordingly, mapping each round's index used to train the model weights to an embedding. Then, the recursive model inputs the corresponding embedding sequence that has already passed through and outputs a representation of the current state of the model weights. The state representation of the model weights in the m-th round is calculated as follows:

[0046] z m =F Env (χ 1:m ,h0;θ Env (12)

[0047] Among them, F Env This represents a recursive model. χ 1:m This involves embedding in each round, up to round m. h0 is the initial state of the recursive model, set as the zero vector, and θ... Env These are the parameters of the recursive model, z m To train the agent.

[0048] S44: Design an interpretive model to train a recursive model. The interpretive model takes a state-action pair (S,a) and a representation z of the environment state when the agent follows (S,a) and the reward r of the agent is predicted. The representation z is information about the environment state when the interpretive model can use the representation z to accurately predict r. Construct the objective to train the weights of the recursive model and the weights of the interpretive model:

[0049]

[0050] z = F Env (χ,h0;θ Env )

[0051] Where E represents the epoch embedding corresponding to the epoch index, F βIt is an explanatory model, θ β The parameters are represented by a recursive model and a flexible actuation evaluation method to train the agent, and the state S is expanded by the representation of the environment state z.

[0052] S45: To maintain training stability and improve model accuracy, soft regularization is applied to the model weights via a proxy to align them with the selected subnetwork. Given a binary architecture vector [v1, v2, ..., v L ] indicates that the current best agent is the channel selected for each layer, and the following regularization terms are used to train the model weights:

[0053]

[0054] Here, · denotes element-wise multiplication, and the proposed objective regularizes the channels removed by the proxy. Finally, the standard cross-entropy loss L is applied... class With the proposed L align The weights are combined to train the model:

[0055] L ω =L class +βL align (15)

[0056] The beneficial effects of this invention are as follows: First, vehicle image segmentation in complex environments faces challenges such as complex background distribution, occlusion by non-target vehicles or other obstacles affecting recognition and segmentation, and blurred boundaries. Second, vehicle image segmentation methods employ numerous convolutional and Transformer structures to improve segmentation performance, resulting in significant computational and memory consumption, failing to balance segmentation performance and speed effectively, and hindering the deployment of segmentation models on resource-constrained in-vehicle devices such as embedded systems, mobile devices, or edge computing nodes. To address these issues, this patent proposes a vehicle image segmentation method based on edge guidance and dynamic pruning, utilizing a hybrid perceptual encoder-decoder network based on a state-space model to extract and restore shallow and deep semantic features of the image. The encoder constructed by the hybrid state-space module consists of a state-space model branch and a hybrid convolutional branch. The state-space model branch utilizes the state transition capability of the state-space model to enhance the spatial correlation between features, thereby compensating for discontinuities introduced by gaps. In the hybrid convolutional branch, the receptive field of the convolutional kernel is expanded by dilation convolution to capture broader contextual information, perceiving different scale structures of the image without losing image details. This method utilizes the encoded features of the shrinking path, the decoded and predicted features of the higher layers in the expanding path, and the high-frequency features of the Gaussian-Laplacian operation to guide the edge detection and preserve high-frequency details. An edge loss function is designed to supervise edge information learning. Finally, a dynamic joint pruning algorithm is used to jointly learn the model weights, and a reinforcement learning agent is used for filter pruning. A recursive network is constructed to dynamically model the changes in the pruning accuracy reward function. The model weights and agent strategy are iteratively trained to obtain the optimal segmentation model that balances model layer compression ratio and pruning accuracy. This method can accurately segment vehicle images in complex environments and can be efficiently deployed and run on resource-constrained devices, achieving a balance between performance and speed.

[0057] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0058] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0059] Figure 1 It is a hybrid sensing encoding / decoding network based on a state-space model;

[0060] Figure 2 Multi-scale edge-guided branches;

[0061] Figure 3 This is a dynamic joint pruning algorithm. Detailed Implementation

[0062] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0063] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0064] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0065] like Figure 1 , Figure 2 and 3 As shown, the specific implementation details of each part of the present invention are as follows:

[0066] (1) The hybrid sensing encoding and decoding network consists of a patch embedding layer, a hybrid state space module, and a patch merging layer, which realizes the extraction and recovery of shallow and deep semantic features of the image. In the state space module, by passing the features generated by dilated convolution to the state space model, the spatial correlation between features can be enhanced by utilizing the state transition capability of the state space model, thereby compensating for the discontinuity introduced by gaps. At the same time, the hybrid convolution is used to capture contextual information, improving the model's ability to perceive the structure of the image at different scales without losing image details.

[0067] (2) Multi-scale edge guidance branches preserve edge information at different resolution levels, while connecting the hybrid sensing encoder to extract features and the decoder to predict features. Gaussian filters and Laplacian operators are used to achieve edge detection and preserve high-frequency details, and gated convolutional blocks are used to process and refine edge-related information.

[0068] (3) Design a dynamic joint pruning algorithm to jointly learn the model weights, use reinforcement learning agents to prune the filters, use the accuracy of the pruning model as the agent reward function, construct a recursive network that provides the current state representation to dynamically model the changes in the reward function, and iteratively train the model weights and agent policies.

[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A vehicle image segmentation method based on edge guidance and dynamic pruning, characterized in that: The method includes the following steps: S1: Image resizing and quality improvement are achieved through data preprocessing. First, the images are resized to a uniform size. Then, the brightness and contrast of the images are changed through color space conversion and brightness / contrast adjustment. Histogram equalization, blurring, and sharpening techniques are used to enhance image features. High-quality and diverse vehicle segmentation image datasets are obtained through data augmentation techniques such as translation, rotation, scaling, mirroring, and random cropping. S2: The hybrid sensing network consists of a patch embedding layer, a hybrid state space module, and a patch merging layer, which realizes the extraction and recovery of shallow and deep semantic features of the image. In the state space module, the features generated by dilated convolution are passed to the state space model. The state transition capability of the state space model is used to enhance the spatial correlation between features, thereby compensating for the discontinuity introduced by gaps. At the same time, the hybrid convolution is used to capture contextual information, improving the model's ability to perceive the structure of the image at different scales without losing image details. S3: Multi-scale edge guidance branches preserve edge information at different resolution levels, while connecting the hybrid perceptual encoder to extract features and the decoder to predict features; edge detection is achieved and high-frequency details are preserved using Gaussian filters and Laplacian operators, and edge-related information is processed and refined through gated convolutional blocks; S4: Design a dynamic joint pruning algorithm to jointly learn model weights, use reinforcement learning agents to prune filters, use the accuracy of the pruned model as the agent reward function, construct a recursive network that provides the current state representation to dynamically model the changes in the reward function, and iteratively train the model weights and agent policies.

2. The vehicle image segmentation method based on edge guidance and dynamic pruning according to claim 1, characterized in that: Specifically, S2 is: S21: Input the baseline dataset sequence I into the patch embedding layer, input image Divided into sizes of The non-overlapping blocks are linearly mapped from the image dimension to C dimension to obtain the embedded image. The embedded image is normalized by layer normalization and then input into the encoder constructed by the hybrid state space module; S22: The encoder constructed by the hybrid state-space module consists of a state-space model branch and a hybrid convolution branch. The embedded image is divided into two sub-inputs of equal size through channel segmentation, and the sub-inputs are respectively sent to the two branch modules; wherein, as shown in formula (1), the state-space model uses implicit latent states One-dimensional input function or sequence Mapped to ; (1) in It is a state matrix, and and The projection parameters are represented; to discretize a continuous system, a time scale parameter or step size is introduced. and using fixed discretization rules to and Convert to discrete parameters and : (2) After discretization, the state-space model is calculated via linear recursion: (3) Achieve this through global convolution: (4) in, Represents a structured convolution kernel. Represents the input sequence Length; In the state-space model branch, the input is normalized by layers, first enhanced in dimension by linear mapping, then a convolutional layer with depthwise separable convolutions is applied, which preserves the dimension and improves feature localization by grouping features; then a non-linear transformation is applied using the SiLU activation function, and the input enters the SS2D module for feature extraction and processing. Finally, the processed features are remapped back to the original feature space to obtain the output of the state-space model branch. The SS2D module includes scan expansion, S6 blocks, and scan merging. Scan expansion decomposes the input image into independent sequences along the four directions (up, down, left, and right), ensuring broad spatial coverage of information and enabling multi-directional feature capture. The S6 block uses a selective mechanism to select parameters of the state-space model to accurately identify and extract useful information while filtering out redundant information. The S6 block takes a feature format of [B,L,D] as input, where B is the batch size, L is the sequence length, and D is the feature dimension. First, the features are transformed through a linear layer, and then the update and output equations in the state-space model are applied to generate the final output features. Finally, the scan and merge operations reconfigure the sequences of these transformations to produce an output image that matches the size of the original input image. S23: In the hybrid convolution branch, the receptive field of the convolution kernel is expanded by dilating the convolution to capture a wider range of contextual information and perceive the structure of the image at different scales without losing image details; to avoid the gridding effect of discontinuous data, an expansion strategy with expansion rates of 1, 2, 3, and 1 is used to refocus local features after multi-scale feature extraction while maintaining the continuity of the feature space; finally, the outputs of the two branches are merged along the channel dimension of the feature map, and a parameterless channel shuffling operation is used to realize the information interaction between the two sub-input channels; S24: The hybrid sensing encoder consists of four stages. At the end of the first three stages, a patch merging operation is applied to reduce the height and width of the input features while increasing the number of channels. A hybrid state space module is used in the four stages, with the channel count of each stage being [C, 2C, 4C, 8C]. The decoder, which has a symmetrical structure with the encoder, has four stages. At the beginning of the last three stages of the decoder, upsampling is performed by patch expansion to recover the height and width of the features. A final projection layer is used before output to recover the size of the features to match the segmentation target.

3. The vehicle image segmentation method based on edge guidance and dynamic pruning according to claim 2, characterized in that: Specifically, S3 is: S31: During the coding phase Multi-scale edge-guided branch input encoding features , No. Predictive characteristics of the stage and high-frequency features obtained from Gaussian Laplace operations Among them, the Laplacian Gaussian operator performs initial smoothing on the original image using a Gaussian filter, and edge detection is achieved by applying the Laplacian operator; the Laplacian Gaussian operation obtains key details through a cascaded approximation sequence of the Laplacian Gaussian operator. (5) in It is the input image. It is a convolution operator with a Gaussian filter. Indicates a 2x downsampling operation; each level of the Gaussian Laplace operation. By starting from the current level Subtract the smaller level upsampled version And obtained from the Gaussian pyramid; (6) The Laplacian operator captures second-order transformations in the input image, extracting high-frequency details of edges and contours, corresponding to the first-order transformation of the Gaussian Laplacian operation. class The high-frequency characteristics are provided to the first An edge detection module, represented as As shown in formula (7), in order to retain high-frequency information at each level From the basic level Export Effectively retains high-frequency information; (7) Among them, This indicates a 2x downsampling operation. Indicates high-frequency features Continuous execution i The second 2x downsampling operation, i.e. ; S32: Forecast diagram for the next stage Decomposed into reverse attention map and edge attention map The reverse attention map is calculated as follows: This allows for the re-evaluation and refinement of imprecise prediction maps from higher layers; the edge attention map is obtained via the Laplacian operator. As shown in formula (8), the combined features are obtained by multiplying the three attention maps element by element. (8) Where [.] denotes cascading; to guide the model's attention to important regions while suppressing background noise and redundant information, in The attention mask is introduced at each level, represented as , No. Attention feature map of layer The calculation is as follows: (9) in, This represents the sigmoid function; to process and refine edge-related information, the attention features are recalibrated using gated convolutional blocks. ; S33: To effectively supervise edge information learning, binary cross-entropy loss is adopted. and dice loss The combination is used as the marginal loss function for training: (10) in D The decoder has 4 stages; It is the first Predicted feature maps of the decoding layer It is the first Layer-scale segmentation of Groundtruth.

4. The vehicle image segmentation method based on edge guidance and dynamic pruning according to claim 3, characterized in that: Specifically, S3 is: S41: In each iteration, train the model weights once on the training dataset, while fixing the reinforcement learning agent and keeping the model weights frozen. l Indicates the number of layers in the convolution, and uses Indicates its first l The weights of each convolutional layer; , This indicates the number of output and input channels of the layer. and It is the spatial dimension of its core. Showing the number l The stride of the layer, Indicates the FLOPs value; S42: To prune the model using a reinforcement learning agent, the agent is defined as the state accessed in the environment, the operations that can be performed, and the reward function given the state and operations; where the agent's state depends on the index of the layer the agent is currently pruning, the layer kernel size and FLOPs, and the number of FLOPs already pruned; the agent is currently pruning the... l The state of the layer and environment is defined as follows: (11) in It is the kernel size of the layer; This represents the number of FLOPs in the previous layers of a given model that are currently being operated on. Showing the next layer of FLOPs that have not yet been trimmed. It is the proxy's operation on the upper layer; The actions performed by the agent are based on the first l Layer state Determine its predicted pruning rate , making ;Predicted pruning rate given the forecast Remove the channel at that time; according to , , Calculate the minimum and maximum practically feasible predicted pruning rates for the current layer, along with the required budget FLOPs; then, calculate the predicted pruning rates... Limited to Within the range; The reward function is set to the accuracy of the pruned model on a subset of the training dataset, as a proxy for its final performance; the proxy prunes one layer of the model at a time, and calculating the proxy value after each operation of the proxy will be very time-consuming; To reduce computational memory usage, the agent's one pass through all layers of the model is treated as a plot trajectory; then, the final trimmed model's accuracy on the subset at the end of the trajectory is calculated and used as the reward value for all state-action pairs seen during the trajectory. S43: When iteratively training the model weights and agent policies, the weights of the convolutional layers on which the agent performs operations change continuously, and the reward function changes dynamically accordingly, mapping each round of indexes used to train the model weights to embeddings; then, using the corresponding embedding sequence that has been passed through the recursive model input, the current state representation of the model weights is output. Calculate the model weights in the th case. m The wheel state is represented as follows: (12) in, Represents a recursive model; It is embedded in each round until m wheel; This is the initial state of the recursive model; we set it to the zero vector. These are parameters of the recursive model. To train agents; S44: Design an interpreter model to train a recursive model. The interpreter model uses state-action pairs (…). S , a ) and when the agent follows ( S , a And predict the agent's reward. r Representation of environmental state z When interpreting the model using representation z To predict r When, it means z This involves information about the environmental state, constructing the target to train the weights of the recursive model, and interpreting the weights of the model. (13) in, E This indicates the epoch embedding corresponding to the epoch index. It is an explanatory model. The parameters are represented by a recursive model and a flexible actuation evaluation method, which are used to train the agent based on environmental states. z To expand the state representation S ; S45: To maintain training stability and improve model accuracy, soft regularization is applied to the model weights via a proxy to align them with the selected subnetwork; given a binary architecture vector. , indicating that the current best agent is the channel selected for each layer, and the following regularization terms are used to train the model's weights: (14) in, The proposed objective represents element-wise multiplication, and the objective regularizes the channels removed by the proxy; finally, the standard cross-entropy loss is applied. With the proposed The weights are combined to train the model: (15)。

Citation Information

Patent Citations

  • Image anomaly detection method and system based on sparse completion network

    CN115049597A

  • Single-machine task scene information acquisition and single-agent motion control method

    CN115457424A