Method and device for training graphic identifier recognition model and identifying graphic identifier

By integrating traditional computer vision and deep learning methods, multi-dimensional difference mask images are generated and intelligently identified, solving the adaptability and cost problems of graphic identifier identification in existing technologies, and realizing efficient and automated graphic identifier identification.

CN121904512APending Publication Date: 2026-04-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
Filing Date
2026-01-19
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Among existing graphic identification technologies, traditional methods are not adaptable to complex scenarios, while pure deep learning methods rely on a large amount of manual annotation, have high training costs, and are opaque in process.

Method used

This method integrates traditional computer vision and deep learning. It generates multi-dimensional difference mask images for training, combines ROI region extraction and alignment to generate high-precision pixel-level difference mask icon annotations, and uses a deep learning model for intelligent identification.

Benefits of technology

It achieves high-precision, automated, and robust graphic identification, reducing manual annotation costs and improving identification efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121904512A_ABST
    Figure CN121904512A_ABST
Patent Text Reader

Abstract

The invention discloses a graphic identifier identification model training and graphic identifier identification method and device, and relates to the technical field of computer vision. A specific embodiment of the method comprises the following steps: preprocessing a training image pair of a standard image and a training image to be detected, which comprises a graphic identifier, to generate a corresponding target difference mask graph, wherein the target difference mask graph comprises multi-dimensional difference information; a triple composed of the standard image, the to-be-tested training image and the target difference mask graph is used as a training sample, a sample data set composed of a plurality of training samples is used for training an identification model, and the identification model is trained to output the difference mask graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a method and apparatus for training a graphic identifier recognition model and identifying graphic identifiers. Background Technology

[0002] With the widespread application of graphic logos in areas such as product anti-counterfeiting, brand authentication, and document verification, the demand for rapid and accurate identification of graphic logos is increasing. Graphic logos typically contain complex design elements, sophisticated printing processes, and specific anti-counterfeiting features, making them a key basis for distinguishing authenticity.

[0003] Traditional manual identification methods rely primarily on professionals subjectively comparing the detailed features of graphic symbols (such as pattern texture, dot structure, and stroke shape) with the naked eye or simple optical tools. This method has inherent drawbacks, including low efficiency, high cost, and difficulty in standardizing and scaling the results.

[0004] To overcome the limitations of manual identification, the industry has begun to explore the use of computer vision technology for automated identification. Currently, automated identification technologies are mainly divided into methods based on traditional computer vision and methods based on general deep learning classification / detection.

[0005] However, current automated technologies applied to graphic identification, whether traditional methods or deep learning methods, all suffer from significant technical limitations when directly used for high-precision identification of graphic symbols such as trademarks. This makes it difficult to balance accuracy, robustness, and scalability in practical applications. For example, traditional computer vision methods have insufficient geometric registration accuracy and poor robustness, while general-purpose deep learning methods heavily rely on manual annotation, resulting in high costs and limited scalability.

[0006] In summary, existing technologies either have bottlenecks in algorithm accuracy and robustness, or face insurmountable cost and efficiency barriers in data acquisition and model building. Summary of the Invention

[0007] In view of this, embodiments of the present invention provide a method and apparatus for training a graphic identifier recognition model and identifying graphic identifiers, aiming to solve the technical problems in existing graphic identifier identification technologies, where single traditional methods are insufficiently adaptable to complex scenarios, while pure deep learning methods rely on a large amount of manual annotation, have high training costs, and lack transparency in the process.

[0008] In a first aspect, embodiments of the present invention provide a method for training a graphic identifier recognition model, the method comprising: preprocessing a training image pair including a standard image and a training image to be tested to generate a corresponding target difference mask, the target difference mask containing multi-dimensional difference information; using a triplet consisting of the standard image, the training image to be tested, and the target difference mask as a training sample, and using a sample dataset consisting of multiple training samples to train a recognition model, wherein the recognition model is trained to output a difference mask.

[0009] Optionally, the training image pair, including a standard image and a training image to be tested, is preprocessed to generate a corresponding target difference mask map, including: determining multi-dimensional difference information between the standard image and the training image to be tested; fusing the multi-dimensional difference information to generate a comprehensive difference map; and binarizing the comprehensive difference map to generate a pixel-level target difference mask map.

