Trademark identification method and device, electronic equipment and nonvolatile storage medium

By performing multi-scale scaling and feature extraction and fusion of the image to be detected, the problem of poor trademark identification accuracy in the prior art is solved, and more efficient trademark identification and positioning is achieved.

CN119964134APending Publication Date: 2025-05-09CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510045580.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The identification and positioning accuracy of trademark identification methods in the prior art is poor, and malicious use and plagiarism cannot be effectively avoided, resulting in corporate intellectual property risks and financial losses.

Method used

Multi-scale scaling technology is used to process the detected images, and feature extraction, fusion and identification are performed through the backbone network, neck network and head network in the target model to determine the location information and category of the trademark.

Benefits of technology

It improves the accuracy and robustness of trademark inspection, can identify and locate trademarks more accurately, reduces the situation of misidentification and misidentification, and improves the overall identification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119964134A_ABST
    Figure CN119964134A_ABST
Patent Text Reader

Abstract

The invention discloses a trademark identification method and device, electronic equipment and a nonvolatile storage medium. The method comprises the following steps: performing multi-scale scaling on a to-be-detected image to obtain a plurality of target to-be-detected images with different scales; performing feature extraction on the target to-be-detected image by adopting a backbone network in the target model to obtain a first feature; fusing the plurality of first features extracted by the backbone network by using a neck network in the target model to obtain a fused feature, and performing secondary feature extraction according to the fused feature by using the backbone network to obtain a target feature; and determining an initial recognition result corresponding to the target to-be-detected image according to the target features by adopting a head network in the target model, and determining a target recognition result corresponding to the original to-be-detected image according to the initial recognition results corresponding to the target to-be-detected images with different scales. According to the invention, the technical problem of poor trademark identification and positioning precision in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of target detection technology, and in particular, to a trademark recognition method, device, electronic device and non-volatile storage medium. Background Art

[0002] In today's highly competitive business world, the importance of product logos is self-evident. As the intellectual property representative of enterprises and brands, how to avoid malicious use and plagiarism of product logos, thereby reducing corporate intellectual property risks and financial losses, has become an important issue faced by companies in recent years.

[0003] The accuracy of trademark recognition directly determines whether the intellectual property rights of an enterprise are damaged, so the accuracy of trademark positioning and category recognition is very important. However, the trademark recognition methods in related technologies often only rely on single-scale feature extraction on the image and cannot fully reflect the characteristics of the image, resulting in technical problems such as poor precision and accuracy of trademark recognition results.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a trademark recognition method, device, electronic device and non-volatile storage medium to at least solve the technical problem of poor recognition and positioning accuracy of trademarks in related technologies.

[0006] According to one aspect of an embodiment of the present application, a trademark recognition method is provided, including: obtaining an original image to be detected, and performing multi-scale scaling on the image to be detected to obtain a plurality of target images to be detected of different scales; using a backbone network in a target model to perform feature extraction on the target image to be detected to obtain a first feature, wherein each network level in the backbone network corresponds to a first feature; using a neck network in the target model to fuse a plurality of first features extracted by the backbone network to obtain a fused feature, and using the backbone network to perform secondary feature extraction based on the fused feature to obtain a target feature; using a head network in the target model to determine an initial recognition result corresponding to the target image to be detected based on the target feature, and determining a target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

[0007] Optionally, the backbone network includes: a Swin-Transformer network, wherein the backbone network includes multiple network layers connected in sequence; using the backbone network in the target model, feature extraction is performed on the target image to be detected, and obtaining the first feature includes: dividing the target image to be detected into multiple image blocks, and linearly embedding the image blocks into a high-dimensional vector space to obtain a vector representation corresponding to the target image to be detected; in each network layer in the backbone network, according to the vector representation corresponding to the target image to be detected, determining a feature map corresponding to the target image to be detected, and determining the feature map as the first feature, wherein the resolution and number of channels corresponding to the first feature determined by different network layers are different.

[0008] Optionally, the neck network includes: a feature pyramid network; the head network includes: a dual-head cascade convolutional neural network 2Head Cascade-RCNN detection head; the neck network in the target model is used to fuse multiple first features extracted by the backbone network to obtain fused features, including: using a feature pyramid network to perform multi-scale fusion of first features corresponding to each network level of the backbone network through upsampling and downsampling operations to obtain fused features; using the head network in the target model to determine the initial recognition result corresponding to the target image to be detected based on the target features, including: using the region proposal network in the head network to determine the preliminary candidate region in the target image to be detected based on the target features; using the first detection head to perform bounding box prediction on the preliminary candidate region to obtain a target box, wherein the target box is used to frame the region where the trademark is located in the preliminary candidate region; using the second detection head to determine the trademark category corresponding to the trademark in the preliminary candidate region; determining the initial recognition result based on the target box and the trademark category.

[0009] Optionally, determining the target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales includes: determining the target frame information and trademark category corresponding to the trademark in the target images to be detected of different scales, as well as the first confidence corresponding to the target frame and the second confidence corresponding to the trademark category based on the initial recognition result, wherein the target frame information includes at least one of the following: coordinate position and size, the first confidence is used to characterize the credibility of the target frame, and the second confidence is used to characterize the credibility of the trademark in the target image to be detected as each trademark category; determining the fusion weight corresponding to each target frame based on the first confidence, and fusing the target frames corresponding to each initial recognition result based on the fusion weight to obtain a final fused target frame; determining the average value of the second confidence of the trademark category corresponding to the trademark in the target image to be detected in each initial recognition result, and determining the trademark category with the largest average value as the target trademark category corresponding to the trademark in the target image to be detected; determining the target recognition result based on the fused target frame and the target trademark category.

