Vehicle sticker recognition method, attention model training method, and related device

The vehicle sticker recognition method, which utilizes multi-scale feature extraction and attention optimization, solves the problem of low recognition accuracy in complex scenarios, achieving high-precision and automated vehicle sticker recognition and reducing manual intervention.

CN122368607APending Publication Date: 2026-07-10SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN YISHIHUOLALA TECH CO LTD
Filing Date
2026-04-14
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing vehicle sticker recognition systems have low recognition accuracy in complex scenarios, are difficult to adapt to dynamic changes, and rely on manual intervention, resulting in slow response speed and wasted resources.

Method used

A multi-scale feature extraction and attention optimization method is adopted. Through feature extraction layer, attention optimization layer and feature fusion layer, combined with self attention, spatial attention and channel attention mechanisms, feature weights are adjusted to generate comprehensive feature representation, and the vehicle sticker type is output through classification network.

Benefits of technology

It improves the accuracy and generalization ability of vehicle sticker recognition, reduces the need for manual intervention, and achieves high-precision automated recognition in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122368607A_ABST
    Figure CN122368607A_ABST
Patent Text Reader

Abstract

This invention discloses a vehicle sticker recognition method, an attention model training method, and related equipment. The vehicle sticker recognition method includes: acquiring an image of a vehicle sticker to be recognized, as well as a trained attention model and a classification network; inputting the image of the vehicle sticker to be recognized into a feature extraction layer for feature extraction processing to obtain multi-scale features of the image; inputting the multi-scale features into an attention optimization layer to adjust the weights of each feature in the multi-scale features to obtain attention-optimized multi-scale features; inputting the attention-optimized multi-scale features into a feature fusion layer for feature fusion processing to obtain fused features; and providing the fused features to a classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be recognized. By extracting multi-scale features and optimizing attention, key image information is highlighted and fused to generate comprehensive features, which are then used by the classification network to determine the type of vehicle sticker, thereby achieving high-precision vehicle sticker recognition in complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition, and more particularly to a vehicle sticker recognition method, an attention model training method, and related equipment. Background Technology

[0002] Vehicle sticker recognition is widely used in scenarios such as advertising monitoring and vehicle management. In existing technologies, vehicle sticker recognition systems typically rely on static rules or human experience for image feature monitoring and classification. For example, some methods use preset thresholds or fixed rules to determine whether a vehicle sticker image conforms to a specific type or style, triggering manual intervention or alarms when anomalies or task delays are detected.

[0003] However, these methods have significant limitations. On the one hand, static thresholds and fixed rules are difficult to adapt to the dynamic changes in the number, type, and scene conditions of vehicle stickers in real-world applications. Especially in complex situations such as insufficient lighting, sticker occlusion, or positional changes, static rules can easily lead to a decrease in recognition accuracy. On the other hand, methods relying on manual judgment or experience-based configuration are slow to respond and prone to misjudgments, omissions, or resource waste when processing a large number of vehicle stickers or performing multi-task parallel recognition.

[0004] Therefore, how to improve the recognition accuracy and algorithm adaptability in complex scenarios, while reducing the need for manual intervention, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] Therefore, it is necessary to provide a vehicle sticker recognition method, an attention model training method, and related equipment to address the aforementioned technical problems. This method has the advantages of improving recognition accuracy and algorithm adaptability in complex scenarios, while reducing the need for manual intervention.

[0006] A method for recognizing vehicle stickers includes: The system acquires an image of the car sticker to be identified, as well as a trained attention model and a classification network. The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. The vehicle sticker image to be identified is input into the feature extraction layer for feature extraction processing to obtain the multi-scale features of the vehicle sticker image to be identified. The multi-scale features are input into the attention optimization layer to adjust the weights of each feature in the multi-scale features, thereby obtaining the attention-optimized multi-scale features. The attention-optimized multi-scale features are input into the feature fusion layer for feature fusion processing to obtain fused features; The fused features are provided to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified.

[0007] Optionally, the attention optimization layer includes a self-attention optimization layer, a spatial attention optimization layer, and a channel attention optimization layer. The step of inputting the multi-scale features into the attention optimization layer to adjust the weights of each feature in the multi-scale features to obtain attention-optimized multi-scale features includes: The multi-scale features are input into the self-attention optimization layer to calculate the correlation between the features and obtain the self-attention optimized features. The self-attention optimized features are input into the spatial attention optimization layer to adjust the response of each pixel or position feature based on the spatial attention mechanism, so as to obtain the spatially optimized features. The spatially optimized features are input into the channel attention optimization layer to adjust the weights of each channel feature based on the channel attention mechanism, thereby obtaining attention-optimized multi-scale features.

[0008] Optionally, the attention-optimized multi-scale features include attention-optimized low-level texture features, mid-level shape features, and high-level semantic features. The step of inputting the attention-optimized multi-scale features into the feature fusion layer for feature fusion processing to obtain fused features includes: The attention-optimized low-level texture features, mid-level shape features, and high-level semantic features are processed by convolution to unify the dimensions and obtain a unified feature representation. The unified feature representation is input into a top-down feature pyramid network for multi-scale fusion to generate the fused feature. In this process, location coding is introduced to compensate for the spatial information of the fused features.