[0010] Optionally, determining the multi-dimensional difference information between the standard image and the training image to be tested includes: extracting the standard ROI image of the standard image and the ROI image to be tested of the training image to be tested; aligning the standard ROI image and the ROI image to be tested; and determining the multi-dimensional difference information between the aligned standard ROI image and the ROI image to be tested.

[0011] Optionally, the multidimensional difference information indicates the degree of difference in visual features, wherein the visual features include structural features, color features, and texture features.

[0012] In a second aspect, embodiments of the present invention provide a method for identifying graphic identifiers, the method comprising: using a recognition model to identify differences between a test image of a graphic identifier and a standard image to output a difference mask; and generating an index for identifying graphic identifiers based on the difference mask, comparing the index with a preset threshold to generate a graphic identifier identification result, wherein the recognition model is trained based on the method described in any embodiment of the first aspect above.

[0013] Optionally, generating an index for identifying graphic identifiers based on the difference mask image includes: determining one or more difference regions in the difference mask image output by the recognition model; and calculating one or more parameters associated with the one or more difference regions, and generating a quantified index representing the authenticity of the graphic identifier based on the one or more parameters, wherein the parameters include one or both of statistical parameters and geometric feature parameters.

[0014] Thirdly, embodiments of the present invention provide an image recognition model training apparatus, the apparatus comprising: a preprocessing module, the preprocessing module being used to preprocess a training image pair including a standard image and a training image to be tested, to generate a corresponding target difference mask, the target difference mask containing multi-dimensional difference information; and a training module, the training module being used to use a triplet consisting of the standard image, the training image to be tested, and the target difference mask as training samples, and using a sample dataset consisting of multiple training samples to train a recognition model, the recognition model being trained to output a difference mask.

[0015] Fourthly, embodiments of the present invention provide a graphic identifier identification device, the device comprising: an identification module, the identification module being configured to use an identification model to identify the difference between a test image of a graphic identifier and a standard image, so as to output a difference mask image; and an identification module, the identification module being configured to generate an index for identifying graphic identifiers based on the difference mask image, and to compare the index with a preset threshold to generate a graphic identifier identification result, wherein the identification model is trained according to the method described in any embodiment of the first aspect above.

[0016] Fifthly, embodiments of the present invention provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the above embodiments.

[0017] In a sixth aspect, embodiments of the present invention provide a computer-readable medium having a computer program stored thereon that, when executed by a processor, implements the methods of any of the above embodiments.

[0018] In a seventh aspect, embodiments of the present invention provide a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements the method of any of the above embodiments.

[0019] One embodiment of the above invention has the following advantages or beneficial effects: This invention integrates traditional computer vision with deep learning. In the training data generation stage, a comprehensive difference evaluation mechanism incorporating multi-dimensional information is used to generate high-precision pixel-level difference mask annotations for deep learning training. In the second stage, the automated annotation dataset generated in the first stage is used to train the recognition network. This network can intelligently complete difference comparison in an end-to-end manner and output accurate difference mask maps. This invention replaces the expensive and time-consuming manual annotation process with a controllable and automated traditional vision algorithm, providing a massive, high-quality data foundation for training deep learning models. Simultaneously, the powerful learning and generalization capabilities of deep learning models are utilized for final identification, giving the entire system the advantages of automation, high precision, and strong robustness.

[0020] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0021] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein: Figure 1 This is an overall architecture diagram of a system for graphic identifier identification provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the flow of a method for identifying graphic identifiers according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the flow of a method for identifying graphic identifiers provided in another embodiment of the present invention; Figure 4 This is a schematic diagram of processing a graphic identifier image according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a graphic identifier identification device provided in one embodiment of the present invention; Figure 6 This is an architecture diagram of yet another exemplary system applicable thereto, according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0022] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0023] It should be noted that the acquisition, storage, use, and processing of data in the technical solutions of this invention comply with the relevant provisions of national laws and regulations.