[0010] Optionally, the training step of the target model includes: obtaining an initial training data set, wherein the initial training data set contains: multiple training images, and label information corresponding to the training images, the label information is used to characterize the location information and trademark category of the trademark contained in the training images; performing data enhancement processing on the training images in the initial training data set to obtain a target training data set, wherein the data enhancement processing is used to increase the diversity of the training images in the initial training data set; and training the initial model based on the initial training data set to obtain a target model.

[0011] Optionally, performing data enhancement processing on the training images in the initial training data set includes: normalizing the pixel value of each point in the training image, and adjusting the image size of the normalized training image, wherein the image sizes of the training images after size adjustment are the same; randomly selecting any two training images, and determining a mixing coefficient, wherein the mixing coefficient is used to determine a mixing ratio of the two training images; performing linear interpolation on the two selected training images based on the mixing coefficient to obtain a first image, and determining a first label corresponding to the first image based on the label information corresponding to the two selected training images; and adding the first image and the first label to the initial training data set.

[0012] Optionally, performing data enhancement processing on the training images in the initial training data set further includes: randomly selecting a first enhancement operation to process the training image according to a first probability corresponding to each first enhancement operation, wherein the first enhancement operation includes: randomly selecting a scaling operation, a scaling-then-cropping operation, and a random horizontal flipping operation, the randomly selected scaling operation is used to randomly select a scaling factor to adjust the size of the training image, the scaling-then-cropping operation is used to first adjust the size of the training image and then crop the training image, and the random horizontal flipping operation is used to horizontally flip the training image; and / or, according to a second probability corresponding to each second enhancement operation, randomly selecting a scaling operation to randomly select a scaling factor to adjust the size of the training image, the scaling-then-cropping operation is used to first adjust the size of the training image and then crop the training image, and the random horizontal flipping operation is used to horizontally flip the training image; The machine selects a second enhancement operation to process the training image, wherein the second enhancement operation includes: a mask enhancement operation, a rotation and annotation box adjustment operation, and an annotation box masking operation. The mask enhancement operation is used to randomly select an area in the training image and set the pixel value in the area to zero. The rotation and annotation box adjustment operation is used to randomly rotate the training image and adjust the label information corresponding to the training image so that the annotation box corresponding to the position information represented by the training image can correctly select the trademark in the rotated training image. The annotation box masking operation is used to randomly select an area in the annotation box of the training image and set the pixel value in the area to zero.

[0013] According to another aspect of the embodiment of the present application, a trademark recognition device is also provided, including: an image acquisition enhancement module, used to acquire an original image to be detected, and perform multi-scale scaling on the image to be detected to obtain a plurality of target images to be detected of different scales; a first feature extraction module, used to use a backbone network in a target model to perform feature extraction on the target image to be detected to obtain a first feature, wherein each network level in the backbone network corresponds to a first feature; a second feature extraction module, used to use a neck network in a target model to fuse a plurality of first features extracted by the backbone network to obtain a fused feature, and use the backbone network to perform secondary feature extraction based on the fused feature to obtain a target feature; a trademark information recognition module, used to use a head network in a target model to determine an initial recognition result corresponding to the target image to be detected based on the target feature, and determine a target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

[0014] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the trademark recognition method is executed when the program is run.

[0015] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, wherein the non-volatile storage medium includes a stored computer program, wherein a device where the non-volatile storage medium is located executes the trademark recognition method by running the computer program.

[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which implements the steps of the trademark recognition method when the computer program is executed by a processor.

[0017] In an embodiment of the present application, an original image to be detected is obtained, and the image to be detected is scaled at multiple scales to obtain target images to be detected at multiple scales; a backbone network in a target model is used to extract features of the target image to be detected to obtain a first feature, wherein each network level in the backbone network corresponds to a first feature; a neck network in the target model is used to fuse multiple first features extracted by the backbone network to obtain a fused feature, and the backbone network is used to perform secondary feature extraction based on the fused feature to obtain a target feature; a head network in the target model is used to determine an initial recognition result corresponding to the target image to be detected based on the target feature, and a target recognition result corresponding to the original image to be detected is determined based on the initial recognition results corresponding to the target images to be detected at multiple scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected. By designing an exclusive detection model and performing multi-scale feature extraction and fusion, the purpose of improving the positioning and recognition accuracy of the product logo is achieved, thereby solving the technical problem of poor recognition and positioning accuracy of the trademark in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 It is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a method for trademark recognition provided in an embodiment of the present application;

[0020] Figure 2 is a schematic diagram of a trademark identification method flow provided according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of the architecture of a post-processing module provided according to an embodiment of the present application;

[0022] Figure 4 It is a schematic diagram of the architecture of a commodity identification recognition model provided according to an embodiment of the present application;

[0023] Figure 5 It is a schematic diagram of a Cascade-rcnn architecture comparison provided according to an embodiment of the present application;

[0024] Figure 6 It is a schematic diagram of a method flow for enhancing commodity identification data provided in accordance with an embodiment of the present application;

[0025] Figure 7 It is a structural schematic diagram of a trademark identification device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] In the relevant technologies, there are three mainstream technical solutions for the positioning and identification of product logos. These three solutions have solved the problem of trademark identification to a certain extent, but they are not satisfactory in some tasks, as follows.

