Deep neural network construction method and application for cotton textile anti-counterfeiting watermark generation and extraction

Through the deep neural network construction method, combined with a variety of data enhancement technologies, the problem of high image quality requirements for cotton textile watermark extraction in the existing technology has been solved, and the watermark extraction of wrinkled and stained cotton textiles under consumer-grade equipment has been achieved, improving It improves the robustness of the watermarking algorithm and is suitable for a wide range of applications.

CN118485563BActive Publication Date: 2024-09-20CHENGDU UNIV OF INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410950505.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-09-20
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

Existing cotton textile image watermarking technology has strict requirements on image quality during the extraction process and requires high-precision scanners, making it difficult to apply it to ordinary consumers. In particular, it cannot effectively identify wrinkled and stained cotton textile products for anti-counterfeiting.

Method used

A deep neural network construction method is adopted, including a coding network, a perturbation layer and a decoding network. It is trained through the Adam optimization algorithm and combined with data enhancement technologies such as affine transformation, blur distortion, chromatic aberration distortion, JPEG compression and random deformation to generate and extract watermarks and simulate In reality, the watermark destroys the effect and improves the robustness of the watermark.

Benefits of technology

It realizes the extraction of watermarks from cotton textiles under consumer-grade equipment. It can resist the destruction of multiple watermarks, improves the robustness of the watermark algorithm, is suitable for multiple watermark attack scenarios in the real world, and facilitates anti-counterfeiting identification by ordinary consumers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118485563B
    Figure CN118485563B
Patent Text Reader

Abstract

The present invention discloses a deep neural network construction method and application for generating and extracting cotton textile anti-counterfeiting watermarks, which belongs to the field of anti-counterfeiting technology, wherein the construction method includes obtaining watermark information and a number of cotton textile patterns; constructing a deep neural network including an encoding network, a perturbation layer and a decoding network, wherein the encoding network is used to generate a watermark image from the watermark information and the cotton textile pattern, the perturbation layer is used to perform data enhancement on the watermark image, and the decoding network is used to decode the watermark sequence in the watermark image after data enhancement; the several cotton textile patterns and the watermark sequence are input into the deep neural network, and the deep neural network is iteratively trained using the Adam optimization algorithm to obtain a trained deep neural network model. The deep neural network model constructed by this scheme can restore the original watermark by using a consumer-grade mobile phone camera imaging pipeline when the cotton textile article has slight wrinkles and stains, so as to facilitate the application of anti-counterfeiting identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to cotton textile anti-counterfeiting technology, and in particular to a deep neural network construction method and application for cotton textile anti-counterfeiting watermark generation and extraction. Background Art

[0002] Cotton textile images can reflect the personalized value of textiles. However, the increasingly frequent infringement of cotton textile images has brought huge losses to individuals and enterprises. Digital watermarking technology can embed given information into digital images as a certificate of genuine goods. It cannot be forged and does not affect the appearance. It has the function of protecting textile copyright. The paper "Digital Watermarking Technology of Textile Images Based on Chromatography System and Thermal Transfer Technology" discloses the combination of DCT-based digital watermarking technology and thermal imaging technology to embed 56×56 pixel copyright images into carrier images, which has high invisibility. However, the watermark obtained by this technology has high requirements for the collected images when the watermark is extracted later to confirm whether the cotton textile is genuine. For example, the carrier image needs to be clean and flat, and a high-precision scanner imaging pipeline is required to extract the watermark. However, most users are ordinary consumers and do not have high-precision scanners, which makes it difficult to confirm the authenticity. This harsh extraction condition limits the application of this technology. Summary of the invention

[0003] In view of the above-mentioned deficiencies in the prior art, the deep neural network construction method and application for generating and extracting anti-counterfeiting watermarks for cotton textiles provided by the present invention solve the problem in the prior art that cotton textile products with wrinkles and stains cannot be identified for anti-counterfeiting.

[0004] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0005] In a first aspect, the present invention provides a method for constructing a deep neural network for generating and extracting anti-counterfeiting watermarks for cotton textiles, which comprises the following steps:

[0006] Obtain watermark information and several cotton textile patterns;

[0007] Constructing a deep neural network including an encoding network, a perturbation layer and a decoding network, wherein the encoding network is used to generate a watermark image by combining watermark information with a cotton textile pattern, the perturbation layer is used to perform data enhancement on the watermark image, and the decoding network is used to decode the watermark information in the watermark image after data enhancement;

[0008] Several cotton textile patterns and watermark information are input into the deep neural network, and the deep neural network is iteratively trained using the Adam optimization algorithm to obtain a trained deep neural network model;

[0009] During iterative training, the cross entropy loss function of the watermark information is updated according to the preset number of training times, and the total loss function including the cross entropy loss function is updated according to the preset number of iterations;

[0010] The expressions of the cross entropy loss function and the total loss function are:

[0011]

[0012]

[0013] Among them, L1 is the cross entropy loss function; N is the length of the watermark information; y i is the predicted value of the information of the ith position of the cotton textile pattern, p i To predict y i The probability of; L is the total loss function; m, n are the length and width of the cotton textile pattern respectively; x ij and ij are the pixel values ​​of the i-th row and j-th column of the cotton textile pattern and the pixel values ​​of the i-th row and j-th column of the watermark image respectively; M and λ R The hyperparameter balanced model is used to learn the invisible watermark task and the anti-interference watermark task respectively.

[0014] Furthermore, the encoding network includes upsampling a 100-bit binary number through a fully connected layer to a 400×3 tensor and downsampling a cotton textile pattern to a 400×3 tensor, cascading to a 400×6 tensor, and inputting the 100-bit binary number into an asymmetric U-net structure through a 3×3 convolution, and performing several 3×3 convolution downsampling and upsampling;

[0015] The decoding network includes a spatial transformation network, several convolutional layers, a fully connected layer and an upsampling operation; the perturbation layer sequentially performs affine transformation, blur distortion, chromatic aberration distortion, Gaussian noise, JPEG compression and random deformation processing on the watermark image.

[0016] The beneficial effects of the above technical solution are as follows: this solution adopts an end-to-end design solution, and applies multiple data enhancements at both the decoding and encoding ends to fit the multiple watermark destruction effects that actually exist in reality. The superposition of these watermark destruction effects cannot be overcome by watermark algorithms based on traditional frequency domain such as DCT. Since the neural network of this solution has learned the characteristics of these multiple watermark destructions, the encoder can embed information that is sufficient to resist the destructive effects at key positions of the carrier image, so that the decoder can restore the watermark, thereby training the watermark algorithm to be more robust in the multiple watermark attacks in the real world than traditional frequency domain watermark algorithms such as DCT, and can have a wider range of application scenarios.

[0017] Furthermore, during the training process, the affine transformation uses a random 2×3 affine transformation matrix kernel for each batch of watermark images, and sets the affine transformation strength to offset up to ±40 pixels and rotate up to ±10 degrees; at the same time, bilinear interpolation is performed on the missing pixel parts of the watermark image;

[0018] The expression of the affine transformation matrix kernel is:

[0019]

[0020] in, and are the coordinate values ​​of the pixel points of the watermark image after affine transformation; x and y are the coordinate values ​​of the pixel points of the watermark image before affine transformation; m00, m01, m10, and m11 are cosθ, -sinθ, sinθ, and cosθ, respectively, and θ is the angle value of random rotation, which is between [-10°, 10°]; m02 and m12 are the random offsets of the pixel points of the watermark image on the x-axis and y-axis before affine transformation, and their values ​​are between [-40, 40];

[0021] The expression of bilinear interpolation is:

[0022]

[0023] in, is the pixel value of the image at coordinate (x, y) before bilinear interpolation; , , , are the pixel values ​​of the four pixels (x1, y1), (x2, y1), (x1, y2), (x2, y2) closest to the coordinate (x, y); dx and dy are the distance differences, respectively and ; x1 and x2, y1 and y2 are distance The horizontal and vertical coordinates of the four nearest pixels.