[0009] Optionally, providing the fused features to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified includes: When the fusion features include visual features and text features, the visual features and text features are fused to generate a fusion feature representation for classification; The fused feature representation is input into the classification network for processing, so that the classification network outputs the type label of the vehicle sticker image to be identified.

[0010] An attention model training method, the method comprising: Acquire a training set, an image generation model to be trained, and an attention model to be trained. The training set includes vehicle sticker images and corresponding vehicle sticker labels. The vehicle sticker labels include at least one of the following: type, location, degree of damage, and degree of occlusion. The image generation model to be trained is trained based on the training set to obtain a trained image generation model; An extended training dataset is generated based on the trained image generation model; The attention model to be trained is trained based on the extended training dataset to obtain the trained attention model.

[0011] Optionally, training the image generation model to be trained based on the training set to obtain a trained image generation model includes: The car sticker images and corresponding car sticker labels in the training set are input into the image generation model so that the image generation model generates a car sticker image with the same style as the car sticker image. The loss value of the generated car sticker image, the car sticker image, and the car sticker label is calculated based on a preset multi-task loss function, which includes an adversarial loss function, a style loss function, a damage loss function, and an occlusion loss function. The parameters of the image generation model to be trained are iterated with the goal of minimizing the loss value, until the loss value converges at the minimum or the number of iterations reaches a preset number, at which point the training stops and the trained image generation model is obtained.

[0012] A vehicle sticker recognition device includes: The first acquisition module is used to acquire the image of the car sticker to be identified, as well as a trained attention model and a classification network. The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. The extraction module is used to input the vehicle sticker image to be identified into the feature extraction layer for feature extraction processing to obtain the multi-scale features of the vehicle sticker image to be identified; An adjustment module is used to input the multi-scale features into the attention optimization layer to adjust the weights of each feature in the multi-scale features, thereby obtaining attention-optimized multi-scale features. The fusion module is used to input the attention-optimized multi-scale features into the feature fusion layer for feature fusion processing to obtain fused features; The classification module is used to provide the fused features to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified.

[0013] An attention model training device, comprising: The second acquisition module is used to acquire a training set, an image generation model to be trained, and an attention model to be trained. The training set includes a car sticker image and a car sticker label corresponding to the car sticker image. The car sticker label includes at least one of the following: type, location, degree of damage, and degree of occlusion. The first training module is used to train the image generation model to be trained based on the training set, so as to obtain a trained image generation model; The generation module is used to generate an extended training dataset based on the trained image generation model; The second training module is used to train the attention model to be trained based on the extended training dataset to obtain the trained attention model.

[0014] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-described vehicle sticker recognition method or attention model training method when executing the computer-readable instructions.

[0015] A readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the vehicle sticker recognition method or the attention model training method.

[0016] The aforementioned vehicle sticker recognition method, attention model training method, and related equipment include the following steps: The vehicle sticker recognition method involves acquiring an image of the vehicle sticker to be recognized, a trained attention model, and a classification network. The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. The image of the vehicle sticker to be recognized is input into the feature extraction layer for feature extraction processing to obtain multi-scale features of the image. These multi-scale features are then input into the attention optimization layer to adjust the weights of each feature, resulting in attention-optimized multi-scale features. The attention-optimized multi-scale features are then input into the feature fusion layer for feature fusion processing to obtain fused features. Finally, the fused features are provided to the classification network so that the classification network outputs a type label corresponding to the vehicle sticker image. By extracting multi-scale features and optimizing attention, key image information is highlighted and fused to generate comprehensive features. The classification network then determines the type of vehicle sticker, thereby achieving high-precision vehicle sticker recognition in complex scenarios and improving accuracy, generalization ability, and automation efficiency. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating a vehicle sticker recognition method according to an embodiment of the present invention; Figure 2This is a flowchart illustrating another vehicle sticker recognition method according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating an attention model training method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a vehicle sticker recognition device according to an embodiment of the present invention; Figure 5 This is a schematic diagram of an attention model training device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] In one embodiment, such as Figure 1 As shown, a vehicle sticker recognition method is provided, including the following steps: 101. Obtain the image of the car sticker to be identified, as well as the trained attention model and classification network.

[0021] In this embodiment of the invention, a vehicle sticker can be understood as an identification pattern pasted on the surface of a vehicle to identify the vehicle category, purpose, or advertising information. The image of the vehicle sticker to be identified can be a partial image of the vehicle sticker included in a vehicle image captured by a camera, or it can be an image of the sticker area cropped from surveillance video or a photo uploaded by a user. In some embodiments, the image can be preprocessed, such as cropping the license plate or sticker area, adjusting the image size and color, for subsequent model processing.

[0022] The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. The feature extraction layer is responsible for extracting multi-scale features such as low-level texture, mid-level shape, and high-level semantics from the input image. The attention optimization layer adjusts the weights of each feature through self-attention, spatial attention, and channel attention mechanisms to highlight key regions and important information in the image. The feature fusion layer integrates the optimized multi-scale features to generate a comprehensive feature representation for classification.

[0023] The classification network can be a deep neural network, such as a multi-layer convolutional network, a fully connected network, or a deep classification network that fuses visual and textual features, used to output a category label for the vehicle sticker based on the comprehensive features. In some embodiments, the classification network can also be combined with a text recognition module to fuse the text information on the vehicle sticker with visual features, thereby improving the recognition accuracy and robustness for complex vehicle stickers.