[0029] The first is the combination of image engineering and machine learning algorithms. This type of solution usually uses image engineering to extract key features of the target image, and then classifies the features through a machine learning classification algorithm. Although this type of solution can identify product logos in images, it cannot accurately provide the location information of product logos. In addition, the accuracy of trademark recognition is affected by the developer's image engineering technology level and the classification algorithm effect, making it difficult to achieve end-to-end high-precision recognition.

[0030] The second type is based on computer vision image classification algorithm to realize the recognition of product identification category in the target image. With the help of the development of deep learning algorithm, this type of solution eliminates the manually designed feature engineering work and realizes end-to-end high-precision recognition of product identification. However, this solution still cannot accurately provide the precise location of the product identification, and when there are multiple product identifications in the target image, it is difficult to cope with.

[0031] The third type is feature localization and recognition based on target detection algorithms, which realizes end-to-end product logo localization and recognition. This type of solution has also become the mainstream solution in the industry. However, product logos are usually designed to be small and are mostly very small targets in the target image. Different product logos may have similar features, resulting in the mainstream target detection algorithms' positioning and recognition accuracy being far behind that of other tasks.

[0032] In order to solve the above problems, relevant solutions are provided in the embodiments of the present application. By constructing an exclusive data enhancement scheme for the product identification task, designing an exclusive detection model, and building an exclusive inference post-processing module, the positioning and recognition accuracy of the product identification is improved, which is described in detail below.

[0033] According to an embodiment of the present application, a method embodiment of trademark identification is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or electronic device) for implementing a trademark recognition method. Figure 1 As shown, the computer terminal 10 (or electronic device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0035] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or electronic device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the trademark recognition method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above-mentioned trademark recognition method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0037] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0038] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or electronic device).

[0039] In the above operating environment, the embodiment of the present application provides a trademark recognition method. Figure 2 is a schematic diagram of a trademark identification method flow according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0040] Step S202, obtaining an original image to be detected, and performing multi-scale scaling on the image to be detected to obtain a plurality of target images to be detected at different scales;

[0041] Step S204, using the backbone network in the target model to extract features of the target image to be detected, to obtain a first feature, wherein each network level in the backbone network corresponds to a first feature;

[0042] Step S206, using the neck network in the target model to fuse multiple first features extracted by the backbone network to obtain a fused feature, and using the backbone network to perform secondary feature extraction based on the fused feature to obtain a target feature;

[0043] Step S208, using the head network in the target model, based on the target features, determine the initial recognition result corresponding to the target image to be detected, and based on the initial recognition results corresponding to the target images to be detected of multiple different scales, determine the target recognition result corresponding to the original image to be detected, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

[0044] Through the above steps, by designing a dedicated detection model and performing multi-scale feature extraction and fusion, the purpose of improving the positioning and recognition accuracy of product logos is achieved, thereby solving the technical problem of poor recognition and positioning accuracy of trademarks in related technologies.

[0045] The following is a further introduction to the trademark recognition method in steps S202 to S208 of the embodiment of the present application.

[0046] First, the original image to be detected is obtained. In this embodiment, a dedicated inference post-processing module is designed for the commodity identification. The module can be used to perform multi-scale scaling on the original image to be detected. Specifically, Figure 3 As shown in FIG. 1 , the input original image to be detected is first normalized (Norm Load ann) to facilitate subsequent model processing, and then the image is rescaled (Rescale). For example, in Figure 3 In the process, the images are scaled to four different sizes: 640x640, 880x880, 1080x1080 and 1680x1680. Then, the target images to be detected of different scales obtained after scaling are input into the target model respectively, and the type and position of the product identification are predicted to obtain the initial recognition result (Predict) corresponding to each target image to be detected. Finally, the initial recognition results of the target images to be detected of different scales can be averaged (Avg), and the average value is used as the final prediction result, that is, the target recognition result.

[0047] The following introduces the processing flow of the target model for the target image to be detected after the target image to be detected is input into the target model.

[0048] In this embodiment, the architecture design of the target model fully applies the multi-stage concept from the backbone network (Backbone), the neck network (Neck), and the head network (Head) to achieve high-precision detection and positioning of product logos, which is described in detail below.

[0049] In some embodiments of the present application, a backbone network includes: a Swin-Transformer network, wherein the backbone network includes multiple network layers connected in sequence; using the backbone network in the target model, feature extraction is performed on the target image to be detected, and obtaining the first feature includes: dividing the target image to be detected into multiple image blocks, and linearly embedding the image blocks into a high-dimensional vector space to obtain a vector representation corresponding to the target image to be detected; in each network layer in the backbone network, according to the vector representation corresponding to the target image to be detected, determining a feature map corresponding to the target image to be detected, and determining the feature map as the first feature, wherein the resolution and number of channels corresponding to the first feature determined by different network layers are different.

[0050] Specifically, in the related art, models based on convolutional neural networks have achieved great success in computer vision tasks. In convolutional neural network models, fixed-size convolution kernels are usually used to downsample the input image. Fixed-size convolution kernels will cause the model to only perceive local features within a certain range, lacking perception of global features, making it difficult to further improve the model effect. In order to avoid the above problems, for the commodity identification detection scenario, the embodiment of the present application adopts the Swin-Transformer network as the backbone network of the target model, wherein the Swin Transformer retains the accuracy of the Transformer model while drawing on the idea of ​​the convolutional neural network convolution kernel, so that the MSA calculation amount is reduced from the full feature map to a fixed-size Window, greatly reducing the model calculation amount, and can effectively capture the local and global features of the image, improving the model's understanding of the features and detection accuracy.