[0024] Graphical logos are widely used in product anti-counterfeiting, brand authentication, and document verification. As a specific example, with the booming high-end consumer goods market, especially for renowned wines and luxury goods, the demand for anti-counterfeiting authentication is increasing. The trademarks of some products, due to their complex printing processes and design details, have become important criteria for consumers and experts to distinguish genuine products from counterfeits. Currently, automated authentication technologies are mainly divided into methods based on traditional computer vision and methods based on general deep learning classification / detection. Methods based on traditional computer vision typically extract feature points from images such as SIFT or ORB for matching, calculate a geometric transformation to align two images, and then find differences by pixel subtraction or calculating SSIM. Methods based on general deep learning classification / detection typically input the graphic logo image directly into a classification network (such as ResNet) to determine "true / false," or use an object detection network (such as YOLO) to find "defective areas."

[0025] However, specifically, traditional computer vision methods suffer from insufficient geometric registration accuracy and poor robustness. Existing methods generally employ affine transformations for image alignment, but this model can only correct linear deformations within a two-dimensional plane and cannot handle perspective distortions caused by the shooting angle and the curved surface of the bottle. This results in significant positional deviations in the edge regions of the aligned image, introducing a large amount of erroneous "spurious difference" information for subsequent difference comparisons, severely impacting accuracy. Furthermore, feature-point-based matching is highly sensitive to weak textures, dramatic changes in illumination, and repetitive patterns, easily leading to alignment failures. In addition, traditional computer vision methods rely on a single dimension of difference analysis, making them susceptible to interference. Most traditional methods depend on a single dimension of difference calculation (such as pixel brightness subtraction or SSIM). Pixel subtraction is extremely sensitive to illumination, shadows, and material reflections, easily misjudging optical changes on the surface of genuine products as counterfeits; while SSIM, although somewhat robust to illumination, is insufficient in perceiving differences in other dimensions such as color and edge sharpness.

[0026] On the other hand, general-purpose deep learning methods heavily rely on manual annotation, which is costly and difficult to scale. Existing deep learning-based identification methods (such as general defect detection) typically require a large and diverse "defect database" with pixel-level manual annotation for training. When applied to trademark (e.g., wine label) identification, this means hiring experts and spending a significant amount of time and money to manually identify every minute flaw in thousands of counterfeit trademark images. This is extremely costly in practice and struggles to cover all the constantly emerging new counterfeiting methods, limiting the model's generalization ability. Furthermore, general-purpose deep learning methods are "black boxes" in terms of identification logic, and the process is uninterpretable. General classification or detection models perform undifferentiated global feature learning; they lack prior knowledge of specific anti-counterfeiting areas of the trademark, and their decision-making process is a "black box," making it difficult to explain why a product is judged to be counterfeit. This is a major drawback in identification scenarios that require credible evidence.

[0027] Therefore, embodiments of the present invention provide a method and apparatus for training a graphic identifier recognition model and identifying graphic identifiers, aiming to solve the technical problems in existing graphic identifier identification technologies, where single traditional methods are insufficiently adaptable to complex scenarios, while pure deep learning methods rely on a large amount of manual annotation, have high training costs, and lack transparency in the process.

[0028] Figure 1 This is an overall architecture diagram of a system 100 for graphic identification provided by an embodiment of the present invention.

[0029] like Figure 1 As shown, the system 100 for graphic identification according to an embodiment of the present invention includes a preprocessing module 110, a recognition model 120, and an identification module 130.

[0030] In one embodiment, a training image pair 111 is provided to a preprocessing module 110. The training image pair 111 includes a standard image of the graphic identifier and a training image to be tested. The preprocessing module 110 preprocesses the training image pair 111 to obtain training samples. The training samples may be triplets comprising a standard image, a training image to be tested, and a target difference mask generated through preprocessing. A sample dataset 112 consisting of multiple training samples is used to train a recognition model 120. The trained recognition model 120 is used to recognize the graphic identifier 121 to be tested and outputs a difference mask. The discrimination module 130 generates a discrimination result for the graphic identifier based on this difference mask.

[0031] Figure 2 This is a schematic diagram of a flowchart 200 of a method for identifying graphic identifiers according to an embodiment of the present invention. Figure 2 As shown, the method includes: Step 201: Preprocess the training image pairs.

[0032] This step specifically includes preprocessing the training image pairs for the graphic identifiers. The training image pairs include a standard image of the graphic identifier and a training image to be tested. This step further includes preprocessing the training image pairs to generate a target difference mask. Preprocessing the training image pairs may involve processing and comparing the visual features of the training image pairs to generate a degree of difference in visual features between the training image pairs, and then generating the target difference mask based on this degree of difference.

