Trademark identification method and system based on anti-counterfeiting codes

By using chaotic encryption and blockchain technology to embed anti-counterfeiting encoding in trademark identification, and combining the trademark authenticity and false identification model, the problems of low efficiency and high cost of trademark identification in the existing technology are solved, and effective adaptation to complex counterfeiting methods is achieved. and efficient identification.

CN119129620AActive Publication Date: 2024-12-13JIANGSU NUOZHEN ANTI COUNTERFEITING TECH CO LTD

Patent Information

Application Number
CN202411134788.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-13
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

The existing trademark identification technology is low in efficiency and strong subjectivity, and it is difficult to adapt to complex counterfeiting methods, and is costly, so it cannot meet the growing demand for trademark identification.

Method used

The anti-counterfeiting encoding generation algorithm based on chaotic encryption is adopted to embed the anti-counterfeiting encoding into the trademark image, store and verify through blockchain technology, and combine the pre-trained trademark authenticity and false identification model to use multi-source heterogeneous evidence for trademark identification.

Benefits of technology

It improves the accuracy and efficiency of trademark identification, enhances the security and aggressiveness of anti-counterfeiting encoding, reduces costs, and achieves effective adaptation to complex counterfeiting methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129620A_ABST
    Figure CN119129620A_ABST
Patent Text Reader

Abstract

The invention provides a trademark identification method and system based on an anti-counterfeiting code, and relates to the technical field of anti-counterfeiting identification, and the method comprises the steps: obtaining a to-be-identified trademark image, carrying out the preprocessing, generating a corresponding anti-counterfeiting code through employing an anti-counterfeiting code generation algorithm based on chaotic encryption, and embedding the generated anti-counterfeiting code into a standard trademark image, obtaining a trademark image carrying an anti-counterfeiting code, and carrying out code positioning on the trademark image to obtain a standardized anti-counterfeiting code image; decoding the standardized anti-counterfeiting code image to obtain an original bit stream of the anti-counterfeiting code, and verifying the validity of the original bit stream through Hash verification to obtain an anti-counterfeiting code verification result; and judging the authenticity confidence coefficient of the to-be-identified trademark image by using a pre-trained trademark authenticity judgment model, and outputting a final trademark identification result based on the anti-counterfeiting code verification result and the authenticity confidence coefficient of the to-be-identified trademark image in combination with a pre-acquired multi-source heterogeneous trademark identification evidence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to anti-counterfeiting identification technology, and in particular to a trademark identification method and system based on anti-counterfeiting coding. Background Art

[0002] Trademark counterfeiting, counterfeiting and other infringements continue despite repeated prohibitions, seriously damaging the legitimate rights and interests of enterprises and the vital interests of consumers. In the existing technology, trademark identification mainly relies on manual recognition and detection, which has problems such as low efficiency and strong subjectivity, and it is difficult to meet the growing demand for trademark identification.

[0003] At present, academia and industry have carried out a series of research and practice on trademark identification. Traditional trademark identification methods mainly include:

[0004] (1) Naked eye recognition based on human experience. Professional appraisers rely on their years of experience to judge the authenticity of a trademark by observing its color, texture, and other characteristics. However, this method relies on the subjective judgment of the appraiser and is easily affected by personal ability and experience. It is not accurate and is inefficient.

[0005] (2) Feature extraction based on image processing. Computer vision technology is used to extract the color histogram and texture features of the trademark image, and the authenticity of the trademark is determined through feature matching. However, simple visual features are difficult to fully describe the characteristics of the trademark and are not adaptable enough to complex counterfeiting methods.

[0006] (3) Material identification based on spectral analysis. The authenticity of a trademark can be identified by analyzing the spectral characteristics of the trademark printing material, such as ink composition, paper material, etc. This method requires professional spectral analysis equipment, which is expensive and is not suitable for non-contact detection scenarios.

[0007] (4) Tracking and tracing based on anti-counterfeiting labels. Anti-counterfeiting labels, such as QR codes and RFID, are attached to trademarks. Product information can be obtained by scanning the labels to verify the authenticity of the trademarks. However, anti-counterfeiting labels are easy to copy and imitate, and require additional cost investment, which limits their practical application. Summary of the invention

[0008] The embodiments of the present invention provide a trademark authentication method and system based on anti-counterfeiting coding, which can solve the problems in the prior art.

[0009] According to a first aspect of the embodiments of the present invention,

[0010] Provides trademark authentication methods based on anti-counterfeiting codes, including:

[0011] The trademark image to be identified is obtained and preprocessed to obtain a standard trademark image. Based on the standard trademark image, a corresponding anti-counterfeiting code generation algorithm based on chaotic encryption is used to generate the corresponding anti-counterfeiting code. The generated anti-counterfeiting code is embedded in the standard trademark image to obtain a trademark image carrying the anti-counterfeiting code, and the code is positioned to obtain the corresponding coding area. The positioned coding area is corrected to obtain a standardized anti-counterfeiting code image.

[0012] The standardized anti-counterfeiting code image is decoded to obtain the original bit stream of the anti-counterfeiting code, and the original bit stream of the anti-counterfeiting code is compared with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system. The validity of the original bit stream is verified by hash verification to obtain the anti-counterfeiting code verification result:

[0013] The authenticity confidence of the trademark image to be identified is identified using a pre-trained trademark authenticity identification model to obtain the authenticity confidence of the trademark image to be identified. Based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence, the final trademark identification result is output.

[0014] According to a second aspect of the embodiments of the present invention,

[0015] Provide a trademark authentication system based on anti-counterfeiting coding, including:

[0016] The first unit is used to obtain the trademark image to be identified and perform preprocessing to obtain a standard trademark image, based on the standard trademark image, use the anti-counterfeiting code generation algorithm based on chaotic encryption to generate a corresponding anti-counterfeiting code, embed the generated anti-counterfeiting code into the standard trademark image to obtain a trademark image carrying the anti-counterfeiting code, perform coding positioning on it to obtain a corresponding coding area, correct the positioned coding area, and obtain a standardized anti-counterfeiting coding image;

[0017] The second unit is used to decode the standardized anti-counterfeiting code image to obtain an original bit stream of the anti-counterfeiting code, and compare the original bit stream of the anti-counterfeiting code with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system, verify the validity of the original bit stream through hash verification, and obtain an anti-counterfeiting code verification result;

[0018] The third unit is used to use a pre-trained trademark authenticity discrimination model to discriminate the authenticity confidence of the trademark image to be identified, obtain the authenticity confidence of the trademark image to be identified, and output the final trademark identification result based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence.

[0019] According to a third aspect of the embodiments of the present invention,

[0020] An electronic device is provided, comprising:

[0021] processor;

[0022] a memory for storing processor-executable instructions;

[0023] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0024] A fourth aspect of the embodiments of the present invention is:

[0025] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0026] In this embodiment, an anti-counterfeiting code generation algorithm based on chaotic encryption is introduced. The chaotic system is sensitive to initial values ​​and has random orbits, so as to generate highly random and unpredictable anti-counterfeiting codes, which effectively improves the security and anti-attack resistance of the anti-counterfeiting codes and prevents the anti-counterfeiting codes from being maliciously cracked and copied. The generated anti-counterfeiting codes are synchronously bound to the trademark image by using code embedding and code positioning technology to ensure the consistency and integrity of the trademark image and the anti-counterfeiting code. Even if the trademark image is cut or tampered with, the coding area can still be accurately located to extract the complete anti-counterfeiting code information.

[0027] Through coding area correction and standardization, coding distortion and deformation caused by factors such as trademark image shooting angle and lighting conditions are eliminated, and high-quality anti-counterfeiting coding images are restored to provide reliable input for subsequent coding verification and improve the accuracy of anti-counterfeiting coding verification. Blockchain technology is used to build an anti-counterfeiting coding evidence system, and the standard anti-counterfeiting coding bit stream is stored in the blockchain account book. With the decentralized and tamper-proof characteristics of blockchain, the uniqueness and traceability of the anti-counterfeiting coding are ensured, effectively preventing the anti-counterfeiting coding from being forged or replaced. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of a process of a trademark identification method based on anti-counterfeiting coding according to an embodiment of the present invention;

[0029] Figure 2 It is a structural diagram of a trademark identification system based on anti-counterfeiting coding according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0032] Figure 1 FIG. 1 is a flow chart of a trademark identification method based on anti-counterfeiting coding according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0033] S101. Obtain the trademark image to be identified and pre-process it to obtain a standard trademark image. Based on the standard trademark image, use the anti-counterfeiting code generation algorithm based on chaotic encryption to generate a corresponding anti-counterfeiting code. The generated anti-counterfeiting code is embedded in the standard trademark image to obtain a trademark image carrying the anti-counterfeiting code. The code is located to obtain a corresponding code area. The located code area is corrected to obtain a standardized anti-counterfeiting code image.

