Electronic component authentication method and device, computer equipment and storage medium
Through the ESPCN model, super-resolution reconstruction of electronic component images and CNN model extraction features are solved by using cosine similarity comparison, the problem of forged electronic component verification is achieved, rapid and accurate judgment of the authenticity of electronic components is improved, and the stability of the system is improved. Security.
Patent Information
- Application Number
- CN202411249785.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The market is full of a large number of forged electronic components, which makes it difficult to verify the authenticity of electronic components, affecting economic losses and system stability and security.
The trained ESPCN model is used to super-resolution reconstruction of real-time electronic component images to generate high-resolution images, and the depth feature vector is extracted through the CNN model, and the cosine similarity is compared with the standard feature database to judge the authenticity of electronic components.
Significantly improve image quality and feature extraction accuracy, improve the accuracy and efficiency of the authenticity judgment of electronic components, reduce misjudgment and misjudgment, and ensure the accuracy of certification results.
Smart Images

Figure CN119229182A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic component authenticity verification, and in particular to an electronic component authentication method, device, computer equipment and storage medium. Background Art
[0002] With the development of science and technology, electronic components play a vital role in industrial production and daily life. However, the market is flooded with a large number of counterfeit electronic components. These inferior components may cause huge economic losses to users and threaten the stability and security of the entire system. Therefore, how to effectively verify the authenticity of electronic components has become an urgent problem to be solved. Summary of the invention
[0003] In order to achieve rapid and accurate judgment on the authenticity of electronic components, the present application provides an electronic component authentication method, apparatus, computer equipment and storage medium.
[0004] The above-mentioned invention objective of the present application is achieved through the following technical solutions: An electronic component authentication method, the electronic component authentication method comprising: Acquire a real-time electronic component image, and reconstruct the real-time electronic component image using a trained ESPCN model to obtain a processed electronic component image; Performing feature extraction on the processed electronic component image through a trained CNN model to generate a deep feature vector of the electronic component to be authenticated; Comparing the deep feature vector of the electronic component to be authenticated with the standard feature vector in a standard feature database, calculating the similarity, and obtaining the electronic component similarity value; The authenticity of the electronic component is judged according to the electronic component similarity value, and an electronic component authentication result is obtained.
[0005] By adopting the above technical solution, the image quality can be significantly improved by using the trained ESPCN model to perform super-resolution reconstruction on the real-time electronic component image. This makes the details in the image clearer, thereby providing a better data basis for subsequent feature extraction. Improving the image resolution ensures that subtle features can be fully captured and analyzed, enhancing the accuracy and reliability of the entire process. Using the trained CNN model to extract features from the processed high-resolution image can automatically and efficiently generate deep feature vectors of the electronic component to be authenticated. Deep learning models are good at extracting complex and highly distinguishing features from images. These feature vectors can more accurately characterize the uniqueness of electronic components and ensure the accuracy and stability of feature extraction. The deep feature vectors of the electronic component to be authenticated are compared with the standard feature vectors in the standard feature database to calculate the similarity value. Using calculation methods such as cosine similarity, the similarity between two sets of feature vectors can be accurately evaluated. Accurate similarity calculation can effectively distinguish between real components and counterfeit components, reduce the possibility of misjudgment and missed judgment, and improve the accuracy of authentication results.
[0006] In a preferred example, the present application may be further configured as follows: the real-time electronic component image is acquired, and the real-time electronic component image is reconstructed using a trained ESPCN model to obtain a processed electronic component image, including: obtaining a high-resolution electronic component image and a low-resolution electronic component image based on a comparison between the real-time electronic component image and a preset image resolution threshold; The low-resolution electronic component image is input into the trained ESPCN model to obtain the processed electronic component image.
[0007] By adopting the above technical solution, for low-resolution electronic component images, the trained ESPCN model can be used for reconstruction, which can significantly improve the image quality and generate high-resolution processed images. By reconstructing low-resolution images, the clarity and details of the images are improved, so that the deep learning model can more accurately judge the authenticity of electronic components in subsequent feature extraction and similarity calculation.
[0008] In a preferred example, the present application may be further configured as follows: the low-resolution electronic component image is input into the trained ESPCN model to obtain the processed electronic component image, which includes: Acquisition of historical low-resolution imagery; Inputting the low-resolution image into a preset ESPCN model to generate a reconstructed high-resolution image; Using the MSE loss function to calculate the error between the reconstructed high-resolution image and the historical high-resolution electronic component image, to obtain an image frequency loss error result; The weight of the preset ESPCN model is updated according to the image frequency loss error result through the back propagation algorithm until the preset ESPCN model converges to obtain the trained ESPCN model.
[0009] By adopting the above technical solution, the MSE loss function is used to calculate the error between the reconstructed high-resolution image and the historical high-resolution electronic component image, ensuring that the model can accurately capture the details and features of the image. The model weights are continuously adjusted through the back-propagation algorithm, so that the model can generate more accurate high-resolution images when processing low-resolution images, improving the accuracy of overall recognition and authentication.
[0010] In a preferred example, the present application may be further configured as follows: extracting features from the processed electronic component image using a trained CNN model to generate a deep feature vector of the electronic component to be authenticated, which includes: Construct a CNN model, divide the historical image information of electronic components into a training set and a test set, use the training set to train the CNN model, use the test set to evaluate the performance of the CNN model, and generate an evaluation result, and obtain the trained CNN model based on the evaluation result.
[0011] By adopting the above technical solution, a CNN model is constructed and the historical image information of electronic components is divided into a training set and a test set. The model is trained with the training set, and the model performance is evaluated with the test set. This method significantly improves the accuracy of extracting electronic component image features and the accuracy of authentication judgment. Through systematic training and continuous performance evaluation, the structure and parameters of the model are optimized, ensuring the stability and rapid response capability of the system in different application scenarios, thereby achieving rapid and accurate judgment of the authenticity of electronic components.
[0012] In a preferred example, the present application may be further configured as follows: extracting features from the processed electronic component image using the trained CNN model to generate a deep feature vector of the electronic component to be authenticated, including: The processed electronic component image is input into the trained CNN model to obtain a high-dimensional feature map of the image, and the high-dimensional feature map is flattened to generate a deep feature vector of the electronic component to be authenticated.
[0013] By adopting the above technical solution, the high-dimensional feature extraction capability of the deep learning model can capture subtle features in the electronic component images and improve the accuracy of judging the authenticity of the components.
[0014] In a preferred example, the present application can be further configured as: comparing the deep feature vector of the electronic component to be authenticated with the standard feature vector in the standard feature database, calculating the similarity, and obtaining the electronic component similarity value, including: calculating the cosine similarity between the deep feature vector of the electronic component to be authenticated and the standard feature vector to obtain the electronic component similarity value.
[0015] By adopting the above technical solution, cosine similarity can accurately measure the similarity between two vectors, thereby improving the accuracy of authenticity judgment of electronic components.
[0016] In a preferred example, the present application may be further configured as follows: judging the authenticity of the electronic component according to the electronic component similarity value to obtain the electronic component authentication result includes: Comparing the calculated similarity value of the electronic component with a preset standard similarity threshold; If the electronic component similarity value is higher than or equal to the standard similarity threshold, the electronic component is determined to be a real component; If the electronic component similarity value is lower than the standard similarity threshold, the electronic component is determined to be a counterfeit component.
[0017] By adopting the above technical solution, the system can automatically judge the authenticity of electronic components through the preset standard similarity threshold, reducing human intervention and improving the efficiency and consistency of judgment. The process of comparing similarity values has a small amount of calculation and can be completed in a short time, which is suitable for production lines and logistics links that require rapid response. The preset similarity threshold is set based on a large amount of historical data and experimental results, which can effectively distinguish between real components and counterfeit components and improve the accuracy of judgment.
[0018] The second object of the invention is achieved by the following technical solutions: An electronic component authentication device, the electronic component authentication device comprising: An image processing module is used to obtain a real-time electronic component image and reconstruct the real-time electronic component image using a trained ESPCN model to obtain a processed electronic component image; A feature vector module, used to extract features from the processed electronic component image through a trained CNN model to generate a deep feature vector of the electronic component to be authenticated; A similarity module is used to compare the deep feature vector of the electronic component to be authenticated with the standard feature vector in a standard feature database, calculate the similarity, and obtain the electronic component similarity value; The electronic component comparison module is used to determine the authenticity of the electronic component according to the electronic component similarity value and obtain the electronic component authentication result.
[0019] By adopting the above technical solution, the image quality can be significantly improved by using the trained ESPCN model to perform super-resolution reconstruction on the real-time electronic component image. This makes the details in the image clearer, thereby providing a better data basis for subsequent feature extraction. Improving the image resolution ensures that subtle features can be fully captured and analyzed, enhancing the accuracy and reliability of the entire process. Using the trained CNN model to extract features from the processed high-resolution image can automatically and efficiently generate deep feature vectors of the electronic component to be authenticated. Deep learning models are good at extracting complex and highly distinguishing features from images. These feature vectors can more accurately characterize the uniqueness of electronic components and ensure the accuracy and stability of feature extraction. The deep feature vectors of the electronic component to be authenticated are compared with the standard feature vectors in the standard feature database to calculate the similarity value. Using calculation methods such as cosine similarity, the similarity between two sets of feature vectors can be accurately evaluated. Accurate similarity calculation can effectively distinguish between real components and counterfeit components, reduce the possibility of misjudgment and missed judgment, and improve the accuracy of authentication results.
[0020] The third objective of the present application is achieved through the following technical solutions: A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned electronic component authentication method when executing the computer program.
[0021] The fourth objective of the present application is achieved through the following technical solutions: A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the electronic component authentication method are implemented.
[0022] In summary, the present application includes at least one of the following beneficial technical effects: 1. By using the trained ESPCN model to perform super-resolution reconstruction on real-time electronic component images, the image quality can be significantly improved. This makes the details in the image clearer, thus providing a better data basis for subsequent feature extraction. Improving image resolution ensures that subtle features can be fully captured and analyzed, enhancing the accuracy and reliability of the entire process. Using the trained CNN model to extract features from the processed high-resolution image can automatically and efficiently generate deep feature vectors of the electronic components to be authenticated. Deep learning models are good at extracting complex and highly distinctive features from images. These feature vectors can more accurately characterize the uniqueness of electronic components and ensure the accuracy and stability of feature extraction. The deep feature vectors of the electronic components to be authenticated are compared with the standard feature vectors in the standard feature database to calculate the similarity value. Using calculation methods such as cosine similarity, the similarity between two sets of feature vectors can be accurately evaluated. Accurate similarity calculation can effectively distinguish between real components and counterfeit components, reduce the possibility of misjudgment and missed judgment, and improve the accuracy of authentication results; 2. Build a CNN model and divide the historical image information of electronic components into a training set and a test set. Use the training set to train the model, and use the test set to evaluate the model performance. This method significantly improves the accuracy of extracting electronic component image features and the accuracy of authentication judgment. Through systematic training and continuous performance evaluation, the structure and parameters of the model are optimized, ensuring the stability and rapid response capabilities of the system in different application scenarios, thereby achieving rapid and accurate judgment of the authenticity of electronic components; 3. Use the MSE loss function to calculate the error between the reconstructed high-resolution image and the historical high-resolution electronic component image to ensure that the model can accurately capture the details and features of the image. The model weights are continuously adjusted through the back-propagation algorithm, so that the model can generate more accurate high-resolution images when processing low-resolution images, improving the accuracy of overall recognition and authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a flow chart of an electronic component authentication method in one embodiment of the present application; Figure 2 This is a flowchart for implementing step S10 of the electronic component authentication method in one embodiment of the present application; Figure 3 This is a flowchart of the implementation of the electronic component authentication method before step S12 in one embodiment of the present application; Figure 4 This is a flowchart of the implementation of the electronic component authentication method before step S20 in one embodiment of the present application; Figure 5 is a flowchart for implementing step S20 of the electronic component authentication method in one embodiment of the present application; Figure 6is a flowchart for implementing step S30 of the electronic component authentication method in one embodiment of the present application; Figure 7 is a flowchart for implementing step S40 of the electronic component authentication method in one embodiment of the present application; Figure 8 This is a principle block diagram of an electronic component authentication method in one embodiment of the present application; Fig. 9 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The present application is further described in detail below in conjunction with the accompanying drawings.
[0025] In one embodiment, if Figure 1 As shown, the present application discloses an electronic component authentication method, which specifically includes the following steps: S10: Acquire a real-time electronic component image, and reconstruct the real-time electronic component image using the trained ESPCN model to obtain a processed electronic component image.
[0026] In this embodiment, the real-time electronic component image refers to an image of an electronic component collected in real time by a camera device during the production process or in the logistics link. The trained ESPCN model refers to a model obtained by training the ESPCN model with pre-processed low-resolution images and high-resolution images. The processed electronic component image refers to a high-resolution image obtained by super-resolution reconstruction of the real-time electronic component image by the trained ESPCN model.
[0027] Specifically, use a camera to capture images of electronic components in real time in a production line or logistics link. Ensure that the camera settings can cover all electronic component locations that need to be detected and have sufficient frame rate to meet real-time requirements. Input the acquired real-time electronic component images into the trained ESPCN model. The ESPCN model structure includes multiple convolutional layers and sub-pixel convolutional layers, which can process the input low-resolution images. The ESPCN model converts low-resolution images into high-resolution images through forward propagation. In this process, the convolutional layer of the model extracts local features of the image, and the sub-pixel convolutional layer reorganizes these features into a high-resolution image. The model outputs the processed image of the electronic component, that is, the high-resolution image after super-resolution reconstruction.
[0028] S20: Extract features of the processed electronic component image through the trained CNN model to generate a deep feature vector of the electronic component to be authenticated.
[0029] In this embodiment, the trained CNN model refers to a convolutional neural network model trained by electronic component image data. The deep feature vector of the electronic component to be authenticated refers to a high-dimensional vector obtained by extracting features from the processed electronic component image by the trained CNN model.
[0030] Specifically, the processed electronic component image is input into the trained CNN model. The convolution layer of the trained CNN model extracts local features of the image through convolution operations. Each convolution layer generates multiple feature maps, which retain information at different levels of the image. After the convolution operation, the activation function is used to introduce nonlinearity, so that the model can learn more complex and useful features. The pooling operation is used to reduce the size of the feature map, reduce the number of parameters and the amount of calculation, and prevent overfitting. The pooled feature map is flattened into a one-dimensional vector, and further feature extraction and fusion are performed through the fully connected layer to finally generate a deep feature vector of the electronic component to be authenticated.
[0031] S30: Compare the deep feature vector of the electronic component to be authenticated with the standard feature vector in the standard feature database, calculate the similarity, and obtain the electronic component similarity value.
[0032] In this embodiment, the standard feature vector refers to the deep feature vector extracted from the known real electronic component image by the trained CNN model. These standard feature vectors are stored in a feature database as a benchmark for authentication comparison. The electronic component similarity value refers to the value obtained by calculating the similarity between the deep feature vector of the electronic component to be authenticated and the standard feature vector.
[0033] Specifically, a standard feature database is established by performing image acquisition, preprocessing and feature extraction on a large number of known real electronic components. Each standard feature vector corresponds to a known real electronic component. The image of the electronic component to be authenticated is processed by super-resolution reconstruction and a trained CNN model to generate its deep feature vector. The deep feature vector of the electronic component to be authenticated is compared with all the standard feature vectors in the standard feature database, and the cosine similarity is calculated to obtain multiple similarity values. The highest similarity value is selected as the final similarity value of the electronic component.
[0034] S40: judging the authenticity of the electronic component according to the electronic component similarity value, and obtaining an electronic component authentication result.
[0035] In this embodiment, the electronic component authentication result refers to the result obtained by extracting features, comparing feature vectors and calculating similarity of the electronic component image, and judging whether the electronic component is authentic according to a preset threshold. The authentication result is divided into "authentic" or "forged".
[0036] Specifically, the similarity threshold is determined by analyzing the similarity calculation results of a large number of known genuine and counterfeit electronic components. The calculated similarity value of the electronic component is compared with the set similarity threshold. If the similarity value is higher than or equal to the threshold, the electronic component is considered to be authentic and the authentication result is "authentic". If the similarity value is lower than the threshold, the electronic component is considered to be possibly counterfeit or substandard, and the authentication result is "counterfeit".
[0037] In one embodiment, if Figure 2 As shown, in step S10, a real-time electronic component image is obtained, and the real-time electronic component image is reconstructed using the trained ESPCN model to obtain a processed electronic component image, including: S11: Comparing the real-time electronic component image with a preset image resolution threshold to obtain a high-resolution electronic component image and a low-resolution electronic component image.
[0038] In this embodiment, the preset image resolution threshold refers to the image resolution used to distinguish between high and low resolution. A high-resolution electronic component image refers to an image with a resolution higher than or equal to the preset image resolution threshold. A low-resolution electronic component image refers to an image with a resolution lower than the preset image resolution threshold.
[0039] Specifically, an image resolution threshold is set, and a real-time electronic component image is acquired through an image acquisition device (such as a camera, a scanner, etc.). The acquired real-time electronic component image is subjected to resolution detection to determine its resolution value. The detected image resolution value is compared with a preset image resolution threshold. If the resolution value of the real-time electronic component image is higher than or equal to the preset image resolution threshold, it is classified as a high-resolution electronic component image. If the resolution value of the real-time electronic component image is lower than the preset image resolution threshold, it is classified as a low-resolution electronic component image.
[0040] S12: Input the low-resolution electronic component image into the trained ESPCN model to obtain a processed electronic component image.
[0041] Specifically, first, basic preprocessing operations are performed on the low-resolution electronic component image, such as normalization, cropping or resizing, to adapt to the input requirements of the ESPCN model. Load the trained ESPCN model. The model has been trained on high-resolution and low-resolution image pairs and can effectively improve the image resolution. The preprocessed low-resolution electronic component image is input into the ESPCN model. Through the forward propagation process of the model, the low-resolution image is processed using the convolution layer and the sub-pixel convolution layer to generate a high-resolution image. The ESPCN model is characterized in that its sub-pixel convolution layer can directly convert the low-resolution feature map into a high-resolution image, improving the resolution while maintaining the image details. Obtain the processed high-resolution electronic component image from the output of the ESPCN model. For example, assuming that the low-resolution electronic component image is 50x50 pixels in size, normalize it to the [0, 1] range, and resize it to a standard size that meets the model input (for example, resize it to meet the input size during model training, such as 100x100 pixels). Use a deep learning framework (such as TensorFlow or PyTorch) to load the pre-trained ESPCN model weights. The preprocessed image is converted into a tensor format (e.g., [1, 50, 50, 3]) and input into the ESPCN model. Through the model forward propagation process, the model convolution layer extracts image features, and the sub-pixel convolution layer converts the low-resolution feature map into a high-resolution image.
[0042] In one embodiment, if Figure 3 As shown, before step S12, the low-resolution electronic component image is input into the trained ESPCN model to obtain the processed electronic component image, which includes: S101: Acquire historical low-resolution images.
[0043] In this embodiment, the low-resolution image refers to an image obtained by downsampling the high-resolution image.
[0044] Specifically, a stored high-resolution electronic component image is extracted from an image database, the size of the target low-resolution image is determined, and the value of each pixel in the target low-resolution image is calculated by a bilinear interpolation method, and the calculated pixel values are combined into a new low-resolution image.
[0045] S102: Input the low-resolution image into a preset ESPCN model to generate a reconstructed high-resolution image.
[0046] In this embodiment, the preset ESPCN model refers to a designed super-resolution convolutional neural network architecture, but the model has not been trained. The reconstructed high-resolution image refers to a low-resolution image with a significantly higher resolution and detail level than the input.
[0047] Specifically, the architecture of the ESPCN model is designed and loaded to ensure that the model structure meets the requirements. For low-resolution images, data preprocessing is performed, such as normalization and resizing. Forward propagation is performed to input low-resolution images into the model, and high-resolution images are generated through convolutional layers and sub-pixel convolutional layers.
[0048] S103: Using the MSE loss function, calculate the error between the reconstructed high-resolution image and the historical high-resolution electronic component image to obtain an image frequency loss error result.
[0049] In this embodiment, the MSE loss function refers to the average square error between the predicted value and the true value. The image frequency loss error result is an error value calculated by the MSE loss function, which is used to quantify the difference between the reconstructed high-resolution image and the historical high-resolution electronic component image.
[0050] Specifically, a low-resolution electronic component image is input into a preset ESPCN model for reconstruction to generate a high-resolution image, and the MSE loss function is used to calculate the error between the reconstructed image and the historical high-resolution electronic component image to obtain the image frequency loss error result. The smaller the MSE loss value, the smaller the difference between the reconstructed image and the historical high-resolution image, and the higher the image quality. The MSE formula is as follows: Where n is the number of data points, yi is the true value, is the predicted value.
[0051] S104: updating the weight of the preset ESPCN model according to the image frequency loss error result through the back propagation algorithm until the preset ESPCN model converges to obtain a trained ESPCN model.
[0052] In this embodiment, the back propagation algorithm refers to an algorithm for training a neural network, which updates the model parameters by calculating the gradient of the loss function with respect to each parameter (weight and bias).
[0053] Specifically, based on the error calculated by the MSE loss, the gradient of each parameter in the model is calculated through the back-propagation algorithm. The back-propagation algorithm uses the chain rule to pass the partial derivatives of the loss function to the final output back layer by layer to calculate the contribution of each parameter to the loss. The parameters of the model are updated according to the calculated gradient. Repeat forward propagation, loss calculation, and back-propagation until the model converges (the image frequency loss error result no longer decreases).
[0054] The parameter update formula is: Where θ represents the model parameters, α represents the learning rate, Represents the gradient of the loss function with respect to the parameters.
[0055] In one embodiment, if Figure 4 As shown, before step S20, the processed electronic component image is subjected to feature extraction through the trained CNN model to generate a deep feature vector of the electronic component to be authenticated, which includes: S201: construct a CNN model, divide the historical image information of electronic components into a training set and a test set, use the training set to train the CNN model to obtain a trained CNN model, use the test set to test the trained CNN model, retrain the trained CNN model, and further optimize the performance of the trained CNN model.
[0056] In this embodiment, the CNN model refers to a deep learning model specifically used to process image data. The historical image information of electronic components refers to photos of various electronic components in different environments, which are used to train and test the model. The training set refers to a portion of images randomly extracted from the historical image information of electronic components, which is used to train the CNN model. The training set usually accounts for 80% of the total data set. The test set refers to another portion of images randomly extracted from the historical image information of electronic components, which is used to evaluate the performance of the CNN model. The test set usually accounts for 20% of the total data set. The evaluation result refers to the performance of the model on the test set.
[0057] Specifically, the images of the training set are input into the CNN model. Forward propagation is performed through the convolution layer, activation layer, pooling layer and fully connected layer to obtain the prediction results. The error between the model prediction results and the true label is calculated using the selected loss function. The gradient is calculated based on the error through the back propagation algorithm to update the model weights. Repeat the forward propagation until the model converges. The images of the test set are input into the trained CNN model. The prediction results are obtained through the CNN model. Based on the prediction results and the true labels, the evaluation indicators such as accuracy, precision, recall and F1 score are calculated. The evaluation results are generated, and the hyperparameters of the model are adjusted based on the evaluation results to optimize the trained CNN model.
[0058] In one embodiment, if Figure 5 As shown, in step S20, the processed electronic component image is subjected to feature extraction through the trained CNN model to generate a deep feature vector of the electronic component to be authenticated, including: S201: Input the processed electronic component image into the trained CNN model to obtain a high-dimensional feature map of the image, flatten the high-dimensional feature map, and generate a deep feature vector of the electronic component to be authenticated.
[0059] In this embodiment, the high-dimensional feature map of the image refers to a feature map obtained by performing multi-layer convolution and pooling operations on the input image through a trained CNN model.
[0060] Specifically, the preprocessed electronic component image is input into the trained CNN model. The image is processed by multiple convolutional layers and pooling layers. These layers are used to extract different features in the image, such as edges, textures, and complex patterns. After being processed by multiple convolutional layers and pooling layers, a high-dimensional feature map of the image is obtained. For example, if the input image size is 224×224×3, after several layers of convolution and pooling, a 7×7×512 feature map may be obtained. The high-dimensional feature map is flattened and the three-dimensional feature map is converted into a one-dimensional vector. For example, a 7×7×512 feature map is flattened into a 7×7×512=25088-dimensional one-dimensional vector. The flattened high-dimensional feature map is the deep feature vector of the electronic component to be authenticated. These vectors represent high-level features in the image and are used for subsequent comparison and authentication.
[0061] In one embodiment, if Figure 6 As shown, in step S30, the deep feature vector of the electronic component to be authenticated is compared with the standard feature vector in the standard feature database, the similarity is calculated, and the electronic component similarity value is obtained, including: S31: calculating the cosine similarity between the deep feature vector of the electronic component to be authenticated and the standard feature vector to obtain the electronic component similarity value.
[0062] In this embodiment, cosine similarity refers to a measurement method for measuring the similarity between two vectors, and calculates the cosine value of the angle between the two vectors. Its value is between -1 and 1, and the closer the value is to 1, the more similar the two vectors are, and the closer the value is to -1, the less similar the two vectors are.
[0063] Specifically, the deep feature vector V1 of the electronic component to be authenticated and the standard feature vector V2 in the standard feature database are obtained. The dot product (inner product) of vectors V1 and V2 is calculated: Calculate the norm (length) of vector V1: Calculate the norm (length) of vector V1: Calculate cosine similarity: Among them, cos(θ) is the similarity value of electronic components.
[0064] In one embodiment, if Figure 7 As shown, in step S40, the authenticity of the electronic component is judged according to the electronic component similarity value to obtain the electronic component authentication result, including: S41: Compare the calculated electronic component similarity value with a preset standard similarity threshold.
[0065] In this embodiment, the preset standard similarity threshold refers to a predefined value used to determine whether the electronic component similarity value is high enough to determine the authenticity of the electronic component.
[0066] Specifically, by comparing the calculated electronic component similarity value with a preset standard similarity threshold, it can be determined whether the electronic component passes the authentication.
[0067] S42: If the electronic component similarity value is higher than or equal to the standard similarity threshold, the electronic component is determined to be a real component.
[0068] Specifically, the electronic component similarity value is compared with the standard similarity threshold. If the electronic component similarity value is greater than or equal to the standard similarity threshold, the electronic component is determined to be a real component. For example, the electronic component similarity value obtained by calculation is 0.92. The preset standard similarity threshold is 0.85. The electronic component similarity value 0.92 is compared with the standard similarity threshold 0.85. Because 0.92>=0.85, the electronic component is determined to be a real component.
[0069] S43: If the electronic component similarity value is lower than the standard similarity threshold, the electronic component is determined to be a counterfeit component.
[0070] Specifically, the electronic component similarity value is compared with the standard similarity threshold. If the electronic component similarity value is lower than the standard similarity threshold, the electronic component is determined to be a counterfeit component. For example, the electronic component similarity value obtained by calculation is 0.75. The preset standard similarity threshold is 0.85. The electronic component similarity value 0.75 is compared with the standard similarity threshold 0.85. Because 0.75<0.85, the electronic component is determined to be a counterfeit component.
[0071] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0072] In one embodiment, an electronic component authentication device is provided, and the electronic component authentication device corresponds one-to-one to the electronic component authentication method in the above embodiment. Figure 8 As shown, the electronic component authentication device includes an image processing module, a feature vector module, a similarity module and an electronic component comparison module. The detailed description of each functional module is as follows: An image processing module is used to obtain a real-time electronic component image and reconstruct the real-time electronic component image using a trained ESPCN model to obtain a processed electronic component image; The feature vector module is used to extract features from the processed electronic component images through the trained CNN model to generate a deep feature vector of the electronic component to be authenticated; A similarity module is used to compare the deep feature vector of the electronic component to be authenticated with the standard feature vector in the standard feature database, calculate the similarity, and obtain the electronic component similarity value; The electronic component comparison module is used to determine the authenticity of the electronic component based on the electronic component similarity value and obtain the electronic component authentication result.
[0073] Optionally, the image processing module includes: A comparison submodule, used for comparing the real-time electronic component image with a preset image resolution threshold to obtain a high-resolution electronic component image and a low-resolution electronic component image; The image processing submodule is used to input the low-resolution electronic component image into the trained ESPCN model to obtain the processed electronic component image.
[0074] Optionally, the image processing submodule includes: The historical image acquisition submodule is used to acquire historical low-resolution images; The image reconstruction submodule is used to input the low-resolution image into the preset ESPCN model to generate a reconstructed high-resolution image; A frequency loss error result submodule is used to calculate the error between the reconstructed high-resolution image and the historical high-resolution electronic component image using the MSE loss function to obtain an image frequency loss error result; The training submodule is used to update the weights of the preset ESPCN model according to the image frequency loss error result through the back propagation algorithm until the preset ESPCN model converges to obtain a trained ESPCN model.
[0075] Optionally, include before the feature vector module: The CNN model submodule is used to construct a CNN model, divide the historical image information of electronic components into a training set and a test set, use the training set to train the CNN model, use the test set to evaluate the performance of the CNN model, and generate evaluation results. According to the evaluation results, a trained CNN model is obtained.
[0076] Optionally, the feature vector module includes: The submodule to be authenticated is used to input the processed electronic component image into the trained CNN model to obtain a high-dimensional feature map of the image, flatten the high-dimensional feature map, and generate a deep feature vector of the electronic component to be authenticated.
[0077] Optionally, the similarity module includes: The cosine calculation submodule is used to calculate the cosine similarity between the deep feature vector of the electronic component to be authenticated and the standard feature vector to obtain the electronic component similarity value.
[0078] Optional electronic component comparison module includes: A comparison submodule, used for comparing the calculated electronic component similarity value with a preset standard similarity threshold; A true result submodule, used to determine that the electronic component is a true component if the electronic component similarity value is higher than or equal to a standard similarity threshold; The counterfeit result submodule is used to determine that the electronic component is a counterfeit component if the similarity value of the electronic component is lower than the standard similarity threshold.
[0079] For the specific definition of the electronic component authentication device, please refer to the definition of the electronic component authentication method above, which will not be repeated here. Each module in the above-mentioned electronic component authentication device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0080] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for an image database. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an electronic component authentication method is implemented.
[0081] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Acquire a real-time electronic component image, and reconstruct the real-time electronic component image using the trained ESPCN model to obtain a processed electronic component image; The trained CNN model is used to extract features from the processed electronic component images to generate deep feature vectors of the electronic components to be authenticated. Compare the deep feature vector of the electronic component to be authenticated with the standard feature vector in the standard feature database, calculate the similarity, and obtain the electronic component similarity value; According to the electronic component similarity value, the authenticity of the electronic component is judged to obtain the electronic component authentication result.
[0082] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Acquire a real-time electronic component image, and reconstruct the real-time electronic component image using the trained ESPCN model to obtain a processed electronic component image; The trained CNN model is used to extract features from the processed electronic component images to generate deep feature vectors of the electronic components to be authenticated. Compare the deep feature vector of the electronic component to be authenticated with the standard feature vector in the standard feature database, calculate the similarity, and obtain the electronic component similarity value; According to the electronic component similarity value, the authenticity of the electronic component is judged to obtain the electronic component authentication result.
[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0084] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0085] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An electronic component authentication method, characterized in that: The electronic component authentication method comprises: Acquire a real-time electronic component image, and reconstruct the real-time electronic component image using a trained ESPCN model to obtain a processed electronic component image; Performing feature extraction on the processed electronic component image through a trained CNN model to generate a deep feature vector of the electronic component to be authenticated; Comparing the deep feature vector of the electronic component to be authenticated with the standard feature vector in a standard feature database, calculating the similarity, and obtaining the electronic component similarity value; The authenticity of the electronic component is judged according to the electronic component similarity value, and an electronic component authentication result is obtained.
2. The electronic component authentication method according to claim 1, characterized in that: The step of acquiring a real-time electronic component image and reconstructing the real-time electronic component image using a trained ESPCN model to obtain a processed electronic component image includes: Based on comparing the real-time electronic component image with a preset image resolution threshold, a high-resolution electronic component image and a low-resolution electronic component image are obtained; The low-resolution electronic component image is input into the trained ESPCN model to obtain the processed electronic component image.
3. The electronic component authentication method according to claim 2, characterized in that: The step of inputting the low-resolution electronic component image into the trained ESPCN model to obtain the processed electronic component image comprises: Acquisition of historical low-resolution imagery; Inputting the low-resolution image into a preset ESPCN model to generate a reconstructed high-resolution image; Using the MSE loss function to calculate the error between the reconstructed high-resolution image and the historical high-resolution electronic component image, to obtain an image frequency loss error result; The weight of the preset ESPCN model is updated according to the image frequency loss error result through the back propagation algorithm until the preset ESPCN model converges to obtain the trained ESPCN model.
4. The electronic component authentication method according to claim 1, characterized in that: The process of extracting features from the processed electronic component image using the trained CNN model to generate a deep feature vector of the electronic component to be authenticated includes: Construct a CNN model, divide the historical image information of electronic components into a training set and a test set, use the training set to train the CNN model to obtain the trained CNN model, use the test set to test the trained CNN model, retrain the trained CNN model, and further optimize the performance of the trained CNN model.
5. The electronic component authentication method according to claim 1, characterized in that: The step of extracting features from the processed electronic component image using the trained CNN model to generate a deep feature vector of the electronic component to be authenticated includes: The processed electronic component image is input into the trained CNN model to obtain a high-dimensional feature map of the image, and the high-dimensional feature map is flattened to generate a deep feature vector of the electronic component to be authenticated.
6. The electronic component authentication method according to claim 1, characterized in that: The step of comparing the deep feature vector of the electronic component to be authenticated with the standard feature vector in a standard feature database, calculating the similarity, and obtaining the electronic component similarity value includes: The cosine similarity between the deep feature vector of the electronic component to be authenticated and the standard feature vector is calculated to obtain the electronic component similarity value.
7. The electronic component authentication method according to claim 1, characterized in that: The step of judging the authenticity of the electronic component according to the electronic component similarity value and obtaining the electronic component authentication result includes: Comparing the calculated similarity value of the electronic component with a preset standard similarity threshold; If the electronic component similarity value is higher than or equal to the standard similarity threshold, the electronic component is determined to be a real component; If the electronic component similarity value is lower than the standard similarity threshold, the electronic component is determined to be a counterfeit component.
8. An electronic component authentication device, characterized in that: The electronic component authentication device comprises: An image processing module is used to obtain a real-time electronic component image and reconstruct the real-time electronic component image using a trained ESPCN model to obtain a processed electronic component image; A feature vector module, used to extract features from the processed electronic component image through a trained CNN model to generate a deep feature vector of the electronic component to be authenticated; A similarity module is used to compare the deep feature vector of the electronic component to be authenticated with the standard feature vector in a standard feature database, calculate the similarity, and obtain the electronic component similarity value; The electronic component comparison module is used to determine the authenticity of the electronic component according to the electronic component similarity value and obtain the electronic component authentication result.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the electronic component authentication method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the electronic component authentication method according to any one of claims 1 to 7 are implemented.