[0024] The beneficial effects of the above technical solution are as follows: the role of the affine transformation is to simulate the image loss of the watermark carrier image when entering the camera imaging pipeline, which is mainly caused by the shooting angle and shooting distance; therefore, the affine transformation layer simulates this damage, which can make the watermark robust to this damage.

[0025] Furthermore, during the blurring and distortion processing, a mixed blurring and distortion kernel is adopted, and the expression of the mixed blurring and distortion kernel is:

[0026]

[0027]

[0028] in, is the mixed blur distortion kernel; p is the random probability; σ is the standard deviation, which is randomly sampled between 1 and 3 pixels; e is the natural logarithm; is the linear blur kernel; L is the width of the linear blur kernel, which is randomly sampled between 3 and 7 pixels; θ is the angle of random rotation; x and y are the coordinates of the pixel points on the image, respectively.

[0029] The beneficial effects of the above technical solution are as follows: the role of blurring and distortion is to simulate the motion blurring and distortion caused by human jitter when the watermark carrier image enters the camera imaging pipeline, and the focus blurring and distortion caused by the camera's failure to focus successfully; therefore, the blurring and distortion layer simulates this kind of damage, which can make the watermark robust to this kind of damage.

[0030] Further, the chromatic aberration distortion processing includes hue shift and desaturation;

[0031] The hue shift is for each channel c of the {R, G, B} color channels, generating a new color value c' as:

[0032]

[0033] in, is a random number uniformly sampled in [-0.1, 0.1];

[0034] Desaturation is done by randomly linearly interpolating between an RGB image and its grayscale equivalent:

[0035]

[0036] Among them, I'RGB is the desaturated image; IRGB is the RGB image; I gray is the grayscale equivalent of IRGB; α is a random number uniformly sampled in [0, 1], indicating the proportion of interpolation.

[0037] The beneficial effects of the above technical solution are: the role of the chromatic aberration distortion layer is to simulate the undersaturation distortion caused by insufficient lighting and the chromatic aberration distortion caused by strong chromatic aberration lighting conditions of the watermark carrier image due to the influence of external lighting conditions, so the chromatic aberration distortion layer simulates this kind of damage, which can make the watermark robust to this kind of damage.

[0038] Furthermore, the expression of JPEG compression is:

[0039]

[0040] Among them, Q(C) is the image after JPEG compression; C is the coefficient after DCT transformation; q iis the quantization step size corresponding to different frequency coefficients; round(•) is rounded to the nearest integer;

[0041] The random deformation is to simulate the surface deformation of cotton textiles by using free-form deformation based on vector grid in image registration, and then use bilinear interpolation to remove the jagged edges caused by the surface deformation;

[0042] The expression for free-form deformation based on vector mesh is:

[0043]

[0044] Where V(x) is the image after free-form deformation; p' is the pixel point on the original image; x or is the grid point in the oth row and rth column in the vector grid; A or For x or The magnitude of the displacement vector on ; u is the unit vector; e is the natural logarithm; σ' is the standard deviation of the Gaussian diffusion kernel; M and are the total number of rows and columns in the vector grid, respectively; is the Euclidean distance between two points.

[0045] The beneficial effects of the above technical solution are as follows: the role of the deformation disturbance layer is to simulate the surface deformation of the watermark carrier image caused by the influence of the attached clothing fabric. Since this deformation will cause the displacement of the local overall pixels and affect the extraction of the watermark, the deformation disturbance layer simulates this damage, which can make the watermark robust to this damage.

[0046] Furthermore, the deep neural network training also includes returning a value from 0 to 1 according to the global training steps and the slope function value ramp, which is used to control the degree of image change in the perturbation layer; the slope function value ramp=10000.

[0047] Furthermore, the watermark information is a randomly generated binary bit sequence.

[0048] In a second aspect, the present solution also provides an application of a deep neural network, which comprises the steps of:

