Trademark image authenticity identification method and device, electronic equipment and storage medium

By extracting the key feature regions and feature vectors of trademark images, combining the prototype template feature set, the similarity of trademark images is calculated for authenticity identification, which solves the problems of limited positioning accuracy and high calculation cost in the existing technology, and improves the identification efficiency and accuracy.

CN119478453AInactive Publication Date: 2025-02-18CNTC HUBEI PROVINCIAL TOBACCO CORP
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411591258.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has problems of limited positioning accuracy and high calculation cost in authenticity identification of trademark images, which affects the accuracy and efficiency of identification.

Method used

By determining the key feature areas of the target trademark image and the original trademark image, extracting the feature vectors, generating the target feature vectors and the original feature vectors, and determining the prototype template feature set based on the original feature vectors and mean values, calculating the between the target trademark image and the original trademark image. The similarity is authentic and false.

Benefits of technology

It improves the efficiency and accuracy of authenticity identification of trademark images, provides an efficient and simple operation method, integrating deep learning models, intelligent recognition of key feature regions, and optimization algorithms to calculate the similarity between feature vectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478453A_ABST
    Figure CN119478453A_ABST
Patent Text Reader

Abstract

The invention discloses a trademark image authenticity identification method and device, electronic equipment and a storage medium, and belongs to the technical field of image recognition, and the method comprises the steps: determining key feature regions of a target trademark image and an original trademark image; extracting feature vectors of key feature regions of the target trademark image and the original trademark image, and generating a target feature vector and an original feature vector; determining a prototype template feature set according to the original edition feature vectors of the original edition trademark image and the mean value of the original edition feature vectors; and determining the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set, and carrying out authenticity identification on the target trademark image according to the similarity. According to the invention, the authenticity of the target trademark is identified by extracting the feature vector of the key region of the target trademark image and calculating the similarity between the feature vector of the key feature region of the target trademark image and the original feature vector in the corresponding prototype template feature set, so that the authenticity identification efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a method, device, electronic equipment and storage medium for identifying the authenticity of a trademark image. Background Art

[0002] In the crackdown on the illegal production and sale of counterfeit cigarettes, the first step is to conduct a preliminary sensory identification of the trademark paper without destroying the packaging of the inspection sample. This task is large and arduous. For monopoly inspectors, accurate identification of authenticity not only tests personal visual acuity, color discrimination and the ability to maintain continuous concentration, but also requires the accumulation of professional knowledge.

[0003] In the prior art, the representative algorithms for deep learning-based target detection include the YOLO series target detection algorithm model and the ResNet series classification algorithm model. Domestic scholars Wei Zhonghua and Wen Yudong proposed a cigarette authenticity determination method based on SVM neural network and a cigarette packaging authenticity intelligent identification APP system based on YOLOv5, which achieved a high identification accuracy rate. However, the YOLO series algorithm divides the image into grids, and each grid may not accurately capture all the features of small objects or dense objects, resulting in limited positioning accuracy. The ResNet series classification algorithm has high computational cost and limited generalization ability, which will affect the accuracy and efficiency of trademark image authenticity identification.

[0004] Therefore, there is an urgent need for a method for identifying the authenticity of trademarks, which can extract features from trademark images and calculate the similarity between their features and the features of prototype templates to identify the authenticity of trademarks, thereby improving the efficiency and accuracy of identification. Summary of the invention

[0005] In view of this, it is necessary to provide a trademark authenticity identification method, device, electronic device and storage medium, which can extract features of trademark images, calculate the similarity between their features and prototype template features to identify the authenticity of the trademark, and improve the efficiency and accuracy of identification.

[0006] In order to solve the above technical problems, on the one hand, the present invention provides a method for identifying the authenticity of a trademark, comprising: Determine the key feature areas of the target trademark image and the original trademark image; Extracting feature vectors of key feature areas of the target trademark image and the original trademark image to generate a target feature vector and an original feature vector; Determining a prototype template feature set according to the original feature vector of the original trademark image and the mean value of the original feature vector; The similarity between the target trademark image and the original trademark image is determined according to the target feature vector and the prototype template feature set, and the authenticity of the target trademark image is identified according to the similarity.

[0007] In one possible implementation, determining key feature areas of the target trademark image and the original trademark image includes: Determine the location and size of the historical original trademark image and its corresponding key feature area; Based on the target detection algorithm, an initial region detection model is constructed, and according to the historical original trademark image and the position and size of the corresponding key feature region, the initial region detection model is iteratively trained to obtain a fully trained target region detection model; Based on the target region detection model, identifying the key feature region of the target trademark image, and cropping and extracting the key feature region to generate a target key feature region; Based on the target area detection model, the key feature area of ​​the original trademark image is identified, and the key feature area is cropped and extracted to generate the original key feature area.