[0051] Specifically, the process of using Swin Transformer to extract features from the target image to be detected is as follows: Figure 4As shown in the figure, first, the input target image to be detected is divided into patches (Patch Partition) to obtain multiple patches (Patch). This step is similar to the convolution operation in the convolutional neural network, and its purpose is to convert image information into processable features. Then, the image patch (Patch) is linearly embedded (Linear Embedding) to convert it into a high-dimensional feature vector to increase the representation ability of the model. In Swin Transformer, each stage (Stage 1 to Stage 4) contains Swin Transformer blocks of different network levels, which are used to gradually extract and transform the features of the image through the self-attention mechanism. In addition, at the end of each stage, the adjacent small patches are merged into a large patch through the Patch Merging operation to reduce the resolution of the feature map and increase the number of channels to provide more abstract features for the next layer. The feature map (i.e., the first feature) output at each stage (network level) has different resolutions and channels, which is suitable for detecting targets of different sizes.

[0052] Afterwards, the neck network in the target model is used to fuse multiple first features extracted by the backbone network. The specific steps are as follows.

[0053] In some embodiments of the present application, the neck network includes: a feature pyramid network; using the neck network in the target model, a plurality of first features extracted by the backbone network are fused to obtain fused features, and the fused features include the following steps: using the feature pyramid network, through upsampling and downsampling operations, the first features corresponding to each network level of the backbone network are multi-scale fused to obtain fused features.

[0054] Specifically, in the neck network, the embodiment of the present application adopts a feature pyramid network (FPN) structure to fuse multiple first features (i.e., feature maps at different levels) extracted by the backbone network to obtain fused features. This step integrates feature information from different levels through upsampling and downsampling operations to form a multi-scale feature representation.

[0055] Further, in the present application, the following embodiments are adopted: Figure 4The Logo RSDetector architecture shown in the figure sends the FPN multi-stage fusion features to the backbone network again in layers for secondary feature learning and fusion, and fuses across stages to obtain the final target features, realizing multi-stage feature learning, and greatly improving the recognition and positioning accuracy of small target tasks such as commodity identification. Among them, cross-stage fusion involves integrating features of different levels, and the feature maps extracted at each level (stage) have different resolutions and receptive fields. The feature maps of lower levels (such as Stage 1) have higher resolutions and are suitable for detecting small targets; the feature maps of higher levels (such as Stage 4) have lower resolutions and are suitable for detecting large targets. In the related art, commonly used detection models usually call the Stage 1, Stage 2, Stage 3, and Stage 4 layer features in Backbone, and commodity identification is usually a small target. Therefore, the embodiment of the present application calls the stem (initial convolution layer), Stage 1, Stage 2, and Stage 3 layer features of Backbone. By selecting the features of these levels, the model can enhance the detection effect of small targets and better capture the detailed information of commodity identification, thereby improving the detection accuracy of commodity identification.

[0056] After obtaining the target features, the head network in the target model can be used to determine the initial recognition result corresponding to the target image to be detected based on the target features. The specific steps are as follows.

[0057] In some embodiments of the present application, the head network includes: a dual-head cascade convolutional neural network 2HeadCascade-RCNN detection head; using the head network in the target model, based on the target features, determining the initial recognition result corresponding to the target image to be detected includes the following steps: using the region proposal network in the head network, based on the target features, determining the preliminary candidate region in the target image to be detected; using the first detection head, performing bounding box prediction on the preliminary candidate region to obtain a target box, wherein the target box is used to frame the region where the trademark is located in the preliminary candidate region; using the second detection head to determine the trademark category corresponding to the trademark in the preliminary candidate region; determining the initial recognition result based on the target box and the trademark category.

[0058] In this embodiment, the head network of the target model can adopt the Cascade-RCNN multi-stage Head. At the same time, in order to further improve the accuracy of classification and positioning, this invention further optimizes the Head. On the basis of Cascade-RCNN, a 2Head-Cascade-RCNN detection head is designed to separate the classification and positioning Head, further deepen the multi-stage idea, and the specific architecture optimization is as follows: Figure 5As shown in the figure, by splitting the shared Head in Cascade-RCNN into BHead (first detection head) and CHead (second detection head), the separate prediction of classification and positioning is achieved, and the refined prediction of product identification is achieved.

[0059] Specifically, Figure 5 As shown, the Region Proposal Network (RPN) generates a series of preliminary candidate regions (Region Proposals) based on the target features, which may contain trademarks; in this embodiment, the 2Head-Cascade-RCNN detection head uses multiple cascaded detectors, each detector is optimized based on the previous one, and this cascade method allows the model to gradually improve the accuracy of prediction. Each cascade stage contains two independent heads, one focusing on the classification task and the other focusing on bounding box regression.

[0060] For example, in the first stage, the preliminary candidate regions generated by RPN are pooled and sent to BHead1 and CHead1 for bounding box regression and classification prediction. The subsequent stages (such as the second and third stages) will generate more accurate candidate regions through RPN based on the output of the previous stage. These regions are also pooled and sent to the corresponding BHead (such as BHead2, BHead3) and CHead (such as CHead2, CHead3) for further bounding box regression and classification prediction. Through the cascade structure, the BHead and CHead of each stage are optimized on the basis of the previous stage, gradually improving the accuracy of the prediction and realizing the refined prediction of the product identification. After all the cascade stages, the final classification and positioning results (i.e., the initial recognition results) are obtained. These results include the location (bounding box) and category of the trademark.