[0049] A deep neural network model obtained by obtaining a deep neural network construction method for generating and extracting cotton textile anti-counterfeiting watermarks;

[0050] Obtaining cotton textile patterns and watermark information to be printed on cotton textile products, and adding a BCH error correction code to the watermark information;

[0051] The cotton textile pattern and the watermark information with BCH error correction code are input into the deep neural network model, and the encoding network of the deep neural network model is used to generate the watermark image of the cotton textile pattern.

[0052] In a second aspect, the present solution also provides an application of a deep neural network, which comprises the steps of:

[0053] A deep neural network model obtained by obtaining a deep neural network construction method for generating and extracting cotton textile anti-counterfeiting watermarks;

[0054] Taking an image of a cotton textile pattern on a cotton textile product and performing positioning correction on the image;

[0055] The image after positioning correction is input into the deep neural network model, and the watermark sequence is obtained by decoding the image using the decoding network of the deep neural network model;

[0056] Use BCH code check to restore the watermark sequence and obtain BCH error correction code and watermark information;

[0057] Determine whether the watermark information is the watermark information input by the encoding network. If so, the cotton textile product is authentic, otherwise it is a counterfeit.

[0058] The beneficial effects of the present invention are as follows: due to the poor robustness of the existing frequency-domain-based cotton textile watermarking method, the watermark can only be restored by feeding the clean cotton textile flatly into the scanner imaging pipeline, which limits the implementation of the watermarking method. The deep neural network model constructed by this scheme applies a variety of disturbance layers that simulate watermark attacks between the watermark encoder and the decoder, including affine transformation, blur distortion, chromatic aberration distortion, deformation disturbance, etc., forcing the deep watermark model to learn these watermark attacks and improve the robustness of the watermarking algorithm. This watermark can also extract the watermark when the cotton textile has slight wrinkles and stains, and the original watermark information can be restored by using the imaging pipeline of a consumer-grade mobile phone camera, which facilitates the application of anti-counterfeiting identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 Flowchart of the method for building a deep neural network for anti-counterfeiting watermark generation and extraction of cotton textiles.

[0060] Figure 2 A schematic diagram of a deep neural network.

[0061] Figure 3 The architecture diagram of the encoding network.

[0062] Figure 4 This is the architecture diagram of the decoding network. DETAILED DESCRIPTION

[0063] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0064] refer to Figure 1 , Figure 1 The flowchart of the deep neural network construction method for generating and extracting cotton textile anti-counterfeiting watermarks is shown; Figure 1 As shown, the method S includes steps S1 to S3.

[0065] In step S1, watermark information and several cotton textile patterns are obtained; preferably, the watermark information is a randomly generated binary bit sequence.

[0066] In step S2, a deep neural network including an encoding network, a perturbation layer, and a decoding network is constructed. The schematic diagram of the deep neural network can be found in Figure 2 The encoding network is used to generate a watermark image by combining the watermark information with the cotton textile pattern, the perturbation layer is used to perform data enhancement on the watermark image, and the decoding network is used to decode the watermark information in the watermark image after data enhancement.

[0067] like Figure 3 As shown, when implemented, the preferred encoding network of this scheme includes upsampling a 100-bit binary number through a fully connected layer to a 400×3 tensor and downsampling a cotton textile pattern to a 400×3 tensor, cascading to a 400×6 tensor, and inputting it into an asymmetric U-net structure through a 3×3 convolution, and performing several 3×3 convolution downsampling and upsampling;

[0068] like Figure 4 As shown, the decoding network includes a spatial transformation network, several convolutional layers, a fully connected layer and an upsampling operation; the perturbation layer performs affine transformation, blur distortion, chromatic aberration distortion, Gaussian noise, JPEG compression and random deformation processing on the watermark image in sequence.