[0008] In a possible implementation, extracting feature vectors of key feature areas of the target trademark image and the original trademark image to generate a target feature vector and an original feature vector includes: Based on the Resnet classification algorithm and classification contrast loss function, a feature extraction model is constructed; Normalizing the key feature regions of the target trademark image and the original trademark image to generate an expected target key feature region and an expected original key feature region; Based on the feature extraction model, determining the feature vector of the expected target key feature area, and generating a target feature vector; Based on the feature extraction model, a feature vector of the expected original key feature area is determined to generate an original feature vector.

[0009] In a possible implementation, determining a prototype template feature set according to the original feature vector of the original trademark image and the mean of the original feature vector includes: Calculating the mean of the original feature vector to generate the initial prototype template feature set; Constructing an original feature loss function according to the original feature vector and the initial prototype template feature set; Based on the original feature loss function and the initial prototype template feature set, the prototype template feature set of each key feature area is determined according to the original feature vector.

[0010] In a possible implementation, determining the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set includes: Setting a threshold for the original key feature area corresponding to each original feature vector in the prototype template feature set to generate an original feature threshold; Obtaining an original feature vector of a key feature area corresponding to the target feature vector in the prototype template feature set, and determining it as a target prototype template feature vector; A trademark similarity calculation formula is constructed according to the number of the target key feature areas, the original feature threshold, the target feature vector and the target prototype template feature vector, and the similarity between the target trademark image and the original trademark image is determined based on the trademark similarity calculation formula.

[0011] In one possible implementation, the trademark similarity calculation formula is: , , in, is the similarity value, m is the number of target key feature areas, is the symbolic function, is the cosine similarity, is the feature vector of the mth target key feature area of ​​the target trademark image, is the prototype template feature vector corresponding to the mth target key feature area in the prototype template feature set, is the original feature threshold of the mth original key feature area.

[0012] In one possible implementation method, before confirming the key feature area of ​​the target trademark image, the following steps are included: Collect the target trademark image according to the preset data collection standard to generate an initial target trademark image; Based on a gradient algorithm, calculating the clarity of the initial trademark image according to the edge gradient change of the initial target trademark image; The initial target trademark images whose clarity is higher than a preset threshold are screened out to generate target trademark images.

[0013] In a second aspect, the present invention further provides a trademark authenticity identification device, comprising: A feature region detection module is used to determine the key feature regions of the target trademark image and the original trademark image; A feature vector extraction module, used to extract feature vectors of key feature areas of the target trademark image and the original trademark image, and generate a target feature vector and an original feature vector; A prototype template feature set generation module, used to determine a prototype template feature set according to the original feature vector of the original trademark image and the mean of the original feature vector; The authenticity identification module is used to determine the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set, and to perform authenticity identification on the target trademark image according to the similarity.

[0014] In a third aspect, the present invention also provides an electronic device, comprising a memory and a processor, wherein the memory is used to store programs and data; the processor is coupled to the memory, and is used to execute the program stored in the memory to implement the trademark authenticity identification method as described above, and / or to implement the trademark authenticity identification as described above.

[0015] In a fourth aspect, the present invention further provides a computer storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the trademark authenticity identification method as described above.

[0016] The beneficial effects of the present invention are as follows: first, the key feature areas of the target trademark image and the original trademark image are determined; then, the feature vectors of the key feature areas of the target trademark image and the original trademark image are extracted to generate the target feature vector and the original feature vector; then, the prototype template feature set is determined according to the original feature vector of the original trademark image and the mean of the original feature vector; finally, the similarity between the target trademark image and the original trademark image is determined according to the target feature vector and the prototype template feature set, and the target trademark image is authenticated according to the similarity. The present invention authenticates the target trademark by extracting the feature vector of the key area of ​​the target trademark image, calculating the similarity between the feature vector of the key feature area of ​​the target trademark image and the original feature vector in the corresponding prototype template feature set, and providing an efficient and easy-to-operate method for authenticating cigarette trademark images, which integrates the deep learning model, the intelligent recognition of the key feature area, and the optimization algorithm to calculate the similarity between the feature vectors, thereby improving the efficiency and accuracy of authenticity authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for identifying the authenticity of a trademark provided by the present invention; Figure 2 For the present invention Figure 1 A schematic flow chart of an embodiment of step S101; Figure 3 For the present invention Figure 1A schematic diagram of a flow chart of an embodiment of step S102; Figure 4 For the present invention Figure 1 A schematic flow chart of a first embodiment of step S103; Figure 5 For the present invention Figure 1 A schematic diagram of a flow chart of a first embodiment of step S104; Figure 6 A relationship curve diagram of the authenticity identification accuracy rate when different original feature thresholds are set provided by the present invention; Figure 7 A schematic diagram of the process of collecting cigarette brand images provided by the present invention; Figure 8 The present invention provides a folding shooting box with a built-in light source and a standardized folding shooting bracket; Fig. 9 A schematic diagram of the structure of an embodiment of an electronic device for identifying the authenticity of a trademark provided by the present invention; Fig.10 A schematic diagram of the structure of an embodiment of the trademark authenticity identification storage medium provided by the present invention. DETAILED DESCRIPTION

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