[0061] After obtaining initial recognition results corresponding to a plurality of target images to be detected at different scales, the initial recognition results of the target images to be detected at different scales may be averaged to determine the target recognition result. The specific steps are as follows.

[0062] In some embodiments of the present application, determining the target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales includes the following steps: determining the target frame information and the trademark category corresponding to the trademark in the target images to be detected of different scales, as well as the first confidence corresponding to the target frame and the second confidence corresponding to the trademark category based on the initial recognition result, wherein the target frame information includes at least one of the following: coordinate position and size, the first confidence is used to characterize the credibility of the target frame, and the second confidence is used to characterize the credibility of the trademark in the target image to be detected as each trademark category; determining the fusion weight corresponding to each target frame based on the first confidence, and fusing the target frames corresponding to each initial recognition result based on the fusion weight to obtain a final fused target frame; determining the average value of the second confidence of the trademark category corresponding to the trademark in the target image to be detected in each initial recognition result, and determining the trademark category with the largest average value as the target trademark category corresponding to the trademark in the target image to be detected; determining the target recognition result based on the fused target frame and the target trademark category.

[0063] On the other hand, in order to address the problems existing in the commodity identification task, such as the difficulty in collecting training data for commodity identification, the small area of ​​commodity identification, the single commodity identification, and the problem that during reasoning, the commodity identification of the detection object usually has a series of interferences such as occlusion, distortion, color change, etc., which leads to model overfitting or weak generalization and affects the recognition accuracy, the embodiment of the present application designs a commodity identification-specific data enhancement scheme during the training process of the above-mentioned target model. The training process of the target model is further introduced below.

[0064] In some embodiments of the present application, the training step of the target model includes: obtaining an initial training data set, wherein the initial training data set contains: multiple training images, and label information corresponding to the training images, the label information is used to characterize the location information and trademark category of the trademark contained in the training images; performing data enhancement processing on the training images in the initial training data set to obtain a target training data set, wherein the data enhancement processing is used to increase the diversity of the training images in the initial training data set; based on the initial training data set, training the initial model to obtain a target model.

[0065] Among them, the data enhancement processing of the training images in the initial training data set includes: data formatting processing, MixUp, AutoAugment, PPAutoAugment and other processes, such as Figure 6 As shown, the details are as follows.

[0066] In some embodiments of the present application, data enhancement processing of training images in an initial training data set includes the following steps: normalizing the pixel value of each point in the training image, and adjusting the image size of the normalized training image, wherein the image sizes of the training images after size adjustment are the same; randomly selecting any two training images, and determining a mixing coefficient, wherein the mixing coefficient is used to determine a mixing ratio of the two training images; based on the mixing coefficient, linearly interpolating the two selected training images to obtain a first image, and determining a first label corresponding to the first image based on the label information corresponding to the two selected training images; and adding the first image and the first label to the initial training data set.

[0067] Specifically, the training images are formatted, including but not limited to: normalization so that the pixel values ​​are distributed in a standard range, such as 0 to 1, which helps the stability and convergence speed of model training. In addition, the training images are adjusted to the input size required by the model to ensure that the model can receive input of uniform size.

[0068] Then, the training images can be enhanced by MixUp. Based on the characteristics of the product identification dataset, MixUp data enhancement is used to increase the diversity of the original samples, thereby improving the generalization of the model. The mathematical expression of MixUp is as follows:

[0069]

[0070] Among them, (x i ,y i ), (x j ,y j ) are two training images randomly selected from the input data, σ is a hyperparameter (mixing coefficient), and in this embodiment, σ=0.6.

[0071] In addition, the training image may be enhanced by AutoAugment (first enhancement operation) and PPAutoAugment (second enhancement operation), and the specific steps are as follows.

[0072] In some embodiments of the present application, performing data enhancement processing on the training images in the initial training data set further includes the following steps: randomly selecting a first enhancement operation to process the training image according to a first probability corresponding to each first enhancement operation, wherein the first enhancement operation includes: randomly selecting a scaling operation, a scaling-then-cropping operation, and a random horizontal flipping operation, the randomly selected scaling operation is used to randomly select a scaling factor to adjust the size of the training image, the scaling-then-cropping operation is used to first adjust the size of the training image and then crop the training image, and the random horizontal flipping operation is used to horizontally flip the training image; and / or, according to the first probability corresponding to each second enhancement operation a second probability, randomly selecting a second enhancement operation to process the training image, wherein the second enhancement operation includes: a mask enhancement operation, a rotation and annotation box adjustment operation, and an annotation box masking operation. The mask enhancement operation is used to randomly select an area in the training image and set the pixel values ​​in the area to zero. The rotation and annotation box adjustment operation is used to randomly rotate the training image and adjust the label information corresponding to the training image so that the annotation box corresponding to the position information represented by the training image can correctly select the trademark in the rotated training image. The annotation box masking operation is used to randomly select an area in the annotation box of the training image and set the pixel values ​​in the area to zero.

[0073] Specifically, in this embodiment, the AutoAugment enhancement operation includes three enhancement methods: random selection of scaling operation (ChoiceResize), scaling followed by cropping operation (ResizeCrop), and random horizontal flipping operation (RandomFlip). For the training image, the enhancement method will be randomly called according to the enhancement probability p (that is, the first probability mentioned above), and the training data passing through this module will be randomly scaled and flipped.