[0034] In an optional embodiment,

[0035] Based on the standard trademark image, the corresponding anti-counterfeiting code is generated by using the anti-counterfeiting code generation algorithm based on chaotic encryption, and the generated anti-counterfeiting code is embedded in the standard trademark image to obtain the trademark image carrying the anti-counterfeiting code, and the coding is positioned to obtain the corresponding coding area, and the positioned coding area is corrected to obtain a standardized anti-counterfeiting coding image including:

[0036] Extract the hash value of the standard trademark image, and combine it with the key provided by the trademark owner to generate a random sequence through chaotic mapping, permute and diffuse the random sequence to obtain a binary anti-counterfeiting code, and perform error correction coding and asymmetric encryption on the binary anti-counterfeiting code to obtain an encrypted anti-counterfeiting code;

[0037] The encrypted anti-counterfeiting code is embedded into the standardized trademark image by using digital watermark technology, and the standardized trademark image is decomposed into low-frequency sub-bands and high-frequency sub-bands by discrete wavelet transform. The embedding strength is adaptively adjusted according to the importance of each sub-band, and the bit information of the encrypted anti-counterfeiting code is embedded at the same time. The trademark image carrying the anti-counterfeiting code is reconstructed by inverse discrete wavelet transform;

[0038] Based on the obtained trademark image carrying the anti-counterfeiting code, the edge detection algorithm is used to extract its regional contour, and the initial coding area is screened out in combination with the prior knowledge of the anti-counterfeiting code. The initial coding area is screened by the region proposal network, multiple candidate areas are generated, and classification and regression are performed, and finally the target coding area is output;

[0039] The target coding area is preprocessed, and the preprocessed target coding area is geometrically corrected to finally obtain a standardized anti-counterfeiting coding image.

[0040] For example, a standard trademark image is needed as a basis, which is usually provided by the trademark owner. Then, the feature information of the standard trademark image is extracted using image processing technology. Common feature extraction algorithms include SIFT and SURF. The extracted feature information usually includes the position, scale, direction, etc. of key points.

[0041] Next, the extracted feature information is processed to generate a hash value for the standard trademark image. The hash algorithm can map data of any length to a fixed-length binary string and has good anti-collision properties. Commonly used hash algorithms include MD5, SHA-1, etc. This solution uses the SHA-256 algorithm to generate a 256-bit hash value.

[0042] The trademark owner provides a pre-set key as the seed for generating the random sequence. The key is usually a binary string with a length of no less than 128 bits to ensure adequate security.

[0043] This scheme uses chaotic mapping to generate random sequences. Chaotic systems are extremely sensitive to initial values, have randomness and unpredictability, and are widely used in the field of cryptography. Common chaotic mappings include Logistic mapping, Tent mapping, Sine mapping, etc. This scheme uses Logistic mapping, and its expression is:

[0044] x(n+1)=μ·x(n)·[1-x(n)];

[0045] Among them, μ is the bifurcation parameter, which takes values ​​between 0 and 4; x is the system variable, with the initial value x(0)∈(0,1). When μ=4, the system is in a chaotic state.

[0046] Perform XOR operation on the hash value and the key, and normalize the result to the interval (0, 1) as the initial value x(0) of the chaotic map. Iterate the chaotic map N times, and get an x(n) each time. Binarize it to get a random binary sequence. The size of N is related to the required anti-counterfeiting code length.

[0047] The random sequence generated in the previous step is further processed by permutation and diffusion to enhance its security. Permutation and diffusion are two basic principles of modern cryptography.

[0048] Permutation refers to changing the position of elements in a sequence. Common permutation algorithms include circular shift, swap permutation, etc. This scheme performs circular shift permutation on the random sequence, and the shift amount is set to 1 / 4 of the sequence length.

[0049] Diffusion refers to changing the value of an element in a sequence so that a small difference in input leads to a huge change in output. This scheme uses XOR operation to diffuse each bit in the sequence. Specifically, a pseudo-random sequence of the same length as the random sequence is generated, and the corresponding bits of the two sequences are XORed to obtain the diffused sequence.

[0050] After substitution and diffusion processing, a binary anti-counterfeiting code for embedding the trademark image is obtained.

[0051] In order to improve the robustness and confidentiality of the anti-counterfeiting code, it needs to be subjected to error correction coding and encryption processing.

[0052] Error correction coding is to encode data at the sending end so that it can detect and automatically correct errors generated during transmission at the receiving end, thereby ensuring reliable data transmission. Commonly used error correction codes include Hamming code, BCH code, RS code, etc. This solution uses RS (7, 3) code, which expands the 3-symbol information code into a 7-symbol system code. In this way, 2 symbol errors can be corrected or 3 symbol errors can be detected at the receiving end.

[0053] The encryption process uses an asymmetric encryption algorithm, such as RSA, ECC, etc. Asymmetric encryption algorithms use different encryption keys and decryption keys, making the encryption key public and the decryption key confidential, thereby achieving data encryption and identity authentication. This solution is based on the elliptic curve cryptography (ECC), generates a pair of public and private keys, and uses the private key to encrypt the anti-counterfeiting code after the error correction coding to obtain the encrypted anti-counterfeiting code.

[0054] The commonly used embedding domains of digital watermarking technology include spatial domain and transform domain. Transform domain embedding has better robustness. Discrete wavelet transform (DWT) is a time-frequency analysis tool that can characterize the local features of an image at multiple scales and is widely used in the field of digital watermarking.

[0055] This scheme performs three-level DWT decomposition on the standard trademark image to obtain a low-frequency subband LL3 and multiple high-frequency subbands HLi, LHi, HHi (i = 1, 2, 3). The low-frequency subband contains the main information of the image, and the high-frequency subband reflects the detailed texture of the image. Generally, the watermark information is embedded in the high-frequency subband to achieve better imperceptibility.

[0056] Different sub-bands have different masking capabilities for watermarks, with LL3 sub-band having the strongest masking capability and HH1 sub-band having the weakest. In order to minimize the impact on the original image while ensuring robustness, it is necessary to adaptively adjust the watermark embedding strength according to the importance of each sub-band.

[0057] Define a strength adjustment factor α(i), which is inversely proportional to the importance of the subband. Assume α(3) = 1, and the values ​​of α(2) and a(1) increase in turn. For high-frequency subbands HLi, LHi, and HHi, the embedding strength should satisfy:

[0058] E(HLi)>E(LHi)>E(HHi), i=1, 2, 3;

[0059] Here, E(·) represents the embedding strength. This scheme sets three strength levels, which are used for HL3 / LH3, HL2 / LH2 / HH3, and HL1 / LH1 / HH2 / HH1 sub-bands respectively.

[0060] Using the masking characteristics of human vision, the encrypted anti-counterfeiting code is embedded into the mid-high frequency coefficients of the wavelet subband. Each subband is embedded in sequence from low frequency to high frequency, and each coefficient is used to embed one bit of coding information.

[0061] For the subband coefficient C(i, j), the process of embedding the k-th coding information W(k) is:

[0062] C′(i,j)=C(i,j)+α·W(k), W(k)∈{0,1};

[0063] Among them, C'(i, j) is the coefficient after embedding the watermark, and α is the embedding strength factor. When W(k) is 0, C(i, j) remains unchanged; when W(k) is 1, C(i, j) is added or subtracted from α, so that the parity of C'(i, j) and C(i, j) changes.

[0064] After embedding, all subband coefficients carry the anti-counterfeiting coded bit information.

[0065] The watermarked wavelet coefficients obtained in the previous step are subjected to inverse discrete wavelet transform (IDWT) from low frequency to high frequency, and finally the trademark image carrying the anti-counterfeiting code is reconstructed. The IDWT process is opposite to the DWT process, and the image details are gradually restored through sub-band synthesis until a reconstructed image with the same size as the original image is obtained.

[0066] Compared with the standard trademark image, the trademark image carrying the security code has no obvious visual difference, which realizes the imperceptibility requirement of digital watermark. At the same time, the embedded security code has a certain robustness and can resist common image attacks such as noise pollution and geometric deformation.

[0067] In order to accurately locate the area where the anti-counterfeiting code is embedded, it is first necessary to extract the outline of the area that may contain the code from the trademark image carrying the anti-counterfeiting code. Commonly used edge detection algorithms include Canny, Sobel, Laplacian, etc. This solution uses the Canny algorithm to detect the edge of the image. The basic steps of Canny edge detection are as follows:

[0068] Perform Gaussian filtering on the image to smooth the image and remove noise; calculate the gradient amplitude and direction of the image; perform non-maximum suppression on the gradient amplitude to refine the edge; use the double threshold method to detect and connect the edge. The Canny algorithm can effectively extract the contour information in the image and obtain the preliminary coding area.

[0069] Since there may be multiple extracted contours, they need to be screened based on the prior knowledge of the anti-counterfeiting code to obtain the initial coding area. The prior knowledge mainly includes the size, shape, position, etc. of the coding area.

[0070] The specific screening criteria are as follows:

[0071] Area size: The pixel area of ​​the coding area should be within a certain range, and areas that are too large or too small will be eliminated; Aspect ratio: The aspect ratio of the coding area is close to a square, and areas that are too narrow or flat will be eliminated; Area location: The coding area is generally located at the edge or corner of the trademark image, and those located in the central area will be eliminated. The outline that meets the above conditions is determined as the initial coding area and enters the next step of processing.

[0072] In order to accurately locate the real anti-counterfeiting coding area from multiple initial coding areas, this solution uses the region proposal network (RPN) for further screening. RPN is a two-stage target detection algorithm that generates region proposals and performs classification and regression by sliding a small network on the convolutional feature map to achieve target positioning. The initial coding area is input into the RPN and processed through the following steps:

[0073] Feature extraction: Use pre-trained convolutional neural networks (such as VGG, ResNet, etc.) to extract image features; Region proposal: Slide a 3x3 convolution kernel on the feature map, generate k anchor boxes at each position, and perform binary classification (whether it is a coded area) and bounding box regression on each anchor box; Region screening: Filter region proposals based on classification probability and bounding box coordinates, and remove negative samples and areas with high overlap; Region merging: Use the non-maximum suppression (NMS) algorithm to merge the remaining candidate areas to obtain the final coded area. The coded area positioning generated by RPN is more accurate, laying the foundation for subsequent anti-counterfeiting code extraction.

[0074] Due to the inevitable geometric distortion introduced during the digitization and printing process, the located security code area may be deformed by rotation, scaling, tilt, etc. In order to extract a complete and accurate security code, it is necessary to perform geometric correction on the code area.

[0075] This solution uses a projection-based correction method. Assuming that the coding area is a square, ideally, its edge projections in the horizontal and vertical directions should be two pulse functions. In practice, due to the existence of geometric distortion, the edge projections will show changes such as broadening and offset. Construct an optimization objective function to minimize the difference between the corrected edge projection and the ideal pulse function, thereby estimating the deformation parameters. Use the obtained parameters to reversely map the anti-counterfeiting coding area, eliminate geometric distortion, and obtain a standardized square area.

[0076] The method of the present application makes full use of technologies such as chaotic encryption, digital watermarking, and target detection, and takes into account the imperceptibility and robustness of the watermark while ensuring anti-counterfeiting performance, and can be effectively applied in the field of trademark rights protection.

[0077] In an optional embodiment,

[0078] Extract the hash value of the standard trademark image, and combine it with the key provided by the trademark owner to generate a random sequence through chaotic mapping, permute and diffuse the random sequence to obtain a binary anti-counterfeiting code, and perform error correction coding and asymmetric encryption on the binary anti-counterfeiting code to obtain the encrypted anti-counterfeiting code including:

[0079] Extract the hash value of the standard trademark image, introduce a quantum random number generator to generate an initial random sequence, and obtain the seed key by performing an XOR operation on the initial random sequence and the key provided by the trademark owner;

[0080] The obtained seed key is used as the initial value, and a fractional differential operator is introduced. By adjusting the order of the fractional differential operator, a target pseudo-random sequence is generated, and the generated target pseudo-random sequence is adaptively and dynamically permuted by a permutation algorithm based on dynamic key control. At the same time, multiple chaotic functions are introduced to iteratively diffuse the target pseudo-random sequence to obtain the final binary anti-counterfeiting code.

[0081] A low-density parity check code is used to perform primary error correction on the obtained binary anti-counterfeiting code, and a polarization code is introduced to perform secondary error correction on the binary anti-counterfeiting code after the primary error correction, so as to obtain an optimized anti-counterfeiting code;

[0082] Based on the optimized anti-counterfeiting code, encryption is performed in combination with a predefined user attribute set, wherein the user attribute set includes user authority and access authority, and the user's identity information is embedded in the optimized anti-counterfeiting code signature to obtain an encrypted anti-counterfeiting code.

[0083] For example, first, a standard trademark image provided by the trademark owner is needed as a basis. The image should be a clear, complete, and undistorted original trademark image. The image format can be a common lossless format such as BMP, PNG, TIFF, etc. Before extracting the hash value, the standard trademark image needs to be preprocessed as necessary, including:

[0084] Image format conversion: convert the image into grayscale or binary image to reduce the computational complexity; image size normalization: scale the image to a fixed size (such as 64x64) to eliminate the impact of size differences; image filtering and denoising: use median filtering, wavelet denoising and other methods to suppress image noise. After preprocessing, a standardized trademark image can be obtained, laying the foundation for hash value extraction.

[0085] For the preprocessed standard trademark image, a secure hash algorithm (such as SHA-256) is used to calculate its hash value. The specific steps are as follows:

[0086] The image is divided into small blocks of fixed size (such as 16x16); the pixel mean of each small block is calculated to generate a 16x16 mean matrix; the mean matrix is ​​binarized, and pixels greater than the mean are set to 1, and pixels less than the mean are set to 0; the binarized matrix is ​​converted into a 256-bit binary string; the binary string is hashed with SHA-256 to obtain a 256-bit hash value.

[0087] Since SHA-256 is a one-way hash algorithm with a significant avalanche effect, a small difference in the image will result in a huge change in the hash value. Therefore, by comparing the hash value, it is possible to quickly and accurately determine whether the image has been tampered with.

[0088] Traditional pseudo-random number generators are mainly based on deterministic algorithms and have a certain degree of predictability. In order to further improve randomness, this solution introduces a quantum random number generator as a random source. Quantum random numbers use the uncertainty principle of quantum mechanics systems to generate true random numbers by measuring physical processes such as photon polarization states and atomic decay times. In order to ensure the sufficient length of the random sequence, the length of the initial random sequence is not less than 128 bits. In order to enhance the security and unpredictability of the random sequence, the initial random sequence needs to be further processed. The trademark owner provides a preset key as a seed for participating in the generation of the random sequence. The key is a binary string with a length of not less than 128 bits.

[0089] The initial random sequence is XORed with the key, that is, the corresponding bits that are the same are 0, and those that are different are 1. The XOR operation has good obfuscation and diffusion characteristics, which can effectively hide the correlation between the random sequence and the key. The binary string obtained after XOR is used as the seed key for subsequent pseudo-random sequence generation.

[0090] This scheme innovatively introduces fractional-order differential operators to generate pseudo-random sequences. Different from traditional integer-order differentials, fractional-order differentials have long-range correlation and memory, and can generate pseudo-random sequences with chaotic characteristics.

[0091] For a discrete function f(n), its p-order Grünwald-Letnikov fractional difference is defined as:

[0092]

[0093] Where n represents a discrete time variable, which represents the current moment and takes a non-negative integer value; f(n) represents a discrete function, which represents the function value at moment n; p represents a fractional order, which can take any real value; and k represents a summation variable, which represents the number of steps of the time delay.

[0094] It represents the number of combinations of k elements from p different elements, and Γ represents the Gamma function, which is a generalization of factorial.

[0095] Using the above definition, fractional differentiation operation is performed on the seed key to obtain a new pseudo-random sequence. By adjusting the value of the fractional order p, the randomness and correlation of the sequence can be flexibly controlled. In this scheme, p = 0.5 is selected to generate a pseudo-random sequence with good chaotic characteristics.

[0096] In order to further enhance the randomness and security of the pseudo-random sequence, it is necessary to perform permutation processing on it. Traditional permutation algorithms generally use fixed permutation tables or permutation functions, which have certain regularities. This scheme adopts an adaptive permutation strategy based on dynamic keys, dynamically generates a permutation table, and improves the unpredictability of permutation.

[0097] The specific approach is to adjust a control parameter in real time according to the local statistical characteristics of the pseudo-random sequence (such as the ratio of 0 to 1), and use this parameter as the seed key for generating the permutation table. Since the local characteristics of the sequence are randomly and dynamically changing, the corresponding permutation table is also generated and updated in real time, thus realizing an adaptive dynamic permutation mechanism.