[0020] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0021] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.

[0022] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0023] The present invention provides a trademark authenticity identification method, device, electronic device and storage medium, which are described below respectively.

[0024] Figure 1 A schematic flow chart of an embodiment of the method for identifying the authenticity of a trademark provided by the present invention is shown in FIG. Figure 1 As shown, the methods for identifying the authenticity of trademarks include: S101, determining key feature areas of the target trademark image and the original trademark image; S102, extracting feature vectors of key feature areas of the target trademark image and the original trademark image, and generating a target feature vector and an original feature vector; S103, determining a prototype template feature set according to the original feature vector of the original trademark image and the mean value of the original feature vector; S104: Determine the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set, and authenticate the target trademark image according to the similarity.

[0025] It should be noted that the trademark image is an anti-counterfeiting trademark containing the trademark pattern and text of the cigarette product. The trademarks of some products contain color-changing anti-counterfeiting trademark paper. When rotated to a specific angle, different levels of patterns can be seen. The trademark image also needs to contain image data of different angles and different levels of the color-changing anti-counterfeiting trademark paper. The trademark authenticity identification method of this embodiment is divided into two modules, including a detection module and an identification module. Among them, the detection module is the function of step S101. According to the unique personality characteristics of the outer packaging trademark paper of each specification, its feature area contains specific anti-counterfeiting marks and design elements. The identification of the feature area can significantly reduce the complexity of the algorithm and improve the identification accuracy. This module is based on target detection technology. The detection model for cigarette trademark paper features is constructed. The model can accurately locate the key feature areas in the photo and perform cropping and extraction to obtain the key feature areas of the trademark image, where each product image will have multiple key feature areas; the identification module is the function of steps S102, S103 and S104. By improving the ResNet network according to the needs of appearance identification, a classification and identification model suitable for cigarette products is innovatively constructed by combining the metric learning method and parameter-free classifier. The feature area image cropped in the detection stage is used as input, and the similarity between the target trademark feature and the prototype template is calculated, and compared with the preset threshold, and finally the identification result is output.

[0026] This embodiment extracts feature vectors of the key feature regions of the target trademark image and the original trademark image through the key feature regions of the target trademark image and the original trademark image, and generates a target feature vector and an original feature vector; determines a prototype template feature set according to the original feature vector of the original trademark image and the mean of the original feature vector; determines the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set, and performs authenticity identification on the target trademark image according to the similarity. The present invention extracts feature vectors of the key regions of the target trademark image, calculates the similarity between the feature vectors of the key feature regions of the target trademark image and the original feature vectors in the corresponding prototype template feature set, and performs authenticity identification on the target trademark, providing an efficient and easy-to-operate method for authenticity identification of cigarette trademark images, integrating a deep learning model, intelligent recognition of key feature regions, and an optimization algorithm to calculate the similarity between feature vectors, thereby improving the efficiency and accuracy of authenticity identification.

[0027] This embodiment extracts the feature vector of the key area of ​​the target trademark image, calculates the similarity between the feature vector of the key feature area of ​​the target trademark image and the original feature vector in the corresponding prototype template feature set, and authenticates the target trademark, thereby improving the efficiency and accuracy of authenticity authentication.

[0028] In some embodiments of the present invention, Figure 2 As shown, Figure 2 The present invention provides Figure 1 The flowchart of an embodiment of step S101 in the embodiment includes: S201, determining the position and size of the historical original trademark image and its corresponding key feature area; S202, constructing an initial region detection model based on a target detection algorithm, and iteratively training the initial region detection model according to the historical original trademark image and the position and size of the corresponding key feature region to obtain a fully trained target region detection model; S203: Based on the target region detection model, identify the key feature region of the original trademark image, and crop and extract the key feature region to generate the original key feature region.