[0074] The embodiment of the present application changes the traditional data pipeline enhancement to parallel random enhancement. The samples are selectively enhanced according to the enhancement method and probability defined in AutoAugment, which avoids the pipeline redundant processing process while ensuring the effect of data enhancement, simulating different visual changes, and improving the diversity of training data.

[0075] In this embodiment, the PPAutoAugment enhancement operation includes: 1) Cutout: randomly select an area in the image and set its pixel value to zero with a probability of 0.2 to simulate the occlusion effect; 2) Rotate and adjust the annotation box (Rotate_BBox): randomly rotate the image and adjust the annotation box to match the rotated image with a probability of 0.2 to simulate the rotation change of the product logo; 3) Cutout in the annotation box (BBox_Cutout): randomly select an area in the annotation box and set its pixel value to zero with a probability of 0.2. For example, assuming that the position of the image logo in the image is left_top (x i ,y i ), right_down(x j ,y j ), and randomly selects τ·(x j -x i ), τ·(y j -y i ) is set to 0, where τ = 0.3, simulating the size of the product logo occlusion range.

[0076] In the embodiment of the present application, PPAutoAugment is developed based on common problems in product identification reasoning, such as occlusion, distortion, lighting, etc., and the reasoning situation is simulated through methods such as BBox_cutout, which significantly improves the reasoning performance.

[0077] This application scheme can effectively improve the accuracy and robustness of trademark detection through multi-scale scaling and hierarchical feature extraction and fusion of deep learning models, especially when dealing with trademarks of different sizes and complex backgrounds. In practical applications, it can significantly improve the accuracy of trademark recognition, reduce misidentification and missed recognition, and improve overall recognition efficiency. It is suitable for a variety of scenarios such as trademark infringement detection, brand monitoring, market analysis, etc., and can provide strong technical support for intellectual property protection, brand management, etc., and has broad application prospects and value.

[0078] According to an embodiment of the present application, an embodiment of a trademark recognition device is also provided. Figure 7 Schematic diagram of a trademark identification device provided according to an embodiment of the present application. Figure 7 As shown, the device comprises:

[0079] The image acquisition enhancement module 70 is used to acquire the original image to be detected and perform multi-scale scaling on the image to be detected to obtain multiple target images to be detected at different scales;

[0080] A first feature extraction module 72 is used to extract features of the target image to be detected using the backbone network in the target model to obtain a first feature, wherein each network level in the backbone network corresponds to a first feature;

[0081] The second feature extraction module 74 is used to use the neck network in the target model to fuse multiple first features extracted by the backbone network to obtain a fused feature, and use the backbone network to perform secondary feature extraction based on the fused feature to obtain a target feature;

[0082] The trademark information recognition module 76 is used to use the head network in the target model to determine the initial recognition result corresponding to the target image to be detected based on the target characteristics, and to determine the target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to multiple target images to be detected of different scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

[0083] Optionally, the backbone network includes: a Swin-Transformer network, wherein the backbone network includes multiple network layers connected in sequence; using the backbone network in the target model, feature extraction is performed on the target image to be detected, and obtaining the first feature includes: dividing the target image to be detected into multiple image blocks, and linearly embedding the image blocks into a high-dimensional vector space to obtain a vector representation corresponding to the target image to be detected; in each network layer in the backbone network, according to the vector representation corresponding to the target image to be detected, determining a feature map corresponding to the target image to be detected, and determining the feature map as the first feature, wherein the resolution and number of channels corresponding to the first feature determined by different network layers are different.

[0084] Optionally, the neck network includes: a feature pyramid network; the head network includes: a dual-head cascade convolutional neural network 2Head Cascade-RCNN detection head; the neck network in the target model is used to fuse multiple first features extracted by the backbone network to obtain fused features, including: using a feature pyramid network to perform multi-scale fusion of first features corresponding to each network level of the backbone network through upsampling and downsampling operations to obtain fused features; using the head network in the target model to determine the initial recognition result corresponding to the target image to be detected based on the target features, including: using the region proposal network in the head network to determine the preliminary candidate region in the target image to be detected based on the target features; using the first detection head to perform bounding box prediction on the preliminary candidate region to obtain a target box, wherein the target box is used to frame the region where the trademark is located in the preliminary candidate region; using the second detection head to determine the trademark category corresponding to the trademark in the preliminary candidate region; determining the initial recognition result based on the target box and the trademark category.

[0085] Optionally, determining the target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales includes: determining the target frame information and trademark category corresponding to the trademark in the target images to be detected of different scales, as well as the first confidence corresponding to the target frame and the second confidence corresponding to the trademark category based on the initial recognition result, wherein the target frame information includes at least one of the following: coordinate position and size, the first confidence is used to characterize the credibility of the target frame, and the second confidence is used to characterize the credibility of the trademark in the target image to be detected as each trademark category; determining the fusion weight corresponding to each target frame based on the first confidence, and fusing the target frames corresponding to each initial recognition result based on the fusion weight to obtain a final fused target frame; determining the average value of the second confidence of the trademark category corresponding to the trademark in the target image to be detected in each initial recognition result, and determining the trademark category with the largest average value as the target trademark category corresponding to the trademark in the target image to be detected; determining the target recognition result based on the fused target frame and the target trademark category.