[0098] Although the randomness of the replaced sequence is enhanced, it still retains some statistical characteristics of the original sequence. In order to completely eliminate this correlation, the sequence needs to be diffused. This scheme introduces multiple chaotic functions and generates the final pseudo-random sequence through iterative diffusion.

[0099] Common chaotic functions include Logistic mapping, Tent mapping, Sine mapping, Chebyshev mapping, etc. These mappings have chaotic characteristics such as sensitivity to initial values, non-intersecting orbits, and infinite periods. In order to give full play to the chaotic effect, this scheme adopts a triple chaotic function and performs three rounds of iterative diffusion on the permuted sequence.

[0100] Taking Logistic mapping as an example, its expression is: x(n+1)=μx(n)(1-x(n)), where μ is the bifurcation parameter and x is the state variable. When μ=4, the system is in a completely chaotic state. First, the initial values ​​and parameters of the chaotic system are initialized with the permuted sequence, and a new sequence is obtained after several iterations. Then the chaotic parameters are updated with the new sequence, and iterated again several times, and so on, and finally a pseudo-random sequence after diffusion is obtained.

[0101] After permutation and diffusion, the statistical characteristics of the original sequence are completely disrupted, generating a highly randomized, unpredictable, and irregular pseudo-random sequence. Converting this sequence into binary form yields the final binary anti-counterfeiting code.

[0102] Considering that errors may occur in the transmission and storage of anti-counterfeiting codes, in order to improve the error correction capability of the code, it is necessary to perform channel coding on the binary anti-counterfeiting code. Low-density parity-check code (LDPC code) is a linear block code with performance close to the Shannon limit. It has excellent error correction performance and low decoding complexity and is widely used in the fields of communication and storage.

[0103] This scheme uses LDPC code to perform primary error correction on binary anti-counterfeiting codes. Assuming the length of the original code is n, a k×n check matrix H can be constructed, where k is the number of redundant bits. For any coded bit, randomly set 1 in the corresponding column of H and set the rest to 0, and ensure that the number of 1s in each column is much less than n. The position of the 1 can be controlled by a pseudo-random sequence to avoid artificially constructed regularity.

[0104] The security code is multiplied by the check matrix H to obtain a k-bit check code. The check code is added to the security code to complete the LDPC coding. The check relationship can be used at the decoding end to detect and correct certain random bit errors, thereby improving the reliability of the security code.

[0105] In addition to random bit errors, anti-counterfeiting codes may also be affected by complex channels such as burst errors and deletion errors. In order to further enhance the robustness of anti-counterfeiting codes, this scheme introduces polar codes for secondary error correction based on LDPC codes.

[0106] Polar code is a coding scheme based on channel polarization phenomenon, whose capacity reaches the channel capacity. For a given binary input discrete memoryless channel (B-DMC), polar code can convert it into a set of polarization sub-channels whose capacity tends to 0 or 1. Through recursive construction, cascade combination and split mapping, a set of positive polarization sub-channels is obtained, and the anti-counterfeiting coded bits are selectively mapped to reliable sub-channels for transmission to achieve channel capacity.

[0107] This scheme uses CRC-assisted sequential decoding to construct polar codes. Assume that the length of the anti-counterfeiting code after LDPC encoding is m, and calculate its CRC check value according to the preset CRC generator polynomial. Then use the Bhattacharyya parameter to estimate the reliability of each bit channel, and select the m channels with the highest reliability as the information bit channel. Insert several frozen bits between the information bit channel and the CRC check value to form an N-length polar code word. The insertion mode and value of the frozen bits can be controlled by a pseudo-random sequence.

[0108] At the decoding end, a CRC-assisted sequential decoding algorithm is used. First, the likelihood ratio of each bit is obtained by recursive calculation, and then each bit is decoded in order from large to small likelihood ratio. For each decoded bit, if it is an information bit, its soft decision value is compared with the preset decoding threshold to make a hard decision; if it is a frozen bit, the frozen value is directly output. When the CRC check passes, a valid decoding path is found, and the information bit is output as an anti-counterfeiting code.

[0109] The secondary error correction of polarization codes can effectively resist burst errors and deletion errors caused by complex channels, significantly improving the fault tolerance and reliability of anti-counterfeiting codes.

[0110] In order to finely control the access rights of anti-counterfeiting codes, this solution introduces the attribute-based encryption (ABE) mechanism. ABE implements a fine-grained access control method by associating user attributes with ciphertext. Only authorized users who meet specific attributes can decrypt the ciphertext and obtain the plaintext information.

[0111] First, you need to predefine a user attribute set, which includes attributes describing multiple dimensions such as user identity, role, and authority. For example, for trademark anti-counterfeiting scenarios, you can define the following attributes:

[0112] User identity: ordinary user, trademark owner, authorized agent, law enforcement agency, etc.; geographical scope: domestic, foreign, a province or city, etc.; industry field: clothing, electronics, food, etc.; anti-counterfeiting level: level one, level two, level three, etc.; time limit: permanent, one year, half a year, etc.

[0113] These attributes can be freely combined to generate a variety of fine-grained access policies. For example, "(identity = authorized agent) AND (region = Beijing) AND (industry = clothing) AND (level >= level 2)" represents a level 2 or higher anti-counterfeiting access policy for clothing agents in Beijing.

[0114] Based on the attribute set, the system generates a master key MK and a public key PK. Then, based on the attributes of each authorized user, the system uses MK to generate the corresponding attribute key SK. The attribute key is a data structure that contains the user attribute identifier and its corresponding key component.

[0115] At the same time, the system also generates a pair of public and private keys (pk, sk), where the public key pk is embedded in the anti-counterfeiting coded signature, and the private key sk is used to generate attribute keys and decrypt ciphertext. The public and private keys are generated using lightweight asymmetric cryptographic algorithms such as elliptic curve cryptography (ECC) to balance security and computational efficiency.

[0116] For the anti-counterfeiting code after error correction coding, the system first generates an access structure (such as a linear secret sharing scheme) according to the predefined access policy T and attaches it to the ciphertext. Then, the system uses the public key pk and the master key MK to encrypt the anti-counterfeiting code based on the attribute set S. The encryption process includes two main steps:

[0117] A session key ek is randomly selected, and the anti-counterfeiting code is symmetrically encrypted (such as AES) with ek to obtain the ciphertext CT; using the linear secret sharing scheme, ek is split into multiple shares, and each share is associated with an attribute in the attribute set S to generate a set of attribute ciphertext AC.

[0118] Therefore, the final ABE ciphertext consists of three parts: (T, CT, AC). The ciphertext is stored and transmitted as an encrypted anti-counterfeiting code.

[0119] When a new user needs to access the anti-counterfeiting code, the system administrator verifies his identity attributes and distributes the corresponding attribute key SK to him according to the attributes. SK can be transmitted through a secure channel (such as SSL / TLS) or delivered to the user offline (U disk copy).

[0120] The attributes of users may change dynamically over time (such as role changes, permission revocation), so the attribute keys of users need to be updated regularly. A simple method is to set a validity period for the attribute key and require the user to reapply when the key expires. Another method is to bind the attribute key to a timestamp and update the timestamp regularly to automatically invalidate the old key.

[0121] When an authorized user needs to access the security code, he first submits his attribute key SK and the encrypted security code (T, CT, AC). The system verifies whether the user attributes meet the access policy T. If they do, the user can use his SK and T to recover the session key ek. Finally, ek is used to symmetrically decrypt CT to obtain the plaintext security code. If the user attributes do not match the access policy, ek cannot be recovered and the decryption fails.

[0122] By binding user attributes to keys, ABE implements fine-grained authorized access control of anti-counterfeiting codes, greatly improving data security. Even if the anti-counterfeiting code is leaked, illegal users cannot recover valid information without authorization. Combined with the previous digital fingerprint extraction, pseudo-random sequence permutation diffusion, error correction coding and other links, a complete trademark anti-counterfeiting solution based on cryptography and information security theory is formed.

[0123] S102. Decode the standardized anti-counterfeiting code image to obtain an original bit stream of the anti-counterfeiting code, and compare the original bit stream of the anti-counterfeiting code with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system, verify the validity of the original bit stream through hash verification, and obtain an anti-counterfeiting code verification result;

[0124] In an optional embodiment,

[0125] The standardized anti-counterfeiting code image is decoded to obtain the original bit stream of the anti-counterfeiting code, and the original bit stream of the anti-counterfeiting code is compared with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system, and the validity of the original bit stream is verified by hash verification. The anti-counterfeiting code verification results include:

[0126] Construct a consortium blockchain system jointly participated by the trademark owner, the manufacturer and the seller. The consortium blockchain system includes smart contracts for anti-counterfeiting code registration, verification and management functions. In the consortium blockchain system, the anti-counterfeiting code generated by the trademark owner is sent to the manufacturer. The manufacturer prints the anti-counterfeiting code on the trademark product and submits the multi-hash value of the anti-counterfeiting code to the consortium blockchain system. The multi-hash value is generated by the anti-counterfeiting code, timestamp and random number.

[0127] Decode the standardized anti-counterfeiting code image through the discrete wavelet transform algorithm, extract the original bit stream of the anti-counterfeiting code, perform hash operation on the original bit stream of the anti-counterfeiting code to obtain the verification hash value, and submit the obtained verification hash value to the smart contract in the alliance blockchain system;

[0128] The smart contract queries the corresponding multiple hash values ​​on the alliance blockchain system based on the received verification hash value, and determines the authenticity of the anti-counterfeiting code by comparing the verification hash value with the multiple hash values. At the same time, it uses the zero-knowledge proof protocol to determine whether the anti-counterfeiting code is valid. The final anti-counterfeiting code verification result is obtained by combining the authenticity judgment results and the validity judgment results of the anti-counterfeiting code.

[0129] For example, a consortium blockchain system is constructed with the participation of trademark owners, manufacturers and sellers. The consortium blockchain adopts a licensing mechanism, and only authenticated nodes can access the network and participate in the maintenance of the blockchain. All parties perform their respective duties and powers in accordance with the rules of the agreement. Smart contracts are deployed on the consortium blockchain to realize the registration, verification and management of anti-counterfeiting codes. Smart contracts are written in a Turing-complete programming language, which can flexibly customize business logic and processing procedures.

[0130] The trademark owner is responsible for generating the anti-counterfeiting code. The anti-counterfeiting code should be sufficiently random, unique, and unpredictable, and a variety of cryptographic algorithms (such as SHA256, AES, etc.) can be used to design the coding scheme. The trademark owner sends the generated anti-counterfeiting code to the manufacturer through a secure channel. To prevent man-in-the-middle attacks, the code can be digitally signed or encrypted.

[0131] After receiving the anti-counterfeiting code, the manufacturer prints it on the trademarked product, which becomes the only proof of product traceability and authenticity verification. At the same time, the manufacturer submits the anti-counterfeiting code to the alliance blockchain system for registration and evidence storage. In order to protect the confidentiality and integrity of the anti-counterfeiting code, the manufacturer performs multiple hashing on the anti-counterfeiting code before submitting it to the blockchain. Multiple hashing introduces parameters such as timestamps and random numbers to prevent replay attacks and rainbow table attacks. The multiple hash values ​​of the anti-counterfeiting code are packaged into the transaction of the blockchain, and after consensus across the entire network, they are written into the new block. Due to the immutability of the blockchain, the trusted storage and traceability of the anti-counterfeiting code can be ensured.

[0132] When sellers or consumers receive trademark products with anti-counterfeiting codes, they can use mobile devices such as mobile phones to take pictures of the anti-counterfeiting code images and initiate verification requests. The verification request is submitted to the smart contract of the alliance blockchain, triggering the verification logic on the chain. The smart contract calls the image processing module to pre-process the uploaded anti-counterfeiting code image, including image enhancement, noise filtering, geometric correction, etc., to obtain a standardized code image.

[0133] The digital watermark extraction and error correction coding decoding of the standardized coded image are performed to obtain the original bit stream of the anti-counterfeiting code. The watermark extraction algorithm can be implemented by discrete wavelet transform, singular value decomposition and other methods. The extracted original bit stream is hashed to obtain the verification hash value. In order to prevent the verification hash value from being tampered with, the zero-knowledge proof protocol is introduced to prove the correctness of the verification hash value without leaking the original information. The smart contract retrieves the corresponding multiple hash values ​​on the alliance blockchain based on the verification hash value. The authenticity of the anti-counterfeiting code is determined by comparing the two hash values. At the same time, according to the results of the zero-knowledge proof, it is determined whether the anti-counterfeiting code is valid and whether it has been reused. Based on the results of the authenticity and validity determination of the anti-counterfeiting code, the smart contract returns the final verification result and synchronizes the verification record to the alliance blockchain account book to form a complete and credible verification evidence chain.

[0134] The above scheme makes full use of the characteristics of blockchain decentralization, tamper-proof, and traceability, and combines cryptographic mechanisms such as multiple hashing and zero-knowledge proof to fundamentally improve the security, reliability, and unforgeability of anti-counterfeiting codes. At the same time, through algorithms such as image digital watermarking and error correction coding, the robustness and fault tolerance of anti-counterfeiting codes are enhanced.

[0135] In an optional embodiment,

[0136] The smart contract queries the corresponding multi-hash value on the alliance blockchain system based on the received verification hash value, and judges the authenticity of the anti-counterfeiting code by comparing the verification hash value with the multi-hash value. At the same time, the zero-knowledge proof protocol is used to judge whether the anti-counterfeiting code is valid. The final anti-counterfeiting code verification result is obtained by combining the judgment results of the authenticity of the anti-counterfeiting code and the judgment results of whether the anti-counterfeiting code is valid, including:

[0137] The received verification hash value and the corresponding multi-hash value on the consortium blockchain system are used as inputs of the multi-party secure computation protocol, and the verification hash value and the multi-hash value are split into several shares respectively using a secret sharing scheme, where each share is an independent polynomial point, and the original hash value can only be restored when at least a specified number of shares are collected;

[0138] Distribute the generated verification hash value shares and multi-hash value shares to each node in the consortium blockchain system through a secure channel, and each node only holds a pair of shares consisting of a verification hash value share and a multi-hash value share;

[0139] Based on the received shares, each node uses the secure multi-party comparison algorithm in the multi-party secure computing protocol to determine whether the verification hash value and the multi-hash value are equal, and obtains the initial comparison result in the form of secret sharing;

[0140] The initial comparison results of each node are aggregated using the threshold secret recovery algorithm. When the number of aggregated initial comparison results reaches the preset threshold value, the final hash value matching comparison result is recovered and submitted to the alliance blockchain to obtain the anti-counterfeiting code verification result.

[0141] Exemplarily, the anti-counterfeiting coding verification method of the smart contract based on multi-party secure computing and zero-knowledge proof includes the following steps:

[0142] After submitting the anti-counterfeiting code verification request to the alliance blockchain, the smart contract automatically triggers the verification logic and queries the corresponding multi-hash value in the blockchain ledger according to the verification hash value carried in the request. In order to protect the privacy of the hash value and prevent single point leakage, a secret sharing mechanism is introduced. The Shamir secret sharing scheme is adopted to split the verification hash value and the multi-hash value into h shares respectively, and set the threshold value M (M<=h). The secret sharing scheme meets the following requirements:

[0143] By selecting any M or more shares from all h shares, the original hash value can be uniquely restored; by selecting no more than h-1 shares, no information about the original hash value can be obtained.

[0144] Construct an h-1 degree polynomial f(x) over the finite field GF(p):

[0145] f(x)=a_0+a_1*x+a_2*x^2+…+a_(h-1)*x^(h-1)mod p;

[0146] Where p is a prime number greater than the original hash value, a_0 is the original hash value, a_1 to a(h-1) are randomly selected polynomial coefficients, and x represents the input variable.

[0147] Generate h shares of verification hash values ​​(x_1, f(x_1)), (x_2, f(x_2)), …, (x_h, f(x_h)), and h shares of multi-hash values ​​(y_1, g(y_1)), (y_2, g(y_2)), …, (y_h, g(y_h)) respectively. Where x_h and y_h are pre-agreed independent variable values, and f(x) and g(x) are polynomials embedded with verification hash values ​​and multi-hash values, respectively.

[0148] The smart contract distributes the generated hash value shares to each node of the alliance blockchain through a secure channel. Each node only holds a pair of shares and cannot restore the original hash value alone.

[0149] Each node of the alliance blockchain participates in the Secure Multi-party Computation protocol based on the received hash value share. The protocol allows nodes to jointly complete computing tasks under privacy protection without leaking their own data. This scheme adopts a hybrid protocol framework that combines Boolean circuits and secret sharing to design a secure multi-party comparison algorithm. The algorithm flow is as follows:

[0150] The node inputs the verification hash value share and multi-hash value share it holds into a pre-built Boolean circuit. The Boolean circuit is compiled using the GMW (Goldreich-Micali-Wigderson) protocol and can safely evaluate any function. The circuit compares the two hash value shares bit by bit, calculates the XOR result, and obtains the initial comparison result. The initial comparison result is still distributed among the nodes in the form of secret sharing. Each node only holds one bit of the secret share and does not know the share value of other nodes.