[0029] It should be noted that this embodiment uses the lightweight YOLO-Fastest V2 target detection algorithm, which includes a backbone network, a multi-feature fusion network (FPN), and a subsequent processing module. The backbone network of YOLO-Fastest V2 uses an optimized CSPDarknet, which aims to improve the balance between detection speed and accuracy. The CSPDarknet network structure includes multiple stages, each of which is carefully designed to extract features of different scales. The first stage of the network is the preprocessing stage, which reduces the size of the input feature map to 1 / 4 of the original image through a 3×3 depth-separable convolution layer with a step size of 2 and a maximum pooling layer. The next few stages are composed of multiple optimized CSP (Cross Stage Partial Network) blocks. After each stage, the spatial size of the feature map will be halved, and the number of channels will increase accordingly. The CSP block adopts a partial channel separation design. For the input feature map, it is divided into two parts in the channel dimension. One part is directly subjected to identity mapping, and the other part is subjected to a series of convolution operations. Finally, the two parts are fused by channel splicing. The channel splicing operation in YOLO-Fastest V2 can not only effectively reduce element-level operations, but also achieve better information fusion. In addition, the model also introduces the Ghost Bottleneck structure to further reduce the amount of calculation; the multi-feature fusion network (FPN) structure contains two-way detection channels, which are responsible for processing the two different scales of feature maps extracted by the backbone network. The feature map of each scale is first adjusted by the 1×1 convolution layer for the number of channels, and then the corresponding category features and position information are generated by a special classification and regression module. The feature maps of different scales are effectively integrated through the above sampling and channel merging operations; in the subsequent processing module, the category information and bounding box data generated by FPN are received as input, and the final target detection is completed through further feature processing. There are two types of category information: one is used to distinguish between targets and backgrounds, and the other is used to identify specific key areas. Through multiple convolutional layers, these two types of category feature information and bounding box data are processed to obtain category features and position features. These features are then fed into the feature optimization module to accurately locate bounding boxes and assign key region categories to each box. Redundant boxes are removed using the non-maximum suppression (NMS) algorithm, resulting in accurate key region detection results. The final step is to crop the original image based on these detection results to extract all key regions.

[0030] This embodiment uses a target detection algorithm to construct a target area detection model to ensure high-precision positioning of key feature areas of commodity images, thereby providing accurate data basis for subsequent authenticity identification.

[0031] In some embodiments of the present invention, Figure 5 As shown, Figure 3 The present invention provides Figure 1 The flowchart of an embodiment of step S102 in the embodiment includes: S301. Construct a feature extraction model based on the Resnet classification algorithm and classification contrast loss function; S302, normalizing the key feature regions of the target trademark image and the original trademark image to generate an expected target key feature region and an expected original key feature region; S303, based on the feature extraction model, determining the feature vector of the expected target key feature area, and generating a target feature vector; S304: Based on the feature extraction model, determine the feature vector of the expected original key feature area and generate the original feature vector.

[0032] Specifically, this embodiment belongs to the feature extraction model submodule in the identification module. The input of the feature extraction model is the output of the target area detection model, that is, the key feature area image of the product image. When training the model, all product images of real cigarettes and fake cigarettes are collected as much as possible, and the product images of real cigarettes are used as positive samples, and the product images of fake cigarettes are used as negative samples. Through the target area detection model, the key feature area image of each product image is extracted to generate a training data set for the feature extraction model. The classification contrast loss function InfoNCE is used to iteratively train the feature extraction model. The calculation formula of the classification contrast loss function InfoNCE is: , in, is the classification contrast loss function value, is the feature vector of the key feature area of ​​the current product image to be detected, is the feature vector of all positive and negative samples, is the feature vector of the positive sample of the same type as the current product image to be detected, is the temperature coefficient used to adjust the output distribution, The larger the value, the smoother the output distribution. The smaller the value, the more concentrated the output distribution.

[0033] During the training process of the model, this embodiment selects multiple loss functions for comparison in order to select the optimal loss function. The specific experimental data are shown in Table 1 below. Table 1 is the comparison results of the models trained with different loss functions provided by the present invention. It can be seen that the accuracy, precision and recall rates of the classification contrast loss function InfoNCE are excellent. Because this embodiment uses the classification contrast loss function InfoNCE as the loss function and minimizes the classification contrast loss function as the goal, it continuously updates and adjusts the parameters of the feature extraction model so that the extracted feature vectors are closer to the feature vectors of the same type of samples and farther away from the feature vectors of different types of samples, so as to improve the performance of the model. The extracted feature vectors fully reflect the color features, texture features, shape features, spatial relationship features, position features and other information of the key feature area image.

[0034] Table 1 Comparison results of classification models trained with different losses

[0035] This embodiment iteratively trains the feature extraction model in the Resnet network through the classification contrast loss function InfoNCE, optimizes the effect of model feature extraction, and extracts feature vectors of key feature areas through the trained feature extraction model. These feature vectors fully reflect the various types of features in the key feature areas, provide accurate data basis for the comparison of similarity between images, and improve the accuracy of the model.

