Method for analyzing commodity package inspection based on AI algorithm and video acquisition
By applying AI algorithms and video acquisition technology in product packaging inspection, analyzing multi-angle images and three-dimensional stereoscopic images of the packaging, the accuracy and efficiency of traditional manual detection methods are solved, and high-precision and efficient packaging inspection are achieved, ensuring product quality and stability of production process.
Patent Information
- Application Number
- CN202510053424.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional artificial visual inspection methods have shortcomings in accuracy and efficiency, and it is difficult to meet the high-precision and high-efficiency product packaging inspection needs.
Using AI algorithms and video acquisition methods, multi-angle images of packaging are obtained through industrial cameras, and three-dimensional reconstruction software is used to generate physical images, analyze holes, heights and cracks, calculate defect evaluation index, and perform assembly line analysis and equipment maintenance based on production index.
It realizes accurate identification and quantitative analysis of subtle defects of product packaging, improves the reliability and efficiency of testing results, and ensures the stability of product quality and the optimization of production process.
Smart Images

Figure CN119904445A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of commodity packaging inspection, and in particular to a method for commodity packaging inspection based on AI algorithm and video acquisition and analysis. Background Art
[0002] Mycelium packaging uses fungal mycelium as raw material. By cultivating a mixture of mycelium and agricultural waste (such as wood chips and straw), a strong and biodegradable material is formed. This packaging has good cushioning properties and can be used to package fragile items such as electronic products and glass products. It can also be quickly decomposed in the natural environment after being discarded, which is environmentally friendly. Traditional mycelium packaging inspection methods mostly rely on manual visual inspection, but manual visual inspection has the following defects: Insufficient accuracy: Affected by subjective factors, it is difficult to unify the judgment standards of different inspectors, which is prone to misjudgment and omission, and it is difficult to accurately identify some minor defects or internal structural problems; Inefficiency: The detection speed is slow. In the process of large-scale production and inspection, it is difficult to meet the needs of fast and efficient production. In addition, long-term manual inspection can easily lead to fatigue of inspectors, further affecting the accuracy and stability of the test results. In recent years, computer vision technology has made rapid progress. The resolution and accuracy of image acquisition equipment have been continuously improved, and high-quality mycelium packaging images can be obtained. At the same time, image processing algorithms and models have been continuously optimized, showing excellent performance in image recognition, classification, and segmentation, providing technical support for the precise detection of mycelium packaging. To this end, a method for commodity packaging inspection based on AI algorithm and video acquisition and analysis is introduced. Summary of the invention
[0003] In view of this, the present invention provides a method for commodity packaging inspection based on AI algorithm and video acquisition and analysis to solve the problems raised by the above background technology.
[0004] The purpose of the present invention can be achieved by the following technical solution: A method for commodity packaging inspection based on AI algorithm and video acquisition and analysis, comprising: Step 1: Number the production lines of product packaging, and randomly select x product packages from each production line as test samples, x>50; Step 2: Use an industrial camera to obtain images of the test sample at various angles, and use 3D reconstruction software to obtain a 3D stereogram of each surface of the test sample; Step 3: Analyze the holes, heights and cracks on each surface of the test sample to obtain the defect evaluation index of each test sample; Step 4: Analyze the defect evaluation index of the inspection samples located on the same assembly line to obtain the production index of each assembly line; Step 5: Based on the production index of each assembly line, analyze and process the production situation of each assembly line.
[0005] Furthermore, the specific process of analyzing the holes on each surface of the test sample in step 3 is as follows: S1: Extract the plane images of the six surfaces of the test sample, top, bottom, left, and right, from the images of the test sample at various angles acquired by the industrial camera, and pre-process the images; S2: locate the holes in the plane image, divide the plane image into sub-regions, preset a weight influence factor for each sub-region, calculate the area of each hole on the plane image, preset each area interval, set different area intervals corresponding to different area defect scores, match the area intervals corresponding to the area of each hole on the plane image, and thus obtain the area defect score corresponding to each hole on the plane image; obtain the sub-region where each hole on the plane image is located, and thus obtain the weight influence factor corresponding to each hole on the plane image; multiply the area defect score corresponding to each hole on the plane image by the corresponding weight influence factor and then sum them, and thus obtain the hole area defect index of the plane image; S3: Calculate the number of holes in each sub-region of the planar image, recorded as the number of sub-holes, count the sum of the areas of all holes in each sub-region, recorded as the sub-surface sum, divide the number of sub-holes by the sub-surface sum to obtain the hole-surface ratio of the corresponding sub-region, multiply the hole-surface ratio by the weight influence factor of the corresponding sub-region, and thus obtain the initial hole-surface index of each sub-region, calculate the average of the initial hole-surface index of each sub-region, and the result is used as the hole-surface quality index of the planar image; S4: Preset the weighted influence factors corresponding to the hole area defect index and the hole surface quality index, normalize the hole area index and the hole surface quality index, multiply them by the corresponding weighted influence factors, and then sum them up, and the obtained result is used as the hole comprehensive index of the plane image; S5: Perform the calculations of steps S1-S5 on the six faces of the same test sample to obtain the hole comprehensive indexes of the six faces of the test sample, and take the average of the hole comprehensive indexes of the six faces as the hole indication value of the test sample.
[0006] Furthermore, the specific process of analyzing the height of each surface of the test sample in step 3 is as follows: A1: Import the three-dimensional stereogram of the six surfaces of the test sample into the image analysis software, randomly select two points in the three-dimensional stereogram, randomly generate a path between the two points, use the line scanning tool of the image analysis software to scan along the path, and record the height value of each point on the path to obtain a height value set, calculate the mean and standard deviation of the data in the height value set, and obtain the high mean value GJZ and high wave value, and subtract the minimum value from the maximum value in the height value set to obtain the height difference value GCZ; use the formula: Thus, the altitude indication value GDZ is obtained, where is a standard value with a high mean value extracted from a preset database. and is the maximum allowable difference of high mean and the maximum allowable difference of high difference extracted from the preset database, q1 and q2 are the weighted influencing factors corresponding to high mean GJZ and high difference GCZ respectively; A2: Preset each high wave value interval, set different high wave value intervals to correspond to different adjustment factors, match the high wave value intervals corresponding to the high wave value, so as to obtain the adjustment factor corresponding to the high wave value, and multiply the adjustment factor by the height indication value GDZ to obtain the initial height index; A3: Continuously regenerate a path between the two points in step A1, calculate the initial height index under each generated path; take the average of the initial height index under each generated path as the flatness index of the corresponding surface; A4: Perform steps A1-A3 on the six surfaces of the test sample to obtain the flatness indexes corresponding to the six surfaces, and take the average of the flatness indexes of the six surfaces as the roughness indication value of the test sample.
[0007] Furthermore, it is characterized in that the specific process of analyzing the cracks on each surface of the test sample in step three is: D1: Obtain historical pictures of mycelium packaging, pre-process the images, mark the crack areas in the historical pictures of mycelium packaging, and provide unified training for the labelers; the labelers will mark the crack areas with a severity score while marking the crack areas; D2: Group the historical pictures of mycelium packaging in a ratio of 7:2:1. The group with a ratio of 7 is used as the training group, the group with a ratio of 2 is used as the validation group, and the group with a ratio of 1 is used as the test group. The training group is imported into the U-Net model for training. The number of training rounds and batch size are set. The gradient of the loss function with respect to the model parameters is calculated by the back propagation algorithm. The Adam optimizer is selected to adaptively adjust the learning rate of each parameter. During the training process, the validation group data is regularly imported into the model to calculate the loss function and evaluation index of the validation group. The evaluation indexes include accuracy, recall and intersection-over-union ratio. The weight influencing factors of accuracy, recall and intersection-over-union ratio are preset. The accuracy, recall and intersection-over-union ratio are multiplied by the corresponding weight factors and then summed. The result is used as the evaluation index. The loss function threshold and evaluation index threshold are preset. The difference between the loss function of two consecutive validation groups and the difference between the evaluation index are calculated. If the difference between the loss function of a validation group is less than the loss function threshold or the difference between the evaluation index is less than the evaluation index threshold, the training of the model is stopped. D3: The training group data is grouped again, with each hundred data in a group, and the grouped test group data is imported into the trained model for testing, and the loss function and evaluation index of each group of test group data are calculated. The loss function and evaluation index of each group of test group data are calculated using the standard deviation formula; thereby obtaining the loss wave value and the evaluation wave value, and presetting the loss wave value threshold and the evaluation wave value threshold. If the loss wave value is less than the loss wave value threshold and the evaluation wave value is less than the evaluation wave value threshold, the currently trained model is used as the final model, otherwise, the model is retrained; D4: Import the plane image of the test sample into the trained model to obtain the location and severity score of each crack, match the sub-area where each crack is located, and obtain the weight influence factor corresponding to each crack. Multiply the severity score of each crack by the corresponding weight influence factor and then sum them up to obtain the crack influence index; take the average of the crack influence indexes of the six surfaces of the test sample as the crack indication value of the test sample.
[0008] Furthermore, the specific process of obtaining the defect assessment index of each test sample in step 3 is as follows: The weight influence factors corresponding to the hole indication value, roughness indication value and crack indication value are preset, the hole indication value, roughness indication value and crack indication value are normalized, multiplied by the corresponding weight influence factors and then summed up, and the result obtained is used as the defect evaluation index of the test sample.
[0009] Furthermore, the production index of each assembly line is obtained in step 4, and the specific process is as follows: According to the quality requirements of the current batch of commodity packaging, a defect assessment index threshold is preset. If the defect assessment index of the test sample is greater than the preset defect assessment index threshold, the quality of the test sample packaging is judged to be unqualified; the number of commodity packaging with unqualified quality is counted and recorded as the unqualified number, and the unqualified number is divided by x to obtain the unqualified rate; The defect assessment index of the unqualified packaging quality inspection sample is subtracted from the defect assessment index threshold to obtain the quality difference, and each quality difference interval is preset. Different quality difference intervals correspond to different difference factors, and the quality difference intervals corresponding to the quality difference are matched to obtain the difference factor corresponding to the quality difference. The difference factor corresponding to the unqualified packaging quality inspection sample is multiplied by the quality difference to obtain the difference indication value, and the average of the difference indication values of all unqualified packaging quality inspection samples is taken as the unqualified packaging index; Preset the weighted influencing factors corresponding to the non-conforming rate and the non-conforming packaging index, multiply the non-conforming rate and the non-conforming packaging index by the corresponding weighted factors and then sum them up to obtain the production index of the corresponding assembly line.
[0010] Furthermore, the specific process of step five is as follows: Preset production index threshold. If the production index of the assembly line is higher than the production index threshold, an analysis warning will be triggered. Extract the hole indication value, roughness indication value and crack indication value of the production line where the trigger analysis warning is located, preset the threshold values corresponding to the hole indication value, roughness indication value and crack indication value, and if the hole indication value is greater than the hole indication value threshold, trigger the hole analysis instruction; if the roughness indication value is greater than the roughness indication value threshold, trigger the roughness analysis instruction; if the crack indication value is greater than the crack indication value threshold, trigger the crack analysis instruction; Hole analysis instructions: extract the video of the corresponding assembly line cutting area, randomly grab a frame containing a cutting tool in the video, and import the picture into the image analysis software; at the same time, import the picture of the normal cutting tool into the image analysis software, and adjust the size and resolution of the two pictures to keep the same, overlap the cutting tool parts in the two pictures, calculate the ratio of the overlapping area to the normal cutting tool area, and use it as the wear ratio. Preset the wear ratio threshold, if the wear ratio is less than the wear ratio threshold, generate a cutting tool replacement instruction, and send the cutting tool replacement instruction to the maintenance personnel's mobile terminal, and the maintenance personnel will replace the cutting tool; if the wear ratio is greater than the wear ratio threshold, generate a cutting tool repair instruction, and send the instruction to the maintenance personnel's mobile terminal, and the maintenance personnel will perform maintenance operations on the cutting tool; Rough analysis instruction: extract the video of the corresponding assembly line forming area, randomly grab a frame containing the bottom of the forming mold in the video, and send the picture to the maintenance personnel's mobile terminal. The maintenance personnel analyze the picture and determine the treatment plan for the forming mold. After the treatment plan is generated, the treatment plan and the photo of the bottom of the forming mold are sent to the background management center. After the management center performs background authorization, the maintenance personnel can process the corresponding treatment plan on the forming mold; Crack analysis instructions: extract the video of the hot pressing area of the corresponding assembly line, preset the time interval, preset the time node in the time interval, obtain the temperature value of the hot press at each time node in the time interval, obtain the hot temperature set, calculate the hot temperature set using the standard deviation formula and mean value, and thus obtain the thermal wave value and thermal mean value; A heat wave value threshold and a heat pressing interval are preset, and if the heat wave value is less than the heat wave value threshold, the temperature of the heat pressing machine is adjusted to the heat pressing interval; If the thermal wave value is greater than the thermal wave value threshold, a hot press maintenance instruction is generated and the assembly line is suspended. At the same time, the hot press maintenance instruction is sent to the maintenance personnel's mobile terminal, and the maintenance personnel repairs the hot press. After the maintenance is completed, the assembly line is restarted.
[0011] Compared with the prior art, the present invention has the following beneficial effects: The present invention completely overcomes the problem of inconsistent judgment caused by subjective differences in manual visual inspection by relying on the powerful data processing capabilities of AI algorithms and high-resolution image information collected by video. It can accurately identify and quantitatively analyze the subtleties of product packaging, such as tiny holes and hidden cracks, and calculate accurate defect assessment indexes through rigorous algorithm steps, which greatly enhances the reliability of the detection results, provides a solid guarantee for product quality control, and effectively avoids problems such as product damage or customer complaints that may be caused by packaging defects. The present invention analyzes the defect assessment index of the test samples on the same assembly line to obtain the production index of each assembly line, and triggers analysis warnings and specific analysis instructions by setting thresholds and comparing thresholds, thereby providing precise guidance on the maintenance and adjustment of production equipment such as cutting tools, forming molds, and hot presses, thereby achieving full-process control from packaging quality inspection to production process optimization, and ensuring production stability and product quality consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Further details, features and advantages of the present application are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which: Figure 1 It is a principle block diagram of the present invention. DETAILED DESCRIPTION
[0013] Several embodiments of the present application will be described in more detail below with reference to the accompanying drawings so that those skilled in the art can implement the present application. The present application can be embodied in many different forms and purposes and should not be limited to the embodiments described herein. These embodiments are provided to make the present application comprehensive and complete, and to fully convey the scope of the present application to those skilled in the art. The embodiments do not limit the present application.
[0014] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which this application belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the relevant art and / or the context of this specification, and will not be interpreted in an idealized or overly formal sense unless explicitly defined as such herein.
[0015] See also Figure 1 As shown in the figure, a method for commodity packaging inspection based on AI algorithm and video acquisition analysis includes the following five steps: Step 1: Number the production lines of product packages, and randomly select x product packages from each production line as test samples, where x>50.
[0016] Step 2: Use an industrial camera to obtain images of the test sample at various angles, and use 3D reconstruction software to obtain a 3D stereogram of each surface of the test sample.
[0017] Step 3: Analyze the holes, heights and cracks on each surface of the test sample to obtain the defect assessment index of each test sample.
[0018] S1: Extract the plane images of the six surfaces of the test sample from the images of each angle of the test sample acquired by the industrial camera, and preprocess the images, including grayscale, noise reduction and contrast enhancement; S2: Use edge detection algorithm and contour detection algorithm to locate the holes in the plane image, divide the plane image into sub-areas, preset a weight influence factor for each sub-area, calculate the area of each hole on the plane image, preset each area interval, set different area intervals to correspond to different area defect scores, the larger the area, the larger the area defect score, match the area interval corresponding to the area of each hole on the plane image, so as to obtain the area defect score corresponding to each hole on the plane image; obtain the sub-area where each hole on the plane image is located, so as to obtain the weight influence factor corresponding to each hole on the plane image; multiply the area defect score corresponding to each hole on the plane image by the corresponding weight influence factor and then sum them, so as to obtain the hole area defect index of the plane image; By dividing the image into sub-areas and setting weighted influencing factors, and combining the hole area to set the area interval and the corresponding defect score, the hole size and the importance of the area can be comprehensively considered to accurately quantify the degree of hole area defects; S3: Calculate the number of holes in each sub-region of the planar image, recorded as the number of sub-holes, count the sum of the areas of all holes in each sub-region, recorded as the sub-surface sum, divide the number of sub-holes by the sub-surface sum to obtain the hole-surface ratio of the corresponding sub-region, multiply the hole-surface ratio by the weight influence factor of the corresponding sub-region, and thus obtain the initial hole-surface index of each sub-region, calculate the average of the initial hole-surface index of each sub-region, and the result is used as the hole-surface quality index of the planar image; The hole quality index is introduced to evaluate the quality of the plane image from multiple dimensions such as the number of holes, total area and hole-to-surface ratio, which can more comprehensively reflect the hole distribution and quality status of the plane image. S4: Preset the weighted influence factors corresponding to the hole area defect index and the hole surface quality index, normalize the hole area index and the hole surface quality index, multiply them by the corresponding weighted influence factors, and then sum them up, and the obtained result is used as the hole comprehensive index of the plane image; S5: performing the calculations of steps S1-S5 on the six surfaces of the same test sample, thereby obtaining the hole comprehensive indexes of the six surfaces of the test sample, and taking the average of the hole comprehensive indexes of the six surfaces as the hole indication value of the test sample; A1: Import the three-dimensional stereogram of the six surfaces of the test sample into the image analysis software, randomly select two points in the three-dimensional stereogram, randomly generate a path between the two points, use the line scanning tool of the image analysis software to scan along the path, and record the height value of each point on the path to obtain a height value set, calculate the mean and standard deviation of the data in the height value set, and obtain the high mean value GJZ and high wave value, and subtract the minimum value from the maximum value in the height value set to obtain the height difference value GCZ; use the formula: Thus, the altitude indication value GDZ is obtained, where is a standard value with a high mean value extracted from a preset database. and is the maximum allowable difference of high mean and the maximum allowable difference of high difference extracted from the preset database, q1 and q2 are the weighted influencing factors corresponding to high mean GJZ and high difference GCZ respectively; Randomly select two points and randomly generate scanning paths. This method avoids the limitations of fixed path sampling, making the acquired data more random and representative, covering different areas of the sample surface more widely, and reducing detection errors caused by sampling bias; A2: Preset different intervals of high wave value, set different adjustment factors corresponding to different high wave value intervals. The larger the high wave value, the larger the adjustment factor. Match the high wave value corresponding to the high wave value interval to obtain the adjustment factor corresponding to the high wave value. Multiply the adjustment factor by the height indication value GDZ to obtain the initial height index. By recording the height values of each point on the path and calculating multiple statistics such as mean, standard deviation, and difference, the height characteristics of the sample surface are quantified from different angles; these indicators complement each other and can more comprehensively reflect the changes in surface height, providing rich data support for subsequent comprehensive evaluation; A3: Continuously regenerate a path between the two points in step A1, calculate the initial height index under each generated path; take the average of the initial height index under each generated path as the flatness index of the corresponding surface; The path is continuously regenerated between two points and the initial height index is calculated. Finally, the average value is taken as the flatness index. Through multiple sampling and average calculation, the error of a single measurement is effectively reduced, and the accuracy and reliability of flatness evaluation are improved. A4: Perform steps A1-A3 on the six surfaces of the test sample to obtain the flatness indexes corresponding to the six surfaces, and take the average of the flatness indexes of the six surfaces as the roughness indication value of the test sample; D1: Obtain historical images of mycelium packaging and preprocess the images, including normalization and data enhancement. Annotate the crack areas in the historical images of mycelium packaging by manual annotation, and provide unified training for annotators. Unify the severity scores of cracks in various situations. The larger the severity score, the longer the crack and the larger the crack area. When annotating the crack area, the annotators will also give the crack area a severity score. Through unified training for labelers and unified regulations on crack severity scores, we can ensure the consistency and accuracy of labeling, so that the labeled data can truly reflect the crack situation and provide reliable sample labels for model learning; D2: Group the historical pictures of mycelium packaging in a ratio of 7:2:1. The group with a ratio of 7 is used as the training group, the group with a ratio of 2 is used as the validation group, and the group with a ratio of 1 is used as the test group. The training group is imported into the U-Net model for training. The number of training rounds and batch size are set. The gradient of the loss function with respect to the model parameters is calculated by the back propagation algorithm. The Adam optimizer is selected to adaptively adjust the learning rate of each parameter. During the training process, the validation group data is regularly imported into the model to calculate the loss function and evaluation index of the validation group. The evaluation indexes include accuracy, recall and intersection-over-union ratio. The weight influencing factors of accuracy, recall and intersection-over-union ratio are preset. The accuracy, recall and intersection-over-union ratio are multiplied by the corresponding weight factors and then summed. The result is used as the evaluation index. The loss function threshold and evaluation index threshold are preset. The difference between the loss function of two consecutive validation groups and the difference between the evaluation index are calculated. If the difference between the loss function of a validation group is less than the loss function threshold or the difference between the evaluation index is less than the evaluation index threshold, the training of the model is stopped. D3: The training group data is grouped again, with each hundred data in a group, and the grouped test group data is imported into the trained model for testing, and the loss function and evaluation index of each group of test group data are calculated. The loss function and evaluation index of each group of test group data are calculated using the standard deviation formula; thereby obtaining the loss wave value and the evaluation wave value, and presetting the loss wave value threshold and the evaluation wave value threshold. If the loss wave value is less than the loss wave value threshold and the evaluation wave value is less than the evaluation wave value threshold, the currently trained model is used as the final model, otherwise, the model is retrained; After the training group data is grouped again, the test group data is used for testing, the standard deviation of the loss function and the evaluation index is calculated, and the stability of the model is evaluated from the perspective of volatility; the loss wave value and the evaluation wave value threshold are preset, and the model is judged whether it meets the requirements according to the threshold. If not, retraining is performed to ensure that the final selected model has high stability and reliability; D4: Import the plane image of the test sample into the trained model to obtain the location and severity score of each crack, match the sub-region where each crack is located, and obtain the weight influence factor corresponding to each crack. Multiply the severity score of each crack by the corresponding weight influence factor and then sum them up to obtain the crack influence index; take the average of the crack influence indexes of the six surfaces of the test sample as the crack indication value of the test sample; D5: Preset the weighted influence factors corresponding to the hole indication value, roughness indication value and crack indication value, normalize the hole indication value, roughness indication value and crack indication value, multiply them by the corresponding weighted influence factors and then sum them up. The result is used as the defect assessment index of the test sample; The defect assessment index is calculated by combining the hole indication value, roughness indication value and crack indication value, presetting the weight and normalizing them, and comprehensively evaluating the defects of the test samples from multiple dimensions, providing a more accurate and comprehensive basis for product quality evaluation; Step 4: Analyze the defect evaluation index of the inspection samples located on the same assembly line to obtain the production index of each assembly line; According to the quality requirements of the current batch of commodity packaging, a defect assessment index threshold is preset. If the defect assessment index of the test sample is greater than the preset defect assessment index threshold, the packaging quality of the test sample is judged to be unqualified, otherwise, the packaging quality is qualified; the number of commodity packaging with unqualified quality is counted and recorded as the unqualified number, and the unqualified number is divided by x to obtain the unqualified rate; The defect assessment index of the unqualified packaging quality inspection sample is subtracted from the defect assessment index threshold to obtain the quality difference. The quality difference intervals are preset. Different quality difference intervals correspond to different difference factors. The larger the quality difference, the larger the difference factor. The quality difference intervals corresponding to the quality difference are matched to obtain the difference factor corresponding to the quality difference. The difference factor corresponding to the unqualified packaging quality inspection sample is multiplied by the quality difference to obtain the difference indication value. The average of the difference indication values of all unqualified packaging quality inspection samples is taken as the unqualified packaging index. Preset the weighted influencing factors corresponding to the non-conforming rate and the non-conforming packaging index, multiply the non-conforming rate and the non-conforming packaging index by the corresponding weighted factors and then sum them up to obtain the production index of the corresponding assembly line.
[0019] Based on the analysis of the defect evaluation index of the inspection samples of each assembly line, a specific and measurable indicator - the production index - can be provided for the production status of each assembly line, which helps to intuitively understand the production quality level of different assembly lines; Step 5: Analyze and process the production situation of each assembly line based on the production index of each assembly line; Preset production index threshold. If the production index of the assembly line is higher than the production index threshold, an analysis warning will be triggered. Extract the hole indication value, roughness indication value and crack indication value of the production line where the trigger analysis warning is located, preset the threshold values corresponding to the hole indication value, roughness indication value and crack indication value, and if the hole indication value is greater than the hole indication value threshold, trigger the hole analysis instruction; if the roughness indication value is greater than the roughness indication value threshold, trigger the roughness analysis instruction; if the crack indication value is greater than the crack indication value threshold, trigger the crack analysis instruction; By extracting the indicator values of different aspects such as holes, roughness, cracks, etc. and comparing them with their respective thresholds, the corresponding analysis instructions are triggered in a targeted manner. It is possible to accurately determine which link of the production the problem lies in, such as the cutting, forming or hot pressing area, and accurately locate the production problem. Hole analysis instructions: extract the video of the corresponding assembly line cutting area, randomly grab a frame containing a cutting tool in the video, and import the picture into the image analysis software; at the same time, import the picture of the normal cutting tool into the image analysis software, and adjust the size and resolution of the two pictures to keep the same, overlap the cutting tool parts in the two pictures, calculate the ratio of the overlapping area to the normal cutting tool area, and use it as the wear ratio. Preset the wear ratio threshold, if the wear ratio is less than the wear ratio threshold, generate a cutting tool replacement instruction, and send the cutting tool replacement instruction to the maintenance personnel's mobile terminal, and the maintenance personnel will replace the cutting tool; if the wear ratio is greater than the wear ratio threshold, generate a cutting tool repair instruction, and send the instruction to the maintenance personnel's mobile terminal, and the maintenance personnel will perform maintenance operations on the cutting tool; Rough analysis instruction: extract the video of the corresponding assembly line forming area, randomly grab a frame containing the bottom of the forming mold in the video, and send the picture to the maintenance personnel's mobile terminal. The maintenance personnel analyze the picture and determine the treatment plan for the forming mold. After the treatment plan is generated, the treatment plan and the photo of the bottom of the forming mold are sent to the background management center. After the management center performs background authorization, the maintenance personnel can process the corresponding treatment plan on the forming mold; Crack analysis instructions: extract the video of the hot pressing area of the corresponding assembly line, preset the time interval, preset the time node in the time interval, obtain the temperature value of the hot press at each time node in the time interval through thermal imaging technology, obtain the thermal temperature set, calculate the thermal temperature set using the standard deviation formula and mean value, and thus obtain the thermal wave value and thermal mean value; A heat wave value threshold and a heat pressing interval are preset, and if the heat wave value is less than the heat wave value threshold, the temperature of the heat pressing machine is adjusted to the heat pressing interval; If the thermal wave value is greater than the thermal wave value threshold, a hot press maintenance instruction is generated and the assembly line is suspended. At the same time, the hot press maintenance instruction is sent to the maintenance personnel's mobile terminal, and the maintenance personnel repairs the hot press. After the maintenance is completed, the assembly line is restarted.
[0020] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for commodity packaging inspection based on AI algorithm and video acquisition and analysis, characterized in that: include: Step 1: Number the production lines of product packaging, and randomly select x product packages from each production line as test samples, x>50; Step 2: Use an industrial camera to obtain images of the test sample at various angles, and use 3D reconstruction software to obtain a 3D stereogram of each surface of the test sample; Step 3: Analyze the holes, heights and cracks on each surface of the test sample to obtain the defect evaluation index of each test sample; Step 4: Analyze the defect evaluation index of the inspection samples located on the same assembly line to obtain the production index of each assembly line; Step 5: Based on the production index of each assembly line, analyze and process the production situation of each assembly line.
2. According to claim 1, a method for commodity packaging inspection based on AI algorithm and video acquisition and analysis is characterized in that: The specific process of analyzing the holes on each surface of the test sample in step 3 is as follows: S1: Extract the plane images of the six surfaces of the test sample, top, bottom, left, and right, from the images of the test sample at various angles acquired by the industrial camera, and pre-process the images; S2: locate the holes in the plane image, divide the plane image into sub-regions, preset a weight influence factor for each sub-region, calculate the area of each hole on the plane image, preset each area interval, set different area intervals corresponding to different area defect scores, match the area intervals corresponding to the area of each hole on the plane image, and thus obtain the area defect score corresponding to each hole on the plane image; The sub-region where each hole on the plane image is located is obtained, so as to obtain the weight influence factor corresponding to each hole on the plane image; the area defect score corresponding to each hole on the plane image is multiplied by the corresponding weight influence factor and then summed, so as to obtain the hole area defect index of the plane image; S3: Calculate the number of holes in each sub-region of the planar image, recorded as the number of sub-holes, count the sum of the areas of all holes in each sub-region, recorded as the sub-surface sum, divide the number of sub-holes by the sub-surface sum to obtain the hole-surface ratio of the corresponding sub-region, multiply the hole-surface ratio by the weight influence factor of the corresponding sub-region, and thus obtain the initial hole-surface index of each sub-region, calculate the average of the initial hole-surface index of each sub-region, and the result is used as the hole-surface quality index of the planar image; S4: Preset the weighted influence factors corresponding to the hole area defect index and the hole surface quality index, normalize the hole area index and the hole surface quality index, multiply them by the corresponding weighted influence factors, and then sum them up, and the obtained result is used as the hole comprehensive index of the plane image; S5: Perform the calculations of steps S1-S5 on the six faces of the same test sample to obtain the hole comprehensive indexes of the six faces of the test sample, and take the average of the hole comprehensive indexes of the six faces as the hole indication value of the test sample.
3. According to claim 1, a method for commodity packaging inspection based on AI algorithm and video acquisition analysis is characterized in that: The specific process of analyzing the height of each surface of the test sample in step 3 is as follows: A1: Import the three-dimensional stereogram of the six surfaces of the test sample into the image analysis software, randomly select two points in the three-dimensional stereogram, randomly generate a path between the two points, use the line scanning tool of the image analysis software to scan along the path, and record the height value of each point on the path to obtain a height value set, calculate the mean and standard deviation of the data in the height value set, and obtain the high mean value GJZ and high wave value, and subtract the minimum value from the maximum value in the height value set to obtain the height difference value GCZ; use the formula: Thus, the altitude indication value GDZ is obtained, where is a standard value with a high mean value extracted from a preset database. and is the maximum allowable difference of high mean and the maximum allowable difference of high difference extracted from the preset database, q1 and q2 are the weighted influencing factors corresponding to high mean GJZ and high difference GCZ respectively; A2: Preset each high wave value interval, set different high wave value intervals to correspond to different adjustment factors, match the high wave value intervals corresponding to the high wave value, so as to obtain the adjustment factor corresponding to the high wave value, and multiply the adjustment factor by the height indication value GDZ to obtain the initial height index; A3: Continuously regenerate a path between the two points in step A1, calculate the initial height index under each generated path; take the average of the initial height index under each generated path as the flatness index of the corresponding surface; A4: Perform steps A1-A3 on the six surfaces of the test sample to obtain the flatness indexes corresponding to the six surfaces, and take the average of the flatness indexes of the six surfaces as the roughness indication value of the test sample.
4. According to claim 1, a method for commodity packaging inspection based on AI algorithm and video acquisition and analysis is characterized in that: The specific process of analyzing the cracks on each surface of the test sample in step 3 is as follows: D1: Obtain historical pictures of mycelium packaging, pre-process the images, mark the crack areas in the historical pictures of mycelium packaging, and provide unified training for the labelers; the labelers will mark the crack areas with a severity score while marking the crack areas; D2: Group the historical pictures of mycelium packaging in a ratio of 7:2:
1. The group with a ratio of 7 is used as the training group, the group with a ratio of 2 is used as the validation group, and the group with a ratio of 1 is used as the test group. The training group is imported into the U-Net model for training. The number of training rounds and batch size are set. The gradient of the loss function with respect to the model parameters is calculated by the back propagation algorithm. The Adam optimizer is selected to adaptively adjust the learning rate of each parameter. During the training process, the validation group data is regularly imported into the model to calculate the loss function and evaluation index of the validation group. The evaluation indexes include accuracy, recall and intersection-over-union ratio. The weight influencing factors of accuracy, recall and intersection-over-union ratio are preset. The accuracy, recall and intersection-over-union ratio are multiplied by the corresponding weight factors and then summed. The result is used as the evaluation index. The loss function threshold and evaluation index threshold are preset. The difference between the loss function of two consecutive validation groups and the difference between the evaluation index are calculated. If the difference between the loss function of a validation group is less than the loss function threshold or the difference between the evaluation index is less than the evaluation index threshold, the training of the model is stopped. D3: The training group data is grouped again, with each hundred data in a group, and the grouped test group data is imported into the trained model for testing, and the loss function and evaluation index of each group of test group data are calculated. The loss function and evaluation index of each group of test group data are calculated using the standard deviation formula; thereby obtaining the loss wave value and the evaluation wave value, and presetting the loss wave value threshold and the evaluation wave value threshold. If the loss wave value is less than the loss wave value threshold and the evaluation wave value is less than the evaluation wave value threshold, the currently trained model is used as the final model, otherwise, the model is retrained; D4: Import the plane image of the test sample into the trained model to obtain the location and severity score of each crack, match the sub-area where each crack is located, and obtain the weight influence factor corresponding to each crack. Multiply the severity score of each crack by the corresponding weight influence factor and then sum them up to obtain the crack influence index; take the average of the crack influence indexes of the six surfaces of the test sample as the crack indication value of the test sample.
5. The method for commodity packaging inspection based on AI algorithm and video acquisition and analysis according to claim 1 is characterized in that: The specific process of obtaining the defect evaluation index of each test sample in step 3 is as follows: The weight influence factors corresponding to the hole indication value, roughness indication value and crack indication value are preset, the hole indication value, roughness indication value and crack indication value are normalized, multiplied by the corresponding weight influence factors and then summed up, and the result obtained is used as the defect evaluation index of the test sample.
6. The method for commodity packaging inspection based on AI algorithm and video acquisition and analysis according to claim 1 is characterized in that: The production index of each assembly line is obtained in step 4, and the specific process is as follows: According to the quality requirements of the current batch of commodity packaging, a defect assessment index threshold is preset. If the defect assessment index of the test sample is greater than the preset defect assessment index threshold, the quality of the test sample packaging is judged to be unqualified; the number of commodity packaging with unqualified quality is counted and recorded as the unqualified number, and the unqualified number is divided by x to obtain the unqualified rate; The defect assessment index of the unqualified packaging quality inspection sample is subtracted from the defect assessment index threshold to obtain the quality difference, and each quality difference interval is preset. Different quality difference intervals correspond to different difference factors, and the quality difference intervals corresponding to the quality difference are matched to obtain the difference factor corresponding to the quality difference. The difference factor corresponding to the unqualified packaging quality inspection sample is multiplied by the quality difference to obtain the difference indication value, and the average of the difference indication values of all unqualified packaging quality inspection samples is taken as the unqualified packaging index; Preset the weighted influencing factors corresponding to the non-conforming rate and the non-conforming packaging index, multiply the non-conforming rate and the non-conforming packaging index by the corresponding weighted factors and then sum them up to obtain the production index of the corresponding assembly line.
7. The method for commodity packaging inspection based on AI algorithm and video acquisition and analysis according to claim 1 is characterized in that: The specific process of step five is as follows: Preset production index threshold. If the production index of the assembly line is higher than the production index threshold, an analysis warning will be triggered. Extract the hole indication value, roughness indication value and crack indication value of the production line where the trigger analysis warning is located, preset the threshold values corresponding to the hole indication value, roughness indication value and crack indication value, and if the hole indication value is greater than the hole indication value threshold, trigger the hole analysis instruction; if the roughness indication value is greater than the roughness indication value threshold, trigger the roughness analysis instruction; if the crack indication value is greater than the crack indication value threshold, trigger the crack analysis instruction; Hole analysis instructions: extract the video of the corresponding assembly line cutting area, randomly grab a frame containing a cutting tool in the video, and import the picture into the image analysis software; at the same time, import the picture of the normal cutting tool into the image analysis software, and adjust the size and resolution of the two pictures to keep the same, overlap the cutting tool parts in the two pictures, calculate the ratio of the overlapping area to the normal cutting tool area, and use it as the wear ratio. Preset the wear ratio threshold, if the wear ratio is less than the wear ratio threshold, generate a cutting tool replacement instruction, and send the cutting tool replacement instruction to the maintenance personnel's mobile terminal, and the maintenance personnel will replace the cutting tool; if the wear ratio is greater than the wear ratio threshold, generate a cutting tool repair instruction, and send the instruction to the maintenance personnel's mobile terminal, and the maintenance personnel will perform maintenance operations on the cutting tool; Rough analysis instruction: extract the video of the corresponding assembly line forming area, randomly grab a frame containing the bottom of the forming mold in the video, and send the picture to the maintenance personnel's mobile terminal. The maintenance personnel analyze the picture and determine the treatment plan for the forming mold. After the treatment plan is generated, the treatment plan and the photo of the bottom of the forming mold are sent to the background management center. After the management center performs background authorization, the maintenance personnel can process the corresponding treatment plan on the forming mold; Crack analysis instructions: extract the video of the hot pressing area of the corresponding assembly line, preset the time interval, preset the time node in the time interval, obtain the temperature value of the hot press at each time node in the time interval, obtain the hot temperature set, calculate the hot temperature set using the standard deviation formula and mean value, and thus obtain the thermal wave value and thermal mean value; A heat wave value threshold and a heat pressing interval are preset, and if the heat wave value is less than the heat wave value threshold, the temperature of the heat pressing machine is adjusted to the heat pressing interval; If the thermal wave value is greater than the thermal wave value threshold, a hot press maintenance instruction is generated and the assembly line is suspended. At the same time, the hot press maintenance instruction is sent to the maintenance personnel's mobile terminal, and the maintenance personnel repairs the hot press. After the maintenance is completed, the assembly line is restarted.
Citation Information
Patent Citations
Candy package surface defect quick detection method based on machine vision
CN113838034A
Method and system for evaluating running state of packaging carton production line
CN116070894A
Method for producing application adaptive parameter packet
CN116128790A
Intelligent identification method for appearance defects of packaging pieces on packaging production line
CN117214178A
Medicine packaging box quality detection method and system based on image data analysis
CN117649404A
Cited By
Product boxing state identification method and system based on Internet of Things, and storage medium
CN121366323A