A graphic trademark identification method and device
By improving the YOLOv11 network model and combining the C3k2DC module, AIFIRepBN layer, hypergraph adaptive feature enhancement, and SEAM attention mechanism, the problem of low accuracy in graphic trademark recognition was solved, achieving higher detection accuracy and robustness.
Patent Information
- Application Number
- CN202511784652.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-12-01
AI Technical Summary
Existing technologies have low accuracy in graphic trademark recognition, especially in multi-scale transformation and deformation scenarios, making it difficult to meet the high efficiency and accuracy requirements of automated detection.
The YOLOv11 network model architecture was improved by introducing the C3k2DC module, AIFIRepBN layer, hypergraph adaptive feature enhancement and aggregation module, and SEAM attention mechanism to enhance semantic perception and spatial modeling capabilities, and improve the ability to perceive important regions.
It improves the accuracy and recall rate of graphic trademark recognition, especially showing higher detection accuracy in small targets or deformed images, reduces engineering intervention costs, and has good versatility and transferability.
Smart Images

Figure CN121214178B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for identifying graphic trademarks. Background Technology
[0002] As a core identifier distinguishing the source of goods or services, a trademark serves as both a "legal identity card" for a company's brand and a key signal for consumers to discern quality. Accurate identification of graphic trademarks can effectively prevent infringement risks and avoid legal disputes at the commercial level, and provide decision support for a brand's global expansion. At the industrial level, it can precisely ensure product consistency and production safety, meeting the rigid technical requirements of quality control.
[0003] The mainstream solutions in the current industrial inspection field still revolve around template matching algorithms and feature point detection + descriptor matching algorithms. However, both have significant limitations: template matching algorithms only achieve trademark recognition through pixel-level comparison, and their application is strictly limited to rigid scenarios—requiring that the objects to be inspected in the production line have fixed poses and no deformation, typically such as the quality inspection of flat printed trademarks on pharmaceutical packaging. Once an angle shift or slight deformation occurs, the matching failure rate will exceed 30%. Although feature point detection and descriptor matching algorithms can adapt to slight deformations and scale changes through key point extraction and RANSAC optimization, under extreme scale scaling or strong non-rigid deformations (such as surface wrinkles, tensile tears), the failure of local feature descriptors causes the matching accuracy to plummet to below 50%. Therefore, current traditional industrial inspection methods mainly rely on manual feature engineering, which often lacks sufficient robustness when dealing with real-world scenarios such as multi-scale transformations and deformations, making it difficult to meet the demands for efficiency and accuracy in automated inspection.
[0004] With the rise of deep learning, especially the emergence of end-to-end detection models based on convolutional neural networks (CNNs), a completely new technical path has been provided for trademark detection. Compared with manually designed features, CNNs can automatically learn more discriminative representations through training on massive amounts of data, significantly improving adaptability to varied backgrounds. However, existing technologies often suffer from low accuracy in graphic trademark recognition methods due to problems such as the loss of core feature information caused by large changes in trademark size and deformation during the detection process. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a graphic trademark recognition method and apparatus, which aims to solve the problem of low accuracy in existing graphic trademark recognition methods.
[0006] This invention provides a method for identifying graphic trademarks, the method comprising:
[0007] Acquire the trademark image to be detected by the image acquisition device;
[0008] The trademark image to be detected is input into the graphic trademark recognition model trained by the improved YOLOv11 network model architecture to obtain the graphic trademark information of the trademark image to be detected.
[0009] The improved YOLOv11 network model architecture includes a backbone network, a hypergraph adaptive feature enhancement and aggregation module, a Neck network, and a detection head. The backbone network includes a C3k2DC module and an AIFIRepBN layer to improve semantic perception and spatial modeling capabilities. The hypergraph adaptive feature enhancement and aggregation module is used to capture richer global context and higher-order semantic relationships. The detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies and enhance the perception of important regions.
[0010] Furthermore, in the above graphic trademark recognition method, all C3k2 structures in the backbone network are replaced with C3k2DC structures to form C3k2DC modules, wherein the C3k2DC structure is formed by changing the second Conv of BottleNeck in the C3k2 structure to DCNV4.
[0011] After receiving the features, the C3k2DC module performs channel compression and preprocessing through a 1×1 convolution to form the main branch and the residual branch. The main branch retains the original feature shape for subsequent residual connection, while the residual branch enters different processing paths depending on whether C3k is enabled.
[0012] When C3k is enabled, the residual branch enters the C3k2DC module, and the feature map is again divided into two sub-branches through convolution. One branch maintains the shallow expression, and the other branch performs deep feature extraction through multiple stacked Conv-DC4 sub-modules. The outputs of the two branches are concatenated in the channel dimension and fused through convolution.
[0013] If C3k is not enabled, multiple Conv-DC4 modules are directly used to stack the residual branches.
[0014] The Conv-DC4 module improves the model's adaptability to local geometric changes by replacing the second ordinary convolution in Bottleneck with DCNv4 and introducing spatial offset through deformable convolution.
[0015] The output features of all residual branches are concatenated with the main branch, and then channel fusion is completed through a 1×1 convolution to output the feature map processed by the C3k2DC module.
[0016] Furthermore, in the aforementioned graphic trademark recognition method, within the AIFIRepBN layer, when a feature map is received, it is encoded using a two-dimensional sine-cosine positional encoding. The generated positional encoding is then precisely mapped to each spatial location, allowing the feature map to enter the Transformer core layer under the guidance of the positional encoding.
[0017] in, For feature map location index, For channel indexing, For the embedded dimension;
[0018] The feature map dimensions are reshaped, and the spatial dimension is flattened into a sequence form to adapt the convolutional features to the Transformer architecture. Then, the position-encoded feature map is linearly transformed to obtain:
[0019] Where Q represents query relevance, K represents intrinsic characteristics, and V represents query value. , , , respectively, represent the feature mapping matrices of Q, K, and V;
[0020] The linearly transformed features are input into a multi-head self-attention layer, and the contextual information between pixels is extracted through multiple layers, so that each attention head independently focuses on different locations and features:
[0021] Using multilayer perceptrons and RepBN techniques to process hierarchical features:
[0022] Here, η is a learnable parameter. The network can control the degree of reparameterization of RepBN by adjusting η. When η becomes 0, RepBN is completely reparameterized into BN.
[0023] The processed hierarchical features are embedded into the neural network through the Embedded Patches layer and reshaped into a 2D shape.
[0024] Furthermore, in the above-mentioned graphic trademark recognition method, the backbone network generates three feature maps B3, B4, and B5 at different scales in the fourth, sixth, and tenth layers, respectively.
[0025] In the hypergraph adaptive feature enhancement and aggregation module, feature maps B3 and B5 are downsampled and upsampled to the same size as feature map B4, and then aggregated through a 1×1 convolution to obtain the fused feature map. ;
[0026] Subsequently It is divided into three feature groups along the channel dimension, which are represented as follows: , , ,in Used for global high-order correlation modeling Local low-order correlation modeling Used for quick connection;
[0027] The outputs of the three feature groups are concatenated along the channel dimension and then fused using a 1×1 convolutional layer:
[0028] );
[0029] C3AH divides the received features into two branches. One branch extracts local semantic information through 1×1 convolution, preserving basic representation capabilities. The other branch introduces a hypergraph modeling mechanism to mine higher-order structural relationships between features. Specifically, it aggregates and propagates features through a node-hyperedge association matrix, effectively fusing information from multiple related nodes to capture richer global context and higher-order semantic relationships.
[0030] The structural enhancement features and local features obtained from the two branches are concatenated along the channel dimension and fused through 1×1 convolution to obtain the output features of the C3AH module.
[0031] Furthermore, in the above-mentioned graphic trademark recognition method, the second Conv of the two branches in the detection head is replaced with the SEAM attention mechanism to form the SEAMHead; after receiving the features, the detection head sequentially passes through three GSMM modules of different scales to extract multi-scale contextual information and fuses it with the original features of the residual connection to achieve richer feature expression. Each GSMM contains a Patch Embedding submodule, which performs nonlinear modeling and normalization processing through GELU activation and BatchNorm. Subsequently, depthwise separable convolution and pointwise convolution are used to mine the spatial and channel dimension dependencies to enhance the perception ability of important regions. The output features are then reactivated and normalized before being output.
[0032] The outputs of the three GSMMs are fused element-wise and then fed into global average pooling to extract contextual information. The original number of channels is restored through the channel expansion module. Finally, the fused features are concatenated with the input residuals and passed as a new output to the subsequent detection branch.
[0033] Furthermore, in the above-mentioned graphic trademark recognition method, the training process of the defect detection model includes:
[0034] A predetermined number of trademark images are collected, and then subjected to random erasure, random affine transformation and random color jitter processing to obtain the corresponding training dataset.
[0035] The training dataset is divided into training set, validation set and test set according to a preset ratio;
[0036] Define a loss function and train the improved YOLOv11 model architecture on the training set until the training stopping condition is met to obtain the graphic trademark recognition model.
[0037] The random erasure process involves randomly selecting a rectangular region in the image with a certain probability and replacing the pixel values of that region with random values, fixed values, or the image mean; the random affine transformation involves applying a random affine transformation to the original image; and the random color jittering process involves randomly adjusting the brightness, contrast, saturation, and hue parameters of the image.
[0038] Furthermore, in the above graphic trademark recognition method, the loss function adopts Powerful-IoU:
[0039] 2 / 4
[0040] in, Let be the IoU function; P is the penalty factor for adapting to the target size; These are the width and height of the target bounding box, respectively; , , , This represents the absolute value of the distance between the corresponding edges of the predicted bounding box and the target bounding box.
[0041] Another object of the present invention is to provide a graphic trademark recognition device, the device comprising:
[0042] The acquisition module is used to acquire the trademark image to be detected captured by the image acquisition device;
[0043] The detection module is used to input the trademark image to be detected into the graphic trademark recognition model trained by the improved YOLOv11 network model architecture, so as to obtain the graphic trademark information of the trademark image to be detected.
[0044] The improved YOLOv11 network model architecture includes a backbone network, a hypergraph adaptive feature enhancement and aggregation module, a Neck network, and a detection head. The backbone network includes a C3k2DC module and an AIFIRepBN layer to improve semantic perception and spatial modeling capabilities. The hypergraph adaptive feature enhancement and aggregation module is used to capture richer global context and higher-order semantic relationships. The detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies and enhance the perception of important regions.
[0045] Another object of the present invention is to provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0046] Another object of the present invention is to provide an electronic device including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the method described above.
[0047] This invention improves the current YOLOv11 network model architecture by incorporating a C3k2DC module and an AIFIRepBN layer into the backbone network to enhance semantic perception and spatial modeling capabilities. A hypergraph adaptive feature enhancement and aggregation module captures richer global context and higher-order semantic relationships. The detection head integrates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies, enhancing the perception of important regions and giving the detection model stronger environmental adaptability and robustness. This solves the problem of low accuracy in existing graphic trademark recognition methods.
[0048] In addition, the embodiments of the present invention have at least the following beneficial effects:
[0049] 1. The synergistic effect of multiple modules improves the end-to-end accuracy of the entire detection process, especially in detecting small targets or deformed images, showing higher accuracy and recall.
[0050] 2. The entire detection system is highly automated. From feature extraction to target localization, everything is completed by the model through autonomous learning. There is no need for manual design of templates, features, or parameters, which greatly reduces engineering intervention costs and improves deployment efficiency and consistency.
[0051] 3. The proposed improved structure has good versatility and portability, and can be applied to the YOLO series or other mainstream detection frameworks. It is easy to migrate to different detection tasks and improve the reusability of the overall algorithm platform. Attached Figure Description
[0052] Figure 1 This is a schematic diagram of the improved YOLOv11 network model architecture in the graphic trademark recognition method of the first embodiment of the present invention.
[0053] Figure 2 This is a flowchart of the graphic trademark recognition method in the first embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram of the structure of the C3k2DC module in the improved YOLOv11 network model architecture in the graphic trademark recognition method of the first embodiment of the present invention;
[0055] Figure 4This is a schematic diagram of the structure of the AIFIRepBN layer in the improved YOLOv11 network model architecture in the graphic trademark recognition method of the first embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of the HyperACE structure in the hypergraph adaptive feature enhancement aggregation module of the improved YOLOv11 network model architecture in the graphic trademark recognition method of the first embodiment of the present invention.
[0057] Figure 6 This is a schematic diagram of the C3AH module in the improved YOLOv11 network model architecture of the graphic trademark recognition method in the first embodiment of the present invention;
[0058] Figure 7 This is a schematic diagram of the structure of SEAMHead in the improved YOLOv11 network model architecture in the graphic trademark recognition method of the first embodiment of the present invention;
[0059] Figure 8 This is a structural block diagram of the graphic trademark recognition device in the third embodiment of the present invention.
[0060] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0061] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0062] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0064] The core objective of this invention is to accurately identify trademarks that cannot be accurately identified due to feature loss caused by multi-scale transformations and deformations by improving the YOLOv11 network model. This mainly includes optimizing the model structure and the model recognition process.
[0065] Specifically, such as Figure 1 As shown, all C3k2 structures in the backbone network are replaced with C3k2DC structures. The main changes to the C3k2DC structure are: replacing the second Conv of the BottleNeck structure in the C3k2 structure with DCNV4; replacing the SPPF structure with the AIFIRepBN structure; using the Hypergraph's Adaptive Relevance Enhancement (HyperACE) mechanism and Full Pipeline Feature Aggregation and Distribution (FullPAD) to improve detection performance; replacing the original CIoU with Powerful-IOU; and replacing the original Detect head with SEAMHead.
[0066] After model structure optimization, the images are fed into the improved backbone network, which consists of eleven layers. The first layer is a Conv layer, followed by a combined structure of four Conv layers and C3k2DC, then one AIFIRepBN layer and one C2PSA layer. Simultaneously, three feature maps of different scales, B3, B4, and B5, are generated at the fourth, sixth, and tenth layers, respectively.
[0067] Feature maps B3, B4, and B5 are augmented using hypergraph adaptive correlation to generate feature map Y. The size of Y is adjusted to the spatial resolution of each level, and a 1×1 convolutional layer is used to adjust its channel dimensions. . Enhanced and original features Feature fusion was performed, enabling fine-grained information flow and representation collaboration, which significantly improved gradient propagation and enhanced detection performance.
[0068] Example 1
[0069] Please see Figure 2 The figure shows a graphic trademark recognition method in the first embodiment of the present invention, the method including steps S10 to S11.
[0070] Step S10: Obtain the image of the trademark to be detected captured by the image acquisition device.
[0071] The image acquisition device, such as a camera, will capture the trademark image that needs to be identified, obtain high-resolution detection data, and obtain the corresponding trademark image to be detected.
[0072] Step S11: Input the trademark image to be detected into the graphic trademark recognition model trained by the improved YOLOv11 network model architecture to obtain the graphic trademark information of the trademark image to be detected.
[0073] Among them, the defect detection model has mastered the inherent logic of recognizing graphic trademarks based on trademark images. Therefore, by inputting the trademark image to be detected into the graphic trademark recognition model, the graphic trademark information of the trademark image to be detected can be obtained.
[0074] Specifically, in this embodiment of the invention, the YOLOv11 network model architecture is selected as the basic model architecture, and some of its internal architectures are improved to obtain a customized model architecture for accurate identification of graphic trademarks.
[0075] More specifically, the improved YOLOv11 network model architecture includes a backbone network, a hypergraph adaptive feature enhancement and aggregation module, a Neck network, and a detection head. The backbone network includes a C3k2DC module and an AIFIRepBN layer to improve semantic perception and spatial modeling capabilities. The hypergraph adaptive feature enhancement and aggregation module is used to capture richer global context and higher-order semantic relationships. The detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies and enhance the perception of important regions.
[0076] For example, such as Figure 3 As shown, all C3k2 structures in the backbone network are replaced with C3k2DC structures to form C3k2DC modules. The C3k2DC structure is formed by changing the second Conv of the BottleNeck of the C3k2 structure to DCNV4.
[0077] After receiving the features, the C3k2DC module performs channel compression and preprocessing through a 1×1 convolution to form the main branch and the residual branch. The main branch retains the original feature shape for subsequent residual connection, while the residual branch enters different processing paths depending on whether C3k is enabled.
[0078] When C3k is enabled, the residual branch enters the C3k2DC module, and the feature map is again divided into two sub-branches through convolution. One branch maintains the shallow expression, and the other branch performs deep feature extraction through multiple stacked Conv-DC4 sub-modules. The outputs of the two branches are concatenated in the channel dimension and fused through convolution.
[0079] If C3k is not enabled, multiple Conv-DC4 modules are directly used to stack the residual branches.
[0080] The Conv-DC4 module improves the model's adaptability to local geometric changes by replacing the second ordinary convolution in Bottleneck with DCNv4 and introducing spatial offset through deformable convolution.
[0081] The output features of all residual branches are concatenated with the main branch, and then channel fusion is completed through a 1×1 convolution to output the feature map processed by the C3k2DC module.
[0082] The Conv-DC4 module replaces the second ordinary convolution in Bottleneck with DCNv4, introducing spatial offset through deformable convolution to improve the model's adaptability to local geometric changes. This effectively enhances the modeling ability for complex target shapes such as occlusion, rotation, and distortion. The entire process effectively improves semantic perception and spatial modeling capabilities while maintaining the model's lightweight nature, making it particularly suitable for target detection tasks in complex backgrounds, multi-scale, and high-deformation scenes.
[0083] like Figure 4 As shown, in the AIFIRepBN layer, when a feature map is received, it is encoded using a two-dimensional sine-cosine positional encoding. The generated positional encoding is then precisely mapped to each spatial location, allowing the feature map to enter the Transformer core layer under the guidance of the positional encoding.
[0084] in, For feature map location index, For channel indexing, For the embedded dimension;
[0085] The feature map dimensions are reshaped, and the spatial dimension is flattened into a sequence form to adapt the convolutional features to the Transformer architecture. Then, the position-encoded feature map is linearly transformed to obtain:
[0086] Where Q represents query relevance, K represents intrinsic characteristics, and V represents query value. , , , respectively, represent the feature mapping matrices of Q, K, and V;
[0087] The linearly transformed features are input into a multi-head self-attention layer, and the contextual information between pixels is extracted through multiple layers, so that each attention head independently focuses on different locations and features:
[0088] Using multilayer perceptrons and RepBN techniques to process hierarchical features:
[0089] Here, η is a learnable parameter. The network can control the degree of reparameterization of RepBN by adjusting η. When η becomes 0, RepBN is completely reparameterized into BN.
[0090] The processed hierarchical features are embedded into the neural network through the Embedded Patches layer and reshaped into a 2D shape.
[0091] Among them, multilayer perceptrons and RepBN technology are used to process hierarchical features. Compared with the traditional LayerNorm layer, RepBN is gradually reparameterized to BN (BatchNorm) during training, which can reduce the consumption of memory resources while maintaining training stability.
[0092] like Figure 5 , Figure 6 As shown, the Hypergraph Adaptive Feature Enhancement and Aggregation Module includes Hypergraph Adaptive Relevance Enhancement (HyperACE) and Full Pipeline Feature Aggregation and Distribution (FullPAD). The backbone network generates three feature maps B3, B4, and B5 at different scales in the fourth, sixth, and tenth layers, respectively.
[0093] In the hypergraph adaptive feature enhancement and aggregation module, feature maps B3 and B5 are downsampled and upsampled to the same size as feature map B4, and then aggregated through a 1×1 convolution to obtain the fused feature map. ;
[0094] Subsequently It is divided into three feature groups along the channel dimension, which are represented as follows: , , ,in Used for global high-order correlation modeling Local low-order correlation modeling Used for quick connection;
[0095] The outputs of the three feature groups are concatenated along the channel dimension and then fused using a 1×1 convolutional layer:
[0096] );
[0097] C3AH divides the received features into two branches. One branch extracts local semantic information through 1×1 convolution, preserving basic representation capabilities. The other branch introduces a hypergraph modeling mechanism to mine higher-order structural relationships between features. Specifically, it aggregates and propagates features through a node-hyperedge association matrix, effectively fusing information from multiple related nodes to capture richer global context and higher-order semantic relationships.
[0098] The structural enhancement features and local features obtained from the two branches are concatenated along the channel dimension and fused through 1×1 convolution to obtain the output features of the C3AH module.
[0099] The compressed features are first fed into an adaptive hyperedge generation module. This module dynamically constructs many-to-many hyperedge connections based on the similarity or semantic relevance between features, using a learnable strategy to achieve flexible and data-driven graph structure modeling. Compared to the one-to-one edge connections in traditional graphs, hyperedges can simultaneously connect multiple nodes, significantly improving the freedom and expressiveness of structural modeling. The generated hypergraph is then input into a hypergraph convolution module, where feature aggregation and propagation are performed through a node-hyperedge association matrix, effectively fusing information from multiple related nodes to capture richer global context and higher-order semantic relationships.
[0100] like Figure 7 As shown, since trademarks can be deformed at multiple scales and due to shooting angles, the second Conv of the two branches in the detection head is replaced with the SEAM attention mechanism to reduce false negatives and false positives caused by feature loss.
[0101] The input features are sequentially passed through three GSMM modules at different scales (Patch=8, 7, 6) to extract multi-scale contextual information, which is then fused with the original features from residual connections to achieve richer feature representation. Each GSMM contains a Patch Embedding submodule, which performs non-linear modeling and normalization using GELU activation and BatchNorm. Subsequently, depthwise separable convolution and pointwise convolution are used to mine spatial and channel dimensional dependencies, enhancing the ability to perceive important regions. The output features are then reactivated and normalized before being output.
[0102] The outputs of the three GSMMs are fused element-wise, then fed into global average pooling to extract contextual information, and the original number of channels is restored through a channel expansion module. Finally, the fused features are concatenated with the input residuals and passed as a new output to the subsequent detection branch.
[0103] In summary, the graphic trademark recognition method in the above embodiments of the present invention improves the current YOLOv11 network model architecture by adding a C3k2DC module and an AIFIRepBN layer to the backbone network to enhance semantic perception and spatial modeling capabilities. A hypergraph adaptive feature enhancement and aggregation module captures richer global context and higher-order semantic relationships, and the detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies, enhancing the perception of important regions and giving the detection model stronger environmental adaptability and robustness. This solves the problem of low accuracy in existing graphic trademark recognition methods.
[0104] Example 2
[0105] This embodiment also proposes a graphic trademark recognition method. The difference between the graphic trademark recognition method in this embodiment and the graphic trademark recognition method in Embodiment 1 is as follows:
[0106] The training process of the defect detection model includes:
[0107] A predetermined number of trademark images are collected, and then subjected to random erasure, random affine transformation and random color jitter processing to obtain the corresponding training dataset.
[0108] The training dataset is divided into training set, validation set and test set according to a preset ratio;
[0109] Define a loss function and train the improved YOLOv11 model architecture on the training set until the training stopping condition is met to obtain the graphic trademark recognition model.
[0110] Specifically, random erasure involves randomly selecting a rectangular region in the image with a certain probability and replacing the pixel values of that region with random, fixed, or image average values. This simulates interference factors in real-world scenarios such as image occlusion and missing pixels, thereby enhancing the model's adaptability to occlusion interference. Random affine transformation applies random affine transformations to the original image, enabling the model to better adapt to complex situations in the real world such as pose changes, viewpoint shifts, and scale changes, thus addressing feature loss issues caused by angle changes. Random color jitter involves randomly adjusting parameters such as brightness, contrast, saturation, and hue of the image, enhancing the model's robustness to environmental interference such as lighting changes and color distortion. It can effectively simulate color deviations caused by ambient lighting, camera differences, or image quality, thereby improving its generalization ability under different shooting conditions.
[0111] Furthermore, the loss function adopted is Powerful-IoU:
[0112] 2 / 4
[0113] in, Let be the IoU function; P is the penalty factor for adapting to the target size; These are the width and height of the target bounding box, respectively; , , , This represents the absolute value of the distance between the corresponding edges of the predicted bounding box and the target bounding box.
[0114] YOLOv11 uses CIoU by default. In trademark detection tasks with multiple scales and significant deformations, traditional CIoU loss, due to its fixed structure and limited information modeling dimensions, struggles to accurately measure the true relationship between the predicted bounding box and the ground truth target. This leads to problems such as gradient degradation, scale misjudgment, and insufficient perception of local structure, limiting further improvements in regression performance. Powerful-IoU, compared to traditional CIoU loss, possesses stronger expressive power and stability in bounding box regression. It integrates multi-dimensional information such as scale differences, aspect ratio offset, and center distance, enabling a more accurate depiction of the spatial relationship between the predicted and ground truth boxes. Simultaneously, it maintains effective gradients even with minimal overlap, mitigating the gradient vanishing problem. It exhibits greater adaptability to multi-scale and deformed targets, significantly improving training stability and detection performance while enhancing localization accuracy.
[0115] In summary, the graphic trademark recognition method in the above embodiments of the present invention improves the current YOLOv11 network model architecture by adding a C3k2DC module and an AIFIRepBN layer to the backbone network to enhance semantic perception and spatial modeling capabilities. A hypergraph adaptive feature enhancement and aggregation module captures richer global context and higher-order semantic relationships, and the detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies, enhancing the perception of important regions and giving the detection model stronger environmental adaptability and robustness. This solves the problem of low accuracy in existing graphic trademark recognition methods.
[0116] Example 3
[0117] Please see Figure 8 The image shows a graphic trademark recognition device proposed in the third embodiment of the present invention, the device comprising:
[0118] The acquisition module 100 is used to acquire the trademark image to be detected acquired by the image acquisition device;
[0119] The detection module 200 is used to input the trademark image to be detected into the graphic trademark recognition model trained by the improved YOLOv11 network model architecture, so as to obtain the graphic trademark information of the trademark image to be detected.
[0120] The improved YOLOv11 network model architecture includes a backbone network, a hypergraph adaptive feature enhancement and aggregation module, a Neck network, and a detection head. The backbone network includes a C3k2DC module and an AIFIRepBN layer to improve semantic perception and spatial modeling capabilities. The hypergraph adaptive feature enhancement and aggregation module is used to capture richer global context and higher-order semantic relationships. The detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies and enhance the perception of important regions.
[0121] The functions or operation steps implemented by the above modules are largely the same as those in the above method embodiments, and will not be repeated here.
[0122] Example 4
[0123] In another aspect, the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the method described in any one of Embodiments 1 to 2 above.
[0124] Example 5
[0125] In another aspect, the present invention provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of any one of the methods described in Embodiments 1 to 2 above.
[0126] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0127] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequential list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0128] More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable storage media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0129] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0130] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0131] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A method for recognizing graphic trademarks, characterized in that, The method includes: Acquire the trademark image to be detected by the image acquisition device; The trademark image to be detected is input into the graphic trademark recognition model trained by the improved YOLOv11 network model architecture to obtain the graphic trademark information of the trademark image to be detected. The improved YOLOv11 network model architecture includes a backbone network, a hypergraph adaptive feature enhancement and aggregation module, a Neck network, and a detection head. The backbone network includes a C3k2DC module and an AIFIRepBN layer to improve semantic perception and spatial modeling capabilities. The hypergraph adaptive feature enhancement and aggregation module is used to capture richer global context and higher-order semantic relationships. The detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies and enhance the perception of important regions. Replace all C3k2 structures in the backbone network with C3k2DC structures to form C3k2DC modules. The C3k2DC structure is formed by changing the second Conv of the BottleNeck of the C3k2 structure to DCNV4. After receiving the features, the C3k2DC module performs channel compression and preprocessing through a 1×1 convolution to form the main branch and the residual branch. The main branch retains the original feature shape for subsequent residual connection, while the residual branch enters different processing paths depending on whether C3k is enabled. When C3k is enabled, the residual branch enters the C3k2DC module, and the feature map is again divided into two sub-branches through convolution. One branch maintains the shallow expression, and the other branch performs deep feature extraction through multiple stacked Conv-DC4 sub-modules. The outputs of the two branches are concatenated in the channel dimension and fused through convolution. If C3k is not enabled, multiple Conv-DC4 modules are directly used to stack the residual branches. The Conv-DC4 module improves the model's adaptability to local geometric changes by replacing the second ordinary convolution in Bottleneck with DCNV4 and introducing spatial offset through deformable convolution. The output features of all residual branches are concatenated with the main branch, and then channel fusion is completed through a 1×1 convolution to output the feature map processed by the C3k2DC module.
2. The graphic trademark recognition method according to claim 1, characterized in that, In the AIFIRepBN layer, when a feature map is received, it is encoded using a two-dimensional sine-cosine positional encoding. The generated positional encoding precisely maps each spatial location, allowing the feature map to enter the Transformer core layer under the guidance of the positional encoding. in, For feature map location index, For channel indexing, For the embedded dimension; The feature map dimensions are reshaped, and the spatial dimension is flattened into a sequence form to adapt the convolutional features to the Transformer architecture. Then, the position-encoded feature map is linearly transformed to obtain: Where Q represents query relevance, K represents intrinsic characteristics, and V represents query value. , , , respectively, represent the feature mapping matrices of Q, K, and V; The linearly transformed features are input into a multi-head self-attention layer, and the contextual information between pixels is extracted through multiple layers, so that each attention head independently focuses on different locations and features: Using multilayer perceptrons and RepBN techniques to process hierarchical features: Here, η is a learnable parameter. The network controls the degree of reparameterization of RepBN by adjusting η. When η becomes 0, RepBN is completely reparameterized into BN. The processed hierarchical features are embedded into the neural network through the Embedded Patches layer and reshaped into a 2D shape.
3. The graphic trademark recognition method according to claim 2, characterized in that, The backbone network generates three feature maps of different scales, B3, B4, and B5, at the fourth, sixth, and tenth layers, respectively. In the hypergraph adaptive feature enhancement and aggregation module, feature maps B3 and B5 are downsampled and upsampled to the same size as feature map B4, and then aggregated through a 1×1 convolution to obtain the fused feature map. ; Subsequently It is divided into three feature groups along the channel dimension, which are represented as follows: , , ,in Used for global high-order correlation modeling Local low-order correlation modeling Used for quick connection; The outputs of the three feature groups are concatenated along the channel dimension and then fused using a 1×1 convolutional layer: ); C3AH divides the received features into two branches. One branch extracts local semantic information through 1×1 convolution, preserving basic representation capabilities. The other branch introduces a hypergraph modeling mechanism to mine higher-order structural relationships between features. Specifically, it aggregates and propagates features through a node-hyperedge association matrix, effectively fusing information from multiple related nodes to capture richer global context and higher-order semantic relationships. The structural enhancement features and local features obtained from the two branches are concatenated along the channel dimension and fused through 1×1 convolution to obtain the output features of the C3AH module.
4. The graphic trademark recognition method according to claim 3, characterized in that, The second Conv of the two branches in the detection head is replaced with the SEAM attention mechanism to form the SEAMHead. After receiving the features, the detection head sequentially passes through three GSMM modules of different scales to extract multi-scale contextual information and fuses it with the original features of the residual connection to achieve richer feature representation. Each GSMM contains a Patch Embedding submodule, which performs non-linear modeling and normalization through GELU activation and BatchNorm. Then, depthwise separable convolution and pointwise convolution are used to mine the spatial and channel dimension dependencies to enhance the perception of important regions. The output features are then reactivated and normalized before being output. The outputs of the three GSMMs are fused element-wise and then fed into global average pooling to extract contextual information. The original number of channels is restored through the channel expansion module. Finally, the fused features are concatenated with the input residuals and passed as a new output to the subsequent detection branch.
5. The graphic trademark recognition method according to claim 1, characterized in that, The training process of the graphic trademark recognition model includes: A predetermined number of trademark images are collected, and then subjected to random erasure, random affine transformation and random color jitter processing to obtain the corresponding training dataset. The training dataset is divided into training set, validation set and test set according to a preset ratio; Define a loss function and train the improved YOLOv11 model architecture on the training set until the training stopping condition is met to obtain the graphic trademark recognition model. The random erasure process involves randomly selecting a rectangular region in the image with a certain probability and replacing the pixel values of that region with random values, fixed values, or the image mean; the random affine transformation involves applying a random affine transformation to the original image; and the random color jittering process involves randomly adjusting the brightness, contrast, saturation, and hue parameters of the image.
6. The graphic trademark recognition method according to claim 5, characterized in that, The loss function uses Powerful-IoU: 2 / 4 in, Let be the IoU function; P is the penalty factor for adapting to the target size; These are the width and height of the target bounding box, respectively; , , , This represents the absolute value of the distance between the corresponding edges of the predicted bounding box and the target bounding box.
7. A graphic trademark recognition device, characterized in that, The apparatus for implementing the graphic trademark recognition method according to any one of claims 1 to 6, the apparatus comprising: The acquisition module is used to acquire the trademark image to be detected captured by the image acquisition device; The detection module is used to input the trademark image to be detected into the graphic trademark recognition model trained by the improved YOLOv11 network model architecture, so as to obtain the graphic trademark information of the trademark image to be detected. The improved YOLOv11 network model architecture includes a backbone network, a hypergraph adaptive feature enhancement and aggregation module, a Neck network, and a detection head. The backbone network includes a C3k2DC module and an AIFIRepBN layer to improve semantic perception and spatial modeling capabilities. The hypergraph adaptive feature enhancement and aggregation module is used to capture richer global context and higher-order semantic relationships. The detection head incorporates a SEAM attention mechanism to mine spatial and channel-dimensional dependencies and enhance the perception of important regions.
8. A readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor, when executing the program, implements the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Trademark primitive detection method based on multi-scale trademark element recognition network
CN118196507A
Steel surface defect detection method and device based on YOLO11n improvement
CN120088240A