[0151] Each node submits its share of the initial comparison results to the smart contract, which acts as an honest "middleman" responsible for collecting and aggregating results from different nodes.

[0152] The smart contract performs threshold secret recovery on the initial comparison result shares received. Using the Lagrange interpolation formula, the original comparison result can be reconstructed with any h or more shares. In order to prevent nodes from submitting forged result shares, a zero-knowledge proof mechanism is introduced. Each node is required to provide proof of the correctness of its calculation process while submitting the result share. The smart contract verifies the proof to ensure that all shares are obtained through honest calculation. The zero-knowledge proof is implemented using the Schnorr protocol. The node uses the homomorphic hiding technology to prove that the submitted share satisfies the polynomial relationship without leaking the share value.

[0153] By aggregate verification of the zero-knowledge proof of each node, the smart contract can determine whether the final recovered comparison result is credible without knowing the contribution of individual nodes. The authenticity and validity of the anti-counterfeiting code can be obtained by combining the comparison results and the proof verification results.

[0154] The key data generated by the verification process (such as aggregated zero-knowledge proofs, restored comparison results, etc.) are packaged into a transaction and submitted to the alliance blockchain. After the transaction is reached through the consensus of the entire network, it is stored on the chain to form a credible evidence chain for anti-counterfeiting verification.

[0155] The smart contract returns the verification result of the anti-counterfeiting code to the seller or consumer who requested the verification, and automatically triggers subsequent business logic based on the verification result.

[0156] If the anti-counterfeiting code verification is passed, it means that the product is authentic and the source is credible. The system can further trace the information of the production, circulation, sales and other links of the product to achieve visual traceability of the entire chain. At the same time, the incentive mechanism will tokenize the verification behavior and result data, encourage users to participate in verification, supply data, and form a virtuous circle.

[0157] If the anti-counterfeiting code verification fails, it indicates that the product has an anti-counterfeiting problem and may be a counterfeit or inferior product. The system automatically alarms and triggers the regulatory agency to intervene in the investigation. By using the characteristics of blockchain that cannot be tampered with and can be traced, the source of the problematic product can be traced, the responsible party can be identified, and illegal channels can be blocked in a timely manner.

[0158] The data generated during the verification process (such as coded images, verification requests, comparison results, etc.) can provide samples for big data analysis, risk model training, etc. after being desensitized. Through data mining and machine learning algorithms, the characteristic patterns of counterfeit products can be identified, anti-counterfeiting strategies can be optimized, and risk events can be warned.

[0159] The above is the complete process of building a consortium blockchain anti-counterfeiting coding verification method by integrating cryptographic technologies such as multi-party secure computing, zero-knowledge proof, and secret sharing. The technical effects of this solution are:

[0160] Use secret sharing to split the hash value into multiple redundant shares and store them in blockchain network nodes to avoid single point failure and data leakage risks. Use secure multi-party computing to achieve hash value matching under privacy protection and complete the verification task without leaking the original hash value. Introduce zero-knowledge proof mechanism to verify the integrity of the calculation process and results without revealing the node contribution to prevent nodes from doing evil. Use smart contracts and blockchain technology to achieve automated execution of the anti-counterfeiting verification process, trusted evidence storage, and seamless connection with other business systems.

[0161] S103. Use the pre-trained trademark authenticity discrimination model to discriminate the authenticity confidence of the trademark image to be identified, obtain the authenticity confidence of the trademark image to be identified, and output the final trademark identification result based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence.

[0162] In an optional embodiment,

[0163] The authenticity confidence of the trademark image to be identified is identified by using a pre-trained trademark authenticity identification model to obtain the authenticity confidence of the trademark image to be identified. Based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence, the final trademark identification result is output, including:

[0164] Construct a trademark image dataset containing multiple typical features, and use a convolutional neural network to train the trademark image dataset to obtain a trademark authenticity discrimination model, which extracts texture, color, and shape features of the trademark image through a convolutional layer, performs multimodal feature fusion through a fully connected layer, and uses a classifier to output the authenticity confidence of the trademark image to be identified;

[0165] Collect multi-source heterogeneous trademark identification evidence including trademark registration information, trademark sales records, trademark logistics data and consumer feedback information, extract heterogeneous evidence features through feature engineering methods, and use embedded representation methods to map the extracted heterogeneous evidence features into a unified feature space;

[0166] For heterogeneous evidence features mapped to a unified feature space, a multi-view representation learning method is used to evaluate their credibility. Based on the obtained evidence credibility of each heterogeneous evidence feature, a comprehensive evidence feature is generated. At the same time, a reasoning mechanism based on the trademark domain knowledge graph is introduced to perform semantic enhancement and logical reasoning on the comprehensive evidence feature to obtain the semantic support of the comprehensive evidence feature.

[0167] The authenticity confidence of the trademark image to be identified, the semantic support of the comprehensive evidence features, and the anti-counterfeiting code verification result are input into the pre-trained integrated learning model to generate the final trademark identification result.

[0168] In an optional embodiment,

[0169] The authenticity confidence of the trademark image to be identified, the semantic support of the comprehensive evidence features, and the anti-counterfeiting code verification results are input into the pre-trained ensemble learning model to generate the final trademark identification results including:

[0170] A training set is constructed using real trademark samples and known counterfeit trademark samples, and the ensemble learning model is trained using an adaptive boosting algorithm to obtain a base classifier group consisting of a plurality of decision trees, wherein each decision tree recursively selects the optimal feature attributes of the training samples to perform node splitting until a preset splitting stop condition is reached;

[0171] In the iterative process, the classification loss is calculated based on the feature vector of each training sample and the weighted voting result of the current base classifier group. The weight of the misclassified training samples is increased so that the next decision tree focuses on the previously misclassified samples.

[0172] The authenticity confidence of the trademark image to be identified, the semantic support of the comprehensive evidence features, and the anti-counterfeiting code verification result are taken as input feature vectors and simultaneously input into each trained decision tree to obtain the classification result of each decision tree. The classification results of each decision tree are combined to generate the final trademark identification result.

[0173] For example, collect common genuine trademark and counterfeit trademark image samples on the market to build a high-quality training data set. The data set should cover multiple trademark categories and contain rich texture, color, shape and other features. Preprocess the original trademark images, including size normalization, noise removal, background segmentation, etc., to improve data quality and consistency. Use data enhancement techniques (such as rotation, scaling, flipping, etc.) to expand training samples and improve model generalization capabilities.

[0174] The convolutional neural network (CNN) is used as the main framework of the trademark authenticity discrimination model. The convolution layer and pooling layer are used to extract the local texture, color and shape features of the trademark image, and the hierarchical abstraction of the features is achieved by stacking multiple convolution blocks. After the convolution layer, the attention mechanism layer is introduced to adaptively adjust the weights of the features in different regions, highlight the key features of the trademark, and suppress the interference of background noise. The features extracted by the convolution layer are subjected to multimodal feature fusion through the fully connected layer, and the texture, color and shape information are comprehensively utilized to comprehensively characterize the visual features of the trademark. After the fully connected layer, a classifier (such as the Softmax layer) is connected to output the authenticity confidence of the trademark image to be identified. According to needs, multiple categories (such as genuine, counterfeit, unidentifiable, etc.) can be set to achieve fine-grained classification.

[0175] Cross Entropy is used as the loss function of the model, and L1 / L2 regularization terms are introduced to prevent overfitting. Mini-batch gradient descent algorithm is used to optimize model parameters and accelerate training convergence. Reasonable hyperparameters (such as learning rate, batch size, regularization coefficient, etc.) are set to control model complexity and generalization performance. Early Stopping mechanism is introduced to dynamically adjust the number of training rounds according to the effect of the validation set to avoid overfitting. Data Parallelism and Model Parallelism strategies are used to accelerate training using multiple GPUs. Checkpointing mechanism is used to save the model regularly to prevent interruption of the training process.

[0176] Collect trademark registration information (such as registration number, category, application date, etc.), trademark sales records (such as sales time, channel, quantity, etc.), trademark logistics data (such as storage address, transportation track, etc.) and consumer feedback information (such as evaluation, complaints, etc.). Clean and preprocess the original evidence data to handle missing values, outliers and inconsistent representations. Convert unstructured data (such as text, images) into structured features to unify the representation of evidence.