[0024] As one possible implementation, the attention model can be multi-task optimized during training, so that it not only focuses on the shape and texture of the sticker, but also automatically identifies locally damaged or occluded areas, thereby improving the recognition ability in complex scenes.

[0025] 102. Input the image of the vehicle sticker to be identified into the feature extraction layer for feature extraction processing to obtain the multi-scale features of the image of the vehicle sticker to be identified.

[0026] In this embodiment of the invention, after the vehicle sticker image to be identified is input into the feature extraction layer, it is first processed by a Transformer architecture suitable for image processing, such as the Vision Transformer (ViT). This architecture can effectively capture local and global information of the image and has a strong representation capability for specific texture, shape and detail features in the vehicle sticker image.

[0027] During processing, the lower layers of the Transformer output low-to-mid-level texture features, which reflect the texture, edges, and local details of the decal. The higher layers output semantic features, which can characterize the overall shape, pattern category, and possible text information of the decal. In this way, a multi-scale feature pyramid can be constructed, representing the lower, middle, and higher-level features at different scales, enabling the model to perceive both local details and overall semantics simultaneously.

[0028] As one possible implementation, to further enhance the extraction capability of vehicle decal details, residual connections or inter-layer fusion mechanisms can be introduced into different layers of the Transformer. This allows low-level texture features to interact with high-level semantic features, thereby obtaining richer and more stable multi-scale feature representations. This helps to accurately extract key features of vehicle decals even under conditions of varying illumination, partial occlusion, or image noise.

[0029] 103. Input the multi-scale features into the attention optimization layer to adjust the weights of each feature in the multi-scale features, and obtain the attention-optimized multi-scale features.

[0030] In this embodiment of the invention, after inputting multi-scale features into the attention optimization layer, the weights of each feature are adjusted through an attention mechanism. This highlights the feature information of key regions in the image while suppressing redundant or irrelevant features, thereby generating optimized multi-scale features. The optimized features include low-level texture features, mid-level shape features, and high-level semantic features, providing clearer and more discriminative feature representations for subsequent feature fusion and classification.

[0031] In one embodiment, the attention optimization layer includes a self-attention optimization layer, a spatial attention optimization layer, and a channel attention optimization layer. Specifically, multi-scale features are first input into the self-attention optimization layer, and the feature weights are adjusted by calculating the correlation between the features to obtain self-attention-optimized features. Then, these features are input into the spatial attention optimization layer, and the pixel or region feature responses are adjusted according to spatial positional relationships to obtain spatially optimized features. Finally, these features are input into the channel attention optimization layer, and the attention-optimized multi-scale features are output by adjusting the weights of the features in each channel. This layered processing can take into account both local details and global semantics, improving the recognition capability of vehicle stickers in complex scenes.

[0032] In addition, the attention optimization layer can also include only the self-attention optimization layer and the channel attention optimization layer, without using the spatial attention optimization layer, so that feature weights can still be effectively adjusted and recognition performance can be improved in scenarios with limited computing resources or high real-time requirements.

[0033] In one possible embodiment, the attention optimization layer can also incorporate a dynamic attention mechanism to adaptively adjust the weights of each attention module based on the feature distribution of the input image, or introduce cross-layer attention to jointly optimize the attention of bottom, middle and high-level features, so as to further enhance the expressive power of multi-scale features and the ability to recognize rare or small-sample car stickers.

[0034] 104. Input the attention-optimized multi-scale features into the feature fusion layer for feature fusion processing to obtain fused features.

[0035] In this embodiment of the invention, after the attention-optimized multi-scale features are input into the feature fusion layer, the low-level texture features, mid-level shape features, and high-level semantic features are uniformly processed to generate fused features. Feature fusion processing can integrate feature information at different scales and semantic levels, enabling the classification network to utilize both local details and overall structural information, thereby improving the accuracy and robustness of vehicle sticker recognition.

[0036] In one embodiment, the fusion process includes first unifying the dimensions of features across different layers through convolutional processing, then inputting the unified features into a top-down feature pyramid network for multi-scale fusion. Simultaneously, positional encoding is introduced during the fusion process to compensate for spatial information. Through this method, the fused features retain both the fine details of low-level textures and integrate high-level semantic features, enabling the classification network to more effectively recognize vehicle stickers in complex scenes.

[0037] In addition, the feature fusion layer can also perform simple weighted fusion by unifying the dimensions through convolution, without using the feature pyramid network, to adapt to application scenarios with limited computing resources or high real-time requirements, while still obtaining enhanced multi-scale feature representations.

[0038] In one possible embodiment, the feature fusion layer can introduce an attention-guided cross-layer fusion mechanism to dynamically adjust the fusion weights of low-level, mid-level, and high-level features based on the content of the input image, or perform adaptive feature fusion by combining the spatial context information of the image, thereby further enhancing the model's recognition ability under complex lighting, occlusion, or partially damaged vehicle stickers.

[0039] 105. Provide the fused features to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified.

[0040] In this embodiment of the invention, after the fused features are provided to the classification network, the classification network outputs the type label corresponding to the vehicle sticker image to be identified based on the fused features. The fused features include low-level texture, mid-level shape, and high-level semantic information, and the weights of key regions are enhanced during attention optimization and feature fusion, enabling the classification network to fully utilize the local details and overall semantics of the vehicle sticker to achieve accurate identification of different types of vehicle stickers.