[0036] In some embodiments of the present invention, Figure 4 As shown, Figure 4 The present invention provides Figure 1 The flowchart of the first embodiment of step S103 in FIG. 1 includes: S401, calculating the mean of the original feature vector to generate an initial prototype template feature set of the original key feature area; S402, constructing an original feature loss function according to the original feature vector and the initial prototype template feature set; S403 , based on the original feature loss function and the initial prototype template feature set, and according to the original feature vector, determine the prototype template feature set of each key feature area.

[0037] Specifically, first, for all genuine cigarette product samples, original feature vectors are extracted in the feature extraction model. These feature vectors can capture important information in the product image so as to distinguish samples of different categories in the feature space. The mean of the feature vectors of all genuine cigarette product samples is solved, and the mean of the feature vector is set as the initial prototype template feature vector. The calculation formula of the feature vector mean is: , in, is the feature vector of the real cigarette product sample, is the mean of the feature vectors of all genuine cigarette product samples, is the number of samples of all genuine cigarette products; Then, the original feature loss function is constructed based on the cosine similarity. This loss function is defined to maximize the sum of all original feature vectors and the prototype template feature set. The original feature loss function is: , in, is the feature vector of the real cigarette product sample, is the mean of the feature vectors of all genuine cigarette product samples, is the number of samples of all genuine cigarette products; Finally, with the goal of minimizing the original feature loss function, the cosine similarity between each original feature vector and the initial prototype template feature vector is calculated, the gradient is calculated based on this cosine similarity, and the initial prototype template feature vector is updated using the gradient descent method or other optimization algorithms. After the update, the cosine similarity between the original feature vector and the prototype template feature vector is recalculated, and the prototype template feature vector is updated. The above steps are repeated until the stopping condition is reached, that is, the loss function converges or the maximum number of iterations is reached, and the final prototype template feature vector is obtained. The above processing is performed on all real cigarette product samples to generate the final prototype template feature set.

[0038] This embodiment trains a prototype template feature set to form a tight cluster of feature vectors of all real cigarette samples in the feature space, while maintaining a large distance from fake cigarette samples, so that the prototype template feature set represents the features of all real cigarette samples and reduces the feature differences within the real cigarette samples, thereby improving the accuracy of similarity calculation between the cigarette product image to be detected and the prototype template feature set.

[0039] In some embodiments of the present invention, Figure 5 As shown, Figure 5 The present invention provides Figure 1 The flowchart of an embodiment of step S104 in the embodiment includes: S501, setting a threshold for the original key feature area corresponding to each original feature vector in the prototype template feature set to generate an original feature threshold; S502, obtaining the original feature vector of the key feature area corresponding to the target feature vector in the prototype template feature set, and determining it as the target prototype template feature vector; S503, constructing a trademark similarity calculation formula according to the number of target key feature regions, the original feature threshold, the target feature vector, and the target prototype template feature vector, and determining the similarity between the target trademark image and the original trademark image based on the trademark similarity calculation formula; The trademark similarity calculation formula is: , , in, is the similarity value, m is the number of target key feature areas, is the symbolic function, is the cosine similarity, is the feature vector of the mth target key feature area of ​​the target trademark image, is the prototype template feature vector corresponding to the mth target key feature area in the prototype template feature set, is the original feature threshold of the mth original key feature area.

[0040] Specifically, this embodiment uses Resnet as the backbone network to construct a parameter-free classifier to identify true and false cigarette product images. For all cigarette specifications, the similarity threshold is set to 0, that is, when the similarity is greater than 0, the cigarette product is judged to be a true sample, and when the similarity is less than 0, the cigarette product is judged to be a false sample. In order to verify the setting of the original feature threshold, this embodiment takes the Yellow Crane Tower 1916 (hard box) specification as an example and conducts a series of threshold setting experiments. The experimental results are as follows Figure 6 As shown, Figure 6 The relationship curve diagram of the authenticity identification accuracy rate when setting different original feature thresholds provided by the present invention shows that when the threshold is set to 0, the authenticity identification accuracy rate is the highest.

[0041] This embodiment performs authenticity identification of cigarette brands by calculating the similarity between the target feature vector and the prototype template feature vector, and can quickly and accurately identify the authenticity of cigarette brand images.

[0042] In some embodiments of the present invention, Figure 7 As shown, Figure 7 The schematic diagram of the process of collecting cigarette brand images provided by the present invention includes: S701, collecting the target trademark image according to a preset data collection standard to generate an initial target trademark image; S702, calculating the clarity of the initial trademark image according to the edge gradient change of the initial target trademark image based on a gradient algorithm; S703: Filter out initial target trademark images whose clarity is higher than a preset threshold, and generate a target trademark image.