[0033] The triplet consisting of the standard image, the training image to be tested, and the target difference mask image can be used as the training sample, and the batch training samples can be used to form the training dataset for subsequent training of the model.

[0034] Step 202: Use the training dataset to train the recognition model.

[0035] This step specifically involves building a recognition model to identify the differences between the test image and the standard image for identifying graphic symbols.

[0036] The recognition model can be a network with dual input channels. The first input channel receives a standard image of the graphic symbol, and the second input channel receives an image of the graphic symbol to be identified. The recognition model outputs the differences between the input images. Specifically, the recognition model can be constructed based on a network with dual input channels that outputs the differences between the input images.

[0037] As an example, in one embodiment of the present invention, the recognition model can employ a dual-branch image processing structure based on an encoder-decoder architecture. This recognition model can include two symmetrical encoder branches, used to receive and extract multi-scale features from two input images respectively. Each encoder branch internally constructs a feature pyramid through cascaded convolutional and downsampling layers, while simultaneously passing shallow high-resolution features to subsequent stages via skip connections. The features extracted by the two branches are integrated in the deeper layers of the network through a feature fusion module. The fused information is input to a unified decoder, which gradually recovers spatial details through upsampling and convolutional operations, ultimately outputting pixel-level segmentation or recognition results. Specifically, the entire model can be configured as a twin mode with shared encoder branch weights or a pseudo-twin mode with independent weights, depending on the task requirements. For example, the recognition model can be constructed based on networks such as twin U-shaped segmentation networks and pseudo-twin U-shaped segmentation networks, but is not limited to these.

[0038] In one embodiment, the constructed recognition model is trained using a preprocessed training dataset. Specifically, the constructed recognition model can be trained under supervised supervision based on the training dataset, where the target difference mask map in the training dataset can be a difference mask icon label serving as the supervised target. During training, by minimizing the pixel-level loss between the recognition model's prediction results and the label, the model can be driven to progressively optimize its parameters, enabling the recognition model to learn a complex ability for fine-grained difference recognition.

[0039] Specifically, as an example, in each iteration, the recognition model outputs a predicted difference mask based on the input image. By comparing the difference between the predicted difference mask and the difference mask icon pixel by pixel, the error level of the current prediction is calculated. Then, the error is quantified using, for example, cross-entropy loss, mean squared error loss, or a composite loss function based on perceptual similarity. The loss gradient is then backpropagated to each layer of the network through a backpropagation algorithm, thereby updating the model weights so that they can more accurately capture subtle differences in subsequent predictions.

[0040] Step 203: Output the difference mask map of the test image with graphic identifier using the trained recognition model.

[0041] This step specifically involves using a trained recognition model to identify the graphic identifier image to be tested, and outputting a difference mask map indicating the difference between the graphic identifier image to be tested and a standard image. The aim is to use the trained model to perform fast and accurate difference analysis on new and unknown test samples.

[0042] In one embodiment, the step may further include using the image of the graphic identifier to be tested and a standard image of a known graphic identifier as input to a trained recognition model, and having the trained recognition model output a pixel-level difference mask between the image of the graphic identifier to be tested and the standard image. For example, the graphic identifier may be a graphic trademark of a product, the image of the graphic identifier to be tested may be an image of the trademark to be detected, and the standard image may be a known genuine image of the trademark to be detected. In this case, the trained recognition model outputs a pixel-level difference mask between the image of the trademark to be tested and the genuine trademark image.

[0043] Step 204: Based on the difference mask image, generate the identification result of the graphic identifier.

[0044] In one embodiment, this step specifically includes generating an index for identifying graphic identifiers based on a difference mask image. Specifically, one or more difference regions in a pixel-level difference mask image output by a trained recognition model can be identified, and one or more parameters associated with the one or more difference regions can be calculated. Based on these parameters, a quantified index representing the authenticity of the graphic identifier can be generated. The parameters may include one or both of statistical parameters and geometric feature parameters. The index can be compared with a preset threshold to generate a graphic identifier identification result. For example, in the case of a graphic identifier as a trademark, if the index is higher than the preset threshold, an identification result indicating that the trademark image is "counterfeit" can be output.