[0041] In one embodiment, when the fused features include both visual and textual features, the visual and textual features are first fused to generate a feature representation for classification. This feature representation is then input into a classification network for processing, thereby outputting a vehicle sticker type label. Through this processing method, the classification network can take into account both the overall visual information and local textual information of the vehicle sticker image, improving the recognition accuracy for complex or partially obscured vehicle stickers.

[0042] Furthermore, classification networks can classify based solely on visual features without incorporating textual features, making them suitable for scenarios where there is no significant text or incomplete textual information in vehicle stickers. At the same time, they can still improve classification performance by utilizing multi-scale information from fused features.

[0043] In one possible embodiment, the classification network can employ a multi-task classification strategy, simultaneously outputting the sticker type, sticker status (e.g., complete, damaged, partially occluded), or sticker style category. Joint learning further enhances the ability to recognize rare or complex sticker samples. Furthermore, the structure of the classification network can be flexibly adjusted according to the specific application, for example, by introducing lightweight convolutional modules or variable depth networks to balance recognition accuracy and computational efficiency.

[0044] In this embodiment of the invention, an image of a vehicle sticker to be identified, a trained attention model, and a classification network are acquired. The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. The image of the vehicle sticker to be identified is input to the feature extraction layer for feature extraction processing to obtain multi-scale features of the image. The multi-scale features are input to the attention optimization layer to adjust the weights of each feature in the multi-scale features to obtain attention-optimized multi-scale features. The attention-optimized multi-scale features are input to the feature fusion layer for feature fusion processing to obtain fused features. The fused features are provided to the classification network so that the classification network outputs the type label corresponding to the image of the vehicle sticker to be identified. By extracting multi-scale features and adjusting attention, key image information is highlighted and fused to generate comprehensive features. Then, the classification network determines the type of vehicle sticker, thereby achieving high-precision vehicle sticker recognition in complex scenes and improving accuracy, generalization ability, and automation efficiency.

[0045] It is understood that in the specific implementation of this application, data such as the vehicle sticker image to be identified and the training set are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required. Furthermore, the collection, use and processing of related data, as well as the construction and use of attention models, classification networks and image generation models, must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0046] Optionally, the attention optimization layer includes a self-attention optimization layer, a spatial attention optimization layer, and a channel attention optimization layer. In the step of inputting multi-scale features into the attention optimization layer to adjust the weights of each feature in the multi-scale features and obtain attention-optimized multi-scale features, the multi-scale features can also be input into the self-attention optimization layer to calculate the correlation between each feature and obtain self-attention-optimized features; the self-attention-optimized features can be input into the spatial attention optimization layer to adjust the response of each pixel or position feature based on the spatial attention mechanism and obtain spatially optimized features; the spatially optimized features can be input into the channel attention optimization layer to adjust the weights of each channel feature based on the channel attention mechanism and obtain attention-optimized multi-scale features.

[0047] In this embodiment of the invention, the attention optimization layer may include a self-attention layer, a spatial attention layer, and a channel attention layer. When processing multi-scale features, the multi-scale features are first input into the self-attention optimization layer. By calculating the correlation matrix between each feature, the importance of different features is determined, thereby adjusting the feature weights to obtain the self-attention optimized features. Self-attention optimization can highlight key feature regions related to vehicle sticker recognition while suppressing the interference of irrelevant background information on the classification results.

[0048] Subsequently, the self-attention-optimized features are input into the spatial attention optimization layer. Spatial attention adjusts the feature response at each location in the image by calculating a pixel-level correlation matrix, enhancing the edges, textures, and key local regions of the decal, thereby improving the model's ability to perceive local details. This mechanism maintains the accuracy of feature extraction even when the decal is partially occluded or the lighting is uneven.

[0049] Finally, the spatially optimized features are input into the channel attention optimization layer. Channel attention dynamically enhances or suppresses information from different channels through global average pooling of each channel and weight adjustment via a fully connected layer, ensuring a reasonable allocation of channel features such as color, brightness, and texture. Channel attention optimization helps maintain the stability of feature representation even under complex decal colors or varying lighting conditions.

[0050] As one possible implementation, the attention optimization layer can be flexibly combined according to application requirements. For example, only self-attention and channel attention optimization layers can be used to reduce computational complexity while still effectively highlighting key features; or a multi-head attention mechanism can be introduced into the self-attention optimization layer to capture the correlation of multiple features through different heads, thereby enhancing the recognition ability of different types of car stickers.

[0051] Optionally, the attention-optimized multi-scale features include attention-optimized low-level texture features, mid-level shape features, and high-level semantic features. In the step of inputting the attention-optimized multi-scale features into the feature fusion layer for feature fusion processing to obtain fused features, the attention-optimized low-level texture features, mid-level shape features, and high-level semantic features can also be processed by convolution to unify the dimensions and obtain a unified feature representation. The unified feature representation is then input into a top-down feature pyramid network for multi-scale fusion to generate fused features. In the multi-scale fusion process, positional encoding is introduced to compensate for the spatial information of the fused features.