[0043] It should be noted that the trademark authenticity identification method of this embodiment also includes an image acquisition module. The image acquisition module uses an ordinary smart phone and a portable photo-taking auxiliary tool without damaging the product packaging, follows a set of image acquisition and application standards, and collects high-definition photos of the appearance of the product trademark paper. The clarity of the photos is quantitatively evaluated and screened through an evaluation algorithm, and the photo data with clarity that meets the established standards is screened out to lay a solid data foundation for subsequent steps.

[0044] It should be further explained that, in the process of image acquisition, this embodiment adopts a lightweight mobile device for the convenience of carrying. This will face some problems, such as the problem of focus accuracy. The adjustment of focal length and distance requires professional training to ensure that stable quality photos are taken to avoid blurry photos caused by focus and shaking; the problem of ambient light variables. The lighting conditions at the anti-counterfeiting site vary greatly, which makes it difficult for the photos taken to achieve a relatively stable level in terms of brightness uniformity and clarity; the problem of reflection interference. In the environment of strong background light, the transparent film on the surface of the trademark paper is easy to reflect the contour of the surrounding environment, causing interference to the image and affecting the purity and usability of the photo sample. In order to solve the above problems, this embodiment adopts shooting auxiliary equipment, which consists of three key components: a foldable shooting box, a folding bracket and a universal bracket, such as Figure 8 As shown, Figure 8 The present invention provides a folding shooting box with a self-contained light source and a standardized folding shooting bracket. Figure 8 - (a) is a folding box with built-in light source. The folding box has built-in light source and dual fill light functions of white light and purple light. Under the condition of uncertain external light source, it can still collect standardized product appearance photos. At the same time, for some specifications of color-changing anti-counterfeiting trademark paper, different levels of patterns can be seen when it is rotated to a specific angle. At certain angles, the anti-counterfeiting pattern is invisible. The folding box with built-in light source can also collect image data of different angles and different levels of color-changing anti-counterfeiting trademark paper. Figure 8 - (b) is a standardized folding shooting stand. When the ambient light for shooting products is suitable and no additional fill light is needed, the folding stand can be used for standardized acquisition. The size of the stand after folding is extremely compact, occupying only a tiny space of 20cm long, 13cm wide and 2cm high. Both the shooting box and the folding stand are foldable, which is easy to store and carry, improving the practicality and convenience of the equipment.

[0045] It should be further explained that the preset image acquisition standards include: a specified model of smartphone, the optimal placement and distance in the shooting box, and the ideal height of the folding stand in a free shooting scene, that is, the precise shooting distance, to ensure that the quality of the photos taken reaches the optimal level. The acquisition standards are not limited to textual descriptions, but also set up intuitive and easy-to-use shooting position indicators. Clear camera position indicators intuitively guide the precise alignment during shooting, thereby greatly improving the standardization and efficiency of photo acquisition, and can significantly reduce the number of photo samples required for training.

[0046] Specifically, after the target trademark paper is imaged according to the preset image acquisition standard, the initial target trademark paper image is accurately evaluated for image clarity. The principle of the clarity gradient method is that the edges and details of the trademark paper will be clearer in a clear image, while the edges and details of the trademark paper will be blurred in an incorrectly focused, jittery, or blurred photo. This difference is reflected in the image as the difference between adjacent pixels. The edge of the trademark paper is the edge information in the image. The edge of the image is caused by the discontinuity of the grayscale intensity in the image, and this discontinuity is caused by the different depths, different reflection characteristics, and different brightness of the target in the scene. Therefore, the edge is related to the gradient of the image in some cases.

[0047] Furthermore, the gradient amplitude of the image edge is calculated by the edge detection operator. The sum or average value of the gradient amplitude is usually used as a clarity evaluation index. The larger the value, the clearer the image. The gradient calculation formula is: , in, is the image gradient value, which is obtained by summing the image edge detection operator G (x, y) from the horizontal direction x and the vertical direction y. The edge detection operator uses the Sobel operator, which is a discrete difference operator used to calculate the approximate grayscale of the image brightness function. The operator contains two sets of 3x3 matrices, one for the horizontal direction x and one for the vertical direction y. By plane convolution with the image, the brightness difference gradient values ​​in the horizontal and vertical directions can be obtained respectively. The image quality is quantitatively evaluated according to the calculated image clarity. Only images with qualified clarity will be retained and used in subsequent processes. For example, multiple images of cigarette trademark paper of a certain specification are collected, and the clarity gradient threshold is set to 50. The clarity of each cigarette trademark paper image is calculated, and the trademark images with a clarity higher than 50 are screened out as qualified trademark images. The remaining trademark images with a clarity lower than 50 do not meet the standard and are not used for model training, verification or identification. It is worth noting that the specific clarity gradient threshold needs to be determined through model training and verification to achieve the best screening effect.