[0069] exist Figure 3 and Figure 4 In the figure, the number 100×1 refers to a tensor with a length of 100 and a width of 1, and has 1 channel. Its function is to embed the anti-counterfeiting code. This tensor actually contains 100 binary bits. Other numbers such as 400×32 refer to a tensor with a length of 400×400 and a width of 32 channels. 100×64 refers to a tensor with a length of 100×100 and a width of 64 channels. The remaining numbers are similar to 400×32 and 100×64, so they will not be repeated here.

[0070] After the encoding network of this scheme adopts the above network structure, it can help the encoding network learn the multi-scale global information of the image; the decoding network can capture and correct the slight perspective changes introduced when encoding the image.

[0071] In step S3, a number of cotton textile patterns and watermark information are input into the deep neural network, and the deep neural network is iteratively trained using the Adam optimization algorithm to obtain a trained deep neural network model.

[0072] The deep neural network training also includes returning a value from 0 to 1 according to the global training steps and the slope function value ramp, which is used to control the degree of image change of the perturbation layer so that the perturbation layer is a slowly enhanced differentiable process; the slope function value ramp=10000.

[0073] During iterative training, the first preset number of training times updates the cross entropy loss function of the watermark information, and the second preset number of iterations updates the total loss function including the cross entropy loss function; wherein the preset number of training times is much smaller than the preset number of iterations.

[0074] This scheme updates the cross entropy loss function in the early stage of training. The reason is that the initial training fluctuations of image quality loss and image perception loss are large, which will cause the deep neural network to fall into a local suboptimal solution with strong image concealment, and fail to obtain a global optimal solution with strong image concealment and strong robustness.

[0075] The expressions of the cross entropy loss function and the total loss function are:

[0076]

[0077]

[0078] Among them, L1 is the cross entropy loss function; N is the length of the watermark information; y i is the predicted value of the information of the ith position of the cotton textile pattern, p i To predict y i The probability of; L is the total loss function; m, n are the length and width of the cotton textile pattern respectively; x ij and ij are the pixel values ​​of the i-th row and j-th column of the cotton textile pattern and the pixel values ​​of the i-th row and j-th column of the watermark image respectively; M and λ R The hyperparameter balanced model is used to learn the invisible watermark task and the anti-interference watermark task.

[0079] The cross entropy loss function can supervise the deep neural network to learn anti-interference ability and ensure the robustness of the watermark; the right part of the total loss function can supervise the deep neural network to learn the ability to hide information and ensure the invisibility of the watermark.

[0080] In one embodiment of the present invention, during the training process, the affine transformation uses a random 2×3 affine transformation matrix kernel for each batch of watermark images, and sets the affine transformation strength to offset by a maximum of ±40 pixels and rotate by a maximum of ±10 degrees; at the same time, bilinear interpolation is performed on the missing pixel parts of the watermark image;

[0081] The expression of the affine transformation matrix kernel is:

[0082]

[0083] in, and are the coordinate values ​​of the pixel points of the watermark image after affine transformation; x and y are the coordinate values ​​of the pixel points of the watermark image before affine transformation; m00, m01, m10, and m11 are cosθ, -sinθ, sinθ, and cosθ, respectively, and θ is the angle value of random rotation, which is between [-10°, 10°]; m02 and m12 are the random offsets of the pixel points of the watermark image on the x-axis and y-axis before affine transformation, and their values ​​are between [-40, 40];

[0084] The expression of bilinear interpolation is:

[0085]

[0086] in, is the pixel value of the image at coordinate (x, y) before bilinear interpolation; , , , are the pixel values ​​of the four pixels (x1, y1), (x2, y1), (x1, y2), (x2, y2) closest to the coordinate (x, y); dx and dy are the distance differences, respectively and ; x1 and x2, y1 and y2 are distance The horizontal and vertical coordinates of the four nearest pixels.

[0087] During implementation, this solution preferably adopts a mixed fuzzy distortion kernel during the fuzzy distortion processing, and the expression of the mixed fuzzy distortion kernel is:

[0088]

[0089]

[0090] in, is the mixed blur distortion kernel; p is the random probability; σ is the standard deviation, which is randomly sampled between 1 and 3 pixels; e is the natural logarithm; is the linear blur kernel; L is the width of the linear blur kernel, which is randomly sampled between 3 and 7 pixels; θ is the angle of random rotation; x and y are the coordinates of the pixel points on the image, respectively.