[0052] In this embodiment of the invention, the attention-optimized multi-scale features may include low-level texture features, mid-level shape features, and high-level semantic features. To fully utilize the information from each layer of features, the low-level texture features, mid-level shape features, and high-level semantic features can first be processed by convolution to unify the feature dimensions of different layers, resulting in a unified feature representation. This processing ensures that features at different scales and semantic levels can be effectively combined in the subsequent fusion process.

[0053] Subsequently, the unified feature representation is input into a top-down feature pyramid network for multi-scale fusion. Through the feature pyramid network (e.g., the FPN feature pyramid), low-level detailed features and high-level semantic features can be integrated at different scales to generate a comprehensive feature map containing multi-granularity information, enabling the classification network to simultaneously perceive local texture and overall structural information. Positional encoding is introduced during the fusion process to compensate for spatial information, ensuring that features at different locations retain their spatial relationships after fusion, thus facilitating accurate recognition of the edges, shapes, and text information of vehicle stickers.

[0054] As a possible implementation, to adapt to application scenarios with limited computing resources, a simplified feature fusion strategy can also be adopted, which integrates features from different layers by only performing convolution processing and weighted fusion, while still achieving high recognition performance.

[0055] Optionally, in the step of providing the fused features to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified, when the fused features include visual features and text features, the visual features and text features can be fused to generate a fused feature representation for classification; the fused feature representation is then input into the classification network for processing so that the classification network outputs the type label of the vehicle sticker image to be identified.

[0056] In this embodiment of the invention, after the fused features are provided to the classification network, the classification network outputs the type label corresponding to the vehicle sticker image to be identified based on the fused features. The fused features can simultaneously include visual features and textual features. The visual features reflect the texture, shape, color, and overall pattern information of the vehicle sticker, while the textual features originate from the text content on the vehicle sticker, such as advertising slogans or identification numbers. During processing, the visual features and textual features can be fused to generate a comprehensive feature representation for classification, enabling the classification network to utilize both overall image information and local textual information simultaneously, thereby improving the recognition accuracy of complex or partially occluded vehicle stickers.

[0057] The classification network can be designed as a deep classification network, which determines the type of vehicle sticker by fusing features. During training and optimization, a validation set can be used to evaluate the performance of the classification network. Based on the evaluation results, the network structure, feature fusion method, or training parameters can be adjusted to improve the accuracy and robustness of classification.

[0058] As one possible implementation, the classification network can employ a multi-task classification strategy, simultaneously outputting the sticker type and sticker status (e.g., complete, partially occluded, or damaged) to further enhance the ability to identify rare or unusual sticker samples. Furthermore, to adapt to application scenarios with limited computing resources or high real-time requirements, the fused feature representation can also be processed through a lightweight network to balance classification accuracy and computational efficiency.

[0059] Furthermore, such as Figure 2 As shown, this embodiment of the invention also provides another method for vehicle sticker recognition, through... Figure 2 It can be seen that there are four main steps. First, diverse vehicle sticker image data is collected from different sources to ensure data coverage and diversity, such as the Internet, traffic monitoring cameras, or user-uploaded photos. The images are then manually labeled, including the type of vehicle sticker, its location, the degree of damage, and the degree of obstruction.

[0060] Secondly, a style-based generative adversarial network model is constructed. This model generates expanded training data consistent with the style of real car sticker images by training the generator and discriminator, thereby enriching the training set and improving the model's generalization ability in complex scenes. The generation process is optimized using a multi-task loss function, including adversarial loss, style loss, damage loss, and occlusion loss, ensuring that the generated images closely approximate real data in both visual style and label attributes.

[0061] Third, an attention-based Transformer model is used to extract the image backbone features, including low-level texture features, mid-level shape features, and high-level semantic features. An attention optimization layer is used to adjust the weights of each feature to highlight key regions. Multi-scale features are processed by a feature fusion layer, which unifies the dimensions through convolution and uses a top-down feature pyramid network for fusion. Location encoding is also introduced to compensate for spatial information, thus obtaining fused features.

[0062] Finally, a deep classification network integrating visual and textual features is designed. This network combines visual information from the fused features with the textual features of the vehicle sticker to generate a comprehensive feature representation for classification. This representation is then input into the classification network for processing, outputting a vehicle sticker type label. This method achieves high-precision recognition even in complex lighting conditions, partially occluded scenes, or damaged scenes, while also maintaining good classification performance for rare categories or small sample vehicle stickers.

[0063] In one embodiment, such as Figure 3As shown, an attention model training method is provided, including the following steps: 301. Obtain the training set, the image generation model to be trained, and the attention model to be trained; 302. Train the image generation model to be trained based on the training set to obtain a trained image generation model; 303. Generate an extended training dataset based on the trained image generation model; 304. Train the attention model to be trained based on the expanded training dataset to obtain a trained attention model.

[0064] In this embodiment of the invention, the training set includes vehicle sticker images and corresponding vehicle sticker labels. The vehicle sticker labels include at least one of four attributes: type, location, damage level, and occlusion level. The vehicle sticker images can come from various sources, such as publicly available images on the internet, vehicle images captured by traffic monitoring cameras, or user-uploaded vehicle sticker photos, to ensure data diversity and coverage. The collected images are manually labeled with information such as the type, location, damage level, and occlusion level of the vehicle sticker for subsequent model training. To improve model training performance, the images can be preprocessed, including resizing, color correction, and noise removal.