[0048] This embodiment uses an ordinary smart mobile device plus a portable photo-taking auxiliary tool to collect high-definition trademark images in accordance with a standardized process, and uses a gradient algorithm to quantitatively evaluate and screen the clarity of the photos to obtain high-definition images that meet the requirements, providing an accurate basis for subsequent detection and identification.

[0049] In order to verify the accuracy of the trademark image authenticity identification method of this embodiment, this embodiment verifies each model through a series of experiments. Specifically, the verification work is carried out in the office of a provincial quality inspection station to simulate the real identification work environment to ensure the practical feasibility and effectiveness of the intelligent identification method. The verification samples strictly follow the principle of random sampling and are randomly selected from the latest batch samples received by the quality inspection station. Three small packs of each cigarette sample are taken as representative samples for verification, and each specification is guaranteed to collect at least 200 high-definition photo samples. In the working scene of the quality inspection station, 7098 photos of appearance trademark paper covering 17 specifications were collected according to the intelligent identification method. These photos include true and false samples, among which the false samples include "high imitation" samples of mechanisms such as GDX1, GDX2 and HLP. By detecting and extracting feature areas from these photos, a total of 14,736 feature area images were obtained, and these feature areas were intelligently identified, with an overall accuracy rate of 97.4%.

[0050] In addition, verification work is also carried out in some city and district monopoly inspection offices, which are the front line of tobacco monopoly anti-counterfeiting. The verification samples also follow strict random sampling criteria. In the monopoly anti-counterfeiting work scenario, 1141 photos of the appearance of product trademark paper covering 12 specifications were collected according to the intelligent identification method. These photos include real and fake samples. The fake samples include "high imitation" samples of mechanisms such as GDX1, GDX2 and HLP. By detecting and extracting feature areas from these photos, a total of 3540 feature area images were obtained, and these feature areas were intelligently identified, with an overall accuracy rate of 96.9%.

[0051] The above verification work fully demonstrates that the present embodiment has extremely high accuracy in identifying the authenticity of cigarette trademark paper, and has simple operation and high identification efficiency.

[0052] In order to better implement the trademark authenticity identification method in the embodiment of the present invention, based on the trademark authenticity identification method, correspondingly, Fig. 9 As shown, the embodiment of the present invention further provides a trademark authenticity identification device 900 including: The feature region detection module 901 is used to determine the key feature regions of the target trademark image and the original trademark image; A feature vector extraction module 902 is used to extract feature vectors of key feature areas of the target trademark image and the original trademark image, and generate a target feature vector and an original feature vector; The prototype template feature set generation module 903 is used to determine the prototype template feature set according to the original feature vector of the original trademark image and the mean value of the original feature vector; The authenticity identification module 904 is used to determine the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set, and to perform authenticity identification on the target trademark image according to the similarity.

[0053] The trademark authenticity identification device 900 provided in the above embodiment can implement the technical solution described in the above trademark authenticity identification method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above trademark authenticity identification method embodiment, which will not be repeated here.

[0054] In the embodiments of the present invention, the trademark authenticity identification device may be an independent server, or a server network or server cluster composed of servers. For example, the trademark authenticity identification device described in the embodiments of the present invention includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0055] The present invention also provides a trademark authenticity identification electronic device, such as Fig.10 As shown, Fig.10 This is a structural block diagram of an embodiment of a trademark authenticity identification device provided by the present invention. The trademark authenticity identification device 1000 can be a computing device such as a mobile terminal, a desktop computer, a notebook, a palm computer, and a server. The trademark authenticity identification device 1000 includes a processor 1001 and a memory 1002, wherein the memory 1002 stores a trademark authenticity identification program 1003.

[0056] In some embodiments, the memory 1002 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 1002 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory 1002 may also include both an internal storage unit of the computer device and an external storage device. The memory 1002 is used to store application software and various types of data installed in the computer device, such as program codes installed in the computer device. The memory 1002 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the trademark authenticity identification program 1003 may be executed by the processor 1001, thereby realizing the trademark authenticity identification method, device, electronic device and storage device of each embodiment of the present invention.

[0057] In some embodiments, the processor 1001 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes stored in the memory 1002 or process data, such as executing a trademark authenticity identification program.

[0058] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0059] The trademark authenticity identification method, device, electronic device and storage device provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for identifying the authenticity of a trademark image, characterized in that: include: Determine the key feature areas of the target trademark image and the original trademark image; Extracting feature vectors of key feature areas of the target trademark image and the original trademark image to generate a target feature vector and an original feature vector; Determining a prototype template feature set according to the original feature vector of the original trademark image and the mean value of the original feature vector; The similarity between the target trademark image and the original trademark image is determined according to the target feature vector and the prototype template feature set, and the authenticity of the target trademark image is identified according to the similarity.

