Lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception image
By constructing a lightweight multi-task network model and utilizing a task-driven adaptive multi-task network and a progressive cyclic pruning framework, the problems of computational redundancy and resource constraints in vehicle multi-attribute recognition are solved, achieving efficient recognition of vehicle brand, type, and color, and adapting to the deployment requirements of roadside edge devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2025-08-12
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies suffer from computational redundancy, resource constraints, and insufficient accuracy in vehicle multi-attribute recognition, resulting in low computational efficiency of roadside CVIS units and an inability to effectively utilize the correlation between attributes.
A lightweight multi-task vehicle multi-attribute recognition model is constructed using a task-driven adaptive multi-task network (TamNet) and progressive recurrent pruning (PCP) framework. By optimizing the model structure through adaptive feature sharing and progressive pruning, efficient joint recognition of vehicle brand, type and color is achieved.
While ensuring recognition accuracy, it significantly reduces the amount of computation and parameters, adapts to the deployment requirements of roadside edge devices, and improves the efficiency and accuracy of vehicle information perception.
Smart Images

Figure CN120976679B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Intelligent Transportation Systems (ITS), specifically relating to a method for multi-attribute vehicle recognition based on roadside perception images in a road system (CVIS), which is particularly suitable for the deployment of roadside edge devices with limited resources. Background Technology
[0002] Vehicle multi-attribute recognition (including brand, type, and color) is a core foundation of intelligent transportation systems, widely used in vehicle re-identification, law enforcement tracking, and traffic analysis. Traditional methods rely on multiple independent networks for single-attribute recognition, leading to computational redundancy and inefficiency. Specific problems include: repetitive feature extraction: parallel deployment of multiple models requires repeated extraction of low-level features, failing to utilize inter-attribute correlations and increasing computational overhead. Deployment bottlenecks: roadside CVIS units are limited by the computational resources and power consumption of edge devices, and existing multi-task learning frameworks do not optimize model compression. Insufficient accuracy: single-task models ignore the coupling relationships between attributes, reducing recognition robustness. Therefore, there is an urgent need for a lightweight multi-task network that reduces parameters and computational load while maintaining accuracy, adapting to edge deployment of roadside CVIS units. Summary of the Invention
[0003] Purpose of the invention: To overcome the shortcomings of existing technologies, this invention provides a lightweight multi-task vehicle attribute recognition method based on roadside perception images. By using a task-driven adaptive multi-task network (TamNet) and progressive recurrent pruning (PCP) framework, it achieves efficient joint recognition of vehicle brand, type, and color, optimizes edge deployment, and provides a foundation for subsequent accurate vehicle recognition in highway scenarios.
[0004] Technical Solution: To achieve the above objectives, this invention provides a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images, comprising the following steps:
[0005] S1: Construct a multi-attribute vehicle recognition dataset for highway scenarios;
[0006] S2: To address the diverse needs of roadside applications, a multi-task vehicle multi-attribute recognition model (Task-Driven Adaptive Multi-TaskNetwork, TamNet) for roadside perception images is constructed based on an adaptive feature sharing mechanism.
[0007] S3: To address the lightweight requirements of roadside applications, the network further integrates Progressive Cyclic Pruning (PCP) to achieve model lightweighting, constructing a lightweight multi-task vehicle multi-attribute recognition model TamNet-PCP for roadside perception images.
[0008] Furthermore, the specific method for constructing the vehicle multi-attribute recognition dataset in the highway scenario in step S1 is as follows:
[0009] S1-1: Using raw single-lane data obtained from traffic monitoring cameras, 19,826 vehicle face images from real highway scenes were acquired to construct the Southeast University vehicle multi-attribute recognition dataset (SEU-MultiVR).
[0010] S1-2: Labels brand (131 categories), type (3 categories: cars, trucks, buses) and color (8 categories: white, black, gray, red, blue, yellow, green, night). The dataset covers lighting changes, motion blur, and weather factors (rainy days, foggy days, etc.).
[0011] S1-3: The data is divided into training and testing sets in a ratio of 7:3, with a total of 13,878 training images and 5,947 testing images.
[0012] Furthermore, the specific steps for constructing the multi-task vehicle multi-attribute recognition model TamNet in step S2 are as follows:
[0013] S2-1: After the input image is uniformly scaled to a resolution of 224×224, spatial features are first extracted through a 7×7 convolutional layer to generate a basic feature map.
[0014] S2-2: The basic feature map is then fed into a series of cascaded residual blocks for deep representation learning. The residual blocks contain shared blocks and task-specific blocks: for each specific task, the feature map only flows through the residual blocks associated with it (i.e., shared blocks and task-specific blocks). For blocks of irrelevant tasks (i.e., task-specific blocks of other tasks), the inherent shortcut connections of the residual structure are used to skip the blocks and avoid performing unnecessary computations.
[0015] S2-3: After the feature learning stage, the model uses independent fully connected layer classifiers for multi-task recognition. The specific feature maps learned by each task are input into their corresponding classifiers: FC1 (brand, 131 categories), FC2 (type, 3 categories) and FC3 (color, 8 categories). The model training is entirely driven by the multi-task loss function.
[0016] S2-4: The policy variable dynamically determines whether to select or skip each residual block for each task. In order to achieve adaptive feature sharing, the model automatically trains the policy variable during training, and its value is supervised and optimized by the overall loss function during training.
[0017] S2-5: Policy variables directly determine the network's path selection. If a residual block is selected for computation by multiple tasks, it is defined as a shared block. A phased optimization method is used in the training process to improve training stability.
[0018] Furthermore, the specific content of skipping blocks using the inherent shortcut connection of the residual structure in step S2-2 is as follows: A binary decision variable strategy is introduced, and the model skips blocks for each task during training. A binary selection strategy is introduced in each layer l. l,k ∈{0,1}, where u l,k =1 indicates that the l-th layer participates in the task. Forward computation, u l,k =0 indicates that the l-th layer does not participate in the task. The forward computation, specifically, the activation output of the l-th layer for task k is calculated as shown in formula (1), where This is the residual block transformation function.
[0019]
[0020] Furthermore, the specific content of the model training in steps S2-3 being entirely driven by the multi-task loss function is as follows: the total loss function is defined only as formula (2), where For the task Cross-entropy loss, λ k For the task The weighting coefficients.
[0021]
[0022] Furthermore, the specific content of the automatic training policy variables in steps S2-4 is as follows: differentiable sampling is achieved using the Gumbel-Softmax reparameterization technique; policy parameters are defined. Use [α] l,k ,1-α l,k Replace the binary variable u l,k Then, the continuous decision variables are obtained through relaxation processing using formula (3), where G is Gumbel noise and τ is the annealing temperature coefficient. During the training phase, the continuous variable v... l,k Gradient propagation is performed, and finally, the gradient is discretized into the final policy u through the argmax operation. l,k .
[0023]
[0024] Furthermore, the specific content of the phased optimization method in steps S2-5 is as follows: during the preheating cycle, all residual blocks are fixed in a fully shared state (u l,k =1, k), after the network prioritizes establishing robust general feature representations to adapt to the feature coupling requirements of strongly correlated tasks, it then enters joint optimization, using an alternating update mechanism to update the strategy parameters {α}. l,k} and network model parameters W.
[0025] Furthermore, the specific steps of the lightweight multi-task vehicle multi-attribute recognition model TamNet-PCP in step S3 are as follows:
[0026] S3-1: Perform iterative channel pruning in ascending order of task complexity for the k-th task. Structured pruning is performed using channel importance I(·) as the indicator;
[0027] S3-2: For the k-th pruning iteration, perform local retraining after pruning to update the current task. Relevant parameters were used to restore accuracy;
[0028] S3-3: After the pruning and retraining of the k-th task is completed, the model enters the incremental learning phase of the k+1-th task, restarting the network in the pruned part of the previous task to learn the new task.
[0029] S3-4: After completing all task pruning, fix the parameters of the shared feature extraction network model, and only fine-tune the fully connected layers to compensate for the representation shift caused by structural changes, so as to achieve global accuracy balance.
[0030] Furthermore, the specific content of the structured pruning in step S3-1 is as follows: perform structured pruning with a fixed ratio according to formula (4), wherein... The loss function, g(W,d,j,k), is defined by four parameters: the network model parameters W, d∈{0,1} representing the size to be compressed, j representing the index of the j-th row or column in W, and the task number k.
[0031]
[0032] Furthermore, in step S3-2, the current task is updated. The specific details of the relevant parameters are as follows: Define the set of reserved channels as... Obtain the current network model parameter matrix And generate a binary mask matrix Where d l This represents the number of channels in the l-th layer. After pruning, local retraining is performed based on formula (5) to update the current task. Relevant parameters are used to restore accuracy, where W out The weights of the fully connected layer are represented by , and a dynamic constraint formula (6) is introduced in the gradient update, that is, the weights of the first K-1 tasks are fixed during the retraining process.
[0033]
[0034] Furthermore, the specific content of restarting the network to learn the new task in step S3-3 is as follows: loading the frozen parameters of the previous K tasks from the global model. With historical mask The initial parameters of the new task k+1 can be expressed as formula (7), where This is a non-updateable parameter. These are parameters that can be updated.
[0035]
[0036] Furthermore, the specific content of achieving global accuracy balance in step S3-4 is as follows: Based on formula (8), a knowledge distillation regularization term is introduced to optimize the objective, thereby achieving global accuracy rebalancing. For the task Cross-entropy loss, α-controlled teacher model Alignment strength with the representation of the new task.
[0037]
[0038] Beneficial effects: Compared with the prior art, the present invention achieves lightweight and efficient joint recognition of vehicle brand, type and color based on multi-task learning and progressive network pruning, which can provide technical support for vehicle information perception in highway scenarios. Attached Figure Description
[0039] Figure 1 These are sample images (brand, model, color) from the SEU-MultiVR dataset.
[0040] Figure 2 This is a model framework diagram for TamNet-PCP.
[0041] Figure 3 A detailed flowchart of Progressive Cyclic Pruning (PCP).
[0042] Figure 4 This is a visual analysis graph on the SEU-MultiVR dataset. The first row shows the output results for vehicle brand recognition, the second row shows the output results for vehicle type recognition, and the third row shows the output results for vehicle color recognition. The models are: (a) single-task model, (b) multi-task model (TamNet), and (c) sparse model (TamNet-PCP). Detailed Implementation
[0043] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments.
[0044] This invention provides a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images, comprising the following steps:
[0045] S1: Construct a multi-attribute vehicle recognition dataset for highway scenarios, specifically as follows:
[0046] S1-1: Using raw single-lane data obtained from traffic monitoring cameras, 19,826 vehicle face images from real highway scenes were acquired to construct the Southeast University vehicle multi-attribute recognition dataset (SEU-MultiVR).
[0047] S1-2: Labels brand (131 categories), type (3 categories: cars, trucks, buses) and color (8 categories: white, black, gray, red, blue, yellow, green, night). The dataset covers lighting changes, motion blur, and weather factors (rainy days, foggy days, etc.).
[0048] S1-3: The data is divided into training and testing sets in a ratio of 7:3, with a total of 13,878 training images and 5,947 testing images.
[0049] S2: To address the diverse needs of roadside applications, a multi-task vehicle multi-attribute recognition model (Task-Driven Adaptive Multi-Task Network, TamNet) for roadside perception images is constructed based on an adaptive feature sharing mechanism. The structure is as follows: Figure 2 As shown, it is specifically as follows:
[0050] S2-1: After the input image is uniformly scaled to a resolution of 224×224, spatial features are first extracted through a 7×7 convolutional layer to generate a basic feature map.
[0051] S2-2: The base feature map is then fed into a series of cascaded residual blocks for deep representation learning. These residual blocks contain shared blocks and task-specific blocks: for each specific task, the feature map only flows through its associated residual blocks (i.e., shared blocks and task-specific blocks). For blocks unrelated to other tasks (i.e., task-specific blocks), the inherent shortcut connections of the residual structure are used to skip these blocks, avoiding unnecessary computation. A binary decision variable strategy is introduced, where the model performs training on each task... A binary selection strategy is introduced in each layer l. l,k ∈{0,1}, where u l,k =1 indicates that the l-th layer participates in the task. Forward computation, u l,k =0 indicates that the l-th layer does not participate in the task. The forward computation, specifically, the l-th layer for the task The activation output is calculated as shown in formula (1), where This is the residual block transformation function.
[0052]
[0053] S2-3: After the feature learning stage, the model uses independent fully connected layer classifiers for multi-task recognition. The specific feature maps learned by each task are input into their corresponding classifiers: FC1 (make, 131 classes), FC2 (type, 3 classes), and FC3 (color, 8 classes). Model training is entirely driven by the multi-task loss function. The total loss function is defined only by formula (2), where For the k-th task Cross-entropy loss, λ k For the task The weighting coefficients.
[0054]
[0055] S2-4: The policy variable dynamically determines whether to select or skip each residual block for each task. To achieve adaptive feature sharing, the model automatically trains the policy variable during training, and its values are supervised and optimized by the overall loss function. Differentiable sampling is achieved using the Gumbel-Softmax reparameterization technique: defining policy parameters... Use [α] l,k ,1-α l,k Replace the binary variable u l,k Then, the continuous decision variables are obtained through relaxation processing using formula (3), where G is Gumbel noise and τ is the annealing temperature coefficient. During the training phase, the continuous variable v... l,k Gradient propagation is performed, and finally, the gradient is discretized into the final policy u through the argmax operation. l,k .
[0056] v l,k =softmax((log[α]) l,k ,1-α l,k ]+G) / τ) (3)S2-5: The policy variable directly determines the network's path selection. If a residual block is selected for computation by multiple tasks, it is defined as a shared block. A phased optimization method is used in the training process to improve training stability. During the warm-up period, all residual blocks are fixed in a fully shared state (u l,k =1, k), after the network prioritizes establishing robust general feature representations to adapt to the feature coupling requirements of strongly correlated tasks, it then enters joint optimization, using an alternating update mechanism to update the strategy parameters {α}.l,k} and network model parameters W.
[0057] S3: To address the lightweight requirements of roadside applications, the network further integrates Progressive Cyclic Pruning (PCP) to achieve model lightweighting, constructing a lightweight multi-task vehicle multi-attribute recognition model, TamNet-PCP, for roadside perception images. The process is as follows: Figure 3 As shown, it is specifically as follows:
[0058] S3-1: Perform iterative channel pruning in ascending order of task complexity for the k-th task. Using channel importance I(·) as the indicator, a fixed proportion of structured pruning is performed according to formula (4), where The loss function, g(W,d,j,k), is defined by four parameters: the network model parameters W, d∈{0,1} representing the size to be compressed, j representing the index of the j-th row or column in W, and the task number k.
[0059]
[0060] S3-2: For the k-th pruning, define the set of retained channels as follows: Obtain the current network model parameter matrix And generate a binary mask matrix Where d l This represents the number of channels in the l-th layer. After pruning, local retraining is performed based on formula (5) to update the current task. Relevant parameters are used to restore accuracy, where W out The weights of the fully connected layer are listed separately here for easy distinction later. At the same time, a dynamic constraint formula (6) is introduced in the gradient update, that is, the weights of the first K-1 tasks are fixed during the retraining process.
[0061]
[0062] S3-3: After pruning and retraining for the k-th task, the model enters the incremental learning phase for the (k+1)-th task, restarting the network on the pruned portion of the previous task to learn the new task. The frozen parameters from the previous k tasks are loaded from the global model. With historical mask The initial parameters of the new task k+1 can be expressed as formula (7), where This is a non-updateable parameter. These are parameters that can be updated.
[0063]
[0064] S3-4: After completing all task pruning, fix the parameter matrix of the shared feature extraction network model. Only for fully connected layer W out Fine-tuning is performed to compensate for the representational shift caused by structural changes. A knowledge distillation regularization term is introduced according to formula (8) to optimize the objective, achieving a global accuracy rebalancing. For the task Cross-entropy loss, α-controlled teacher model Alignment strength with the representation of the new task.
[0065]
[0066] To verify the rationality of selecting multi-attribute vehicle information when constructing the adaptive multi-task model, Table 1 shows the training results of different task combinations. The performance changes between the multi-task and single-task models exhibit asymmetric characteristics. In the Task 1 + Task 2 combination, the accuracy of the two tasks improved by 0.88% and 0.10%, respectively, and the training efficiency increased, indicating positive knowledge transfer between these tasks. Conversely, the Task 1 + Task 3 combination led to a decrease in the accuracy of the two tasks by 0.45% and 0.27%, respectively, indicating competitive interference in the feature space. The Task 2 + Task 3 combination improved the performance of Task 3 by 1.11% while maintaining the high accuracy of Task 2 (99.55%). Joint training of vehicle brand, model, and color recognition tasks achieved comprehensive optimization: the accuracy of Task 1 improved by 1.53% (from 93.96% to 95.49%), and Task 3 improved by 1.09% (from 93.76% to 94.85%), while maintaining the baseline advantage of Task 2 (99.60% to 99.70%). The overall improvement of 0.91% significantly exceeds the maximum gain of 0.53% for the dual-task combination.
[0067] Table 1. Test performance of different multi-task learning combinations on the SEU-MultiVR dataset.
[0068]
[0069] To verify the comprehensive performance advantages of the proposed PCP framework in multi-task scenarios, as shown in Table 2, its core value lies in balancing the trade-off between model efficiency and task performance. First, the multi-task model achieves significant optimization compared to the single-task model: the average accuracy increases from 95.77% to 96.68%, while the computational cost decreases from 5.46 to 1.82, and the number of parameters is compressed from 33.6G to 11.25G, fundamentally reducing computational and storage costs while slightly improving accuracy. Second, without a progressive pruning strategy, a serious trade-off occurs: to achieve a pruning rate (90%) similar to progressive pruning, reducing the number of parameters to 9.62G leads to a sharp drop in model accuracy to 94.30%; while maintaining the accuracy of Task 1 at 95.46% (on par with our method), only weak pruning can be achieved, with the number of parameters only decreasing from 11.25G to 10.62G. Furthermore, the pruning order has a crucial impact: compared to the task difficulty order (task 2-3-1) proposed in this study, the random order only achieves 95.86% accuracy at a pruning rate of 0.90, while the reverse order (task 1-3-2) drops to an average accuracy of 95.83% under the same conditions. Although the accuracy for the simpler task 2 is improved, the improvement is limited, while the accuracy for the high-difficulty task 1 drops significantly from 95.49% to 93.56%. This verifies the rationality of prioritizing the processing of high-difficulty tasks in this scheme. Finally, in the progressive pruning method based on task difficulty, maintaining a pruning rate of 0.90 results in an accuracy of 96.65% (a decrease of only 0.03%), while increasing the pruning ratio to 0.85 leads to a significant drop in average accuracy to 96.00%. Therefore, a 90% pruning ratio becomes the optimal solution, successfully achieving a balance between model efficiency and task performance. In summary, this fully demonstrates the advantages of multi-task models, progressive pruning frameworks, task difficulty order, and a 90% pruning ratio in minimizing accuracy loss while improving model efficiency.
[0070] Table 2. Test performance of different pruning methods on the SEU-MultiVR dataset.
[0071]
[0072] To verify the effectiveness of TamNet-PCP, we used gradient-weighted class activation map visualization technology to compare it with the standard single-task model. Figure 4 (a)), Task-adaptive multi-task model ( Figure 4 (b) and the progressive pruning multi-task loop model ( Figure 4 (c) The feature interest region. The heatmap generated by overlaying the feature map channel dimensions shows significant differences: in the multi-task architecture, for the vehicle brand recognition task (first row), Figure 4 (b) shift the focus area from Figure 4(a) extends the single car logo positioning to the overall air intake grille structure, demonstrating a global feature perception capability that can mitigate misjudgments caused by similar car logos or blurred imaging; for relatively simple vehicle model recognition tasks (Bank of China), Figure 4 (b) By creating a high-density response band in the headlight and grille area instead of extracting complete front-face features, task-related local feature extraction is enhanced; in the color recognition task (last row), Figure 4 (b) It exhibits unique structural perception transfer characteristics, shifting attention from key components ( Figure 4 (a) Steering areas such as the hood panel and bumper where color is stable. It's worth noting that the progressive pruning model ( Figure 4 (c) Demonstrates the advantages of refined features: While maintaining the ability to capture features for multiple tasks, its brand recognition region is more compact and has higher weight, which confirms the effectiveness of our pruning strategy in reducing feature redundancy and enhancing core features.
[0073] The technical means disclosed in this invention are not limited to those disclosed in the above embodiments, but also include technical solutions composed of any combination of the above technical features. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications are also considered within the scope of protection of this invention.
Claims
1. A method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images, characterized in that: Includes the following steps: S1: Construct a multi-attribute vehicle recognition dataset for highway scenarios; S2: To address the diverse needs of roadside applications, TamNet, a multi-task vehicle multi-attribute recognition model for roadside perception images, is constructed based on an adaptive feature sharing mechanism. S3: To address the lightweight requirements of roadside applications, the network further integrates Progressive Multi-Task Cyclic Pruning (PCP) to achieve model lightweighting, and constructs a lightweight multi-task vehicle multi-attribute recognition model, TamNet-PCP, for roadside perception images. The specific steps for constructing the TamNet multi-task vehicle multi-attribute recognition model in step S2 are as follows: S2-1: After the input image is uniformly scaled to a resolution of 224×224, it first passes through a 7×7 convolutional layer to extract spatial features and generate a basic feature map. S2-2: The basic feature map is then fed into a series of cascaded residual blocks for deep representation learning. The residual blocks contain shared blocks and task-specific blocks: For each specific task, the feature map only flows through the residual blocks associated with it, i.e., the shared blocks and the task-specific blocks. For blocks of irrelevant tasks, i.e., the task-specific blocks of other tasks, the inherent shortcut connections of the residual structure are used to skip the blocks and avoid performing unnecessary calculations. S2-3: After the feature learning stage, the model uses independent fully connected layer classifiers for multi-task recognition. The specific feature maps learned by each task are input into their corresponding classifiers: FC1, FC2, and FC3, which correspond to brand, type, and color, respectively. The model training is entirely driven by the multi-task loss function. S2-4: The policy variable dynamically determines whether to select or skip each residual block for each task. In order to achieve adaptive feature sharing, the model automatically trains the policy variable during training, and its value is supervised and optimized by the overall loss function during training. S2-5: Policy variables directly determine the network's path selection. If a residual block is selected for computation by multiple tasks, it is defined as a shared block. A phased optimization method is used in the training process to improve training stability.
2. The method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images according to claim 1, characterized in that: The specific method for constructing the vehicle multi-attribute recognition dataset in the highway scenario in step S1 is as follows: S1-1: Using raw single-lane data obtained from traffic monitoring cameras, construct a vehicle multi-attribute recognition dataset by acquiring vehicle face images in real highway scenes; S1-2: Label the brand, type and color. The dataset covers lighting changes, motion blur and weather factors. S1-3: The data is divided into training and test sets in a ratio of 7:
3.
3. The method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images according to claim 1, characterized in that: The specific content of skipping blocks using the inherent shortcut connection of the residual structure in step S2-2 is as follows: A binary decision variable strategy is introduced, and the model skips blocks for each task during training. On each floor Introducing a binary selection strategy ,in Indicates the first Layer participation in tasks Forward computation, Indicates the first Layers do not participate in tasks The forward computation, specifically, the first Layered tasks The activation output is calculated as shown in formula (1): (1) in This is the residual block transformation function.
4. The method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images according to claim 1, characterized in that: The specific content of the model training in step S2-3, which is entirely driven by the multi-task loss function, is as follows: The total loss function is defined only by formula (2): (2) in For the task Cross-entropy loss, For the task The weighting coefficients.
5. The method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images according to claim 1, characterized in that: The specific content of the automatic training policy variables in step S2-4 is as follows: Differentiable sampling is achieved using the Gumbel-Softmax reparameterization technique; policy parameters are defined. ,use Replace binary variables Then, the continuous decision variables are obtained by relaxation treatment using formula (3): (3) in It is Gumbel noise. The annealing temperature coefficient is used as a continuous variable during the training phase. Gradient propagation is performed, and finally, the policy is discretized into the final policy through the argmax operation. .
6. The method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images according to claim 1, characterized in that: The specific content of the phased optimization method in steps S2-5 is as follows: During the preheating period, all residual blocks are fixed in a fully shared state, that is... After establishing robust and general feature representations in the network to adapt to the feature coupling requirements of strongly correlated tasks, joint optimization is then performed, using an alternating update mechanism to update the strategy parameters. With network model parameters .
7. The method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images according to claim 1, characterized in that: The specific steps of the lightweight multi-task vehicle multi-attribute recognition model TamNet-PCP in step S3 are as follows: S3-1: Perform iterative channel pruning in ascending order of task complexity, for the first... Task The importance of the channel Perform structured pruning for the indicators; S3-2: For the first The second pruning is followed by local retraining to update the current task. Relevant parameters were used to restore accuracy; S3-3: When the first After completing pruning and retraining in the first task, the model enters the second... In the incremental learning phase of each task, the network is restarted in the pruned part of the previous task to learn the new task. S3-4: After completing all task pruning, fix the parameters of the shared feature extraction network model, and only fine-tune the fully connected layers to compensate for the representation shift caused by structural changes, so as to achieve global accuracy balance.
8. The method for constructing a lightweight multi-task network model for vehicle multi-attribute recognition based on roadside perception images according to claim 7, characterized in that: The specific content of the structured pruning in step S3-1 is as follows: perform structured pruning with a fixed ratio according to formula (4): (4) in For loss function, Defined by four parameters: network model parameters, Indicates the size to be compressed. express The Middle Row or column index, and task number ; In step S3-2, the current task is updated. The specific details of the relevant parameters are as follows: Define the set of reserved channels as... The current network model parameter matrix is obtained. And generate a binary mask matrix. ,in For the first Layer channel number; after pruning, local retraining is performed based on formula (5) to update the current task. The relevant parameters are used to restore accuracy, and dynamic constraint formula (6) is introduced into the gradient update, that is, the previous parameters are fixed during the retraining process. Each task's weight; (5) (6) in Indicates the weights of the fully connected layer; The specific content of restarting the network to learn the new task in step S3-3 is as follows: from before loading the global model... Freeze parameters for each task With historical mask New task The initial parameters are expressed as in formula (7): (7) in This is a non-updateable parameter. For updatable parameters; The specific content of achieving global accuracy balance in step S3-4 is as follows: Based on formula (8), a knowledge distillation regularization term is introduced to optimize the objective, thereby achieving global accuracy rebalancing. (8) Among them, For the task Cross-entropy loss, Control Teacher Model Alignment strength with the representation of the new task.