[0045] Figure 3 This is a schematic diagram of a flowchart 300 of a method for identifying graphic identifiers provided in another embodiment of the present invention.

[0046] like Figure 3 As shown, one embodiment of the present invention may include a stage 310 for generating a training dataset and a stage 320 for identifying graphic identifiers.

[0047] In one embodiment, stage 310 of generating the training dataset includes step 311 of obtaining training image pairs. It should be understood that in this step, batches of training image pairs can be obtained to obtain a set of training image pairs, but for simplicity, this embodiment is described using a single training image pair.

[0048] The training image pair includes a standard image of the graphic identifier and a training image to be tested. The following explanation uses a graphic identifier as an example of a trademark, but it should be understood that a graphic identifier can include any other graphic that needs to be authenticated or identified and serves an identifying function. In this embodiment, the training image pair includes a standard image indicating a genuine trademark and a training image to be tested. The standard image and the training image to be tested can be processed to obtain corresponding target difference masks. The processing steps may include step 312 of extracting the ROI images of the training image pair. The extracted ROI images of the standard image and the training image to be tested are used to extract the main body region of the graphic identifier, such as the main body region of the trademark.

[0049] In one embodiment, contour detection methods can be used to extract the respective ROI images of the standard image and the training image to be tested. For example... Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the processing of a graphic identifier image according to an embodiment of the present invention. It should be understood that, for ease of explanation, Figure 4 The graphic logo in the example is used as a trademark. Figure 4 (a) shows an example of circular contour detection on a standard image of a graphic identifier. Figure 4(b) shows an example of circular contour detection on a test training image of a graphic identifier.

[0050] Specifically, for example, when the trademark outline is circular, the center and radius of the circular label can be accurately determined by calculating and filtering the circularity of the outline, combined with the minimum enclosing circle algorithm. As another example, when the trademark outline is rectangular, shape features such as the aspect ratio and rectangularity of the outline can be calculated, combined with the minimum enclosing rectangle algorithm or the boundary rectangle algorithm to extract the trademark outline. This invention is not limited to a specific trademark outline, nor is it limited to a specific algorithm for extracting trademark outlines.

[0051] In one embodiment, the shape category of a trademark can be automatically determined by calculating the geometric features of the outline (such as roundness, rectangularity, aspect ratio, etc.), and then dynamically select whether to use the minEnclosingCircle algorithm for circular outlines or a fitting algorithm such as the minimum bounding rectangle algorithm for rectangular outlines, thereby achieving generalized processing of trademarks of different shapes.

[0052] In one embodiment, a contour detection method based on saturation channel analysis can be used to extract the ROI image. For example, the graphic logo of a trademark (such as the label of a famous wine) is usually beautifully printed with high color saturation, while the background is often darker or highly reflective but with low saturation. On the saturation channel, the contrast between the trademark and the background is usually more pronounced than on a grayscale image, and it effectively resists interference from background reflections (highlights are usually white and have low saturation), thus more stably extracting the complete trademark area. In addition, other contour detection methods can be used, such as contour detection methods based on grayscale images (Canny edge detection, Sobel operator, Otsu thresholding), etc., but are not limited to these.

[0053] Taking the circular outline of the trademark as an example, after determining the shape feature parameters such as the center and radius of the circular wine label through algorithms such as the minimum circumcircle algorithm, a mask can be generated using these circular feature parameters. Then, through a bitwise AND operation, a clean circular ROI image containing only the main content of the trademark can be extracted from the original image.

[0054] like Figure 4 As shown, Figure 4 (c) shows an example of a ROI image from which a standard image has been extracted. Figure 4 (d) shows an example of a ROI image from which the training image to be tested was extracted. For clarity, Figure 4 Two exemplary areas of difference are shown in (c) and (d) with circular markers.

[0055] After extracting the respective ROI images of the standard image and the training image to be tested, stage 310 may also include a step 313 of ROI image alignment.

[0056] Before the alignment step, both the standard image ROI and the training image ROI can be converted to grayscale. Converting to grayscale reduces data dimensionality and computational cost. In one embodiment, key feature points can be extracted and descriptors computed from the grayscale ROI image pairs. For example, the ORB (Oriented FAST and Rotated BRIEF) algorithm can be used to extract key feature points and compute descriptors, but the invention is not limited thereto.

