Visual recognition method and system for liquid crystal angular color shifting materials
By constructing a dual-branch feature extraction module and optimizing the polarization loss function, the problem of insufficient feature extraction in liquid crystal material identification was solved, and high-precision identification of genuine and counterfeit liquid crystal materials was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN VIVID COLOWR NEW METERIAL TECH CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies are difficult to adapt to different types of liquid crystal materials or new counterfeiting techniques. Deep learning methods have not established sequential dependencies between angles, resulting in insufficient utilization of the angle selectivity characteristics of liquid crystal materials and low recognition accuracy.
Optical images of liquid crystal materials at preset angle sequences are acquired, Lab chromaticity and local binary mode texture features are extracted, a dual-branch feature extraction module is constructed, angle dependence is explored through differential spectral analysis and bidirectional gated recurrent units, and the model is optimized by polarization loss function to enhance feature representation and decision boundary.
It achieves high-precision identification of genuine and counterfeit liquid crystal materials, solves the problem of low identification accuracy caused by insufficient feature extraction in traditional methods, and enhances the utilization of angle selectivity characteristics.
Smart Images

Figure CN122156779A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of identification, and in particular relates to a visual identification method and system for liquid crystal angle-changing color materials. Background Technology
[0002] The anti-counterfeiting properties of angle-selective liquid crystal materials lie in the law of optical representation changing with angle, i.e., the angle spectrum. However, similar-looking counterfeits have appeared on the market, and identification methods based on human visual observation are insufficient to meet the needs of large-scale, high-precision genuine-counterfeit identification. Machine vision-based identification methods typically acquire material images at specific or a few fixed angles, extract static features such as color histograms, gray-level co-occurrence matrices (GLCM), or local binary patterns (LBP), and combine them with support vector machines (SVM) and k-nearest neighbors (KNN) classifiers for discrimination. However, these methods do not utilize the continuous change of optical features with the observation angle, relying only on static information at discrete angles, and cannot detect differences in the angle response curves of genuine and counterfeit products. Manually planned feature extraction methods are mainly based on expert experience and cannot adapt to the challenges of different types of liquid crystal materials or new counterfeiting technologies. Some deep learning methods also treat images from different angles as independent samples and fail to establish a sequential dependency model between angles, resulting in insufficient utilization of the core angle-selective properties of the material and low identification accuracy. Summary of the Invention
[0003] This invention proposes a visual recognition method for angle-sensitive liquid crystal materials to address the challenges posed by existing feature extraction methods, which are ill-suited to different types of liquid crystal materials or novel counterfeiting techniques. Furthermore, deep learning methods have failed to establish a sequential dependency model between angles, resulting in insufficient utilization of the material's core angle-selective characteristics. The method includes:
[0004] Optical images of the liquid crystal material to be identified are acquired under a preset angle sequence, and the Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features of each angle image are extracted to form a multidimensional initial feature sequence.
[0005] A recognition model is established, comprising a dual-branch feature extraction module, a feature fusion module, and a classifier. The model is trained using samples of known genuine and counterfeit liquid crystal materials. The training includes: inputting the multidimensional initial feature sequence in parallel into two feature extraction branches: obtaining an abstract representation of the features through the first branch and obtaining an angle-enhanced context vector through the second branch; concatenating the abstract representation and the context vector to form a fused feature vector; inputting the fused feature vector into the classifier, mapping it to obtain a latent space encoding vector, and optimizing it with a polarization loss function, so that the encoding vector of genuine samples converges to a first preset polarization vector, and the encoding vector of counterfeit samples converges to a second preset polarization vector opposite to the first preset polarization vector.
[0006] After training is completed, in the recognition stage, the multidimensional initial feature sequence of the liquid crystal material to be tested is extracted, and the sequence is input into the trained recognition model to obtain the latent space encoding vector. The distance between the encoding vector and the first and second preset polarization vectors is calculated, and the authenticity of the liquid crystal material is determined based on the distance.
[0007] In another aspect, the present invention proposes a visual recognition system for a liquid crystal angle-changing color-changing material, comprising the following modules:
[0008] The extraction module is used to acquire optical images of the liquid crystal material to be identified under a preset angle sequence, and extract the Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features of each angle image to form a multidimensional initial feature sequence.
[0009] The training module is used to establish a recognition model including a dual-branch feature extraction module, a feature fusion module, and a classifier, and to train the model using known genuine and counterfeit liquid crystal material samples. The training includes: inputting the multidimensional initial feature sequence in parallel into two feature extraction branches: obtaining an abstract representation of the features through the first branch and obtaining an angle-enhanced context vector through the second branch; concatenating the abstract representation and the context vector to form a fused feature vector; inputting the fused feature vector into the classifier, mapping it to obtain a latent space encoding vector, and optimizing it with a polarization loss function so that the encoding vector of genuine samples converges to a first preset polarization vector, and the encoding vector of counterfeit samples converges to a second preset polarization vector opposite to the first preset polarization vector;
[0010] The identification module is used to extract the multidimensional initial feature sequence of the liquid crystal material to be tested during the identification stage after training is completed. The sequence is then input into the trained identification model to obtain the latent space encoding vector. The distance between the encoding vector and the first and second preset polarization vectors is calculated, and the authenticity of the liquid crystal material is determined based on the distance.
[0011] This invention acquires initial information by acquiring optical images of liquid crystal materials at multiple angles and simultaneously extracting Lab chromaticity and LBP texture features. A dual-branch recognition model is constructed: one branch uses differential spectral analysis to detect the inherent patterns and subtle differences in feature variations with angle; the other branch uses a bidirectional gated recurrent unit and attention mechanism to mine the contextual dependencies between angle sequences and enhances the expression weights of key angles and feature channels. By fusing information from two different dimensions and optimizing the model using a polarization loss function, the inter-class distance between genuine and counterfeit samples in the feature space is increased, forming a decision boundary. This achieves the identification of genuine and counterfeit angle-selective liquid crystal materials, solving the problem of low recognition accuracy caused by insufficient feature extraction and blurred classification boundaries in traditional methods. Attached Figure Description
[0012] Figure 1 A flowchart of the first embodiment;
[0013] Figure 2 This is a schematic diagram of cubic spline interpolation fitting.
[0014] Figure 3 A schematic diagram for generating fused feature vectors. Detailed Implementation
[0015] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0016] See Figure 1 The first embodiment is a visual recognition method for a liquid crystal angle-changing color material, including:
[0017] S1. Acquire optical images of the liquid crystal material to be identified under a preset angle sequence, and extract the Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features of each angle image to form a multidimensional initial feature sequence.
[0018] Using a camera and a computer-controlled goniometer or multi-axis rotation platform, digital optical images of the liquid crystal material were acquired at 25 different observation angles within the range of -60° to +60°, at 5° intervals. For each image acquired at each angle, the cvtColor function in the OpenCV library was used to convert the image from the BGR color space to the CIELAB color space. The mean, standard deviation, skewness, and kurtosis of the pixel values in the L, a, and b channels were calculated as color features. Simultaneously, the local_binary_pattern function in the scikit-image library was used, with the number of neighborhood sampling points set to 8, the radius to 1, and the modes to uniform and ror, to extract the rotation-invariant uniform pattern features of the local binary pattern and calculate the statistical histogram. The calculated color features and texture feature histograms were concatenated to obtain the feature vector at that angle. The feature vectors of all angles were arranged in order to form a multidimensional initial feature sequence.
[0019] In an optional embodiment, the extraction of Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features from each angle image to form a multidimensional initial feature sequence includes:
[0020] Each optical image is converted from the RGB color space to the CIELab color space;
[0021] Calculate the pixel mean and standard deviation of the three channels L*, a*, and b* to obtain six dimensions of Lab chromaticity features;
[0022] For the L* channel image, the local binary mode rotation-invariant uniform mode features are calculated using parameters with a radius of 1 and a neighborhood of 8, and the feature histogram is statistically analyzed.
[0023] The six dimensions of Lab chromaticity features are concatenated with the LBP-RIU feature histogram to form the feature vector at the specified angle.
[0024] Using color space conversion functions from an image processing library, the input 24-bit RGB optical image is converted to the CIELab color space. This space simulates human eye color perception and separates the luminance (L*) and chrominance (a*, b*) components. The arithmetic mean and standard deviation of all pixel values in the image matrix are calculated for each of the L*, a*, and b* channels, resulting in six floating-point numbers that form the initial chrominance feature vector. Simultaneously, texture analysis is performed on the luminance channel (L×) image, which is related to texture information, using a local binary mode rotation-invariant uniform mode. The operator. The preferred parameters for this operator are radius R = 1 and number of neighborhood points P = 8. For With P=8, 10 LBP modes will be generated. A 10-dimensional normalized histogram is generated by statistically analyzing the frequency of these 10 modes across the entire L× image. The Lab chromaticity features of the aforementioned 6 dimensions are then compared with the 10-dimensional... The feature histograms are concatenated in sequence to obtain a feature vector with a total dimension of 16 at that angle.
[0025] S2, establish a recognition model including a dual-branch feature extraction module, a feature fusion module, and a classifier, and train the model using known genuine and counterfeit liquid crystal material samples. The training includes: inputting the multidimensional initial feature sequence in parallel into two feature extraction branches: obtaining an abstract expression of the features through the first branch and obtaining an angle-enhanced context vector through the second branch; concatenating the abstract expression and the context vector to form a fused feature vector; inputting the fused feature vector into the classifier, obtaining a latent space encoding vector through mapping, and optimizing it with a polarization loss function, so that the encoding vector of genuine samples converges to a first preset polarization vector, and the encoding vector of counterfeit samples converges to a second preset polarization vector opposite to the first preset polarization vector.
[0026] More specifically, the first branch performs differential spectrum analysis on the multidimensional initial feature sequence, calculates the first and second derivatives of each feature dimension as a function of angle through cubic spline interpolation, constructs an angular response differential spectrum representing feature change information, and inputs the differential spectrum into a multilayer perceptron network to obtain an abstract representation of the features;
[0027] The second branch inputs the multidimensional initial feature sequence into a bidirectional gated recurrent unit to encode the bidirectional contextual dependency relationship of the features as the angle changes, thus obtaining the angle feature encoding; then, the angle-channel association attention module is used to weight the angle feature encoding to obtain the enhanced expression of the key angle-feature; the enhanced expression is pooled along the angle dimension to aggregate the enhanced expression into a fixed-dimensional context vector.
[0028] For each feature dimension in the multidimensional initial feature sequence, with angle as the independent variable and feature value as the dependent variable, cubic spline fitting is performed using the `scipy.interpolate.CubicSpline` function from the SciPy library. Using the `derivative` method of the fitted spline object, with parameters `nu=1` and `nu=2` respectively, the first and second derivatives of the feature at each observation angle are calculated. The original feature value, first derivative value, and second derivative value are concatenated along the feature dimension to form an angle response differential spectrum with a dimension three times that of the initial feature. A multilayer perceptron consisting of three fully connected layers is constructed, with each layer followed by a ReLU activation function, implemented using PyTorch or TensorFlow frameworks. The flattened angle response differential spectrum is used as input, and after forward propagation through the network, an abstract representation vector of the feature is obtained.
[0029] In an optional embodiment, the step of performing differential spectrum analysis on the multidimensional initial feature sequence, calculating the first and second derivatives of each feature dimension as a function of angle using cubic spline interpolation, and constructing an angular response differential spectrum representing feature change information, includes:
[0030] For each feature dimension in the multidimensional initial feature sequence, a cubic spline function is fitted with a preset angle sequence as the independent variable and the feature value on the dimension as the dependent variable.
[0031] Find the first and second derivatives of the fitted cubic spline function;
[0032] Substitute each angle value in the preset angle sequence into the first-order derivative function and the second-order derivative function to calculate the corresponding first-order derivative value and second-order derivative value;
[0033] The first and second derivative values of all feature dimensions at all angles are concatenated to form the angular response differential spectrum.
[0034] Assume the preset angle sequence is [0°, 10°, 20°, ..., 90°], containing N=10 angles. For the multidimensional initial feature sequence composed of N 16-dimensional feature vectors obtained in the previous step, this step processes each of the 16 feature dimensions of the sequence. Taking any one of the feature dimensions as an example, 10 discrete data points are obtained. Cubic spline interpolation was chosen because it generates a smooth function S(angle) with continuous second derivatives at each data point. The 10 data points were fitted using interpolation functions from a numerical computation library; see [link to documentation]. Figure 2 Taking the sign derivative of the fitted spline function S(angle) yields the first derivative function. and second derivative Substitute the original 10 angle values [0°, 10°, 20°, ..., 90°] into... and The velocity and acceleration of the feature change at each observation angle were calculated, resulting in two derivative sequences of length 10. This process was repeated for all 16 feature dimensions, yielding 16 first-order derivative values and 16 second-order derivative values at each angle. These two sets of derivative values were concatenated to form a 32-dimensional differential eigenvector. The differential eigenvectors of all 10 angles were combined to form a 10×32 angular response differential spectrum matrix.
[0035] Using PyTorch's `torch.nn.GRU` module or TensorFlow's `keras.layers.GRU` layer, with the `bidirectional` parameter set to `True`, a bidirectional gated recurrent unit network is constructed. The multidimensional initial feature sequence is taken as input, and the network outputs hidden states at each angle step that fuse information from the preceding and following angles, forming the angle feature encoding. An angle-channel association attention module is constructed, which performs global average pooling on the angle feature encoding along the angle dimension and learns channel attention weights through a two-layer fully connected network. Simultaneously, an angle attention weight is learned through a 1×1 convolutional layer. The two weights are multiplied and passed through a Sigmoid activation function to obtain an attention matrix. This matrix is then multiplied element-wise with the angle feature encoding to weight key angles and key feature channels, resulting in enhanced representation.
[0036] In an optional embodiment, the step of inputting the multidimensional initial feature sequence into a bidirectional gated recurrent unit to encode the bidirectional contextual dependencies of the features as the angle changes, thereby obtaining the angle feature encoding, includes:
[0037] The multidimensional initial feature sequence is used as the input of the bidirectional gated recurrent unit Bi-GRU, where the sequence length is the number of preset angles;
[0038] The Bi-GRU includes a forward GRU and a backward GRU. The forward GRU processes the feature sequences in ascending order of angle, and the backward GRU processes them in descending order of angle.
[0039] The outputs of the forward GRU and the backward GRU are concatenated at each angular position to form the encoding vector for each angular position. All encoding vectors together constitute the angular feature encoding.
[0040] The bidirectional gated loop unit comprises a forward gated loop unit (GRU) and a backward gated loop unit (GRU). Each GRU contains a reset gate. With an update gate Hidden state of the forward GRU Hidden state of backward GRU The output is obtained by concatenating the features along the feature dimension. The input is a multidimensional initial feature sequence of dimension N×D. Where N is the number of angles, and D is the dimension of the feature vector for each angle. The output is an angle feature encoding of dimension N×2H. ,in H is the number of hidden units for each GRU.
[0041] A multidimensional initial feature sequence of size 10×16, where sequence length N=10 and feature dimension D=16, is fed into a bidirectional gated recurrent unit (Bi-GRU) network layer. This Bi-GRU layer consists of a forward GRU and a backward GRU, to ensure that the feature encoding for each angle includes information from all previous and subsequent angles. The number of hidden units in each GRU is set to a hyperparameter, for example, H=64. The forward GRU operates in ascending order of angles. The processing sequence receives a 16-dimensional feature vector of the current angle at each angular step t. The hidden state from the previous angle Output the hidden state at the current angle. Meanwhile, the backward GRU operates in the reverse order. Process the sequence and output the hidden state sequence. After processing, for each angle position t in the sequence, the output of the forward GRU is... 64-dimensional output of backward GRU (64-dimensional) Concatenation is performed along the feature dimensions. The dimension of the encoded vector at each angle position becomes 128. The output of the entire Bi-GRU module is a matrix of size 10×128, which is the angle feature encoding.
[0042] In an optional embodiment, the weighting of the angle feature encoding using the angle-channel association attention module includes:
[0043] The angular feature encoding is globally averaged along the angular dimension to generate channel representations, and then channel attention weights are calculated through a network containing two fully connected layers and a sigmoid activation function.
[0044] The angle feature encoding is globally averaged pooled along the feature channel dimension to generate an angle representation, and then the angle attention weights are calculated through another network containing two fully connected layers and a sigmoid activation function.
[0045] The channel attention weight vector and the angle attention weight vector are multiplied by an outer product to obtain a two-dimensional joint weight matrix.
[0046] The joint weight matrix is multiplied element-wise with the angular feature code to complete the weighting.
[0047] The network model of the angle-channel related attention module includes a channel attention submodule and an angle attention submodule. The channel attention submodule consists of a global average pooling layer and a multilayer perceptron with a bottleneck structure. The angle attention submodule consists of a global average pooling layer and a multilayer perceptron. The weights output by the two submodules are multiplied together via broadcast and then element-wise multiplied with the input features. The input is an N×C dimension angle feature encoding, where N is the number of angles and C is the number of feature channels. The output is a weighted, enhanced representation of dimension N×C.
[0048] This module receives a 10×128 angular feature encoding from a Bi-GRU. Global average pooling is performed along the angular dimension on the 10×128 input matrix to obtain a 1×128 channel representation. This representation is transformed using a bottleneck-structured Multilayer Perceptron (MLP). The MLP consists of a fully connected layer that compresses the dimension from 128 to 32 with a compression ratio r=4, a ReLU activation function, and a fully connected layer that restores the dimension from 32 to 128. The output is a 128-dimensional channel attention weight vector ranging from (0,1) using a sigmoid function. The 10×128 input matrix is subjected to global average pooling along the feature channel dimension to obtain a 10×1 angle representation. This angle representation is then processed by a small MLP and a sigmoid function to generate a 10-dimensional angle attention weight vector. . 10×1 Vector and 1×128 The vectors are broadcast multiplied to generate a 10×128 joint weight matrix. This weight matrix is then combined with the original 10×128 angular feature codes using a Hadamard product, thereby assigning different importance to different angles and feature channels, resulting in a weighted enhanced representation.
[0049] The enhanced representation output from the second branch is subjected to global max pooling along the angle dimension, such as using the `torch.max` function, which aggregates the enhanced representation from a sequence-like tensor into a fixed-dimensional context vector. The `torch.cat` function is then used to concatenate the abstract representation output from the first branch with this context vector along the feature dimension to obtain a fused feature vector. Figure 3The fused feature vector is input into a classifier consisting of a single-layer fully connected network. This network maps the fused features to a K-dimensional latent space and outputs a K-dimensional latent space encoding vector. A first preset polarization vector is defined as a K-dimensional vector with all +1s, and a second preset polarization vector is defined as a K-dimensional vector with all -1s. For genuine liquid crystal samples, the mean square error loss between the sample output encoding vector and the first preset polarization vector is calculated. For counterfeit liquid crystal samples, the mean square error loss between the output encoding vector and the second preset polarization vector is calculated. The losses of all samples in the batch are summed as the total polarization loss function, and the Adam optimizer is used to backpropagate and update the network parameters of the entire model based on this loss.
[0050] In an optional embodiment, the step of pooling the enhanced expression along the angular dimension to aggregate the enhanced expression into a context vector of fixed dimension; concatenating the abstract expression with the context vector to form a fused feature vector includes:
[0051] The enhanced representation output after weighting by the angle-channel association attention module is subjected to global average pooling or global max pooling along the angle dimension to obtain the context vector;
[0052] The abstract representation output by the multilayer perceptron network is concatenated with the context vector along the feature dimension to form a fused feature vector.
[0053] The multilayer perceptron network comprises several fully connected layers, each of which can be followed by an activation function. Its input is a one-dimensional flattened angular response differential spectrum vector, and its output is a dimension-reduced abstract representation vector.
[0054] For the second branch, the weighted 10×128-dimensional augmented representation after the attention module is applied with global average pooling along the angular dimension (0 in dimension, 10 in length). The sequence containing temporal information is converted into a fixed-length vector. By calculating the average of 10 128-dimensional vectors, the sequence information is aggregated into a single, fixed-dimensional 128-dimensional context vector. For the first branch, the input is a 10×32-dimensional angular response differential spectrum, which is flattened into a 320-dimensional vector and input into a multilayer perceptron (MLP) network. This MLP can be planned to contain two fully connected layers. For example, the first layer maps the dimension from 320 to 128 and uses the ReLU activation function, and the second layer maps the dimension from 128 to 64, obtaining a 64-dimensional abstract representation. The 64-dimensional abstract representation vector output from the first branch is concatenated with the 128-dimensional context vector output from the second branch to form a 192-dimensional fused feature vector.
[0055] In an optional embodiment, the optimization using a polarization loss function, such that the encoding vector of genuine samples converges to a first preset polarization vector, and the encoding vector of counterfeit samples converges to a second preset polarization vector opposite to the first preset polarization vector, includes:
[0056] The first preset polarization vector is set to a K-dimensional vector with all +1s, and the second preset polarization vector is set to a K-dimensional vector with all -1s, where K is the dimension of the latent space encoding vector;
[0057] For each sample in the training batch, obtain the latent space encoding vector of the sample after mapping by the classifier;
[0058] If the sample is genuine, then calculate the square of the Euclidean distance between the sample encoding vector and the first preset polarization vector;
[0059] If the sample is a counterfeit, then calculate the square of the Euclidean distance between the sample encoding vector and the second preset polarization vector;
[0060] The squared distances calculated from all samples in the entire training batch are summed to obtain the polarization loss value for that batch, and backpropagation optimization is performed with this as the target.
[0061] Optionally, the classifier consists of a fully connected layer without an activation function, used to linearly map high-dimensional features to a low-dimensional latent space, with the input being a fused feature vector and the output being a latent space encoding vector.
[0062] The classifier receives a 192-dimensional fused feature vector and linearly maps the vector to the latent space through a fully connected layer. For example, the classifier can consist of a fully connected layer FC(192,K), where K is the dimension of the latent space, preferably 16 or 32. Let K=16, then the first preset polarization vector... It is a 16-dimensional vector of all +1s [1,1,...,1], and the second preset polarization vector. It is a 16-dimensional vector of all -1s [-1, -1, ..., -1]. During training, for a batch of samples, the 192-dimensional fused feature vector of each sample is processed by the classifier to obtain a 16-dimensional latent space encoding vector V. If the label of the sample is genuine, the loss is calculated. If the sample is a counterfeit, then calculate the loss. Using the squared L2 norm as the loss avoids the computationally expensive square root operation during backpropagation. The polarization loss for the entire batch is the average of the losses L of all samples within that batch. This loss function drives the optimizer to adjust all model parameters so that the encoding vectors of genuine samples cluster in the latent space. Nearby, while the encoding vectors of counterfeit samples cluster in Nearby, two clearly separated clusters with maximum distance between them are formed.
[0063] S3. After training is completed, in the recognition stage, the multidimensional initial feature sequence of the liquid crystal material to be tested is extracted, and the sequence is input into the trained recognition model to obtain the latent space encoding vector. The distance between the encoding vector and the first and second preset polarization vectors is calculated, and the authenticity of the liquid crystal material is determined based on the distance.
[0064] The entire process of repeatedly acquiring images of the test sample and extracting multidimensional initial feature sequences is described. The model is set to evaluation mode, for example, using the `model.eval` method in PyTorch, with gradient calculation and deactivation layers disabled. The extracted feature sequences are input into the trained model for a complete forward propagation to obtain a K-dimensional latent space encoding vector. The `numpy.linalg.norm` function of the NumPy library is used to calculate the Euclidean distance between this encoding vector and preset genuine polarization vectors, all +1 vectors, and pseudo polarization vectors, all -1 vectors. The two distance values are compared. If the distance value is smaller than the distance of the genuine polarization vector, it is determined to be genuine; otherwise, it is determined to be pseudo.
[0065] In an optional embodiment, the step of calculating the distance between the encoding vector and the first and second preset polarization vectors, and determining the authenticity of the liquid crystal material based on the distance, includes:
[0066] For the liquid crystal material under test, calculate the Euclidean distance between the latent spatial encoding vector output by the material and the first preset polarization vector. ;
[0067] Calculate the Euclidean distance between the output latent space encoding vector and the second preset polarization vector. ;
[0068] like Less than If the test result is positive, the liquid crystal material to be tested is determined to be genuine; otherwise, it is determined to be counterfeit.
[0069] In the recognition stage, the image sequence of the liquid crystal material to be tested is input into the trained recognition model. After feature extraction, dual-branch processing, feature fusion, and classifier mapping, a K-dimensional, for example, K=16 latent space encoding vector is obtained. Calculate the distances between this vector and two predefined polarization vectors. With the first preset polarization vector The square of the Euclidean distance: .calculate With the second preset polarization vector The square of the Euclidean distance: Determining the category by comparing the squared values of distances yields results that are completely equivalent to comparing the original distances, but avoids the square root operation, resulting in higher computational efficiency. If ,show If the test liquid crystal material is located near the pole of the genuine sample in the potential space, it is determined to be genuine; otherwise, it is determined to be counterfeit.
[0070] The second embodiment is a visual recognition system for a liquid crystal angle-changing color material, comprising the following modules:
[0071] The extraction module is used to acquire optical images of the liquid crystal material to be identified under a preset angle sequence, and extract the Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features of each angle image to form a multidimensional initial feature sequence.
[0072] The training module is used to establish a recognition model including a dual-branch feature extraction module, a feature fusion module, and a classifier, and to train the model using known genuine and counterfeit liquid crystal material samples. The training includes: inputting the multidimensional initial feature sequence in parallel into two feature extraction branches: obtaining an abstract representation of the features through the first branch and obtaining an angle-enhanced context vector through the second branch; concatenating the abstract representation and the context vector to form a fused feature vector; inputting the fused feature vector into the classifier, mapping it to obtain a latent space encoding vector, and optimizing it with a polarization loss function so that the encoding vector of genuine samples converges to a first preset polarization vector, and the encoding vector of counterfeit samples converges to a second preset polarization vector opposite to the first preset polarization vector;
[0073] The identification module is used to extract the multidimensional initial feature sequence of the liquid crystal material to be tested during the identification stage after training is completed. The sequence is then input into the trained identification model to obtain the latent space encoding vector. The distance between the encoding vector and the first and second preset polarization vectors is calculated, and the authenticity of the liquid crystal material is determined based on the distance.
[0074] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A visual recognition method for a liquid crystal angle-changing color-changing material, characterized in that, Includes the following steps: Optical images of the liquid crystal material to be identified are acquired under a preset angle sequence, and the Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features of each angle image are extracted to form a multidimensional initial feature sequence. A recognition model is established, comprising a dual-branch feature extraction module, a feature fusion module, and a classifier. The model is trained using samples of known genuine and counterfeit liquid crystal materials. The training includes: inputting the multidimensional initial feature sequence in parallel into two feature extraction branches: obtaining an abstract representation of the features through the first branch and obtaining an angle-enhanced context vector through the second branch; concatenating the abstract representation and the context vector to form a fused feature vector; inputting the fused feature vector into the classifier, mapping it to obtain a latent space encoding vector, and optimizing it with a polarization loss function, so that the encoding vector of genuine samples converges to a first preset polarization vector, and the encoding vector of counterfeit samples converges to a second preset polarization vector opposite to the first preset polarization vector. After training is completed, in the recognition stage, the multidimensional initial feature sequence of the liquid crystal material to be tested is extracted, and the sequence is input into the trained recognition model to obtain the latent space encoding vector. The distance between the encoding vector and the first and second preset polarization vectors is calculated, and the authenticity of the liquid crystal material is determined based on the distance.
2. The method according to claim 1, characterized in that, The abstract representation of the features obtained through the first branch, and the context vector enhanced by angle obtained through the second branch, are specifically as follows: The first branch performs differential spectrum analysis on the multidimensional initial feature sequence, calculates the first and second derivatives of each feature dimension as a function of angle using cubic spline interpolation, constructs an angular response differential spectrum representing feature change information, and inputs the differential spectrum into a multilayer perceptron network to obtain an abstract representation of the features. The second branch inputs the multidimensional initial feature sequence into a bidirectional gated recurrent unit to encode the bidirectional contextual dependency relationship of the features as the angle changes, thus obtaining the angle feature encoding. Then, the angle-channel association attention module is used to weight the angle feature encoding to obtain the enhanced expression of the key angle-feature; the enhanced expression is pooled along the angle dimension to aggregate the enhanced expression into a context vector of fixed dimension.
3. The method according to claim 1, characterized in that, The extraction of Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features from each angle image constitutes a multidimensional initial feature sequence, including: Each optical image is converted from the RGB color space to the CIELab color space; Calculate the pixel mean and standard deviation of the three channels L*, a*, and b* to obtain six dimensions of Lab chromaticity features; For the L* channel image, the local binary mode rotation-invariant uniform mode features are calculated using parameters with a radius of 1 and a neighborhood of 8, and the feature histogram is statistically analyzed. The six dimensions of Lab chromaticity features are concatenated with the LBP-RIU feature histogram to form the feature vector at the specified angle.
4. The method according to claim 2, characterized in that, The step of performing differential spectrum analysis on the multidimensional initial feature sequence, calculating the first and second derivatives of each feature dimension as a function of angle using cubic spline interpolation, and constructing an angular response differential spectrum representing feature change information includes: For each feature dimension in the multidimensional initial feature sequence, a cubic spline function is fitted with a preset angle sequence as the independent variable and the feature value on the dimension as the dependent variable. Find the first and second derivatives of the fitted cubic spline function; Substitute each angle value in the preset angle sequence into the first-order derivative function and the second-order derivative function to calculate the corresponding first-order derivative value and second-order derivative value; The first and second derivative values of all feature dimensions at all angles are concatenated to form the angular response differential spectrum.
5. The method according to claim 2, characterized in that, The step of inputting the multidimensional initial feature sequence into a bidirectional gated recurrent unit to encode the bidirectional contextual dependencies of the features as the angle changes, thereby obtaining the angle feature encoding, includes: The multidimensional initial feature sequence is used as the input of the bidirectional gated recurrent unit Bi-GRU, where the sequence length is the number of preset angles; The Bi-GRU includes a forward GRU and a backward GRU. The forward GRU processes the feature sequences in ascending order of angle, and the backward GRU processes them in descending order of angle. The outputs of the forward GRU and the backward GRU are concatenated at each angular position to form the encoding vector for each angular position. All encoding vectors together constitute the angular feature encoding.
6. The method according to claim 2, characterized in that, The angle-channel association attention module is used to weight the angle feature encoding, including: The angular feature encoding is globally averaged along the angular dimension to generate channel representations, and then channel attention weights are calculated through a network containing two fully connected layers and a sigmoid activation function. The angle feature encoding is globally averaged pooled along the feature channel dimension to generate an angle representation, and then the angle attention weights are calculated through another network containing two fully connected layers and a sigmoid activation function. The channel attention weight vector and the angle attention weight vector are multiplied by an outer product to obtain a two-dimensional joint weight matrix. The joint weight matrix is multiplied element-wise with the angular feature code to complete the weighting.
7. The method according to claim 1, characterized in that, The pooling operation along the angular dimension of the enhanced expression, which aggregates the enhanced expression into a context vector of fixed dimension, includes: The enhanced representation output after weighting by the angle-channel association attention module is subjected to global average pooling or global max pooling along the angle dimension to obtain the context vector.
8. The method according to claim 2, characterized in that, The optimization using the polarization loss function, which causes the encoding vector of genuine samples to converge to a first preset polarization vector and the encoding vector of counterfeit samples to converge to a second preset polarization vector opposite to the first preset polarization vector, includes: The first preset polarization vector is set to a K-dimensional vector with all +1s, and the second preset polarization vector is set to a K-dimensional vector with all -1s, where K is the dimension of the latent space encoding vector; For each sample in the training batch, obtain the latent space encoding vector of the sample after mapping by the classifier; If the sample is genuine, then calculate the square of the Euclidean distance between the sample encoding vector and the first preset polarization vector; If the sample is a counterfeit, then calculate the square of the Euclidean distance between the sample encoding vector and the second preset polarization vector; The squared distances calculated from all samples in the entire training batch are summed to obtain the polarization loss value for that batch, and backpropagation optimization is performed with this as the target.
9. The method according to claim 1, characterized in that, The step of calculating the distance between the encoding vector and the first and second preset polarization vectors, and determining the authenticity of the liquid crystal material based on the distance, includes: For the liquid crystal material under test, calculate the Euclidean distance between the latent spatial encoding vector output by the material and the first preset polarization vector. ; Calculate the Euclidean distance between the output latent space encoding vector and the second preset polarization vector. ; like Less than If the test result is positive, the liquid crystal material to be tested is determined to be genuine; otherwise, it is determined to be counterfeit.
10. A visual recognition system for a liquid crystal angle-changing color-changing material, characterized in that, Includes the following modules: The extraction module is used to acquire optical images of the liquid crystal material to be identified under a preset angle sequence, and extract the Lab chromaticity features and local binary mode rotation-invariant uniform mode texture features of each angle image to form a multidimensional initial feature sequence. The training module is used to establish a recognition model including a dual-branch feature extraction module, a feature fusion module, and a classifier, and to train the model using known genuine and counterfeit liquid crystal material samples. The training includes: inputting the multidimensional initial feature sequence in parallel into two feature extraction branches: obtaining an abstract representation of the features through the first branch and obtaining an angle-enhanced context vector through the second branch; concatenating the abstract representation and the context vector to form a fused feature vector; inputting the fused feature vector into the classifier, mapping it to obtain a latent space encoding vector, and optimizing it with a polarization loss function so that the encoding vector of genuine samples converges to a first preset polarization vector, and the encoding vector of counterfeit samples converges to a second preset polarization vector opposite to the first preset polarization vector; The identification module is used to extract the multidimensional initial feature sequence of the liquid crystal material to be tested during the identification stage after training is completed. The sequence is then input into the trained identification model to obtain the latent space encoding vector. The distance between the encoding vector and the first and second preset polarization vectors is calculated, and the authenticity of the liquid crystal material is determined based on the distance.