[0086] Optionally, the training step of the target model includes: obtaining an initial training data set, wherein the initial training data set contains: multiple training images, and label information corresponding to the training images, the label information is used to characterize the location information and trademark category of the trademark contained in the training images; performing data enhancement processing on the training images in the initial training data set to obtain a target training data set, wherein the data enhancement processing is used to increase the diversity of the training images in the initial training data set; and training the initial model based on the initial training data set to obtain a target model.

[0087] Optionally, performing data enhancement processing on the training images in the initial training data set includes: normalizing the pixel value of each point in the training image, and adjusting the image size of the normalized training image, wherein the image sizes of the training images after size adjustment are the same; randomly selecting any two training images, and determining a mixing coefficient, wherein the mixing coefficient is used to determine a mixing ratio of the two training images; performing linear interpolation on the two selected training images based on the mixing coefficient to obtain a first image, and determining a first label corresponding to the first image based on the label information corresponding to the two selected training images; and adding the first image and the first label to the initial training data set.

[0088] Optionally, performing data enhancement processing on the training images in the initial training data set further includes: randomly selecting a first enhancement operation to process the training image according to a first probability corresponding to each first enhancement operation, wherein the first enhancement operation includes: randomly selecting a scaling operation, a scaling-then-cropping operation, and a random horizontal flipping operation, the randomly selected scaling operation is used to randomly select a scaling factor to adjust the size of the training image, the scaling-then-cropping operation is used to first adjust the size of the training image and then crop the training image, and the random horizontal flipping operation is used to horizontally flip the training image; and / or, according to a second probability corresponding to each second enhancement operation, randomly selecting a scaling operation to randomly select a scaling factor to adjust the size of the training image, the scaling-then-cropping operation is used to first adjust the size of the training image and then crop the training image, and the random horizontal flipping operation is used to horizontally flip the training image; The machine selects a second enhancement operation to process the training image, wherein the second enhancement operation includes: a mask enhancement operation, a rotation and annotation box adjustment operation, and an annotation box masking operation. The mask enhancement operation is used to randomly select an area in the training image and set the pixel value in the area to zero. The rotation and annotation box adjustment operation is used to randomly rotate the training image and adjust the label information corresponding to the training image so that the annotation box corresponding to the position information represented by the training image can correctly select the trademark in the rotated training image. The annotation box masking operation is used to randomly select an area in the annotation box of the training image and set the pixel value in the area to zero.

[0089] It should be noted that the various modules in the above-mentioned trademark identification device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0090] It should be noted that the trademark recognition device provided in this embodiment can be used to perform Figure 2 The trademark recognition method shown, therefore, the relevant explanations and instructions on the above-mentioned trademark recognition method are also applicable to the embodiments of the present application and will not be repeated here.

[0091] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following trademark recognition method by running the computer program: obtaining an original image to be detected, and performing multi-scale scaling on the image to be detected to obtain multiple target images to be detected of different scales; using a backbone network in a target model to extract features of the target image to be detected to obtain a first feature, wherein each network level in the backbone network corresponds to a first feature; using a neck network in the target model to fuse multiple first features extracted by the backbone network to obtain a fused feature, and using the backbone network to perform secondary feature extraction based on the fused feature to obtain a target feature; using a head network in the target model to determine an initial recognition result corresponding to the target image to be detected based on the target feature, and determining a target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

[0092] The embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the trademark recognition method described in each embodiment of the present application: obtaining an original image to be detected, and performing multi-scale scaling on the image to be detected to obtain multiple target images to be detected of different scales; using a backbone network in a target model to extract features of the target image to be detected to obtain a first feature, wherein each network level in the backbone network corresponds to a first feature; using a neck network in a target model to fuse multiple first features extracted by the backbone network to obtain a fused feature, and using the backbone network to perform secondary feature extraction based on the fused feature to obtain a target feature; using a head network in a target model to determine an initial recognition result corresponding to the target image to be detected based on the target feature, and determining a target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

[0093] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0094] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0095] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0097] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0098] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0099] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A trademark identification method, characterized in that: include: Acquire an original image to be detected, and perform multi-scale scaling on the image to be detected to obtain target images to be detected of multiple different scales; Using the backbone network in the target model, extracting features of the target image to be detected to obtain a first feature, wherein each network level in the backbone network corresponds to one first feature; Using the neck network in the target model, a plurality of the first features extracted by the backbone network are fused to obtain a fused feature, and using the backbone network, secondary feature extraction is performed based on the fused feature to obtain a target feature; The head network in the target model is used to determine the initial recognition result corresponding to the target image to be detected based on the target features, and the target recognition result corresponding to the original image to be detected is determined based on the initial recognition results corresponding to the target images to be detected of multiple different scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

2. The trademark recognition method according to claim 1, characterized in that: The backbone network includes: Swin-Transformer network, wherein the backbone network includes a plurality of network layers connected in sequence; the backbone network in the target model is used to extract features of the target image to be detected, and the first feature obtained includes: Dividing the target image to be detected into multiple image blocks, and linearly embedding the image blocks into a high-dimensional vector space to obtain a vector representation corresponding to the target image to be detected; In each of the network levels in the backbone network, a feature map corresponding to the target image to be detected is determined based on the vector representation corresponding to the target image to be detected, and the feature map is determined as the first feature, wherein the resolution and number of channels corresponding to the first feature determined in different network levels are different.