[0065] During training, the image generation model is trained on the training set to obtain a trained image generation model. The image generation model can adopt an improved StyleGAN2 network structure. The generator input layer introduces a style encoding vector, and high-resolution vehicle sticker images (e.g., target resolution of 512×512 pixels) are gradually generated through a multi-layer convolutional network. The discriminator adds a multi-scale feature discrimination module to simultaneously determine the realism and style attributes of the image, including type, degree of damage, and degree of occlusion. During training, the performance of the generator and discriminator is optimized based on a preset multi-task loss function, which may include adversarial loss, style loss, damage loss, and occlusion loss. Adversarial loss is used to improve the realism of the generated image, style loss is used to maintain the consistency of the generated image with the real image in terms of texture and overall style, and damage loss and occlusion loss are used to enhance the realism of the generated image in scenes with edge wear or occlusion. In model training, directional data generation is achieved by adjusting the style encoding vector of the generator. For example, Gaussian noise is injected into the intermediate layer to simulate the wear of the car sticker edge, or a random mask generation algorithm is used to simulate elliptical or polygonal occlusion areas, and the occlusion ratio is controlled to enhance the diversity of generated images and adaptability to complex scenes.

[0066] Through the above training process, the generator can generate more diverse car sticker images to expand the original training set, thereby enhancing the model's generalization ability. This allows the attention model to make full use of diverse data in subsequent training, more accurately extract low-level textures, mid-level shapes, and high-level semantic features, and improve the recognition accuracy of car stickers in complex scenes.

[0067] As one possible implementation, a dynamic adjustment mechanism can also be introduced into the training of the generator and discriminator to dynamically optimize the training parameters based on the quality of the generated image and the discriminator feedback, so as to further improve the realism of the generated image in terms of detail, texture and occlusion simulation.

[0068] Optionally, in the step of training the image generation model to be trained based on the training set to obtain a trained image generation model, the car sticker images and corresponding car sticker labels in the training set can also be input into the image generation model so that the image generation model generates a generated car sticker image with the same style as the car sticker image; the loss value of the generated car sticker image, the car sticker image, and the car sticker label is calculated based on a preset multi-task loss function, which includes an adversarial loss function, a style loss function, a damage loss function, and an occlusion loss function; the parameters of the image generation model to be trained are iterated with minimizing the loss value as the optimization objective until the loss value converges at the minimum or the number of iterations reaches a preset number, at which point training stops and a trained image generation model is obtained.

[0069] In this embodiment of the invention, when training the image generation model based on the training set, the vehicle sticker images and their corresponding vehicle sticker labels from the training set are first input into the image generation model, enabling the generator to generate vehicle sticker images with a style consistent with real vehicle sticker images. The generator's output should not only be visually similar to the real image, but also match the type, location, damage level, and occlusion level of the labels in the training set, thereby providing high-quality and diverse data for subsequent attention model training.

[0070] During training, the difference between the generated car sticker image and the real car sticker image and their labels is calculated based on a preset multi-task loss function. This multi-task loss function includes adversarial loss, style loss, damage loss, and occlusion loss. The adversarial loss optimizes the realism of the generated image, ensuring that the generated car sticker image is difficult for the discriminator to distinguish as a generated image or a real image. An improved version of WGAN-GP can be used for the adversarial loss to enhance training stability. The style loss optimizes the texture, color, and overall style of the generated image, making it visually consistent with the real car sticker. This loss can be calculated using a perceptual loss function. The damage loss and occlusion loss optimize the performance of the generated image in scenarios with edge wear or partial occlusion, ensuring that the generated image covers different damage or occlusion conditions in the training set. These losses can also be calculated using a perceptual loss function.

[0071] Specifically, the above loss combination forms a multi-task joint loss function, expressed as:

[0072] Where L represents the loss value, The adversarial loss function measures the difference in visual realism between the generated image and the real image. By optimizing this loss, the generated car sticker image is made as realistic as possible, making it difficult for the discriminator to distinguish it as a generated image or a real image. The adversarial loss can be improved by using the improved WGAN-GP method to enhance training stability. This is a style loss function used to measure the difference between the generated image and the real image in terms of texture, color, and overall style. Optimizing this loss ensures that the generated car sticker image is consistent with the training set in visual style, and is usually achieved through a perceptual loss function. The damage loss function measures how well the generated image matches the training set labels in terms of edge wear or local defects. By optimizing this loss, the generated image can simulate the damage that may occur in real car stickers during use. This can also be achieved through a perceptual loss function. The occlusion loss function measures the matching of the generated image with the training set labels in partially occluded scenarios. By optimizing this loss, the generated image can simulate various scenarios where the vehicle stickers in the training set are occluded. This can also be achieved through a perceptual loss function.

[0073] and , as well as These are the weight coefficients of the style loss function, the damage loss function, and the occlusion loss function, respectively. Specifically, it controls the degree of attention the generator pays to the consistency of texture, color, and overall style between generated and real images during training. When the size is large, the generator will pay more attention to maintaining the visual style of the generated images consistent with the training set images; when With a smaller value, the style loss has a weaker impact on training, allowing more training resources to be used for optimizing against realism or damaged / occluded features. Specifically, it controls the generator's emphasis on features such as edge wear and localized defects in vehicle decals. Increase This allows the generator to more accurately simulate potential damage to vehicle stickers during actual use when generating images, and enhances the diversity of the expanded training dataset. Specifically, it controls the generator's ability to simulate partially occluded scenes. Higher accuracy is required. This will enable the generator to produce more car decal images with occluded areas, thus allowing the attention model to learn during training the ability to extract key features even under occluded conditions.