2. The method for identifying the authenticity of a trademark image according to claim 1, characterized in that: Determine the key feature areas of the target trademark image and the original trademark image, including: Determine the location and size of the historical original trademark image and its corresponding key feature area; Based on the target detection algorithm, an initial region detection model is constructed, and according to the historical original trademark image and the position and size of the corresponding key feature region, the initial region detection model is iteratively trained to obtain a fully trained target region detection model; Based on the target region detection model, identifying the key feature region of the target trademark image, and cropping and extracting the key feature region to generate a target key feature region; Based on the target area detection model, the key feature area of ​​the original trademark image is identified, and the key feature area is cropped and extracted to generate the original key feature area.

3. The method for identifying the authenticity of a trademark image according to claim 1, characterized in that: Extracting feature vectors of key feature areas of the target trademark image and the original trademark image to generate a target feature vector and an original feature vector includes: Based on the Resnet classification algorithm and classification contrast loss function, a feature extraction model is constructed; Normalizing the key feature regions of the target trademark image and the original trademark image to generate an expected target key feature region and an expected original key feature region; Based on the feature extraction model, determining the feature vector of the expected target key feature area, and generating a target feature vector; Based on the feature extraction model, a feature vector of the expected original key feature area is determined to generate an original feature vector.

4. The method for identifying the authenticity of a trademark image according to claim 3, characterized in that: Determining a prototype template feature set according to the original feature vector of the original trademark image and the mean value of the original feature vector includes: Calculating the mean of the original feature vector to generate an initial prototype template feature set; Constructing an original feature loss function according to the original feature vector and the initial prototype template feature set; Based on the original feature loss function and the initial prototype template feature set, the prototype template feature set of each key feature area is determined according to the original feature vector.

5. The method for identifying the authenticity of a trademark image according to claim 1, characterized in that: Determining the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set includes: Setting a threshold for the original key feature area corresponding to each original feature vector in the prototype template feature set to generate an original feature threshold; Obtaining an original feature vector of a key feature area corresponding to the target feature vector in the prototype template feature set, and determining it as a target prototype template feature vector; A trademark similarity calculation formula is constructed according to the number of the target key feature areas, the original feature threshold, the target feature vector and the target prototype template feature vector, and the similarity between the target trademark image and the original trademark image is determined based on the trademark similarity calculation formula.

6. The method for identifying the authenticity of trademark images according to claim 5, characterized in that: The trademark similarity calculation formula is: , , in, is the similarity value, m is the number of target key feature areas, is the symbolic function, is the cosine similarity, is the feature vector of the mth target key feature area of ​​the target trademark image, is the prototype template feature vector corresponding to the mth target key feature area in the prototype template feature set, is the original feature threshold of the mth original key feature area.

7. The method for identifying the authenticity of a trademark image according to claim 1, characterized in that: Before confirming the key feature areas of the target trademark image, including: Collect the target trademark image according to the preset data collection standard to generate an initial target trademark image; Based on a gradient algorithm, calculating the clarity of the initial trademark image according to the edge gradient change of the initial target trademark image; The initial target trademark images whose clarity is higher than a preset threshold are screened out to generate target trademark images.

8. A trademark image authenticity identification device, characterized in that: include: A feature region detection module is used to determine the key feature regions of the target trademark image and the original trademark image; A feature vector extraction module, used to extract feature vectors of key feature areas of the target trademark image and the original trademark image, and generate a target feature vector and an original feature vector; A prototype template feature set generation module, used to determine a prototype template feature set according to the original feature vector of the original trademark image and the mean of the original feature vector; The authenticity identification module is used to determine the similarity between the target trademark image and the original trademark image according to the target feature vector and the prototype template feature set, and to perform authenticity identification on the target trademark image according to the similarity.

9. An electronic device for identifying the authenticity of trademark images, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the method for identifying the authenticity of a trademark image as claimed in any one of claims 1 to 7 are implemented.

10. A storage medium, characterized in that: The storage medium stores computer program instructions, and when the computer program instructions are executed by a computer, the computer is caused to execute the trademark image authenticity identification method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Official seal image similarity calculation method and device, electronic equipment and medium

    CN114913513A

  • Seal authenticity identification method and identification device, storage medium and electronic equipment

    CN116503720A

  • Small sample image classification method based on image foreground and background fragment separation

    CN117576448A

  • Image classification method and system based on small sample learning

    CN117576450A

  • Small sample medical image processing method based on double similarity measurement and joint learning

    CN117809058A