[0177] Design specific feature engineering methods for different types of evidence data. For structured data (such as sales records), extract statistical features (such as sales volume, frequency), time series features (such as fluctuation trends), etc. Use One-hot encoding, continuous encoding and other methods to process discrete features. For text data (such as consumer reviews), use bag-of-words models, TF-IDF and other methods to extract text features. Use word embedding models such as Word2vec and GloVe to learn the distributed representation of words. For image data (such as logistics documents), use CNN to extract visual features. For spatiotemporal data (such as logistics trajectories), use RNN, LSTM and other models to capture temporal dependencies. For graph structured data (such as knowledge graphs), use graph neural networks (GNNs) to learn embedded representations of nodes and edges while retaining the topological structure information of the graph.

[0178] For the extracted heterogeneous evidence features, an embedded representation learning method is used to map them into a unified low-dimensional feature space. Ensure that the features of different evidences are distributed at the same scale to facilitate subsequent feature interaction and fusion. Common embedded representation learning methods include linear mapping (such as PCA), nonlinear mapping (such as manifold learning), deep learning (such as autoencoders), etc. Choose a suitable method to balance representation ability and computational efficiency. In a unified feature space, use a multi-view representation learning method to jointly model the feature distribution of different evidences. Learn a unified evidence representation by maximizing the mutual information between different evidence features. Common multi-view representation learning methods include CCA (Canonical Correlation Analysis) and MvDA (Multi-view Discriminant Analysis). Obtain a compact and consistent evidence representation by optimizing the correlation or discriminability between evidences.

[0179] Evaluate the credibility of heterogeneous evidence features mapped into a unified feature space. Credibility reflects the degree of support for the authenticity of a trademark and helps identify and eliminate unreliable evidence. Common methods for evaluating the credibility of evidence include support calculation, consistency testing, and confidence estimation. Design targeted evaluation indicators and rules based on trademark domain knowledge. For evidence that supports that a trademark is genuine, increase its credibility weight; for evidence that supports that a trademark is counterfeit, reduce its credibility weight; for contradictory evidence, reconcile the credibility to reduce its impact on the final judgment result.

[0180] Based on the evidence credibility assessment results, heterogeneous evidence features are selected and filtered. Features with low credibility and high noise are eliminated, and features with high credibility and strong discrimination are retained. A weighted fusion strategy based on evidence credibility is adopted to generate comprehensive evidence features. Evidence features with high credibility are given greater weights, and evidence features with low credibility are given smaller weights, so as to achieve dynamic weighting of evidence features.

[0181] Introduce the knowledge graph in the trademark field to perform semantic enhancement on the comprehensive evidence features. The knowledge graph contains the association information between trademarks (such as trademark ownership relationship, trademark usage relationship, etc.), which helps to mine the implicit semantics between evidence features. Use knowledge representation learning technology (such as TransE) to embed the comprehensive evidence features into the representation space of the knowledge graph. Enrich the semantic representation ability of evidence features through semantic interaction with trademark entities and relationships. Apply reasoning mechanisms (such as rule-based reasoning and path-based reasoning) on ​​the knowledge graph to perform logical reasoning on the comprehensive evidence features. Discover new relationships between evidence and improve the semantic support of evidence features.

[0182] The multi-dimensional evidence matrix includes information from three different perspectives: trademark characteristics, multi-source heterogeneous evidence, and anti-counterfeiting code verification. It comprehensively depicts the authenticity of the trademark and provides sufficient basis for judgment.

[0183] For the trademark to be identified, its image features and heterogeneous evidence features are extracted, the anti-counterfeiting code verification results are obtained, and a multi-dimensional evidence matrix is ​​constructed. The evidence matrix is ​​input into the trained ensemble learning model, and each base classifier gives the judgment result respectively. Through weighted voting, majority voting and other strategies, the judgment results of each base classifier are integrated to generate the final trademark identification result (such as genuine, counterfeit, doubtful, etc.). The interpretability of the identification results is analyzed, the key evidence and judgment basis are located, and the credibility of the identification results is evaluated. If necessary, human experts are introduced to participate in the review and provide the final identification opinion.

[0184] Figure 2 FIG. 1 is a schematic diagram of the structure of a trademark identification system based on anti-counterfeiting coding according to an embodiment of the present invention. Figure 2 As shown, the system comprises:

[0185] The first unit is used to obtain the trademark image to be identified and perform preprocessing to obtain a standard trademark image, based on the standard trademark image, use the anti-counterfeiting code generation algorithm based on chaotic encryption to generate a corresponding anti-counterfeiting code, embed the generated anti-counterfeiting code into the standard trademark image to obtain a trademark image carrying the anti-counterfeiting code, perform coding positioning on it to obtain a corresponding coding area, correct the positioned coding area, and obtain a standardized anti-counterfeiting coding image;

[0186] The second unit is used to decode the standardized anti-counterfeiting code image to obtain an original bit stream of the anti-counterfeiting code, and compare the original bit stream of the anti-counterfeiting code with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system, verify the validity of the original bit stream through hash verification, and obtain an anti-counterfeiting code verification result;

[0187] The third unit is used to use a pre-trained trademark authenticity discrimination model to discriminate the authenticity confidence of the trademark image to be identified, obtain the authenticity confidence of the trademark image to be identified, and output the final trademark identification result based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence.

[0188] According to a third aspect of the embodiments of the present invention,

[0189] An electronic device is provided, comprising:

[0190] processor;

[0191] a memory for storing processor-executable instructions;

[0192] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0193] A fourth aspect of the embodiments of the present invention is:

[0194] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0195] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0196] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. Trademark identification method based on anti-counterfeiting coding, It is characterized in that include: The trademark image to be identified is obtained and preprocessed to obtain a standard trademark image. Based on the standard trademark image, a corresponding anti-counterfeiting code generation algorithm based on chaotic encryption is used to generate the corresponding anti-counterfeiting code. The generated anti-counterfeiting code is embedded in the standard trademark image to obtain a trademark image carrying the anti-counterfeiting code, and the code is positioned to obtain the corresponding coding area. The positioned coding area is corrected to obtain a standardized anti-counterfeiting code image. Decode the standardized anti-counterfeiting code image to obtain the original bit stream of the anti-counterfeiting code, and compare the original bit stream of the anti-counterfeiting code with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system, verify the validity of the original bit stream through hash verification, and obtain the anti-counterfeiting code verification result; The authenticity confidence of the trademark image to be identified is identified using a pre-trained trademark authenticity identification model to obtain the authenticity confidence of the trademark image to be identified. Based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence, the final trademark identification result is output.

2. The method according to claim 1, It is characterized in that Based on the standard trademark image, the corresponding anti-counterfeiting code is generated by using the anti-counterfeiting code generation algorithm based on chaotic encryption, and the generated anti-counterfeiting code is embedded in the standard trademark image to obtain the trademark image carrying the anti-counterfeiting code, and the coding is positioned to obtain the corresponding coding area, and the positioned coding area is corrected to obtain a standardized anti-counterfeiting coding image including: Extract the hash value of the standard trademark image, and combine it with the key provided by the trademark owner to generate a random sequence through chaotic mapping, permute and diffuse the random sequence to obtain a binary anti-counterfeiting code, and perform error correction coding and asymmetric encryption on the binary anti-counterfeiting code to obtain an encrypted anti-counterfeiting code; The encrypted anti-counterfeiting code is embedded into the standardized trademark image by using digital watermark technology, and the standardized trademark image is decomposed into low-frequency sub-bands and high-frequency sub-bands by discrete wavelet transform. The embedding strength is adaptively adjusted according to the importance of each sub-band, and the bit information of the encrypted anti-counterfeiting code is embedded at the same time. The trademark image carrying the anti-counterfeiting code is reconstructed by inverse discrete wavelet transform; Based on the obtained trademark image carrying the anti-counterfeiting code, the edge detection algorithm is used to extract its regional contour, and the initial coding area is screened out in combination with the prior knowledge of the anti-counterfeiting code. The initial coding area is screened by the region proposal network, multiple candidate areas are generated, and classification and regression are performed, and finally the target coding area is output; The target coding area is preprocessed, and the preprocessed target coding area is geometrically corrected to finally obtain a standardized anti-counterfeiting coding image.