[0091] When implemented, the scheme preferably includes chromatic aberration distortion processing including hue shift and desaturation;

[0092] The hue shift is for each channel c of the {R, G, B} color channels, generating a new color value c' as:

[0093]

[0094] in, is a random number uniformly sampled in [-0.1, 0.1];

[0095] Desaturation is done by randomly linearly interpolating between an RGB image and its grayscale equivalent:

[0096]

[0097] Among them, I'RGB is the desaturated image; IRGB is the RGB image; I gray is the grayscale equivalent of IRGB; α is a random number uniformly sampled in [0, 1], indicating the proportion of interpolation.

[0098] When implemented, the expression for the preferred JPEG compression of this scheme is:

[0099]

[0100] Among them, Q(C) is the image after JPEG compression; C is the coefficient after DCT transformation; q i is the quantization step size corresponding to different frequency coefficients; round(•) is rounded to the nearest integer;

[0101] Camera images are typically stored in a lossy format such as JPEG. JPEG compression compresses the image by computing the discrete cosine transform (DCT) of each 8×8 block in the image and quantizing the resulting coefficients by rounding to the nearest integer (using different intensities for coefficients with different frequencies).

[0102] The random deformation is to simulate the surface deformation of cotton textiles by using free-form deformation based on vector grid in image registration, and then use bilinear interpolation to remove the jagged edges caused by the surface deformation;

[0103] The expression for free-form deformation based on vector mesh is:

[0104]

[0105] Where V(x) is the image after free-form deformation; p' is the pixel point on the original image; x or is the grid point in the oth row and rth column in the vector grid; A or For x or The magnitude of the displacement vector on ; u is the unit vector; e is the natural logarithm; σ' is the standard deviation of the Gaussian diffusion kernel; M and are the total number of rows and columns in the vector grid, respectively; is the Euclidean distance between two points.

[0106] The free-form deformation based on vector grid in image registration is used to simulate the surface deformation of cotton textiles. The deformation process is a smooth transition for the target object. Because it is unpredictable how the surface deformation of cotton textiles will occur, a random vector is input to control the perturbation layer. At this time, the free-form deformation based on vector grid is a random deformation field. In this case, the convergence time of model training will be longer, but the generalization ability of the neural network will be stronger.

[0107] This solution also provides two applications of deep neural networks. The first one is mainly used for enterprises to generate watermark images, so as to print the watermark images embedded with watermark information on cotton products to achieve the purpose of anti-counterfeiting. This application includes the following steps:

[0108] A deep neural network model obtained by obtaining a deep neural network construction method for generating and extracting cotton textile anti-counterfeiting watermarks;

[0109] Obtaining cotton textile patterns and watermark information to be printed on cotton textile products, and adding a BCH error correction code to the watermark information;

[0110] The cotton textile pattern and the watermark information with BCH error correction code are input into the deep neural network model, and the encoding network of the deep neural network model is used to generate the watermark image of the cotton textile pattern.

[0111] Another method is used for consumers to purchase cotton textile products printed with cotton textile patterns, and then take photos and upload them to a deep neural network model for anti-counterfeiting identification. The specific implementation includes the following steps:

[0112] A deep neural network model obtained by obtaining a deep neural network construction method for generating and extracting cotton textile anti-counterfeiting watermarks;

[0113] Taking an image of a cotton textile pattern on a cotton textile product and performing positioning correction on the image;

[0114] The image after positioning correction is input into the deep neural network model, and the watermark sequence is obtained by decoding the image using the decoding network of the deep neural network model;

[0115] Use BCH code check to restore the watermark sequence and obtain BCH error correction code and watermark information;

[0116] Determine whether the watermark information is the watermark information input by the encoding network. If so, the cotton textile product is authentic, otherwise it is a counterfeit.

