Micro-optical structure generating invisible dynamic code AI recognition method
By employing a multimodal acquisition and decoding process and an AI recognition model, the problem of recognition stability of micro-optical structures under environmental changes and counterfeiting attacks has been solved. This enables highly secure and practical dynamic cipher recognition on mobile terminals, improving the robustness and anti-counterfeiting capabilities of the recognition system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN DINGXUN TECH CO LTD
- Filing Date
- 2025-04-11
- Publication Date
- 2026-05-29
Smart Images

Figure CN120373329B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of AI recognition, and in particular relates to a method for AI recognition of invisible dynamic codes generated by micro-optical structures. Background Technology
[0002] With the increasing demand for applications such as information security, product anti-counterfeiting, and intelligent identification, anti-counterfeiting technologies based on physically uncopyable characteristics have received widespread attention. Among these, micro-optical structures (such as nanogratings, microlens arrays, and surface relief structures) are widely used to manufacture anti-counterfeiting marks that are invisible to the naked eye and difficult to imitate due to their high structural complexity, viewpoint dependence, and sensitivity to ambient light. These microstructures can be embedded in the surface of labels, packaging, or other carriers, and by precisely controlling their geometry, they can form optical patterns under specific lighting or observation conditions for tasks such as identity authentication and anti-counterfeiting identification. However, despite the excellent uncopyability of microstructures, their technological development at the identification end still faces many challenges.
[0003] Traditional microstructure recognition methods are mostly based on a "static imaging + template matching" model, which involves photographing microstructure patterns under standard lighting and angle conditions and then comparing them with pre-registered images. While this approach works reasonably well in laboratory environments, it exhibits significant instability in real-world applications. Firstly, microstructures are extremely sensitive to external conditions (especially incident light angle, viewing angle, light source type, and ambient brightness). Their reflection patterns can change drastically under different angles or lighting conditions, leading to recognition failures. Secondly, with advancements in printing technology and forgery techniques, attackers can replicate optical patterns that appear identical under specific conditions, deceiving traditional image recognition algorithms. Thirdly, traditional AI recognition algorithms are often built on standardized image training sets and lack the ability to model dynamic changes in real-world environments. Their accuracy drops significantly when faced with angular perturbations, lighting variations, and differences in camera modules. Furthermore, some research has attempted to introduce AI-assisted recognition, but this often still relies on single-frame images, failing to effectively utilize the physical characteristics of microstructures such as "angle responsiveness" or "dynamic reflection patterns."
[0004] With the widespread deployment of mobile terminals, higher demands are placed on microstructure recognition systems. These systems must possess adaptability to environmental changes, the ability to identify forgery attacks, and robustness to real-world user operations. Currently, no mature solution can combine physical microstructure responses with artificial intelligence recognition models to build a highly secure and practical dynamic cipher recognition system without altering user operating habits. Therefore, there is an urgent need for a recognition method that can utilize the complex physical response characteristics of microstructures and adapt to various usage conditions through intelligent algorithms, fundamentally addressing the shortcomings of traditional solutions in terms of anti-counterfeiting capabilities, recognition stability, and deployment flexibility. Summary of the Invention
[0005] The purpose of this invention is to propose an AI recognition method for generating invisible dynamic cryptographic codes using micro-optical structures. It constructs a multi-modal acquisition and decoding process that can run in real time on mobile terminals, which can adaptively adjust image preprocessing strategies and resist the influence of real-world factors such as changes in illumination, differences in shooting angles, and differences in camera modules. It has good versatility and ease of deployment.
[0006] To achieve the above objectives, this invention provides a method for generating invisible dynamic cryptographic codes using micro-optical structures for AI recognition, the method comprising:
[0007] S1. Use a mobile terminal to scan the product packaging, automatically start the image acquisition process to acquire images in frames, as well as the illumination parameters of each frame of the corresponding image and the shooting angle of the image, and organize each frame of the image, the illumination parameters of each frame of the corresponding image and the shooting angle of each frame of the corresponding image into a structured data sequence.
[0008] S2. Normalize each frame of the structured data sequence of each frame image and regenerate the normalized sequence; wherein, the normalized sequence includes each frame image after normalization, the shooting angle corresponding to the image, and the illumination parameters of each frame image.
[0009] S3. Input the generated normalized sequence into the pre-trained structural response decoding model, identify the unique structural code corresponding to the sequence image formed by the reflection of the micro optical structure under multiple angles and multiple illumination conditions, and output the corresponding structural code.
[0010] S4. Design a structure generation model, using the corresponding structure code, the shooting angle of the image, and the lighting parameters of each frame as the model input, and perform inference analysis to simulate the generation of an image under the current shooting conditions if a certain structure code is real. Then, compare the generated image with the normalized image of each frame to generate an image similarity sequence, thereby completing the verification of the authenticity of its structure code.
[0011] S5. The average value of the image similarity sequence is used as the credibility score. The credibility score is compared with a preset credibility threshold to determine whether to accept the recognition result.
[0012] If the credibility score is greater than or equal to the preset credibility threshold, the current structure encoding recognition is considered credible, and the system returns it as a valid recognition result.
[0013] If the credibility score is less than the preset credibility threshold, the system will refuse to output the recognition result and prompt the user to rescan or warn of the risk of forgery.
[0014] Furthermore, the structured data sequence is a triple;
[0015] Wherein, S1 further includes:
[0016] A legality analysis is performed on each frame of the image to determine whether it should be included in the sequence. The legality analysis is a multi-factor weighted comprehensive analysis based on the brightness variance of each frame, the edge entropy of each frame, and the cosine similarity between the current frame and the previous frame to generate a legality score.
[0017] Furthermore, S1 further includes: evaluating the angle and illumination coverage of the structured data sequence to determine its validity.
[0018] Based on the structured data sequence, the ratio of the number of elements of the corresponding shooting angle to the number of the set minimum effective angle intervals is calculated to obtain the angle coverage.
[0019] Based on the structured data sequence, the ratio of the illumination parameters of each frame to the set types of effective illumination conditions is calculated to obtain the illumination parameter coverage.
[0020] If the angular coverage is less than 0.8 and the illumination parameter coverage is less than 0.7, the user will be prompted to rescan.
[0021] Furthermore, S2 specifically includes:
[0022] After converting each frame of the image into the corresponding grayscale image, the average brightness is calculated, and the average brightness is smoothed to obtain the normalization factor. All pixel values of each frame of the image are multiplied by the normalization factor to adjust the overall image brightness so that the images acquired under different light intensities are unified to the average brightness level.
[0023] Based on the color temperature obtained from the main hue and environmental parameters in the HSV space of each frame image, equivalent color shift adjustment is performed;
[0024] Generate normalized images for each frame and form a normalized sequence.
[0025] Furthermore, the operation steps of the structural response decoding model are as follows:
[0026] First, a convolutional encoder is used to extract the local feature vector of each normalized frame image. The corresponding angle and illumination parameters are then encoded into a context vector through two fully connected networks. The two are concatenated to obtain the joint input representation of each frame image, and a joint input representation sequence is constructed.
[0027] Then, a multi-layer residual attention modeling module is constructed. It takes the joint input representation sequence as input, combines it with the angle position encoding of each frame, and outputs a global representation vector of the structural response sequence. Finally, a decoder predicts the structural encoding, represented as:
[0028]
[0029] Where C is the structural encoding, f φ For the structure generation model, x i Let be the joint input representation of image i, n be the total number of frames, MLP be a multilayer perceptron, AttnBlock be a multilayer residual attention modeling module, and Ω({x i}) is the response trajectory sparse regularization term, used to penalize information redundancy in the sequence;
[0030] The final output structure encoding C includes:
[0031] Fixed-length binary vectors are used for encrypted identification and / or structurally unique ID numbers are used for database comparison and verification.
[0032] Furthermore, the multi-layer residual attention modeling module consists of two layers of residual attention blocks, which include multi-head attention and a feedforward network; the angular position encoding of each frame image is constructed using sine and cosine functions.
[0033] Furthermore, the sparse regularization term of the response trajectory is analyzed for sparsity constraint by measuring the difference between the features and the mean using the L1 norm.
[0034] Furthermore, the structure generation model, used to simulate image generation, is designed as follows:
[0035]
[0036] in, To generate an image, G θ For the structure generation model, (C,θ) i E i ) is a fusion vector of the corresponding structural encoding, the shooting angle of the image, and the illumination parameters of each frame, Φ C (C) is the prior tensor of the structural pattern obtained by structural encoding feature mapping; Φ env (θ i E i ) is the modulation tensor output by the environmental factor encoder, representing the optical modulation of the structure under specific shooting conditions; It is a residual response activation term used to learn the higher-order nonlinear response behavior under the coupling of structure and angle / lighting;
[0037] Among them, residual response activation term The structure pattern prior tensor obtained by the structure-environment channel mapping matrix and the structure encoding feature mapping, and the modulation tensor output by the environment factor encoder are generated by a single-head weighted attention operation.
[0038] Furthermore, the structure generation model also includes a response consistency regularization term, which is used to ensure that the image generated by the model exhibits the typical physical response behavior of real microstructures in local structural regions; the response consistency regularization term is obtained based on the difference analysis of the energy spectrum extracted after performing a fast Fourier transform on each generated image and a normalized image in the horizontal direction.
[0039] The reasoning analysis includes:
[0040] Structural similarity is calculated between each generated image and each normalized image to generate a structural similarity index. After full sequence alignment, a similarity sequence is output.
[0041] Furthermore, the structural similarity index includes the SSIM index.
[0042] The beneficial technical effects of the present invention are at least as follows:
[0043] This invention proposes an intelligent identification method and system for stealth codes carried by micro-optical structures, which can stably identify them even in complex real-world environments and possesses high anti-counterfeiting capabilities. Compared to traditional methods that rely on single static image recognition, this invention fully leverages the physical characteristics of microstructures exhibiting different optical responses under different angles and lighting conditions. It proposes extracting multi-dimensional structural features through dynamic information acquisition and modeling, significantly enhancing the robustness and anti-counterfeiting capabilities of the identification system. Furthermore, this invention does not solely rely on the image recognition model itself to improve accuracy; instead, it introduces a structural authenticity verification mechanism based on physical laws, capable of identifying the source of captured images and effectively preventing image forgery attacks. In addition, this invention constructs a multi-modal acquisition and decoding process that can run in real-time on mobile terminals. It can adaptively adjust image preprocessing strategies to resist the influence of real-world factors such as changes in lighting, differences in shooting angles, and differences in camera modules, exhibiting good versatility and ease of deployment.
[0044] In summary, this invention establishes a closed-loop identification system from four levels: "structural coding design", "information acquisition strategy", "AI recognition modeling" and "authenticity verification mechanism", which systematically solves the core problems of existing microstructure cryptographic identification technology in terms of environmental adaptability, anti-counterfeiting capability and practical usability. Attached Figure Description
[0045] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.
[0046] Figure 1 This is a flowchart of the AI recognition method for generating invisible dynamic cryptographic codes using a micro-optical structure according to the present invention. Detailed Implementation
[0047] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0048] like Figure 1 As shown in the embodiment of the present invention, the method for generating invisible dynamic cryptographic codes using micro-optical structures includes the following steps S1-S5:
[0049] S1. Use a mobile terminal to scan the product packaging, automatically start the image acquisition process to acquire images in frames, as well as the illumination parameters of each frame of the corresponding image and the shooting angle of the image, and organize each frame of the image, the illumination parameters of each frame of the corresponding image and the shooting angle of each frame of the corresponding image into a structured data sequence.
[0050] Specifically, when a user scans the miniature optical structure on the product packaging with a mobile device, the system automatically initiates the image acquisition process. The device uses a camera to capture one image frame every 60 milliseconds. i Furthermore, by utilizing the perspective changes naturally caused by hand-held shaking, the corresponding shooting angle θ of the image is obtained. i Among them, I i It is an RGB image with a resolution of 640×480, taken by the device's rear camera in automatic exposure mode; θ i =(α i ,β i ), where α i Indicates pitch angle, β i The yaw angle is expressed in degrees and is collected in real time from the device's gyroscope, with timestamps aligned to each frame of the image.
[0051] At the same time, during the acquisition of each frame of image I i During the process, the device acquires the illumination parameter E through the ambient light sensor. i =(l i ,T i ,ψ i ),in:
[0052] l i This indicates the ambient light intensity (in lux), which is obtained in real time by the phone's light intensity sensor.
[0053] T i This indicates the color temperature of the main light source (in Kelvin), from image I. i The color histogram is obtained by fitting the grayscale channels;
[0054] ψ i This represents the direction angle of the main light source (in degrees), estimated from the area of maximum brightness in the image brightness distribution.
[0055] This design ensures image I i The optical imaging conditions are fully described in the data structure, enhancing the ability to model physical consistency in subsequent processing.
[0056] Furthermore, each triplet (I) collected i ,θ i E i Organized into a structured data sequence:
[0057]
[0058] The value of n is controlled between 8 and 15 frames to ensure that the samples are sufficiently dense in both time and angle dimensions, but without causing a system performance bottleneck. This data structure is the core input structure of the entire system.
[0059] To avoid image blurring, redundancy, or abnormal exposure, the system performs image processing on each frame. i Calculate the legality score μ i Determine whether it should be included in the sequence:
[0060]
[0061] in:
[0062] Image I i The luminance variance, which measures the overall texture contrast, is from I i Grayscale image calculation;
[0063] G(I i Image I i The edge entropy is extracted using the Sobel gradient map and then the Shannon entropy is calculated.
[0064] D(I i ,I i-1 ): Cosine similarity between the image and the previous frame to avoid redundancy in consecutive frames;
[0065] λ1, λ2, λ3: Control item weights, recommended to be set as (0.5, 1.0, 0.8).
[0066] Only when μ i Only when the threshold value is greater than τ (empirical threshold τ = 3.5) is the frame included in the final sequence, ensuring the quality and variability of the collected data.
[0067] Furthermore, to ensure comprehensive coverage of structural response information, the system performs analysis on the entire sequence. Conduct angle and illumination coverage assessment:
[0068]
[0069] in:
[0070] C θ M represents angular coverage. θ The minimum number of effective angle intervals is set.
[0071] C E M represents the coverage of illumination parameters. E The types of effective lighting conditions to be set;
[0072] System Requirements C θ ≥0.8 and C E ≥0.7, otherwise prompt the user to rescan.
[0073] Valid sampling sequence after filtering by the above mechanism This will serve as the sole input for the next step of image normalization processing. Compared to the traditional "image as input" approach, this invention ensures that each frame of the image carries traceable physical environment information, providing fundamental support for addressing the problem of "structural response being susceptible to external environmental interference" that this invention aims to solve.
[0074] S2. Normalize each frame of the structured data sequence of each frame image to regenerate a normalized sequence; wherein, the normalized sequence includes each frame image after normalization, the shooting angle corresponding to the image, and the illumination parameters of each frame image.
[0075] Specifically, the goal of this step is to receive the image-environment sequence output from step one. For each frame image I i Perform based on illumination parameter E i =(l i ,T i ,ψ i The normalization process outputs a standard image I. i ′, forming a new input sequence The goal of this process is to improve the consistency of the image so that subsequent structural decoding models can obtain stable input features in diverse environments.
[0076] Image brightness normalization is the first step. For image I i Convert to grayscale Then, calculate the average brightness m. i And define the normalization factor:
[0077]
[0078] in:
[0079] m i It is an image The average brightness value of all pixels, with a value range of [0, 255], is obtained by averaging the grayscale values of the image.
[0080] m0 is the standard brightness target, set to 128;
[0081] ∈ is a small constant, set to 1, to prevent division by zero.
[0082] The normalization operation is: to normalize I i Multiply all pixel values by η i Adjust the overall image brightness to unify images acquired under different light intensities to the m0 brightness level.
[0083] Next, color temperature correction is performed. Based on image I i Primary color in HSV color space The color temperature T obtained from the illumination parameters i This invention performs equivalent color shift adjustment. Instead of introducing a fixed color reference model, it uses a linear mapping method of the image's own hue at a standard color temperature T0 = 5000K to converge the image's hue towards the standard light source color gamut.
[0084]
[0085] in:
[0086] It is an image after light intensity normalization;
[0087] T i It is the ambient color temperature of the current frame recorded in step one;
[0088] T0 is the standard color temperature for system design, with a recommended value of 5000K;
[0089] γ is the adjustment amplitude coefficient, and it is recommended to set it to 0.6;
[0090] ColorShift(·) is an operation that shifts the entire hue channel of an image, used to simulate a shift from warm light to white light or vice versa.
[0091] The final normalized sequence is formed:
[0092]
[0093] This sequence preserves the image I of each frame. i ′ and its shooting angle θ i With ambient light E i However, the image content has been unified into a standard optical environment space.
[0094] S3. Input the generated normalized sequence into the pre-trained structural response decoding model, identify the unique structural code corresponding to the sequence image formed by the reflection of the micro optical structure under multiple angles and multiple illumination conditions, and output the corresponding structural code.
[0095] Specifically, the core task of this step is to use the illumination-normalized image sequence output from step two. Construct a structural response decoding model f φ The unique structural code C, or "dynamic cloaking code," is identified by analyzing the sequence of images formed by the reflection of micro-optical structures under multiple angles and illumination conditions. This process is the core information extraction step in the entire system, determining whether a stable and identifiable structural fingerprint can be accurately extracted from the weak optical responses under environmental influences.
[0096] It should be noted that, unlike traditional image recognition tasks, the image sequences of this invention have the following patented features:
[0097] Each frame image I i ′ is when the shooting angle θ is known. i and illumination parameter E i The data was collected from the following sources.
[0098] The pattern changes in the image are not free-moving, but rather the "response trajectory" of the physical structure under different observation conditions;
[0099] All frames are encoded from the same microstructure, but they present different reflection patterns due to different viewing angles and lighting.
[0100] Therefore, the modeling task in this step is not to classify "who" an image "belongs to," but rather to learn a function f. φ This function can reconstruct the code C initially embedded in the structure through the "trend of change" in an image sequence. This trend modeling is far more complex than traditional classification because its input information consists of continuous feature changes that are implicitly present in the differences between sequences.
[0101] First, for each frame image I i Use a convolutional encoder to extract its local feature vectors and the corresponding angle θ i =(α i ,β i ) and illumination parameter E i =(l i ,T i ,ψ i Encoded into a context vector through two layers of fully connected networks. The two are concatenated to obtain the joint input representation of each frame of the image:
[0102]
[0103] in:
[0104] z i It is an image encoder for I i The output of ' is (convolution + pooling + flatten), with dimension d = 128;
[0105] e i It is θ i and E i The concatenated output is mapped to a vector and used to incorporate physical context information.
[0106] spliced x i It is the basic unit for modeling sequential response behavior.
[0107] Then, a multi-layer residual attention modeling module is constructed, with the joint input representation sequence {x1,...,x} as input. n The global representation vector r of the output structural response sequence is then passed through a decoder to predict the structural encoding C.
[0108]
[0109] in:
[0110] p i It is the angular position encoding of each frame (constructed using sine and cosine functions);
[0111] AttnBlock is a two-layer residual attention block, consisting of multi-head attention and a feedforward network;
[0112] Ω({x i}) is a response trajectory sparse regularization term specifically designed for the scenario of this invention. It is used to penalize information redundancy in the sequence and improve the ability to focus on modeling "strong structural response regions". The sparsity constraint analysis is as follows:
[0113]
[0114] in:
[0115] It is the mean vector of the sequence;
[0116] item Represents the sparsity of the response relative to the average response per frame;
[0117] The coefficient λ controls the regularization strength, and a value of 0.1 is recommended.
[0118] This innovative design emphasizes the difference between "response peak frames" (i.e., frames with the clearest structure) and "normal frames," thereby allowing the model to focus on the most discriminative range of image changes. This addresses the issues of uneven reflected images and high inter-frame information redundancy under multi-angle perturbation acquisition in this invention patent.
[0119] The final model output C is:
[0120] Fixed-length binary vectors (e.g., C∈{0,1}) 64 Used for encrypted identification;
[0121] Or a unique structural ID number (such as...) It is used for database comparison and verification.
[0122] The meaning of C is standardized and encoded at the structural manufacturing end. During system training, structural samples and their encoded labels are used. Perform cross-entropy loss optimization.
[0123] S4. Design a structure generation model, using the corresponding structure code, the shooting angle of the image, and the lighting parameters of each frame as input to perform inference analysis. This model is used to simulate the generation of an image under the current shooting conditions if a certain structure code is real. Then, the generated image is compared with the normalized image of each frame to generate an image similarity sequence, thereby completing the verification of the authenticity of its structure code.
[0124] Specifically, this step plays a crucial role in anti-counterfeiting verification within the entire patent system, serving as the substantive judgment of the authenticity of the structural decoding result C. In the previous step, this invention uses the decoding model f φ A structural code C was identified based on the image response trajectory. However, since image sequences can be affected by forged images, counterfeit materials, or even image attacks, this invention cannot directly trust C and must determine whether it truly originates from a physically existing microscopic optical structure. Therefore, this step introduces a structural generation model G. θ This is used to simulate "if a certain structure encoding C is real, under the current shooting conditions (θ)". i E i "What kind of image should it present?" Then, the generated image will be... Compared with actual image I i The comparison is performed to verify the authenticity of C.
[0125] The input data consists of the following three items, all of which come from the previous steps:
[0126] Structural encoding C: derived from model f in step 3 φ The output is the decoding result to be verified;
[0127] Image acquisition angle θ i =(α i ,β i ): Retained from step 1;
[0128] Illumination parameter E i =(l i ,T i ,ψ i ): Retain from step 1.
[0129] The goal of this invention is to construct a generative model G. θ The simulated structure encoding C is a reflection response image under specified observation conditions.
[0130] In model design, G θ Receive (C,θ) i E i (input) = (output image) To ensure that the generated images possess high structural consistency and physical interpretability, this invention proposes a generative architecture based on the fusion of structural condition control and environmental modulation, which models and fuses structural and physical observation variables separately in the network:
[0131]
[0132] in:
[0133] Φ C (C) is the prior tensor of the structure pattern obtained by the structure encoding feature mapping (e.g., through embedding + deconvolution network);
[0134] Φ env (θ i E i ) is the modulation tensor output by the environmental factor encoder, representing the optical modulation of the structure under specific shooting conditions;
[0135] This invention is an innovative residual response activation term designed to learn the high-order nonlinear response behavior under the coupling of structure and angle / illumination.
[0136] In particular, Instead of originating directly from the input, it enhances structural response differences through cross-conditional fusion and attention-guided enhancement, taking the following form:
[0137]
[0138] in:
[0139] W c W e It is a structure-environment channel mapping matrix;
[0140] Attn(·) is a single-head weighted attention operation that dynamically amplifies the current environment-sensitive region in the structural encoding features, and strengthens the modeling of angle-sensitive points and specific reflection regions.
[0141] During training, this invention not only uses image reconstruction errors As part of the loss term, a response consistency regularization term Ω is also introduced, designed to ensure that the images generated by the model exhibit the typical physical response behavior of real microstructures in local structural regions. This regularization term is based on the typical "angle-dependent high-frequency texture response" in microstructure images and is defined as follows:
[0142]
[0143] in:
[0144] FFT h (·) indicates that the energy spectrum is extracted after performing a fast Fourier transform on the image in the horizontal direction;
[0145] This operation is used to capture the frequency characteristic changes caused by the horizontal reflection of microstructures;
[0146] The purpose of the regularization term is to force the generated image to maintain the same frequency response as the real image, thereby avoiding the generation of a "blurred average image".
[0147] During the inference phase, the system will generate images for each frame. Compared with real-shot image I i Structural similarity calculations typically use structural similarity indices. After full sequence alignment, a set of similarity sequences is output. This result will serve as the sole input to the next step, the credibility scoring function. The biggest difference between this step and traditional methods is that:
[0148] Instead of classifying and judging whether an image is fake, it constructs a generation path that can simulate the expected image response.
[0149] The generation process is based on the structural decoding results and the physical acquisition environment, rather than simple tags, thereby achieving physical traceability of the discrimination logic;
[0150] Using structural residual attention terms Improve the ability to model the nonlinear response of microstructures;
[0151] Using frequency response uniformity as the structural authenticity regularization term Ω is particularly suitable for modeling typical periodic reflection patterns in microstructure optical fields.
[0152] The final output is:
[0153] Image sequence The system predicts the structure's expected response under the current angle and illumination.
[0154] Similarity sequence Measuring the consistency between the predicted data and the actual captured images provides physical support for the next step of the credibility assessment module.
[0155] S5. The average value of the image similarity sequence is used as the credibility score. The credibility score is compared with a preset credibility threshold to determine whether to accept the recognition result.
[0156] Specifically, this step is the final output stage of the entire patent system, receiving the image similarity sequence generated in the previous step. The credibility of the structure identification result C is comprehensively evaluated, and a decision is made on whether to accept the identification result based on the evaluation result.
[0157] The credibility scoring function is defined based on the average of similarity sequences:
[0158]
[0159] in:
[0160] r represents the overall credibility score of the structure recognition result;
[0161] n is the number of image frames used for comparison;
[0162] sim i The structural similarity between the real and generated images in the i-th frame is represented by the SSIM metric (the closer the value is to 1, the more similar the images are).
[0163] The system compares the score with a set credibility threshold τ to determine whether to accept the identification result:
[0164]
[0165] in:
[0166] τ is the credibility threshold, which is usually set in [0.85, 0.95] and can be adjusted according to the application scenario;
[0167] If r ≥ τ, the structure encoding is considered reliable, and the system returns it as a valid recognition result C.
[0168] If r < τ, the system refuses to output the identification result and prompts the user to rescan or warns of the risk of forgery.
[0169] To facilitate integration with actual business systems, the system encapsulates the output results into a structured interface format, for example:
[0170] {
[0171] "result":"accepted",
[0172] "structure_code":"C_01783F9A",
[0173] "confidence": 0.921
[0174] }
[0175] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0176] In addition, for technical details not described in detail in this embodiment, please refer to the parameter operation method provided in any embodiment of the present invention, which will not be repeated here.
[0177] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0178] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0179] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0180] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for generating invisible dynamic cryptographic codes using micro-optical structures for AI recognition, characterized in that, The method includes: S1. Use a mobile terminal to scan the product packaging, automatically start the image acquisition process to acquire images in frames, as well as the illumination parameters of each frame of the corresponding image and the shooting angle of the image, and organize each frame of the image, the illumination parameters of each frame of the corresponding image and the shooting angle of each frame of the corresponding image into a structured data sequence. S2. Normalize each frame of the structured data sequence of each frame to generate a normalized sequence; wherein, the normalized sequence includes each frame of the normalized image, the shooting angle corresponding to the image, and the illumination parameters of each frame of the image. S3. Input the generated normalized sequence into the pre-trained structural response decoding model, identify the unique structural code corresponding to the sequence image formed by the reflection of the micro optical structure under multiple angles and multiple illumination conditions, and output the corresponding structural code. S4. Design a structure generation model, using the corresponding structure code, the shooting angle of the image, and the lighting parameters of each frame as the model input, and perform inference analysis to simulate the generation of an image under the current shooting conditions if a certain structure code is real. Then, compare the generated image with the normalized image of each frame to generate an image similarity sequence, thereby completing the verification of the authenticity of its structure code. S5. The average value of the image similarity sequence is used as the credibility score. The credibility score is compared with a preset credibility threshold to determine whether to accept the recognition result. If the credibility score is greater than or equal to the preset credibility threshold, the current structure encoding recognition is considered credible, and the system returns it as a valid recognition result. If the credibility score is less than the preset credibility threshold, the system will refuse to output the recognition result and prompt the user to rescan or warn of the risk of forgery.
2. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 1, characterized in that, The structured data sequence is a triple; Wherein, S1 further includes: A legality analysis is performed on each frame of the image to determine whether it should be included in the sequence. The legality analysis is a multi-factor weighted comprehensive analysis based on the brightness variance of each frame, the edge entropy of each frame, and the cosine similarity between the current frame and the previous frame to generate a legality score.
3. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 1, characterized in that, S1 further includes: evaluating the angle and illumination coverage of the structured data sequence to determine its validity. Based on the structured data sequence, the ratio of the number of elements of the corresponding shooting angle to the number of the set minimum effective angle intervals is calculated to obtain the angle coverage. Based on the structured data sequence, the ratio of the illumination parameters of each frame to the set types of effective illumination conditions is calculated to obtain the illumination parameter coverage. If the angular coverage is less than 0.8 and the illumination parameter coverage is less than 0.7, the user will be prompted to rescan.
4. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 1, characterized in that, S2 specifically includes: After converting each frame of the image into the corresponding grayscale image, the average brightness is calculated, and the average brightness is smoothed to obtain the normalization factor. All pixel values of each frame of the image are multiplied by the normalization factor to adjust the overall image brightness so that the images acquired under different light intensities are unified to the average brightness level. Based on the color temperature obtained from the main hue and environmental parameters in the HSV space of each frame image, equivalent color shift adjustment is performed; Generate normalized images for each frame and form a normalized sequence.
5. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 1, characterized in that, The operation steps of the structural response decoding model are as follows: First, a convolutional encoder is used to extract the local feature vector of each normalized frame image. The corresponding angle and illumination parameters are then encoded into a context vector through two fully connected networks. The two are concatenated to obtain the joint input representation of each frame image, and a joint input representation sequence is constructed. Then, a multi-layer residual attention modeling module is constructed. It takes the joint input representation sequence as input, combines it with the angle position encoding of each frame, and outputs a global representation vector of the structural response sequence. Finally, a decoder predicts the structural encoding, represented as: Where C is the structure code, f φ For the structure generation model, x i Let be the joint input representation of image i, n be the total number of frames, MLP be a multilayer perceptron, AttnBlock be a multilayer residual attention modeling module, and Ω({x i }) is the response trajectory sparse regularization term, used to penalize information redundancy in the sequence; The final output structure encoding C includes: Fixed-length binary vectors are used for encrypted identification and / or structurally unique ID numbers are used for database comparison and verification.
6. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 5, characterized in that, The multi-layer residual attention modeling module consists of two layers of residual attention blocks, which include multi-head attention and a feedforward network; the angle position encoding of each frame image is constructed using sine and cosine functions.
7. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 5, characterized in that, The sparse regularization term of the response trajectory is used to perform sparsity constraint analysis by measuring the difference between the feature and the mean using the L1 norm.
8. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 1, characterized in that, The structure generation model, used to simulate image generation, is designed as follows: in, To generate an image, G θ For the structure generation model, (C,θ) i E i ) is a fusion vector of the corresponding structural encoding, the shooting angle of the image, and the illumination parameters of each frame, Φ C (C) is the prior tensor of the structural pattern obtained by structural encoding feature mapping; Φ env (θ i E i () is the modulation tensor output by the environmental factor encoder, representing the optical modulation of the structure under specific shooting conditions; It is a residual response activation term used to learn the higher-order nonlinear response behavior under the coupling of structure and angle / lighting; Among them, residual response activation term The structure pattern prior tensor obtained by the structure-environment channel mapping matrix and the structure encoding feature mapping, and the modulation tensor output by the environment factor encoder are generated by a single-head weighted attention operation.
9. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 8, characterized in that, The structure generation model also includes a response consistency regularization term to ensure that the image generated by the model exhibits the typical physical response behavior of real microstructures in local structural regions. The response consistency regularization term is obtained based on the difference analysis of the energy spectrum extracted after performing a fast Fourier transform on each generated image and a normalized image in the horizontal direction. The reasoning analysis includes: Structural similarity is calculated between each generated image and each normalized image to generate a structural similarity index. After full sequence alignment, a similarity sequence is output.
10. The method for generating invisible dynamic cryptographic codes using micro-optical structures according to claim 9, characterized in that, The structural similarity metrics include the SSIM metric.