3. The method according to claim 2, It is characterized in that Extract the hash value of the standard trademark image, and combine it with the key provided by the trademark owner to generate a random sequence through chaotic mapping, permute and diffuse the random sequence to obtain a binary anti-counterfeiting code, and perform error correction coding and asymmetric encryption on the binary anti-counterfeiting code to obtain the encrypted anti-counterfeiting code including: Extract the hash value of the standard trademark image, introduce a quantum random number generator to generate an initial random sequence, and obtain the seed key by performing an XOR operation on the initial random sequence and the key provided by the trademark owner; The obtained seed key is used as the initial value, and a fractional differential operator is introduced. By adjusting the order of the fractional differential operator, a target pseudo-random sequence is generated, and the generated target pseudo-random sequence is adaptively and dynamically permuted by a permutation algorithm based on dynamic key control. At the same time, multiple chaotic functions are introduced to iteratively diffuse the target pseudo-random sequence to obtain the final binary anti-counterfeiting code. A low-density parity check code is used to perform primary error correction on the obtained binary anti-counterfeiting code, and a polarization code is introduced to perform secondary error correction on the binary anti-counterfeiting code after the primary error correction, so as to obtain an optimized anti-counterfeiting code; Based on the optimized anti-counterfeiting code, encryption is performed in combination with a predefined user attribute set, wherein the user attribute set includes user authority and access authority, and the user's identity information is embedded in the optimized anti-counterfeiting code signature to obtain an encrypted anti-counterfeiting code.

4. The method according to claim 1, It is characterized in that The standardized anti-counterfeiting code image is decoded to obtain the original bit stream of the anti-counterfeiting code, and the original bit stream of the anti-counterfeiting code is compared with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system, and the validity of the original bit stream is verified by hash verification. The anti-counterfeiting code verification results include: Construct a consortium blockchain system jointly participated by the trademark owner, the manufacturer and the seller. The consortium blockchain system includes smart contracts for anti-counterfeiting code registration, verification and management functions. In the consortium blockchain system, the anti-counterfeiting code generated by the trademark owner is sent to the manufacturer. The manufacturer prints the anti-counterfeiting code on the trademark product and submits the multi-hash value of the anti-counterfeiting code to the consortium blockchain system. The multi-hash value is generated by the anti-counterfeiting code, timestamp and random number. Decode the standardized anti-counterfeiting code image through the discrete wavelet transform algorithm, extract the original bit stream of the anti-counterfeiting code, perform hash operation on the original bit stream of the anti-counterfeiting code to obtain the verification hash value, and submit the obtained verification hash value to the smart contract in the alliance blockchain system; The smart contract queries the corresponding multiple hash values ​​on the alliance blockchain system based on the received verification hash value, and determines the authenticity of the anti-counterfeiting code by comparing the verification hash value with the multiple hash values. At the same time, it uses the zero-knowledge proof protocol to determine whether the anti-counterfeiting code is valid. The final anti-counterfeiting code verification result is obtained by combining the authenticity judgment results and the validity judgment results of the anti-counterfeiting code.

5. The method according to claim 4, It is characterized in that The smart contract queries the corresponding multi-hash value on the alliance blockchain system based on the received verification hash value, and judges the authenticity of the anti-counterfeiting code by comparing the verification hash value with the multi-hash value. At the same time, the zero-knowledge proof protocol is used to judge whether the anti-counterfeiting code is valid. The final anti-counterfeiting code verification result is obtained by combining the judgment results of the authenticity of the anti-counterfeiting code and the judgment results of whether the anti-counterfeiting code is valid, including: The received verification hash value and the corresponding multi-hash value on the consortium blockchain system are used as inputs of the multi-party secure computation protocol, and the verification hash value and the multi-hash value are split into several shares respectively using a secret sharing scheme, where each share is an independent polynomial point, and the original hash value can only be restored when at least a specified number of shares are collected; Distribute the generated verification hash value shares and multi-hash value shares to each node in the consortium blockchain system through a secure channel, and each node only holds a pair of shares consisting of a verification hash value share and a multi-hash value share; Based on the received shares, each node uses the secure multi-party comparison algorithm in the multi-party secure computing protocol to determine whether the verification hash value and the multi-hash value are equal, and obtains the initial comparison result in the form of secret sharing; The initial comparison results of each node are aggregated using the threshold secret recovery algorithm. When the number of aggregated initial comparison results reaches the preset threshold value, the final hash value matching comparison result is recovered and submitted to the alliance blockchain to obtain the anti-counterfeiting code verification result.

6. The method according to claim 1, It is characterized in that The authenticity confidence of the trademark image to be identified is identified by using a pre-trained trademark authenticity identification model to obtain the authenticity confidence of the trademark image to be identified. Based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence, the final trademark identification result is output, including: Construct a trademark image dataset containing multiple typical features, and use a convolutional neural network to train the trademark image dataset to obtain a trademark authenticity discrimination model, which extracts texture, color, and shape features of the trademark image through a convolutional layer, performs multimodal feature fusion through a fully connected layer, and uses a classifier to output the authenticity confidence of the trademark image to be identified; Collect multi-source heterogeneous trademark identification evidence including trademark registration information, trademark sales records, trademark logistics data and consumer feedback information, extract heterogeneous evidence features through feature engineering methods, and use embedded representation methods to map the extracted heterogeneous evidence features into a unified feature space; For heterogeneous evidence features mapped to a unified feature space, a multi-view representation learning method is used to evaluate their credibility. Based on the obtained evidence credibility of each heterogeneous evidence feature, a comprehensive evidence feature is generated. At the same time, a reasoning mechanism based on the trademark domain knowledge graph is introduced to perform semantic enhancement and logical reasoning on the comprehensive evidence feature to obtain the semantic support of the comprehensive evidence feature. The authenticity confidence of the trademark image to be identified, the semantic support of the comprehensive evidence features, and the anti-counterfeiting code verification result are input into the pre-trained integrated learning model to generate the final trademark identification result.

7. The method according to claim 6, It is characterized in that The authenticity confidence of the trademark image to be identified, the semantic support of the comprehensive evidence features, and the anti-counterfeiting code verification results are input into the pre-trained ensemble learning model to generate the final trademark identification results including: A training set is constructed using real trademark samples and known counterfeit trademark samples, and the ensemble learning model is trained using an adaptive boosting algorithm to obtain a base classifier group consisting of a plurality of decision trees, wherein each decision tree recursively selects the optimal feature attributes of the training samples to perform node splitting until a preset splitting stop condition is reached; In the iterative process, the classification loss is calculated based on the feature vector of each training sample and the weighted voting result of the current base classifier group. The weight of the misclassified training samples is increased so that the next decision tree focuses on the previously misclassified samples. The authenticity confidence of the trademark image to be identified, the semantic support of the comprehensive evidence features, and the anti-counterfeiting code verification result are taken as input feature vectors and simultaneously input into each trained decision tree to obtain the classification result of each decision tree. The classification results of each decision tree are combined to generate the final trademark identification result.

8. A trademark authentication system based on anti-counterfeiting coding, used to implement the method described in any one of claims 1 to 7. It is characterized in that include: The first unit is used to obtain the trademark image to be identified and perform preprocessing to obtain a standard trademark image, based on the standard trademark image, use the anti-counterfeiting code generation algorithm based on chaotic encryption to generate a corresponding anti-counterfeiting code, embed the generated anti-counterfeiting code into the standard trademark image to obtain a trademark image carrying the anti-counterfeiting code, perform coding positioning on it to obtain a corresponding coding area, correct the positioned coding area, and obtain a standardized anti-counterfeiting coding image; The second unit is used to decode the standardized anti-counterfeiting code image to obtain an original bit stream of the anti-counterfeiting code, and compare the original bit stream of the anti-counterfeiting code with the standard anti-counterfeiting code bit stream stored in the pre-built blockchain system, verify the validity of the original bit stream through hash verification, and obtain an anti-counterfeiting code verification result; The third unit is used to use a pre-trained trademark authenticity discrimination model to discriminate the authenticity confidence of the trademark image to be identified, obtain the authenticity confidence of the trademark image to be identified, and output the final trademark identification result based on the anti-counterfeiting code verification result and the authenticity confidence of the trademark image to be identified, combined with the pre-acquired multi-source heterogeneous trademark identification evidence.

9. An electronic device, It is characterized in that include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Product antifake method based on digital watermarking and graphic code and apparatus thereof

    CN105701757A

  • Commodity anti-counterfeiting code batch generation method based on trademark picture scrambling encryption

    CN113935344A

  • Medical image digital watermarking method based on perceptual hash and data enhancement

    WO2022205853A1

Cited By

  • Intelligent identification and analysis method for anti-counterfeiting mark

    CN119850230A

  • Transaction anti-counterfeiting identification method based on deep learning

    CN119992303A

  • Deep Learning-Based Transaction Anti-Counterfeiting Identification Method

    CN119992303B

  • Electronic component authentication method and system

    CN120012809A

  • Food authenticity identification method and system based on spectral imaging

    CN120028284A