[0117] This solution uses the constructed deep neural network model for watermark generation and watermark anti-counterfeiting detection, which has the following effects on enterprises and consumers:

[0118] Brand image protection: Effective anti-counterfeiting measures can protect brand image and prevent reputation damage caused by counterfeit products.

[0119] Improved consumer confidence: Products that provide anti-counterfeiting verification can enhance consumer purchasing confidence and improve customer satisfaction.

[0120] Increased transparency: Consumers can verify the authenticity of textiles through scanning or specific equipment testing, increasing market transparency.

[0121] Fight against counterfeiting and shoddy products: Effective watermark technology will make it difficult for counterfeiters to copy or remove watermarks, thereby effectively combating counterfeit and shoddy products.

[0122] Protect intellectual property rights: Brands can use watermark technology to protect their designs and technologies from being illegally used.

[0123] Enhance brand value: Companies that adopt advanced anti-counterfeiting technology can establish a high-quality and trustworthy brand image in the market.

[0124] Promoting supply chain security: Watermarking technology can also help track the flow of products through the supply chain, ensuring the legitimacy of the product’s origin and distribution path.

Claims

1. A deep neural network construction method for generating and extracting cotton textile anti-counterfeiting watermarks, characterized in that: Includes steps: Obtain watermark information and several cotton textile patterns; Constructing a deep neural network including an encoding network, a perturbation layer and a decoding network, wherein the encoding network is used to generate a watermark image by combining watermark information with a cotton textile pattern, the perturbation layer is used to perform data enhancement on the watermark image, and the decoding network is used to decode the watermark information in the watermark image after data enhancement; Several cotton textile patterns and watermark information are input into the deep neural network, and the deep neural network is iteratively trained using the Adam optimization algorithm to obtain a trained deep neural network model; During iterative training, the cross entropy loss function of the watermark information is updated according to the preset number of training times, and the total loss function including the cross entropy loss function is updated according to the preset number of iterations; The expressions of the cross entropy loss function and the total loss function are: in, L 1 is the cross entropy loss function; N is the length of the watermark information; y i For cotton textile pattern i The predicted value of the information at each location, p i For prediction y i probability; L is the total loss function; m , n are the length and width of the cotton textile pattern respectively; x ij and y ij Cotton textile pattern i Line j The pixel value of the column and the watermark image i Line j The pixel value of the column; λ M and λ R They are respectively the task of learning to generate invisible watermarks for the hyperparameter balancing model and the task of learning to generate anti-interference watermarks; The encoding network includes upsampling a 100-bit binary number to a 400×3 tensor through a fully connected layer, cascading it with a cotton textile pattern downsampled to a 400×3 tensor to form a 400×6 tensor, and inputting it into an asymmetric U-net structure through a 3×3 convolution, and performing several 3×3 convolution downsampling and upsampling; The decoding network includes a spatial transformation network, several convolutional layers, a fully connected layer and an upsampling operation; the perturbation layer sequentially performs affine transformation, blur distortion, chromatic aberration distortion, Gaussian noise, JPEG compression and random deformation processing on the watermark image.

2. The method for constructing a deep neural network according to claim 1, characterized in that: During the training process, the affine transformation uses a random 2×3 affine transformation matrix kernel for each batch of watermark images, and sets the affine transformation strength to offset up to ±40 pixels and rotate up to ±10 degrees; at the same time, bilinear interpolation is performed on the missing pixel parts of the watermark image; The expression of the affine transformation matrix kernel is: in, and are the coordinate values ​​of the pixel points of the watermark image after affine transformation; x and y They are the coordinate values ​​of the pixel points of the watermark image before affine transformation; m 00, m 01, m10, m 11 are cos θ 、-sin θ 、sin θ 、cos θ , θ is the angle of random rotation, between [-10°, 10°]; m02, m12 are the pixels of the watermark image before affine transformation. x Axis and y A random offset on the axis, with a value between [-40, 40]; The expression of bilinear interpolation is: in, is the image before bilinear interpolation at coordinates ( x , y ) at the pixel value; , , , are the distance coordinates ( x , y ) The pixel values ​​of the four nearest pixel points (x1, y1), (x2, y1), (x1, y2), (x2, y2); dx and dy are the distance differences, respectively and ; x 1 and x 2, y 1 and y 2 are the distance The horizontal and vertical coordinates of the four nearest pixels.