[0074] The optimization objective is to minimize this loss value. The parameters of the generator and discriminator are updated iteratively until the loss value converges or the number of iterations reaches a preset upper limit, thereby obtaining a trained image generation model.

[0075] As one possible implementation, the weight coefficients of each loss function can be dynamically adjusted during training. , , This allows the generator to pay more attention to corresponding features when generating car sticker images with different attributes. For example, it increases the weight of style loss when generating small samples or rare types of car stickers, and enhances the weight of damage and occlusion loss when simulating partially occluded or damaged car stickers, so as to further improve the diversity and realism of the generated images and provide richer training data for subsequent attention model training.

[0076] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0077] In one embodiment, a vehicle sticker recognition device is provided, which corresponds one-to-one with the vehicle sticker recognition method described in the above embodiments. For example... Figure 4 As shown, the vehicle sticker recognition device includes a first acquisition module 401, an extraction module 402, an adjustment module 403, a fusion module 404, and a classification module 405. Detailed descriptions of each functional module are as follows: The first acquisition module 401 is used to acquire the image of the car sticker to be identified, as well as a trained attention model and a classification network. The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. Extraction module 402 is used to input the vehicle sticker image to be identified into the feature extraction layer for feature extraction processing to obtain the multi-scale features of the vehicle sticker image to be identified; The adjustment module 403 is used to input the multi-scale features into the attention optimization layer to adjust the weights of each feature in the multi-scale features and obtain the attention-optimized multi-scale features. The fusion module 404 is used to input the attention-optimized multi-scale features into the feature fusion layer for feature fusion processing to obtain fused features; The classification module 405 is used to provide the fused features to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified.

[0078] Optionally, the attention optimization layer includes a self-attention optimization layer, a spatial attention optimization layer, and a channel attention optimization layer, and the adjustment module 403 is further configured to: The multi-scale features are input into the self-attention optimization layer to calculate the correlation between the features and obtain the self-attention optimized features. The self-attention optimized features are input into the spatial attention optimization layer to adjust the response of each pixel or position feature based on the spatial attention mechanism, so as to obtain the spatially optimized features. The spatially optimized features are input into the channel attention optimization layer to adjust the weights of each channel feature based on the channel attention mechanism, thereby obtaining attention-optimized multi-scale features.

[0079] Optionally, the attention-optimized multi-scale features include attention-optimized low-level texture features, mid-level shape features, and high-level semantic features. The fusion module 404 is further configured to: The attention-optimized low-level texture features, mid-level shape features, and high-level semantic features are processed by convolution to unify the dimensions and obtain a unified feature representation. The unified feature representation is input into a top-down feature pyramid network for multi-scale fusion to generate the fused feature. In this process, location coding is introduced to compensate for the spatial information of the fused features.

[0080] Optionally, the classification module 405 is further configured to: When the fusion features include visual features and text features, the visual features and text features are fused to generate a fusion feature representation for classification; The fused feature representation is input into the classification network for processing, so that the classification network outputs the type label of the vehicle sticker image to be identified.

[0081] In one embodiment, an attention model training device is provided, which corresponds one-to-one with the attention model training methods described in the above embodiments. For example... Figure 5 As shown, the attention model training device includes a second acquisition module 501, a first training module 502, a generation module 503, and a second training module 504. Detailed descriptions of each functional module are as follows: The second acquisition module 501 is used to acquire a training set, an image generation model to be trained, and an attention model to be trained. The training set includes a car sticker image and a car sticker label corresponding to the car sticker image. The car sticker label includes at least one of the following: type, location, degree of damage, and degree of occlusion. The first training module 502 is used to train the image generation model to be trained based on the training set to obtain a trained image generation model. Generation module 503 is used to generate an extended training dataset based on the trained image generation model; The second training module 504 is used to train the attention model to be trained based on the extended training dataset to obtain the trained attention model.

[0082] Optionally, the first training module 502 is further configured to: The car sticker images and corresponding car sticker labels in the training set are input into the image generation model so that the image generation model generates a car sticker image with the same style as the car sticker image. The loss value of the generated car sticker image, the car sticker image, and the car sticker label is calculated based on a preset multi-task loss function, which includes an adversarial loss function, a style loss function, a damage loss function, and an occlusion loss function. The parameters of the image generation model to be trained are iterated with the goal of minimizing the loss value, until the loss value converges at the minimum or the number of iterations reaches a preset number, at which point the training stops and the trained image generation model is obtained.

[0083] Specific limitations regarding the vehicle sticker recognition device and the attention model training device can be found in the limitations regarding the vehicle sticker recognition method and the attention model training method described above, and will not be repeated here. Each module in the aforementioned vehicle sticker recognition device and attention model training device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0084] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes a readable storage medium storing computer-readable instructions. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer-readable instructions implement a vehicle sticker recognition method or an attention model training method. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.

[0085] In this application embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, it implements the steps of the above-described vehicle sticker recognition method or attention model training method.

[0086] In one embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, they implement the steps of the above-described vehicle sticker recognition method or attention model training method.