[0057] Subsequently, the extracted key feature points and / or descriptors can be initially matched. After matching the key feature points and / or descriptors, the transformation matrix model of the ROI of the training image under test relative to the ROI of the standard image can be estimated, which can be used to align the ROI of the training image under test with the ROI of the standard image.

[0058] In one embodiment, a brute-force matcher can be used to calculate the distance between feature point descriptors in the training image ROI and the standard image ROI and perform preliminary matching. When using the ORB algorithm to extract key feature points and calculate descriptors, considering that ORB is a binary descriptor, the brute-force matcher is typically used in conjunction with Hamming distance for calculation. This combination is extremely fast on modern CPUs using bitwise operations (XOR) and guarantees finding the globally optimal matching point. In scenarios like trademark identification, where alignment accuracy is extremely important, the brute-force matcher ensures matching accuracy and avoids introducing unnecessary errors. Optionally, the FLANN (Fast Library for Approximate Nearest Neighbors) matcher can also be used to match key feature points and / or descriptors.

[0059] After initial matching, the matching results can be refined to estimate a robust partial affine transformation matrix. For example, the RANSAC (Random Sample Consensus) algorithm can be used to refine the matching results. RANSAC is used to filter inliers from an initial matching set containing a large number of mismatches (noise) and robustly estimate the optimal affine transformation matrix model. Alternatively, algorithms such as LMEDS (Least Median of Squares) or PROSAC can be used to estimate the transformation model.

[0060] Subsequently, the estimated matrix can be applied to the ROI of the training image under test, for example, through an affine transformation (warpAffine) function, to generate an aligned and corrected ROI that is strictly aligned with the standard image ROI at the pixel level.

[0061] After obtaining the aligned ROI image, stage 310 may also include step 314 of calculating multidimensional differences.

[0062] In one embodiment, visual feature differences can be calculated across multiple dimensions between aligned ROI image pairs. These visual feature differences may include, but are not limited to, structural differences, color differences, and texture differences. Specifically, structural differences can be calculated using the Structural Similarity Index (SSIM) algorithm. Color differences can be calculated by converting the images to the LAB color space. Furthermore, texture differences can be calculated by performing a bitwise XOR operation on the Canny edge map. All of these differences can be represented using a difference map.

[0063] Specifically, Figure 4 An example of a difference plot that can represent the degree of difference is shown. Figure 4 (e) is the color difference heatmap obtained after calculating the color difference; Figure 4 (f) is the Canny edge difference map; Figure 4 (g) is the SSIM structural difference map. It should be understood that the above difference maps are merely examples. In addition to the visual features listed above, the present invention can also obtain other visual feature differences or difference maps that can represent the differences between ROI image pairs.

[0064] In one embodiment, the obtained multi-dimensional differences can be fused. For example, the multi-dimensional difference maps can be fused using a bitwise OR logical operation and optimized using morphological operations to form a comprehensive difference map.

