A machine vision industrial quality inspection method based on digital signature
Patent Information
- Application Number
- CN202611049765.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-10-23
AI Technical Summary
[0006]针对现有机器视觉工业质检中产品图像与检测结果关联核对易出错、数据易被篡改、不易归档的技术问题,本发明提供一种基于数字签名的机器视觉工业质检方法,通过数字签名技术实现被检产品图像与检测结果的强关联绑定和防篡改保护
被检产品图像和检测结果的强关联防出错。
Smart Images

Figure CN122966545A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision and information security technology, specifically to a machine vision industrial quality inspection method based on digital signatures. Background Technology
[0002] Industrial quality inspection using machine vision technology refers to the process of using hardware such as industrial cameras, lenses, and light sources to collect product images, and then using computer algorithms (traditional image processing or deep learning model recognition) to automatically analyze the images in order to determine whether the product is qualified, whether there are defects, and to achieve classification, positioning, and measurement.
[0003] In industrial quality inspection, a large number of images of the inspected products are taken. These images are then processed by computer algorithms to produce inspection results. As the production process progresses, the accumulated number of images and inspection results becomes enormous and fragmented. The correlation, verification, and traceability of these images and results become error-prone and challenging issues.
[0004] Currently, a common technique is to explicitly store image file names (e.g., pic_20260415.jpg) and inspection results (pass / fail, defect type / details) together, such as in a database or file. However, this approach has the following drawbacks: First, the image file and inspection results are only associated through the filename, making the association fragile and prone to errors during file renaming, moving, or copying. Second, both image files and inspection result data are stored in plaintext, lacking anti-tampering mechanisms, making them susceptible to intentional or unintentional modification without detection. Third, when quality inspection data needs to be archived or migrated, the consistency of the association between image files and inspection result data is difficult to guarantee, contradicting the strict control requirements of industrial quality inspection.
[0005] Therefore, there is an urgent need in the existing technology for a solution that can strongly correlate and bind the images of inspected products with the inspection results in machine vision industrial quality inspection and has anti-tampering capabilities. Summary of the Invention
[0006] To address the technical problems in existing machine vision industrial quality inspection, such as the susceptibility to errors in linking product images with inspection results, the ease with which data can be tampered with, and the difficulty in archiving, this invention provides a machine vision industrial quality inspection method based on digital signatures. This method uses digital signature technology to achieve a strong association and anti-tampering protection between the inspected product image and the inspection results.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: An innovative machine vision-based industrial quality inspection method based on digital signatures includes the following steps: Step 1: Acquire images of the product being inspected and generate inspection results.
[0008] The system uses industrial cameras, lenses, light sources, and other hardware to capture images of the products being inspected. Then, computer algorithms (traditional image processing algorithms or deep learning model recognition algorithms) are used to analyze and process the captured images to determine whether the products are qualified or have defects, and output the inspection results.
[0009] Step 2: Select the key information to be signed during the quality inspection process.
[0010] Key information requiring signature is extracted from the quality inspection process, and the set of key information includes: a) Fingerprint information from the image of the inspected product; b) Test results (pass / fail); c) Defect characteristics and details; d) Detection time.
[0011] Step 3: Generate fingerprint information for the image of the inspected product.
[0012] The binary data of the inspected product image is calculated using a standard hash function (such as SHA-256 or SM3) to obtain a fixed-length hash value H, which is the fingerprint information of the inspected product image. Due to the characteristics of hash functions, any slight modification to the image data will result in a completely different hash value, thus ensuring the uniqueness and sensitivity of the image fingerprint.
[0013] Step 4: Generate private and public keys for signing and verification.
[0014] A paired private and public key are generated using an asymmetric encryption algorithm (such as RSA or SM2) and a 2048-bit key. The private key is used for digital signatures, and the public key is used to verify digital signatures. The private and public keys can be issued and managed as digital certificates.
[0015] Step 5: Sign the set of key quality inspection information.
[0016] The selected set of key quality inspection information (including fingerprint information H of the inspected product image, inspection results, defect features and details, and inspection time) is digitally signed using the private key to generate a digital signature S. The digital signature S is then stored together with the set of key quality inspection information.
[0017] Step 6: Verify the digital signature during information verification and tracing.
[0018] When it is necessary to verify and trace quality inspection information, the public key is first used to verify the digital signature S of the set of key quality inspection information. If the verification passes, it proves that the set of key quality inspection information is correctly matched and has not been tampered with, and is therefore valid; if the verification fails, it proves that the set of key quality inspection information is incorrectly matched or has been tampered with, and is therefore invalid.
[0019] Step 7: Verify whether the image information has been tampered with.
[0020] If the digital signature verification passes, the signed image fingerprint information H is extracted from the key information set, the hash value H1 of the currently inspected product image is recalculated, and H1 is compared with H. If H1 and H match, it proves that the image information has not been tampered with; if H1 and H do not match, it proves that the image information has been tampered with and is invalid.
[0021] Step 8: Distribution and management of digital signatures.
[0022] The public key, paired with the private key, is placed in a digital certificate and issued externally. The digital certificate has an expiration date; an updated certificate should be obtained after the expiration date to ensure the security of signature verification.
[0023] Compared with the prior art, the beneficial effects of the present invention are as follows: Strong correlation between the inspected product image and the test results prevents errors.
[0024] This invention uses digital signature technology to bind the inspected product image and inspection result information together for signing, forcibly linking them through an encryption algorithm, making them inseparable. Compared to existing technologies that rely solely on filename association, this invention fundamentally prevents the problem of incorrect association.
[0025] The images of the inspected products and the test results are tamper-proof.
[0026] Once the inspected product images and test results are digitally signed, their content cannot be tampered with. Any change to the information content will invalidate the signature, and the product images and test results will be deemed invalid during signature verification, thus ensuring the authenticity and integrity of the quality inspection data.
[0027] Portability of the inspected product image and test results.
[0028] After the images of the inspected products and the test results are digitally signed, their relevance and tamper-proof nature are guaranteed. They can be easily moved, distributed, archived and verified, meeting the strict control requirements of industrial quality inspection for data management. Attached Figure Description
[0029] Figure 1This is a flowchart illustrating the machine vision industrial quality inspection method based on digital signatures according to the present invention. Detailed Implementation
[0030] The present invention will now be further described with reference to the accompanying drawings.
[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the invention 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 merely illustrative of the invention and are not intended to limit the invention.
[0032] Example 1 This embodiment uses machine vision quality inspection of appearance defects on an electronic product production line as an example to illustrate the method of the present invention in detail.
[0033] 1. Image acquisition and detection.
[0034] Industrial cameras are installed on the production line to photograph each electronic product coming off the line, acquiring images of the inspected product. The acquired images are then input into a pre-trained deep learning defect detection model, which outputs the detection results. Assume the currently inspected product is number P0001, and the detection result is "unqualified." The defect feature is a scratch on the casing, with details showing a scratch approximately 3mm long on the left panel. The inspection time is 2026-07-06 14:32:18.
[0035] 2. Extract a set of key information.
[0036] The key information from this quality inspection has been extracted and includes: a) Fingerprint information of the inspected product image (to be calculated); b) Test result: Unqualified; c) Defect characteristics and details: Scratches on the casing, with a scratch approximately 3mm long on the left panel; d) Detection time: 2026-07-06 14:32:18.
[0037] 3. Calculate image fingerprints.
[0038] The SM3 hash function is used to calculate a 256-bit hash value H from the binary data of the inspected product image. For example: H=5d4e3f2a8c9b7d1e6f0a3b5c8d9e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8 This hash value is the fingerprint information of the inspected product image.
[0039] 4. Generate a public / private key pair.
[0040] The SM2 asymmetric encryption algorithm is used to generate a 2048-bit private key SK and a public key PK. The private key SK is securely kept by the signature module of the quality inspection system, and the public key PK is placed in a digital certificate for external issuance.
[0041] 5. Digital signature.
[0042] The private key SK is used to perform a digital signature on the quality inspection key information set to generate a digital signature S. The digital signature S and the quality inspection key information set (including the image fingerprint H, the detection result, the defect features and details, and the detection time) are stored in the database together.
[0043] 6. Verification during information check and traceability.
[0044] When it is subsequently required to check and trace the quality inspection information of the product, the system performs the following verification operations: First, the public key PK is used to verify the digital signature S of the quality inspection key information set. If the verification passes, it indicates that the key information set has not been tampered with after being signed; if the verification fails, it indicates that the data has been tampered with, and the system issues a warning.
[0045] Next, on the premise that the signature verification passes, the signed image fingerprint information H is extracted, the currently stored image file of the inspected product is re-read, and its SM3 hash value H1 is calculated. H1 is compared with H; if they are consistent, it indicates that the image file is intact; if they are inconsistent, it indicates that the image file has been replaced or modified, and the system issues a warning.
[0046] 7. Certificate management.
[0047] The public key PK is placed in a digital certificate, which is uniformly issued and managed by the enterprise's certificate management system. The validity period of the digital certificate is set to 1 year, and the system automatically reminds to renew it before expiration. Within the validity period of the certificate, the public-private key pair corresponding to the certificate is used for signature and verification of all quality inspection data; after the certificate is renewed, the new certificate is used for signing newly generated quality inspection data, and the public key of the old certificate can still be used to verify historical data.
[0048] Second Embodiment This embodiment takes the label inspection of a certain food packaging production line as an example to describe another application scenario of the method of the present invention.
[0049] On the food packaging production line, the machine vision system is used to detect whether the label on each package is complete, whether the printing is clear, and whether the position is accurate. Assume that in a certain inspection, the inspected product is the No. 1234 package of batch B20260706, the inspection result is qualified, and the inspection time is 10:15:42 on July 6, 2026.
[0050] The hash value H' of the inspected product image is calculated using the SHA-256 hash function. A public-private key pair is generated using the RSA asymmetric encryption algorithm, and a digital signature is applied to the key information set (image fingerprint H', inspection result of passing, and inspection time). The signed data is archived and stored together with the image.
[0051] In subsequent quality traceability, quality inspectors can verify the authenticity and validity of the test data for the packaging by verifying the digital signature, and verify whether the associated image file is consistent with the one used during the test by comparing the image hash value.
[0052] As can be seen from the above two embodiments, the method of the present invention is applicable to various machine vision industrial quality inspection scenarios and can effectively solve the technical problems of easy errors in the correlation and verification of product images and inspection results and easy data tampering.
[0053] The above description is only used to illustrate the technical solution of the present invention and is not intended to limit it. Any other modifications or equivalent substitutions made by those skilled in the art to the technical solution of the present invention, as long as they do not depart from the spirit and scope of the technical solution of the present invention, should be covered within the scope of the claims of the present invention.
Claims
1. A machine vision-based industrial quality inspection method based on digital signatures, characterized in that, Includes the following steps: Step 1: Acquire images of the product to be inspected, and analyze the images using computer algorithms to generate inspection results; Step 2: Extract the set of key information to be signed during the quality inspection process. The set of key information includes: fingerprint information of the inspected product image, the inspection results, defect features and details, and inspection time. Step 3: Use a hash function to calculate the binary data of the inspected product image to obtain a fixed-length hash value, which serves as the fingerprint information of the inspected product image. Step 4: Generate a paired private and public key using an asymmetric encryption algorithm; Step 5: Use the private key to digitally sign the key information set, generate a digital signature, and store the digital signature together with the key information set; Step Six: During information verification and tracing, the public key is used to verify the digital signature of the key information set. If the verification passes, it proves that the key information set is correctly matched and has not been tampered with, and is therefore valid; if the verification fails, it proves that the key information set is incorrectly matched or has been tampered with, and is therefore invalid. Step 7: If the digital signature verification is successful, extract the signed image fingerprint information from the key information set, recalculate the hash value of the current inspected product image, and compare it with the signed image fingerprint information. If they match, it proves that the image has not been tampered with; if they do not match, it proves that the image has been tampered with.
2. The machine vision industrial quality inspection method based on digital signature according to claim 1, characterized in that: The hash function uses either the SHA-256 or SM3 algorithm.
3. The machine vision industrial quality inspection method based on digital signatures according to claim 1, characterized in that: The asymmetric encryption algorithm uses either RSA or SM2, and the key length is 2048 bits.
4. The machine vision industrial quality inspection method based on digital signature according to claim 1, characterized in that: The public key paired with the private key is placed in a digital certificate and issued externally. The digital certificate has an expiration date, and an updated certificate needs to be obtained after the expiration date.
5. The machine vision industrial quality inspection method based on digital signature according to claim 1, characterized in that: The test results include a pass / fail determination or a fail / unqualified determination.
6. The machine vision industrial quality inspection method based on digital signature according to claim 1, characterized in that: The computer algorithms include traditional image processing algorithms or deep learning model recognition algorithms.