[0087] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0088] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0089] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for recognizing vehicle stickers, characterized in that, The method includes: The system acquires an image of the car sticker to be identified, as well as a trained attention model and a classification network. The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. The vehicle sticker image to be identified is input into the feature extraction layer for feature extraction processing to obtain the multi-scale features of the vehicle sticker image to be identified. The multi-scale features are input into the attention optimization layer to adjust the weights of each feature in the multi-scale features, thereby obtaining the attention-optimized multi-scale features. The attention-optimized multi-scale features are input into the feature fusion layer for feature fusion processing to obtain fused features; The fused features are provided to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified.

2. The vehicle sticker recognition method as described in claim 1, characterized in that, The attention optimization layer includes a self-attention optimization layer, a spatial attention optimization layer, and a channel attention optimization layer. The step of inputting the multi-scale features into the attention optimization layer to adjust the weights of each feature in the multi-scale features to obtain attention-optimized multi-scale features includes: The multi-scale features are input into the self-attention optimization layer to calculate the correlation between the features and obtain the self-attention optimized features. The self-attention optimized features are input into the spatial attention optimization layer to adjust the response of each pixel or position feature based on the spatial attention mechanism, so as to obtain the spatially optimized features. The spatially optimized features are input into the channel attention optimization layer to adjust the weights of each channel feature based on the channel attention mechanism, thereby obtaining attention-optimized multi-scale features.

3. The vehicle sticker recognition method as described in claim 1, characterized in that, The attention-optimized multi-scale features include attention-optimized low-level texture features, mid-level shape features, and high-level semantic features. The process of inputting the attention-optimized multi-scale features into the feature fusion layer for feature fusion processing to obtain fused features includes: The attention-optimized low-level texture features, mid-level shape features, and high-level semantic features are processed by convolution to unify the dimensions and obtain a unified feature representation. The unified feature representation is input into a top-down feature pyramid network for multi-scale fusion to generate the fused feature. In this process, location coding is introduced to compensate for the spatial information of the fused features.

4. The vehicle sticker recognition method as described in claim 1, characterized in that, The step of providing the fused features to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified includes: When the fusion features include visual features and text features, the visual features and text features are fused to generate a fusion feature representation for classification; The fused feature representation is input into the classification network for processing, so that the classification network outputs the type label of the vehicle sticker image to be identified.

5. An attention model training method, characterized in that, The method includes: Acquire a training set, an image generation model to be trained, and an attention model to be trained. The training set includes vehicle sticker images and corresponding vehicle sticker labels. The vehicle sticker labels include at least one of the following: type, location, degree of damage, and degree of occlusion. The image generation model to be trained is trained based on the training set to obtain a trained image generation model; An extended training dataset is generated based on the trained image generation model; The attention model to be trained is trained based on the extended training dataset to obtain the trained attention model as described in any one of claims 1 to 4.

6. The attention model training method as described in claim 5, characterized in that, The step of training the image generation model to be trained based on the training set to obtain a trained image generation model includes: The car sticker images and corresponding car sticker labels in the training set are input into the image generation model so that the image generation model generates a car sticker image with the same style as the car sticker image. The loss value of the generated car sticker image, the car sticker image, and the car sticker label is calculated based on a preset multi-task loss function, which includes an adversarial loss function, a style loss function, a damage loss function, and an occlusion loss function. The parameters of the image generation model to be trained are iterated with the goal of minimizing the loss value, until the loss value converges at the minimum or the number of iterations reaches a preset number, at which point the training stops and the trained image generation model is obtained.

7. A vehicle sticker recognition device, characterized in that, include: The first acquisition module is used to acquire the image of the car sticker to be identified, as well as the trained attention model and classification network. The trained attention model includes a feature extraction layer, an attention optimization layer, and a feature fusion layer. The extraction module is used to input the vehicle sticker image to be identified into the feature extraction layer for feature extraction processing to obtain the multi-scale features of the vehicle sticker image to be identified; An adjustment module is used to input the multi-scale features into the attention optimization layer to adjust the weights of each feature in the multi-scale features, thereby obtaining attention-optimized multi-scale features. The fusion module is used to input the attention-optimized multi-scale features into the feature fusion layer for feature fusion processing to obtain fused features; The classification module is used to provide the fused features to the classification network so that the classification network outputs the type label corresponding to the vehicle sticker image to be identified.

8. An attention model training device, characterized in that, include: The second acquisition module is used to acquire a training set, an image generation model to be trained, and an attention model to be trained. The training set includes a car sticker image and a car sticker label corresponding to the car sticker image. The car sticker label includes at least one of the following: type, location, degree of damage, and degree of occlusion. The first training module is used to train the image generation model to be trained based on the training set, so as to obtain a trained image generation model; The generation module is used to generate an extended training dataset based on the trained image generation model; The second training module is used to train the attention model to be trained based on the extended training dataset to obtain the trained attention model as described in any one of claims 1 to 4.

9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the vehicle sticker recognition method as described in any one of claims 1 to 4 or the attention model training method as described in any one of claims 5 to 6.

10. A readable storage medium having computer-readable instructions stored thereon, characterized in that, When the computer-readable instructions are executed by the processor, they implement the vehicle sticker recognition method as described in any one of claims 1 to 4 or the attention model training method as described in any one of claims 5 to 6.