[0065] In one embodiment, the composite difference map can be binarized. Specifically, a threshold can be preset, marking pixels with difference values ​​greater than the preset threshold as "fake difference regions" and the remaining pixels as "genuine regions." The resulting binarized image is a high-precision pixel-level difference mask annotation that can be used for subsequent deep learning training. For example, the pixel-level difference mask image after binarization is as follows: Figure 4 As shown in (h). Optionally, this pixel-level difference mask can be overlaid on the original image to render the areas where the mask is "1" (e.g., Figure 4 As shown in (i), rendered in red, the difference region is labeled.

[0066] The obtained pixel-level difference mask annotations can be used as learning targets during the training of the recognition model. Therefore, the standard image, the training image to be tested, and the difference mask... Figure 3 Tuples can form training samples for training the recognition model. A batch of training samples constitutes the training dataset 315 and is used to train the constructed recognition model.

[0067] In one embodiment, during the graphic identifier identification stage 320, the actual image to be tested and the standard image 321 can be input into the trained recognition model 322. Specifically, the trained recognition model 322 can use the aligned standard image and the image to be tested (i.e., the trademark image to be tested) as dual inputs, and perform input fusion by channel concatenation. After receiving the dual inputs, the trained recognition model performs one forward propagation inference, automatically completes the difference comparison within the model, and directly outputs a pixel-level predicted difference mask map for identification.

[0068] Stage 320 may further include quantitative analysis 323 of the pixel-level predicted difference mask, aimed at transforming the pixel-level, discrete difference information output by the model into a macroscopic, decision-making-ready numerical indicator. Specifically, the quantitative analysis may include identifying difference regions in the predicted difference mask output by the trained recognition model. For example, difference regions may be areas with a value of "1" in the binarized pixel-level difference mask. All independent difference regions can be identified through connected component analysis. Optionally, the step of identifying difference regions may also include morphological optimization of the predicted difference mask to improve regularity before identifying the difference regions.

[0069] In one embodiment, one or more parameters associated with the identified one or more discrepancy regions can be calculated. The parameters may include statistical parameters of the discrepancy regions. For example, statistical parameters may include the total number N of discrepancy regions and the number N of discrepancy regions with an area greater than a preset threshold. thr And so on. Parameters can also include geometric feature parameters of the differing regions. For example, geometric feature parameters can include the total area A of one or more differing regions. total The area A of the largest difference region among one or more difference regions. max The area A of the smallest difference region min Average difference area A avg The parameters listed above include the perimeter, shape factor, and eccentricity of the regions of difference. It should be understood that these parameters are merely examples.

[0070] In one embodiment, a quantified index representing the authenticity of a graphic identifier can be generated based on one or more parameters associated with one or more difference regions. For example, a trademark authenticity score can be obtained using a predefined weighted summation formula. In an example considering the total area, maximum area, and total number of difference regions, the weighted summation formula can be as shown in Equation 1 below: Score=α A max +β A total +γ N [Equation 1] Here, α, β, and γ are the weights of each parameter that can be preset. Thus, the quantified parameter indicators can be combined into a comprehensive discrimination index.

[0071] Based on the discrimination index, a discrimination result of 324 can be output. Specifically, the discrimination index can be compared with one or more preset thresholds to obtain the discrimination result of the graphic identifier of the test image, such as "genuine" or "counterfeit". Optionally, this result, along with the accurate discrimination index, a detailed list of all difference regions, and the predicted difference mask data, can be packaged into a structured data object (such as JSON) for output.

[0072] Figure 5 This is an embodiment of the present invention providing a device 500 for identifying graphic identifiers. For example... Figure 5 As shown, the device includes: Preprocessing module 501, the preprocessing module is used to preprocess a training image pair including a standard image with graphic identifiers and a training image to be tested to generate a corresponding target difference mask map; Training module 502, the training module is used to use a triplet consisting of the standard image, the training image to be tested and the target difference mask as training samples, and to use a sample dataset consisting of multiple training samples to train a recognition model, the recognition model being trained to output a difference mask; Recognition module 503, the recognition module being used to recognize a test image of a graphic identifier using a trained recognition model, to output a difference mask image; and The identification module 504 is used to generate an index for identifying graphic identifiers based on the difference mask image, and compare the index with a preset threshold to generate a graphic identifier identification result.

[0073] This invention provides an electronic device, comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the methods of any of the above embodiments.

[0074] This invention provides a computer program product, including a computer program that, when executed by a processor, implements the method of any of the above embodiments.

[0075] This invention provides an automated method for generating training data for difference detection tasks. The invention proposes and implements a complete, automated process that requires no manual intervention to generate pixel-level labeled data needed for deep learning segmentation models. This process combines the accuracy and controllability of traditional computer vision algorithms through ROI region extraction and alignment, and multi-dimensional difference calculation and fusion. It can stably and in batches provide high-quality training sample datasets (e.g., {standard image, test image, difference mask} triples) for subsequent deep learning models. This innovation solves the most critical data bottleneck problem in the application of deep learning in this field.

[0076] Secondly, embodiments of the present invention provide a task-decoupled cascaded intelligent identification architecture. This invention decouples the complex trademark identification task into two stages: "traditional visual generation and annotation" and "deep learning intelligent recognition." The advantage of this architecture is that during the training phase, the controllability of traditional methods can be used to ensure the quality of the labeled data. During the inference (identification or recognition) phase, the powerful recognition capabilities of deep learning models can be utilized to quickly and robustly identify new images.

[0077] Furthermore, embodiments of the present invention provide a difference calculation method that integrates multi-dimensional information. Embodiments of the present invention integrate difference information from different dimensions, including structure (SSIM), color (LAB space), and texture (Canny edges). Compared to existing technologies that rely on a single indicator, this multi-dimensional analysis strategy can more comprehensively and robustly capture various forgery features of high-quality counterfeits, greatly improving the accuracy of automated annotation generation.

[0078] Figure 6 An exemplary system architecture 600 is shown, in which the graphic identifier recognition model training and graphic identifier identification methods of embodiments of the present invention can be applied.

[0079] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0080] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0081] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0082] Server 605 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 601, 602, and 603 (for example only). The backend management server can analyze and process data such as received product information query requests, and feed back the processing results (such as product information - for example only) to the terminal devices.