3. The trademark recognition method according to claim 2, characterized in that: The neck network includes: a feature pyramid network; the head network includes: a dual-head cascade convolutional neural network 2Head Cascade-RCNN detection head; Using the neck network in the target model to fuse the multiple first features extracted by the backbone network to obtain the fused features includes: using a feature pyramid network to perform multi-scale fusion of the first features corresponding to each of the network levels of the backbone network through upsampling and downsampling operations to obtain the fused features; Using the head network in the target model to determine the initial recognition result corresponding to the target image to be detected based on the target features includes: using the region proposal network in the head network to determine the preliminary candidate region in the target image to be detected based on the target features; using the first detection head to perform bounding box prediction on the preliminary candidate region to obtain a target box, wherein the target box is used to select the region where the trademark is located in the preliminary candidate region; using the second detection head to determine the trademark category corresponding to the trademark in the preliminary candidate region; and determining the initial recognition result based on the target box and the trademark category.

4. The trademark recognition method according to claim 3, characterized in that: Determining the target recognition result corresponding to the original image to be detected according to the initial recognition results respectively corresponding to the target images to be detected of multiple different scales includes: According to the initial recognition result, determine the target frame information and trademark category corresponding to the trademark in the target to be detected image of different scales, as well as a first confidence corresponding to the target frame and a second confidence corresponding to the trademark category, wherein the target frame information includes at least one of the following: coordinate position and size, the first confidence is used to characterize the credibility of the target frame, and the second confidence is used to characterize the credibility of the trademark in the target to be detected image for each of the trademark categories; Determining, according to the first confidence level, a fusion weight corresponding to each of the target frames, and fusing, according to the fusion weight, the target frames corresponding to each of the initial recognition results to obtain a final fused target frame; Determine an average value of the second confidences of the trademark categories corresponding to the trademarks in the target to-be-detected images in each of the initial recognition results, and determine the trademark category with the largest average value as the target trademark category corresponding to the trademark in the target to-be-detected images; The target recognition result is determined according to the fused target frame and the target trademark category.

5. The trademark recognition method according to claim 1, characterized in that: The training steps of the target model include: Acquire an initial training data set, wherein the initial training data set includes: a plurality of training images, and label information corresponding to the training images, wherein the label information is used to represent the position information and the trademark category of the trademark contained in the training images; Performing data enhancement processing on the training images in the initial training data set to obtain a target training data set, wherein the data enhancement processing is used to increase the diversity of the training images in the initial training data set; The initial model is trained based on the initial training data set to obtain the target model.

6. The trademark recognition method according to claim 5, characterized in that: Performing data enhancement processing on the training images in the initial training data set includes: Normalizing the pixel value of each point in the training image, and adjusting the image size of the normalized training image, wherein the image sizes of the training images after the size adjustment are the same; Randomly selecting any two of the training images and determining a mixing coefficient, wherein the mixing coefficient is used to determine a mixing ratio of the two training images; According to the mixing coefficient, linear interpolation is performed on the two selected training images to obtain a first image, and according to the label information corresponding to the two selected training images, a first label corresponding to the first image is determined; The first image and the first label are added to the initial training dataset.

7. The trademark recognition method according to claim 6, characterized in that: Performing data enhancement processing on the training images in the initial training data set also includes: According to a first probability corresponding to each first enhancement operation, randomly selecting one of the first enhancement operations to process the training image, wherein the first enhancement operation includes: randomly selecting a scaling operation, a scaling-before-cropping operation, and a random horizontal flipping operation, wherein the randomly selected scaling operation is used to randomly select a scaling factor to adjust the size of the training image, the scaling-before-cropping operation is used to first adjust the size of the training image and then crop the training image, and the random horizontal flipping operation is used to horizontally flip the training image; And / or, according to the second probability corresponding to each second enhancement operation, randomly select one of the second enhancement operations to process the training image, wherein the second enhancement operation includes: a masking enhancement operation, a rotation and annotation box adjustment operation, and an annotation box masking operation, the masking enhancement operation is used to randomly select an area in the training image and set the pixel values ​​in the area to zero, the rotation and annotation box adjustment operation is used to randomly rotate the training image and adjust the label information corresponding to the training image so that the annotation box corresponding to the position information represented by the training image can correctly frame the trademark in the rotated training image, and the annotation box masking operation is used to randomly select an area in the annotation box of the training image and set the pixel values ​​in the area to zero.

8. A trademark identification device, characterized in that: include: An image acquisition enhancement module is used to acquire an original image to be detected and perform multi-scale scaling on the image to be detected to obtain target images to be detected of multiple different scales; A first feature extraction module, configured to extract features of the target image to be detected by using a backbone network in the target model to obtain a first feature, wherein each network level in the backbone network corresponds to one first feature; A second feature extraction module is used to use the neck network in the target model to fuse the multiple first features extracted by the backbone network to obtain a fused feature, and use the backbone network to perform secondary feature extraction based on the fused feature to obtain a target feature; The trademark information recognition module is used to use the head network in the target model to determine the initial recognition result corresponding to the target image to be detected based on the target features, and determine the target recognition result corresponding to the original image to be detected based on the initial recognition results corresponding to the target images to be detected of multiple different scales, wherein the target recognition result is used to characterize the position information and trademark category of the trademark contained in the original image to be detected.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the trademark recognition method according to any one of claims 1 to 7 when running.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the trademark recognition method according to any one of claims 1 to 7 by running the computer program.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the trademark recognition method according to any one of claims 1 to 7 are implemented.