3. The method for constructing a deep neural network according to claim 1, characterized in that: During the blurring and distortion processing, a mixed blurring and distortion kernel is adopted, and the expression of the mixed blurring and distortion kernel is: in, is the mixed blur distortion kernel; p is the random probability; σ is the standard deviation, which is randomly sampled between 1 and 3 pixels; e is the natural logarithm; is the linear blur kernel; L is the width of the linear blur kernel, which is randomly sampled between 3 and 7 pixels; θ is the angle value of random rotation; x and y are the coordinate values ​​of the pixels on the image.

4. The method for constructing a deep neural network according to claim 1, characterized in that: Chromatic aberration distortion processing includes hue shift and desaturation; The hue shift is for each of the {R, G, B} color channels c , generating new color values c 'for: in, is a random number uniformly sampled in [-0.1, 0.1]; Desaturation is done by randomly linearly interpolating between an RGB image and its grayscale equivalent: in, I'RGB is the desaturated image; IRGB is an RGB image; I gray for IRGB Grayscale equivalent of ; α is a random number uniformly sampled from [0, 1], indicating the proportion of interpolation.

5. The method for constructing a deep neural network according to claim 4, characterized in that: The expression for JPEG compression is: in, Q ( C ) is the image after JPEG compression; C is the coefficient after DCT transformation; q i is the quantization step size corresponding to different frequency coefficients; round(•) is rounded to the nearest integer; Random deformation is to simulate the surface deformation of cotton textiles by using free-form deformation based on vector grid in image registration, and then bilinear interpolation is used to remove the jagged edges caused by surface deformation. The expression for free-form deformation based on vector mesh is: in, V ( x ) is the image after free-form deformation; p ' is the pixel point on the original image; x or is the first o Line r Grid points of the column; A or for x or The magnitude of the displacement vector on ; u is a unit vector; e is the natural logarithm; σ ' is the standard deviation of the Gaussian diffusion kernel; M and are the total number of rows and columns in the vector grid, respectively; is the Euclidean distance between two points.

6. The method for constructing a deep neural network according to any one of claims 1 to 5, characterized in that: The deep neural network training also includes returning a value from 0 to 1 according to the global training steps and the slope function value ramp, which is used to control the degree of image change in the perturbation layer; the slope function value ramp=10000.

7. The method for constructing a deep neural network according to any one of claims 1 to 5, characterized in that: The watermark information is a randomly generated binary bit sequence.

8. A method for generating a watermark image for cotton textiles, characterized in that: Includes steps: Obtaining a deep neural network model obtained by using the method for constructing a deep neural network for generating and extracting a cotton textile anti-counterfeiting watermark according to any one of claims 1 to 7; Obtaining cotton textile patterns and watermark information to be printed on cotton textile products, and adding a BCH error correction code to the watermark information; The cotton textile pattern and the watermark information with BCH error correction code are input into the deep neural network model, and the encoding network of the deep neural network model is used to generate the watermark image of the cotton textile pattern.

9. A cotton textile anti-counterfeiting identification method, characterized in that: Includes steps: Obtaining a deep neural network model obtained by using the method for constructing a deep neural network for generating and extracting a cotton textile anti-counterfeiting watermark according to any one of claims 1 to 7; Taking an image of a cotton textile pattern on a cotton textile product and performing positioning correction on the image; The image after positioning correction is input into the deep neural network model, and the watermark sequence is obtained by decoding the image using the decoding network of the deep neural network model; Use BCH code check to restore the watermark sequence and obtain BCH error correction code and watermark information; Determine whether the watermark information is the watermark information input by the encoding network. If so, the cotton textile product is authentic, otherwise it is a counterfeit.