[0083] It should be noted that the graphic identifier recognition model training and graphic identifier identification methods provided in the embodiments of the present invention are generally executed by server 605. Correspondingly, the system for graphic identifier recognition model training and the system for graphic identifier identification are generally set in server 605.

[0084] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0085] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing a terminal device of the present invention. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0086] like Figure 6 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0087] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0088] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.

[0089] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0091] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be located in a processor, and for example, can be described as: a preprocessing module, a training module, and a discrimination module. The names of these modules do not necessarily limit the module itself; for example, the preprocessing module can also be described as a "target difference mask generation module".

[0092] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to implement the methods described in the embodiments of the present invention.

[0093] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for training a graphic identifier recognition model, the method comprising: The training image pairs, including the standard image and the training image to be tested, are preprocessed to generate corresponding target difference mask maps, which contain multi-dimensional difference information. The triplet consisting of the standard image, the training image to be tested, and the target difference mask image is used as the training sample, and the recognition model is trained using a sample dataset consisting of multiple training samples. The recognition model is trained to output a difference mask image.

2. The method according to claim 1, wherein, Preprocessing is performed on training image pairs, including standard images with graphic identifiers and training images to be tested, to generate corresponding target difference masks, including: Determine the multi-dimensional difference information between the standard image and the training image to be tested; The multi-dimensional difference information is integrated to generate a comprehensive difference map; and The composite difference map is binarized to generate a pixel-level target difference mask map.

3. The method according to claim 2, wherein, Determining the multi-dimensional difference information between the standard image and the training image to be tested includes: Extract the standard ROI image of the standard image and the ROI image to be tested of the training image to be tested; Align the standard ROI image with the ROI image to be tested; and Determine the multi-dimensional differences between the aligned standard ROI image and the ROI image to be tested.

4. The method according to claim 1, wherein, The multidimensional difference information indicates the degree of difference in visual features, wherein the visual features include structural features, color features, and texture features.

5. A method for identifying graphic symbols, the method comprising: A recognition model is used to identify the differences between the test image and the standard image of the graphic identifier to output a difference mask map; as well as An index for identifying graphic identifiers is generated based on the difference mask image. The index is then compared with a preset threshold to generate a graphic identifier identification result. The recognition model is trained according to the method described in any one of claims 1-4.

6. The method according to claim 5, wherein, Generating an index for identifying graphic identifiers based on the difference mask image includes: Determine one or more difference regions in the difference mask image output by the recognition model; and Calculate one or more parameters associated with the one or more difference regions, and generate a quantified index representing the authenticity of the graphic identifier based on the one or more parameters, wherein the parameters include one or both of statistical parameters and geometric feature parameters.

7. An apparatus for training a graphic identifier recognition model, the apparatus comprising: The preprocessing module is used to preprocess the training image pair, which includes a standard image with graphic identifiers and a training image to be tested, to generate a corresponding target difference mask image, wherein the target difference mask image contains multi-dimensional difference information. The training module is used to use a triplet consisting of the standard image, the training image to be tested, and the target difference mask as training samples, and to train a recognition model using a sample dataset consisting of multiple training samples, wherein the recognition model is trained to output a difference mask.

8. A graphic identifier identification device, the device comprising: The recognition module is used to identify the differences between the test image and the standard image using a recognition model, and to output a difference mask map. as well as The identification module is used to generate an index for identifying graphic identifiers based on the difference mask image, and compare the index with a preset threshold to generate a graphic identifier identification result. The recognition model is trained according to the method of any one of claims 1-4.

9. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

10. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-6.

11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.