Artificial intelligence visual inspection method, system and device based on workpiece production
By performing stage division of workpiece production data and multi-dimensional image acquisition, combined with intelligent detection technology, the shortcomings of traditional methods in complex backgrounds and dynamic detection are solved, and high-precision, full-process monitoring and automated detection of workpiece production process are achieved.
Patent Information
- Application Number
- CN202411224951.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-03
AI Technical Summary
Traditional image processing algorithms have limited effects when processing complex backgrounds and lighting changes, and cannot meet the high-precision and high-speed detection requirements. Especially during the workpiece cleaning and drying stage, defect positioning is not accurate enough, and it is difficult to track dynamic abnormalities in the workpiece movement stage in real time. .
By segmenting the workpiece production data, collecting images of each stage and performing non-coined area segmentation, abnormal detection and temperature distribution mapping, it is integrated into an intelligent defect detection map, combining RGB, thermal imaging, infrared and depth cameras for multi-dimensional monitoring to achieve Detailed detection and analysis of the entire process.
It improves the comprehensiveness and accuracy of inspection in the workpiece production process, enhances the ability to identify defects in key stages, optimizes the inspection process, improves the overall inspection efficiency and reliability, and reduces the occurrence of unqualified products.
Smart Images

Figure CN119205646A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual inspection technology, and in particular to an artificial intelligence visual inspection method, system and device based on workpiece production. Background Art
[0002] With the development of computer vision technology, image processing-based detection methods have been gradually introduced. These methods use cameras to collect workpiece images and use image processing algorithms to perform edge detection, contour extraction, shape matching and other analyses, thereby realizing the detection of workpiece size, shape and surface defects. However, traditional image processing algorithms have limited effects when dealing with complex backgrounds and lighting changes, and cannot meet the needs of high-precision and high-speed detection. Entering the 21st century, the rise of artificial intelligence and deep learning technology has brought new opportunities for visual inspection. Deep learning, especially driven by convolutional neural networks (CNN), has significantly improved the ability to extract and classify image features. Deep learning-based visual inspection systems can be trained with a large amount of labeled data, automatically learn the features of workpieces, and can handle complex inspection tasks, such as the identification of small defects and detection under complex backgrounds. Especially in the field of defect detection and quality control, deep learning models have shown performance that exceeds traditional methods. However, traditional visual inspection methods are often not accurate enough for defect positioning, especially in the cleaning and drying stages of workpieces. At the same time, for the moving stage of workpieces, traditional inspection methods are difficult to track and detect dynamic anomalies in real time, which leads to low accuracy and reliability of visual inspection. Summary of the invention
[0003] Based on this, it is necessary to provide an artificial intelligence visual inspection method, system and device based on workpiece production to solve at least one of the above technical problems.
[0004] To achieve the above purpose, an artificial intelligence visual inspection method based on workpiece production is provided, the method comprising the following steps:
[0005] Step S1: Acquire workpiece production data; divide the workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage; perform stage image acquisition based on the workpiece production stage data to obtain a workpiece production stage image set;
[0006] Step S2: performing non-overlapping area segmentation on the workpiece loading stage images in the workpiece production stage image set and the preset workpiece standard shape template to generate a workpiece template matching non-overlapping area image; performing abnormal workpiece loading area marking on the workpiece template matching non-overlapping area image to generate an abnormal workpiece loading stage area image; performing abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set to generate an abnormal workpiece cleaning stage area image;
[0007] Step S3: grayscale conversion is performed on the workpiece drying stage image in the workpiece production stage image set to generate a workpiece drying stage grayscale image; regional image segmentation is performed on the local overheating area and the local cooling area of the workpiece drying stage grayscale image to generate a drying stage local overheating area image and a drying stage local cooling area image; abnormal area temperature distribution mapping and annotation are performed on the drying stage local overheating area image and the drying stage local cooling area image to generate an abnormal workpiece drying stage area image; abnormal movement visual detection is performed on the workpiece moving stage image in the workpiece production stage image set to generate an abnormal workpiece moving stage image;
[0008] Step S4: Integrate the abnormal workpiece loading stage area images, abnormal workpiece cleaning stage area images, abnormal workpiece drying stage area images and abnormal workpiece moving stage images into a workpiece stage abnormal image set; perform intelligent defect area image marking on the workpiece stage abnormal image set to generate a workpiece intelligent defect detection map to perform artificial intelligence visual inspection operations for workpiece production.
[0009] The present invention ensures detailed monitoring of the entire workpiece production process by dividing the workpiece production data into stages and generating stage data and image sets, so that subsequent detection work can cover all key production links, thereby improving the comprehensiveness and accuracy of detection. By performing non-overlapping area segmentation and abnormal area marking on the workpiece feeding stage image, and performing abnormality detection on the cleaning stage image, the defects occurring in these stages can be accurately identified and marked, and the detection capability and accuracy of abnormal conditions in the workpiece production process are improved. By performing grayscale conversion and regional image segmentation on the workpiece drying stage image, and performing temperature distribution mapping, the abnormalities of local overheating and cooling areas can be detected, and at the same time, abnormality detection is performed on the moving stage image, ensuring that the defect identification of the key stages in the production process is more accurate and detailed. The abnormal images of each stage are integrated into a workpiece stage abnormal image set, and intelligent defect area marking is performed to generate a workpiece intelligent defect detection map, thereby realizing the system integration and intelligent processing of defect information in the entire workpiece production process, optimizing the detection process, and improving the overall detection efficiency and accuracy. Therefore, the present invention improves the accuracy and reliability of visual inspection of workpiece production by refining production stage inspection, precise template matching, accurate defect positioning, enhancing dynamic inspection capabilities and systematically integrating defect information.
[0010] Preferably, step S1 comprises the following steps:
[0011] Step S11: Acquire workpiece production data;
[0012] Step S12: performing data preprocessing on the workpiece production data to generate standard workpiece production data, wherein the data preprocessing includes data cleaning, data denoising, data missing value filling and data standardization;
[0013] Step S13: dividing the standard workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes a workpiece loading stage, a workpiece cleaning stage, a workpiece drying stage, and a workpiece moving stage;
[0014] Step S14: collecting stage images based on the workpiece production stage data to obtain a workpiece production stage image set.
[0015] The present invention ensures the integrity and accuracy of workpiece production data through data preprocessing and standardization, providing a reliable basis for subsequent analysis. Through stage image acquisition, image data of the workpiece production process is generated, which facilitates visual monitoring and analysis of the production process. Standardized and staged data provide detailed information support for quality control and process optimization in the workpiece production process, which helps to improve production efficiency and product quality. Detailed production stage data and image data can be used to detect abnormal conditions in the production process, take timely measures to prevent failures, and reduce production losses.
[0016] Preferably, performing stage image acquisition based on workpiece production stage data includes:
[0017] The workpiece loading stage in the workpiece production stage data is photographed by an RGB camera to obtain an image of the workpiece loading stage;
[0018] The workpiece cleaning stage in the workpiece production stage data is photographed by a thermal imaging camera to generate a workpiece cleaning stage image;
[0019] The workpiece drying stage in the workpiece production stage data is photographed by an infrared camera to generate a workpiece drying stage image;
[0020] The workpiece moving stage in the workpiece production stage data is photographed with a depth camera to generate a workpiece moving stage image; the workpiece loading stage image, workpiece cleaning stage image, workpiece drying stage image and workpiece moving stage image are integrated to generate a workpiece production stage image set.
[0021] The present invention realizes comprehensive monitoring of the workpiece production process by using different types of cameras for image acquisition at different stages. The combination of RGB camera, thermal imaging camera, infrared camera and depth camera provides multi-dimensional and multi-angle production data. The meticulous acquisition and integration of images at each stage helps to detect and analyze problems in the production process, such as incomplete cleaning, uneven drying, incorrect feeding and unsmooth movement, thereby improving the efficiency and accuracy of quality control. By analyzing the image data of the workpiece at each stage, the bottlenecks and deficiencies in the production process can be discovered and optimized, and production efficiency can be improved. Depth image data is particularly helpful in optimizing the movement path of the workpiece and reducing stagnation time. Different types of image data can detect potential faults and abnormal conditions in the production process as early as possible. For example, thermal imaging and infrared images can detect temperature anomalies, and depth images can detect problems such as workpiece position offset, providing timely warning and maintenance information. Integrating the image data of each stage to generate a complete production stage image set helps to establish a data-driven production analysis system. Through the analysis of the integrated image set, detailed production reports and optimization suggestions can be generated to further improve the level of production management.
[0022] Preferably, step S2 comprises the following steps:
[0023] Step S21: performing workpiece contour segmentation on the workpiece loading stage image in the workpiece production stage image set to generate a workpiece contour segmentation area image;
[0024] Step S22: performing image template matching on the workpiece contour segmentation area image and the preset workpiece standard shape template to generate a workpiece template matching image; performing non-overlapping area segmentation on the workpiece template matching image to generate a workpiece template matching non-overlapping area image;
[0025] Step S23: performing shape detection on the workpiece template matching non-overlapping area image to generate workpiece abnormal missing detection data; performing key point position offset detection on the workpiece template matching non-overlapping area image to generate workpiece abnormal position offset data; performing workpiece direction calculation on the workpiece template matching non-overlapping area image based on the workpiece abnormal missing detection data and the workpiece abnormal position offset data to obtain workpiece direction error data;
[0026] Step S24: marking abnormal image regions on the workpiece contour segmentation region image by using the workpiece abnormal missing detection data, the workpiece abnormal position offset data and the workpiece direction error data, and generating an abnormal workpiece feeding stage region image;
[0027] Step S25: performing abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set to generate abnormal workpiece cleaning stage area images.
[0028] The present invention can accurately detect whether there are abnormal conditions such as missing contour, position offset or wrong direction of the workpiece during the production process through workpiece contour segmentation and template matching. This helps to improve the quality control level of the production process. Through shape detection and position offset detection, the production defects of the workpiece can be comprehensively analyzed to identify problems that affect product quality. This helps to adjust the production process or correct defects in a timely manner. Abnormal area marking and visual detection can intuitively display the problem areas in the production process, so that operators and managers can quickly identify and handle abnormalities and optimize the production process. Accurate abnormality detection and clear marking can reduce the workload of manual inspection, improve the automation level of the production process, and thus improve overall production efficiency. Through meticulous abnormality detection and analysis, problems in production can be discovered and corrected in a timely manner to ensure that the quality of the final product meets the standards, thereby reducing the generation of defective products. Collecting and analyzing abnormality detection data can provide data support for production decisions, help enterprises optimize production processes, improve the stability of production lines and product consistency.
[0029] Preferably, step S25 comprises the following steps:
[0030] Step S251: performing temperature gradient view conversion on the workpiece cleaning stage image in the workpiece production stage image set to generate a workpiece cleaning temperature gradient map;
[0031] Step S252: performing pixel color difference uniformity analysis on the workpiece cleaning temperature gradient map to generate pixel color difference uniformity analysis data; performing first abnormal cleaning area segmentation and labeling on the workpiece cleaning stage image using the pixel color difference uniformity analysis data to generate a first abnormal cleaning area image;
[0032] Step S253: performing pixel temperature extreme value analysis on the workpiece cleaning temperature gradient map to generate a pixel temperature extreme value region; performing region mapping and labeling on the workpiece cleaning stage image according to the pixel temperature extreme value region, thereby generating a second abnormal cleaning region image;
[0033] Step S254: integrating the first abnormal cleaning region image and the second abnormal cleaning region image to generate an abnormal workpiece cleaning stage region image.
[0034] The present invention can understand the temperature distribution of the workpiece during the cleaning stage in detail through temperature gradient view conversion. This helps to find uneven or abnormal temperatures, thereby ensuring the uniformity and effectiveness of the cleaning process. The combination of pixel color difference uniformity analysis and pixel temperature extreme value analysis can comprehensively detect various abnormal conditions in the cleaning process. This multi-angle abnormality detection method can identify problem areas more comprehensively. Through accurate segmentation and labeling of abnormal areas, it can help identify areas that are not thoroughly cleaned, thereby optimizing the cleaning process and ensuring thorough cleaning of the workpiece, thereby improving product quality. The detection and labeling of abnormal areas can detect potential problems in cleaning equipment or processes early, provide timely fault warning information, and reduce production downtime. By integrating abnormal area images, the problems in the cleaning process can be fully understood, so that the production process can be adjusted and optimized, and the overall production efficiency and product consistency can be improved. The comprehensive analysis data provides a detailed cleaning effect report, provides data support for production management and equipment maintenance decisions, and helps to formulate improvement measures and improve the level of production management.
[0035] Preferably, step S3 comprises the following steps:
[0036] Step S31: performing grayscale conversion on the workpiece drying stage image in the workpiece production stage image set to generate a workpiece drying stage grayscale image;
[0037] Step S32: performing regional image segmentation of the local overheating area and the local cooling area of the grayscale image of the workpiece drying stage by a threshold segmentation method, and generating a drying stage local overheating area image and a drying stage local cooling area image;
[0038] Step S33: performing temperature histogram calculation on the local overheating area image of the drying stage and the local cooling area image of the drying stage to generate a temperature histogram of the extreme value area of the drying stage; performing abnormal temperature distribution uniformity analysis on the temperature histogram of the extreme value area of the drying stage to generate an abnormal temperature distribution area of the drying stage; mapping and marking the abnormal temperature distribution area of the drying stage to the abnormal area of the workpiece drying stage image, thereby generating an abnormal workpiece drying stage area image;
[0039] Step S34: performing visual detection of abnormal movement on the workpiece movement phase images in the workpiece production phase image set to generate abnormal workpiece movement phase images.
[0040] The present invention can clearly detect the overheating and cooling areas during the workpiece drying process through grayscale conversion and threshold segmentation. This helps to ensure that the temperature control during the drying process meets the requirements and avoids quality problems caused by uneven temperature. The temperature histogram and abnormal temperature distribution uniformity analysis provide detailed temperature data analysis to help identify and locate temperature anomalies during the drying process. This helps to discover and solve the problem of uneven temperature and improve the drying quality. By marking the abnormal area, the problem area in the drying process can be clearly identified, providing a basis for adjusting the drying process, thereby improving the drying effect and final quality of the workpiece. Abnormal movement visual detection helps identify abnormal conditions of the workpiece during the moving stage, such as position deviation or unstable movement. This helps to optimize the movement process of the workpiece and improve the efficiency and stability of the production line. Automated image processing and abnormality detection can reduce manual intervention, improve the automation level of the production process, and improve overall production efficiency and accuracy. Through detailed abnormal detection data and image annotation, data support can be provided for quality control and equipment maintenance, which helps to formulate improvement measures and maintenance plans and improve the level of production management.
[0041] Preferably, step S34 includes the following steps:
[0042] Step S341: performing time series analysis on the workpiece moving phase images in the workpiece production phase image set to generate a workpiece moving phase time series image set;
[0043] Step S342: performing inter-frame difference on the time-series image set in the workpiece moving stage to generate a differential image in the workpiece moving stage; performing workpiece motion analysis on the differential image in the workpiece moving stage to generate workpiece motion change data, wherein the workpiece motion change data includes workpiece static data and workpiece moving data; performing a first workpiece motion abnormality image annotation on the time-series image set in the workpiece moving stage by using the workpiece static data to generate a first workpiece motion abnormality image;
[0044] Step S343: using the workpiece movement data to track the workpiece position of the time-series image set during the workpiece movement phase, and generating a workpiece position movement image; performing workpiece speed detection on the workpiece position movement image, and generating workpiece displacement speed detection data; performing a second workpiece movement abnormality image annotation on the time-series image set during the workpiece movement phase, and generating a second workpiece movement abnormality image by using the workpiece displacement speed detection data;
[0045] Step S344: integrating the first workpiece movement abnormality image and the second workpiece movement abnormality image to generate an abnormal workpiece movement stage image.
[0046] The present invention can accurately capture the changes of the workpiece during the movement process through timing analysis and inter-frame difference, fully understand the movement of the workpiece, and ensure the stability of the production process. The static data and speed detection provide a detailed analysis of the abnormal state of the workpiece. It can identify the abnormal movement speed of the workpiece in the area where it should not move, which helps to find potential problems, such as equipment failure or inaccurate positioning of the workpiece. Combining the static data of the workpiece and the displacement speed detection data, it can identify abnormal situations in multiple dimensions and improve the accuracy of detection. In this way, problems in the production process can be effectively located and solved, and errors and defects can be reduced. By marking and integrating the abnormal movement of the workpiece, problems in the movement of the workpiece can be found, and then the movement mechanism of the workpiece can be optimized or the production line settings can be adjusted to improve production efficiency and product quality. Automated image analysis and abnormality detection reduce manual intervention and improve the automation level of the production line. The system can monitor and adjust in real time, which improves the overall production management level. Detailed abnormality detection and annotation data provide data support for production management and equipment maintenance. Improvement measures and maintenance plans can be formulated to ensure the smooth operation of the production line.
[0047] Preferably, step S4 comprises the following steps:
[0048] Step S41: integrating the abnormal workpiece loading stage area images, the abnormal workpiece cleaning stage area images, the abnormal workpiece drying stage area images and the abnormal workpiece moving stage images into a workpiece stage abnormal image set, and dividing the workpiece stage abnormal image set into an image data set to generate a model training set and a model test set;
[0049] Step S42: Performing model training on the model training set by using a support vector machine algorithm to generate a workpiece defect classification training model; performing model optimization iteration on the workpiece defect classification training model by using a model test set to generate a workpiece defect classification prediction model;
[0050] Step S43: Import the workpiece production stage image set into the workpiece defect classification prediction model to perform intelligent defect area image marking, generate a workpiece intelligent defect detection map, and perform workpiece production artificial intelligence visual inspection operations.
[0051] The present invention can comprehensively cover all kinds of defects in the workpiece production process by integrating abnormal images at different production stages, and provide comprehensive abnormality detection capabilities. The use of support vector machine algorithm for model training and optimization can effectively improve the accuracy and reliability of defect classification. The powerful classification ability of SVM can process complex abnormal data and generate high-quality prediction models. The generation of intelligent defect detection maps reduces the need for manual inspection and improves detection efficiency and accuracy. Automatically marking defect areas can quickly identify and handle problems in workpieces and reduce errors in manual operations. Through intelligent visual inspection, defects in the production process can be discovered and corrected in a timely manner, improving the quality of the final product. Timely defect detection helps to reduce the production of unqualified products and improve the overall efficiency of the production line. The generated defect detection map and prediction model provide data support for production decisions, which helps to optimize the production process and quality control strategy. Automated defect detection and classification can reduce labor costs and detection time, and improve the utilization efficiency of production resources. The introduction of artificial intelligence technology for visual inspection promotes the intelligent upgrade of production lines and improves the automation and intelligence level of production systems.
[0052] In this specification, an artificial intelligence visual inspection system based on workpiece production is provided, which is used to execute the above-mentioned artificial intelligence visual inspection method based on workpiece production. The artificial intelligence visual inspection system based on workpiece production includes:
[0053] The workpiece stage division module is used to obtain workpiece production data; divide the workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage; based on the workpiece production stage data, stage image acquisition is performed to obtain a workpiece production stage image set;
[0054] The module for segmenting abnormal areas for loading and cleaning is used to segment the non-overlapping areas of the workpiece loading stage images in the workpiece production stage image set and the preset workpiece standard shape template, and generate the workpiece template matching non-overlapping area images; to mark the abnormal workpiece loading area on the workpiece template matching non-overlapping area images, and generate the abnormal workpiece loading stage area images; to perform abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set, and generate the abnormal workpiece cleaning stage area images;
[0055] The drying movement abnormal area segmentation module is used to perform grayscale conversion on the workpiece drying stage images in the workpiece production stage image set to generate the workpiece drying stage grayscale images; perform regional image segmentation of the local overheating area and the local cooling area on the workpiece drying stage grayscale images to generate the drying stage local overheating area image and the drying stage local cooling area image; perform abnormal area temperature distribution mapping and annotation on the drying stage local overheating area image and the drying stage local cooling area image to generate the abnormal workpiece drying stage area image; perform abnormal movement visual detection on the workpiece moving stage images in the workpiece production stage image set to generate the abnormal workpiece moving stage image;
[0056] The intelligent defect detection module is used to integrate the area images of the abnormal workpiece loading stage, the area images of the abnormal workpiece cleaning stage, the area images of the abnormal workpiece drying stage and the area images of the abnormal workpiece moving stage into a workpiece stage abnormal image set; to perform intelligent defect area image marking on the workpiece stage abnormal image set, and generate a workpiece intelligent defect detection map to perform artificial intelligence visual inspection operations for workpiece production.
[0057] The present invention also provides an artificial intelligence visual inspection device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, for use in the artificial intelligence visual inspection method based on workpiece production as described above.
[0058] The beneficial effect of the present invention is that by acquiring workpiece production data, detailed data in the workpiece production process is provided, laying a foundation for subsequent analysis and detection. By dividing the workpiece production stage, the production process is divided into feeding, cleaning, drying and moving stages, which can more accurately locate and analyze defects in different stages. By collecting images for each production stage, a workpiece production stage image set is generated to provide detailed visual data for subsequent defect detection. By comparing with the standard shape template, non-overlapping areas are identified, which helps to find abnormalities in the workpiece during the feeding stage. Marking abnormal areas in the feeding stage helps to identify and correct problems in the production process and ensure the quality of the workpiece. Detecting and marking abnormal areas in the cleaning stage helps to find problems in the cleaning process, thereby improving the cleaning effect and workpiece quality. Converting the drying stage image into a grayscale image and segmenting the overheating and cooling areas helps to identify temperature anomalies in the drying process and ensure the uniformity of the workpiece during the drying stage. By mapping and marking the temperature distribution of the local area, the abnormal temperature distribution area can be identified to prevent workpiece defects caused by temperature problems. Abnormal visual detection of the workpiece moving stage can find and correct problems in the moving process of the workpiece and ensure the smooth operation of the production line. Integrating abnormal images of each stage into a workpiece stage abnormal image set can provide a full range of abnormal detection perspectives. Abnormal images are marked and analyzed by intelligent models to generate intelligent defect detection maps of workpieces. This step can achieve efficient automatic defect detection, reduce manual intervention, and improve detection efficiency and accuracy. Through multi-stage image acquisition and analysis, various types of defects in the workpiece production process can be covered to provide comprehensive quality control. Through accurate abnormal detection and annotation, problems in production can be discovered and corrected in a timely manner, thereby improving the quality of the final product. Introducing intelligent defect detection technology, automatic marking and analysis of abnormal areas, reducing manual intervention, and improving the automation level of the production line. Through detailed defect detection and analysis, the production process can be optimized, the generation of unqualified products can be reduced, and production efficiency can be improved. Detailed abnormal detection data provides strong data support for production management and decision-making, helping to formulate improvement measures and optimize production strategies. Therefore, the present invention improves the accuracy and reliability of visual inspection of workpiece production by refining production stage detection, accurate template matching, accurate defect positioning, enhancing dynamic detection capabilities, and systematically integrating defect information. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram of the steps of an artificial intelligence visual inspection method based on workpiece production;
[0060] Figure 2 for Figure 1 Detailed implementation steps of step S2 in the flowchart;
[0061] Figure 3 for Figure 1Detailed implementation steps of step S3 in FIG.
[0062] Figure 4 for Figure 1 Detailed implementation steps of step S4 in FIG.
[0063] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0064] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.
[0065] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.
[0066] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0067] To achieve this, please refer to Figures 1 to 4 , an artificial intelligence visual inspection method based on workpiece production, the method comprising the following steps:
[0068] Step S1: Acquire workpiece production data; divide the workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage; perform stage image acquisition based on the workpiece production stage data to obtain a workpiece production stage image set;
[0069] Step S2: performing non-overlapping area segmentation on the workpiece loading stage images in the workpiece production stage image set and the preset workpiece standard shape template to generate a workpiece template matching non-overlapping area image; performing abnormal workpiece loading area marking on the workpiece template matching non-overlapping area image to generate an abnormal workpiece loading stage area image; performing abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set to generate an abnormal workpiece cleaning stage area image;
[0070] Step S3: grayscale conversion is performed on the workpiece drying stage image in the workpiece production stage image set to generate a workpiece drying stage grayscale image; regional image segmentation is performed on the local overheating area and the local cooling area of the workpiece drying stage grayscale image to generate a drying stage local overheating area image and a drying stage local cooling area image; abnormal area temperature distribution mapping and annotation are performed on the drying stage local overheating area image and the drying stage local cooling area image to generate an abnormal workpiece drying stage area image; abnormal movement visual detection is performed on the workpiece moving stage image in the workpiece production stage image set to generate an abnormal workpiece moving stage image;
[0071] Step S4: Integrate the abnormal workpiece loading stage area images, abnormal workpiece cleaning stage area images, abnormal workpiece drying stage area images and abnormal workpiece moving stage images into a workpiece stage abnormal image set; perform intelligent defect area image marking on the workpiece stage abnormal image set to generate a workpiece intelligent defect detection map to perform artificial intelligence visual inspection operations for workpiece production.
[0072] The present invention ensures detailed monitoring of the entire workpiece production process by dividing the workpiece production data into stages and generating stage data and image sets, so that subsequent detection work can cover all key production links, thereby improving the comprehensiveness and accuracy of detection. By performing non-overlapping area segmentation and abnormal area marking on the workpiece feeding stage image, and performing abnormality detection on the cleaning stage image, the defects occurring in these stages can be accurately identified and marked, and the detection capability and accuracy of abnormal conditions in the workpiece production process are improved. By performing grayscale conversion and regional image segmentation on the workpiece drying stage image, and performing temperature distribution mapping, the abnormalities of local overheating and cooling areas can be detected, and at the same time, abnormality detection is performed on the moving stage image, ensuring that the defect identification of the key stages in the production process is more accurate and detailed. The abnormal images of each stage are integrated into a workpiece stage abnormal image set, and intelligent defect area marking is performed to generate a workpiece intelligent defect detection map, thereby realizing the system integration and intelligent processing of defect information in the entire workpiece production process, optimizing the detection process, and improving the overall detection efficiency and accuracy. Therefore, the present invention improves the accuracy and reliability of visual inspection of workpiece production by refining production stage inspection, precise template matching, accurate defect positioning, enhancing dynamic inspection capabilities and systematically integrating defect information.
[0073] In the embodiment of the present invention, reference Figure 1 The above is a schematic diagram of the steps of an artificial intelligence visual inspection method based on workpiece production of the present invention. In this example, the artificial intelligence visual inspection method based on workpiece production includes the following steps:
[0074] Step S1: Acquire workpiece production data; divide the workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage; perform stage image acquisition based on the workpiece production stage data to obtain a workpiece production stage image set;
[0075] In an embodiment of the present invention, workpiece production data is obtained from workpiece production equipment, sensors and monitoring systems. These data may include relevant information such as production time, workpiece position, temperature, humidity, etc. Workpiece production data is collected through a data acquisition system or database query to ensure data integrity and accuracy, including data from all production stages. The various stages of workpiece production are determined, including the workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage. The collected workpiece production data is preprocessed, the data is cleaned, missing values and abnormal values are processed, and the preprocessed data is sorted and classified according to production time and stage characteristics. The data is divided into different production stages according to the timestamp and stage identifier in the data, and workpiece production stage data is generated, wherein the data of each stage is clearly marked, including the loading stage, cleaning stage, drying stage and moving stage. An RGB camera is selected in the loading stage to record the process of workpiece loading. A thermal imaging camera is selected in the cleaning stage to monitor the temperature distribution during the cleaning process. An infrared camera is selected in the drying stage to obtain the heat distribution during the workpiece drying process. A depth camera is selected in the moving stage to record the depth information of the workpiece movement. The camera position and angle are configured to ensure that the key areas of each production stage can be covered. Adjust the camera's resolution, frame rate and other parameters to obtain clear and continuous images. During the workpiece production process, collect images at preset time intervals and stages. Collect image data at each production stage to ensure that there are enough samples for each stage. Classify and organize the collected images of each stage according to the production stage. Name and archive the images to ensure that the images of each stage are easy to retrieve and manage. Create an image set of the workpiece production stage, including images of the workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage. Ensure that the images of each stage in the image set include samples at different time points for further analysis.
[0076] Step S2: performing non-overlapping area segmentation on the workpiece loading stage images in the workpiece production stage image set and the preset workpiece standard shape template to generate a workpiece template matching non-overlapping area image; performing abnormal workpiece loading area marking on the workpiece template matching non-overlapping area image to generate an abnormal workpiece loading stage area image; performing abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set to generate an abnormal workpiece cleaning stage area image;
[0077] In an embodiment of the present invention, a preset workpiece standard shape template is prepared as a reference for template matching. The template can be a standard shape image of the workpiece under normal conditions. The workpiece loading stage image and the workpiece standard shape template are preprocessed, including graying, denoising, edge detection, etc., to improve the matching accuracy. The workpiece loading stage image is compared with the workpiece standard shape template using an image matching algorithm (such as a template matching algorithm, a structural similarity index, etc.). The similarity between the template and the workpiece image is calculated to determine the area in the image that does not match the template. According to the matching results, the workpiece template matching non-overlapping area is segmented. The non-overlapping area represents the part of the workpiece loading stage image that is inconsistent with the standard template, and a workpiece template matching non-overlapping area image is generated, and all non-matching areas are marked. The workpiece template matching non-overlapping area image is further analyzed to identify abnormal workpiece areas. By using methods such as shape detection and edge detection, it is determined whether these non-overlapping areas are abnormal, such as shape distortion or defects. Abnormal annotation is performed on the workpiece template matching non-overlapping area image. Mark all abnormal workpiece areas, such as workpiece defects and deformations, generate images of abnormal workpiece loading phase areas, and clearly display abnormal areas. Preprocess images of workpiece cleaning phase, such as denoising and contrast enhancement, to more clearly identify abnormalities. Use anomaly detection algorithms (such as background subtraction and outlier detection) to analyze images of workpiece cleaning phase and identify abnormal areas in the images, including uneven cleaning and cleaning fluid leakage. Label images of abnormal workpiece cleaning phase areas, display all detected abnormal areas, and generate clearly marked images of abnormal areas for subsequent manual inspection and processing.
[0078] Step S3: grayscale conversion is performed on the workpiece drying stage image in the workpiece production stage image set to generate a workpiece drying stage grayscale image; regional image segmentation is performed on the local overheating area and the local cooling area of the workpiece drying stage grayscale image to generate a drying stage local overheating area image and a drying stage local cooling area image; abnormal area temperature distribution mapping and annotation are performed on the drying stage local overheating area image and the drying stage local cooling area image to generate an abnormal workpiece drying stage area image; abnormal movement visual detection is performed on the workpiece moving stage image in the workpiece production stage image set to generate an abnormal workpiece moving stage image;
[0079] In an embodiment of the present invention, the image of the workpiece drying stage is converted into a grayscale image. This step converts the color image into a grayscale image for subsequent temperature analysis and abnormality detection. Use a standard grayscale method, such as a weighted average method (usually using 0.299R+0.587G+0.114*B), to convert the RGB image into a grayscale image. Map the pixel values in the grayscale image to a temperature range. Assume that the grayscale value is proportional to the temperature. Apply a threshold segmentation method to segment the image into local overheating areas and local cooling areas. Set a high temperature threshold, and mark the area above the threshold in the grayscale image as an overheating area. Set a low temperature threshold, and mark the area below the threshold in the grayscale image as a cooling area, and generate two images, representing the local overheating area image and the local cooling area image, respectively. Calculate the temperature histogram of the local overheating area image and the local cooling area image. Analyze the temperature histogram to identify the unevenness of the temperature distribution or abnormal peaks, which usually indicate potential abnormal areas. Mark the abnormal area on the workpiece drying stage image to generate an abnormal workpiece drying stage area image. Visualize and mark the temperature anomaly areas in the image. Perform time-series analysis on the workpiece movement phase images to generate a set of time-series images of the workpiece movement phase. Ensure the consistency and integrity of the time-series image data. Perform inter-frame difference on the set of time-series images of the workpiece movement phase to generate a differential image of the workpiece movement phase. Analyze the differential image to identify the motion pattern of the workpiece. Extract motion data using motion analysis algorithms (such as optical flow or background modeling). Identify abnormal motion patterns in the image, such as sudden movement or irregular behavior of the workpiece. Generate an abnormal workpiece movement phase image that shows all detected abnormal motion areas.
[0080] Step S4: Integrate the abnormal workpiece loading stage area images, abnormal workpiece cleaning stage area images, abnormal workpiece drying stage area images and abnormal workpiece moving stage images into a workpiece stage abnormal image set; perform intelligent defect area image marking on the workpiece stage abnormal image set to generate a workpiece intelligent defect detection map to perform artificial intelligence visual inspection operations for workpiece production.
[0081] In an embodiment of the present invention, images of the region of the abnormal workpiece feeding stage, images of the region of the abnormal workpiece cleaning stage, images of the region of the abnormal workpiece drying stage, and images of the abnormal workpiece moving stage are merged into a comprehensive image set. Image processing libraries (such as OpenCV or Pillow) can be used for image stitching. Ensure that all images have the same resolution and size, or resize before merging. Standardize the integrated images, such as adjusting the brightness and contrast, to ensure the consistency of the images in the AI model. Input the abnormal image set of the workpiece stage into the trained intelligent defect detection model. The model can be a target detection model based on deep learning (such as YOLO, Faster R-CNN) or a semantic segmentation model (such as U-Net). The model is used to infer the image, identify and mark the defective area. The model output includes the marked defective area and the category and confidence of each area. Draw the bounding box or segmentation mask of the defective area on the integrated image to visualize the model detection results. Save or display the marked image to generate an intelligent defect detection map of the workpiece. Integrate the intelligent defect detection map and model into the artificial intelligence visual inspection system for workpiece production. The system receives and processes workpiece production images in real time, automatically detects defects, and generates inspection reports or alarms. The inspection results are recorded in the database for subsequent analysis and tracking, and real-time feedback is provided based on the inspection results to help production line operators make adjustments and improvements.
[0082] Preferably, step S1 comprises the following steps:
[0083] Step S11: Acquire workpiece production data;
[0084] Step S12: performing data preprocessing on the workpiece production data to generate standard workpiece production data, wherein the data preprocessing includes data cleaning, data denoising, data missing value filling and data standardization;
[0085] Step S13: dividing the standard workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes a workpiece loading stage, a workpiece cleaning stage, a workpiece drying stage, and a workpiece moving stage;
[0086] Step S14: collecting stage images based on the workpiece production stage data to obtain a workpiece production stage image set.
[0087] In an embodiment of the present invention, various sensors, including temperature sensors, humidity sensors, pressure sensors, displacement sensors, etc., are arranged on the production line to collect various parameter data in the workpiece production process in real time. Through the industrial Internet of Things (IoT) platform, the workpiece production data is obtained in real time from the sensors deployed on the production line. These data include but are not limited to production time, equipment status, workpiece position, temperature and humidity, pressure, vibration, etc. Filtering algorithms such as mean filtering and median filtering are used to remove noise from the data collected by the sensor to ensure the accuracy of the data. Statistical analysis methods such as box plots and Z-score are used to detect abnormal values in the data, and these abnormal values are processed by interpolation or deletion. Wavelet transform, Fourier transform and other methods are used to perform frequency domain analysis on the data to remove high-frequency noise and retain valid signals. For missing data that occurs during the acquisition process, interpolation, mean filling or regression methods are used to fill in the missing data to ensure data integrity. The data is converted to a unified scale, and normalization methods such as Min-Max normalization and Z-score standardization are used to standardize the data to generate standard workpiece production data. According to the different operation steps of the workpiece on the production line, the workpiece production process is divided into different stages, such as the loading stage, cleaning stage, drying stage, and moving stage. Use machine learning classification algorithms such as decision trees and support vector machines (SVM) to analyze sensor data and identify the characteristics of each stage. According to the recognition results, the standard workpiece production data is marked, the start time and end time of each stage are marked, and the workpiece production stage data with stage labels is generated. Deploy image acquisition devices such as industrial cameras and infrared cameras on the production line to ensure that clear images can be obtained at each key production stage. Set the image acquisition trigger condition, and trigger the image acquisition device at the beginning of each stage according to the real-time changes of the workpiece production stage data to collect the workpiece production image of that stage. The collected images are classified and stored according to the production stage to form a workpiece production stage image set.
[0088] Preferably, performing stage image acquisition based on workpiece production stage data includes:
[0089] The workpiece loading stage in the workpiece production stage data is photographed by an RGB camera to obtain an image of the workpiece loading stage;
[0090] The workpiece cleaning stage in the workpiece production stage data is photographed by a thermal imaging camera to generate a workpiece cleaning stage image;
[0091] The workpiece drying stage in the workpiece production stage data is photographed by an infrared camera to generate a workpiece drying stage image;
[0092] The workpiece moving stage in the workpiece production stage data is photographed with a depth camera to generate a workpiece moving stage image; the workpiece loading stage image, workpiece cleaning stage image, workpiece drying stage image and workpiece moving stage image are integrated to generate a workpiece production stage image set.
[0093] In the embodiment of the present invention, by deploying an RGB camera near the loading platform, it is ensured that the camera can cover the area where the workpiece is loaded. When the workpiece enters the loading stage, the sensor detects the presence of the workpiece and triggers the RGB camera to shoot. The captured image includes the entire process of workpiece loading, from the arrival of the workpiece at the loading platform to the workpiece being taken away by the conveyor belt. The collected images of the loading stage are stored in chronological order and marked as workpiece loading stage images. A thermal imaging camera is deployed in the workpiece cleaning area to ensure that the entire cleaning process can be covered. When the workpiece enters the cleaning stage, the sensor detects the arrival of the workpiece and triggers the thermal imaging camera to shoot. The captured image includes the temperature change of the workpiece during the cleaning process, and the cleaning effect is displayed through the thermal imaging image. The captured cleaning stage images are stored in chronological order and marked as workpiece cleaning stage images. An infrared camera is deployed in the workpiece drying area to ensure that the area where the workpiece is dried can be covered. When the workpiece enters the drying stage, the sensor detects the arrival of the workpiece and triggers the infrared camera to shoot. The captured image includes an infrared image of the workpiece during the drying process, and the drying condition and temperature distribution of the workpiece can be monitored through the infrared image. The collected drying stage images are stored in chronological order and marked as workpiece drying stage images. Deploy depth cameras on the moving path of the production line to ensure that the moving area of the workpiece can be covered. When the workpiece moves on the production line, the sensor detects the position of the workpiece in real time and triggers the depth camera to shoot. The captured images include three-dimensional images of the workpiece moving on the production line. The posture and position changes of the workpiece can be monitored through the depth image. The collected moving stage images are stored in chronological order and marked as workpiece moving stage images. The images of different stages are synchronized according to the timestamp to ensure the consistency of image data. Match the images of each stage to ensure that the images of different stages of the same workpiece can correspond. Integrate the images of the workpiece loading stage, the workpiece cleaning stage, the workpiece drying stage, and the workpiece moving stage to form a complete set of images of the workpiece production process. Use image processing technology to process the integrated images to generate a high-quality set of images of the workpiece production stage.
[0094] As an example of the present invention, refer to Figure 2 As shown, in this example, step S2 includes:
[0095] Step S21: performing workpiece contour segmentation on the workpiece loading stage image in the workpiece production stage image set to generate a workpiece contour segmentation area image;
[0096] Step S22: performing image template matching on the workpiece contour segmentation area image and the preset workpiece standard shape template to generate a workpiece template matching image; performing non-overlapping area segmentation on the workpiece template matching image to generate a workpiece template matching non-overlapping area image;
[0097] Step S23: performing shape detection on the workpiece template matching non-overlapping area image to generate workpiece abnormal missing detection data; performing key point position offset detection on the workpiece template matching non-overlapping area image to generate workpiece abnormal position offset data; performing workpiece direction calculation on the workpiece template matching non-overlapping area image based on the workpiece abnormal missing detection data and the workpiece abnormal position offset data to obtain workpiece direction error data;
[0098] Step S24: marking abnormal image regions on the workpiece contour segmentation region image by using the workpiece abnormal missing detection data, the workpiece abnormal position offset data and the workpiece direction error data, and generating an abnormal workpiece feeding stage region image;
[0099] Step S25: performing abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set to generate abnormal workpiece cleaning stage area images.
[0100] In an embodiment of the present invention, by graying the image of the workpiece feeding stage, the computational complexity is reduced. An edge detection algorithm (such as the Canny algorithm) is used to detect the edge of the workpiece contour. A contour extraction algorithm (such as the findContours function in OpenCV) is applied to extract the outer contour of the workpiece. The extracted workpiece contour area is marked on the image to generate a workpiece contour segmentation area image. A preset workpiece standard shape template is used, and the template can be a CAD model or a standard workpiece image. A template matching algorithm (such as the matchTemplate function in OpenCV) is used to match the workpiece contour segmentation area image to generate a workpiece template matching image. The non-overlapping area between the workpiece and the template is detected in the workpiece template matching image. The detected non-overlapping area is marked on the image to generate a workpiece template matching non-overlapping area image. Shape analysis is performed on the workpiece template matching non-overlapping area image to detect whether the workpiece has missing or redundant parts, and shape analysis is performed on the workpiece template matching non-overlapping area image to detect whether the workpiece has missing or redundant parts. Identify key points on the workpiece (such as hole positions, corners, etc.), calculate the position offsets between these key points and the corresponding points in the template, record the position offset data, and generate abnormal position offset data for the workpiece. Calculate the deviation between the actual direction of the workpiece and the standard direction through missing data and position offset data, and record the workpiece direction error data. Combine the workpiece abnormal missing detection data, the workpiece abnormal position offset data, and the workpiece direction error data to mark the abnormal area of the workpiece contour segmentation area image. Mark the abnormal area on the image to generate an image of the abnormal workpiece feeding stage area. Perform thermal imaging on the workpiece cleaning stage image and convert the image into a thermal map to better display the cleaning effect. By analyzing the temperature distribution in the thermal map, detect whether the cleaning effect is uniform and whether there are areas that are not cleaned properly. Mark the detected abnormal area on the image to generate an image of the abnormal workpiece cleaning stage area.
[0101] Preferably, step S25 comprises the following steps:
[0102] Step S251: performing temperature gradient view conversion on the workpiece cleaning stage image in the workpiece production stage image set to generate a workpiece cleaning temperature gradient map;
[0103] Step S252: performing pixel color difference uniformity analysis on the workpiece cleaning temperature gradient map to generate pixel color difference uniformity analysis data; performing first abnormal cleaning area segmentation and labeling on the workpiece cleaning stage image using the pixel color difference uniformity analysis data to generate a first abnormal cleaning area image;
[0104] Step S253: performing pixel temperature extreme value analysis on the workpiece cleaning temperature gradient map to generate a pixel temperature extreme value region; performing region mapping and labeling on the workpiece cleaning stage image according to the pixel temperature extreme value region, thereby generating a second abnormal cleaning region image;
[0105] Step S254: integrating the first abnormal cleaning region image and the second abnormal cleaning region image to generate an abnormal workpiece cleaning stage region image.
[0106] In an embodiment of the present invention, the image noise is removed by denoising the image of the workpiece cleaning stage. The image of the workpiece cleaning stage is converted into a temperature gradient image using thermal imaging data. The temperature gradient image shows the temperature distribution on the surface of the workpiece, and the colors represent different temperature values, generating a workpiece cleaning temperature gradient map showing the temperature distribution. The color difference value of each pixel in the workpiece cleaning temperature gradient map is calculated, and the color difference reflects the temperature change. The distribution of the color difference value is analyzed to detect whether the color change is uniform, and the uniformity difference represents the area where the cleaning is uneven, and the pixel color difference uniformity analysis data is generated. According to the color difference uniformity analysis data, the uneven cleaning area is identified and segmented, and these areas are marked to generate a first abnormal cleaning area image. The temperature value of each pixel in the workpiece cleaning temperature gradient map is analyzed to find the extreme temperature area (highest temperature and lowest temperature). The workpiece cleaning stage image is regionally mapped according to the temperature extreme area, and the extreme area is marked on the image to generate a second abnormal cleaning area image. The first abnormal cleaning area image and the second abnormal cleaning area image are integrated. During the integration process, it is ensured that both abnormal areas can be clearly marked in the final image. The integrated images are uniformly annotated to generate the final abnormal workpiece cleaning stage area image.
[0107] As an example of the present invention, refer to Figure 3 As shown, in this example, step S3 includes:
[0108] Step S31: performing grayscale conversion on the workpiece drying stage image in the workpiece production stage image set to generate a workpiece drying stage grayscale image;
[0109] Step S32: performing regional image segmentation of the local overheating area and the local cooling area of the grayscale image of the workpiece drying stage by a threshold segmentation method, and generating a drying stage local overheating area image and a drying stage local cooling area image;
[0110] Step S33: performing temperature histogram calculation on the local overheating area image of the drying stage and the local cooling area image of the drying stage to generate a temperature histogram of the extreme value area of the drying stage; performing abnormal temperature distribution uniformity analysis on the temperature histogram of the extreme value area of the drying stage to generate an abnormal temperature distribution area of the drying stage; mapping and marking the abnormal temperature distribution area of the drying stage to the abnormal area of the workpiece drying stage image, thereby generating an abnormal workpiece drying stage area image;
[0111] Step S34: performing visual detection of abnormal movement on the workpiece movement phase images in the workpiece production phase image set to generate abnormal workpiece movement phase images.
[0112] In an embodiment of the present invention, noise removal is performed on the image of the workpiece drying stage. The image of the workpiece drying stage is converted into a grayscale image for subsequent image analysis. A standard grayscale conversion algorithm (such as the average method and the weighted average method) is used for conversion to generate a grayscale image of the workpiece drying stage, which displays the brightness distribution of the workpiece surface. A temperature threshold is set, and pixels above the threshold in the grayscale image are segmented to generate an image of the local overheating area in the drying stage. Another temperature threshold is set, and pixels below the threshold in the grayscale image are segmented to generate an image of the local cooling area in the drying stage. An image showing local overheating and local cooling areas is generated by the threshold segmentation method. A temperature histogram is calculated for the image of the local overheating area in the drying stage, and the number of pixels in each temperature interval is counted to generate a temperature histogram of the overheating area. A temperature histogram is calculated for the image of the local cooling area in the drying stage to generate a temperature histogram of the cooling area. A uniformity analysis is performed on the generated temperature histogram to detect whether the temperature distribution is uniform, identify areas with uneven temperature distribution, mark these areas on the original image, generate an image of the abnormal temperature distribution area in the drying stage, and mark the areas with abnormal temperature. The images of the workpiece moving stage are processed for noise removal and enhancement, and the motion trajectory of the workpiece is analyzed using computer vision algorithms (such as optical flow method). Whether there is abnormal movement during the movement process, such as offset, uneven speed, etc., the detected abnormal movement area is marked on the image, and an abnormal workpiece moving stage image is generated.
[0113] Preferably, step S34 includes the following steps:
[0114] Step S341: performing time series analysis on the workpiece moving phase images in the workpiece production phase image set to generate a workpiece moving phase time series image set;
[0115] Step S342: performing inter-frame difference on the time-series image set in the workpiece moving stage to generate a differential image in the workpiece moving stage; performing workpiece motion analysis on the differential image in the workpiece moving stage to generate workpiece motion change data, wherein the workpiece motion change data includes workpiece static data and workpiece moving data; performing a first workpiece motion abnormality image annotation on the time-series image set in the workpiece moving stage by using the workpiece static data to generate a first workpiece motion abnormality image;
[0116] Step S343: using the workpiece movement data to track the workpiece position of the time-series image set during the workpiece movement phase, and generating a workpiece position movement image; performing workpiece speed detection on the workpiece position movement image, and generating workpiece displacement speed detection data; performing a second workpiece movement abnormality image annotation on the time-series image set during the workpiece movement phase, and generating a second workpiece movement abnormality image by using the workpiece displacement speed detection data;
[0117] Step S344: integrating the first workpiece movement abnormality image and the second workpiece movement abnormality image to generate an abnormal workpiece movement stage image.
[0118] In an embodiment of the present invention, noise removal is performed on the images of the workpiece moving stage. Time series analysis is performed on the images of the workpiece moving stage, and the images are arranged in time order to form a time series image set of the workpiece moving stage, and a time series image set containing the workpiece moving process is generated. Adjacent image frames in the time series image set are differentially calculated to generate a differential image of the workpiece moving stage. The differential image reflects the change of the workpiece between adjacent time points. The differential image is analyzed to extract the motion change data of the workpiece, and the workpiece static data and the workpiece moving data are classified and generated according to the motion change data. According to the workpiece static data, the time series image set is annotated with a first workpiece moving abnormal image to generate a first workpiece moving abnormal image. Using the workpiece moving data, the time series image set is tracked for the workpiece position to generate a workpiece position moving image to show the position change of the workpiece at different time points. The workpiece position moving image is detected for the workpiece speed, the moving speed of the workpiece at each time point is calculated, and the workpiece displacement speed detection data is generated, which contains the speed information of the workpiece during the moving process. According to the workpiece displacement speed detection data, the time series image set is annotated with a second workpiece moving abnormal image to generate a second workpiece moving abnormal image. The first workpiece movement abnormality image and the second workpiece movement abnormality image are integrated, and the two abnormality detection results are combined to generate a comprehensive abnormality image containing all abnormality information, and generate an abnormal workpiece movement stage image.
[0119] As an example of the present invention, refer to Figure 4 As shown, in this example, step S4 includes:
[0120] Step S41: integrating the abnormal workpiece loading stage area images, the abnormal workpiece cleaning stage area images, the abnormal workpiece drying stage area images and the abnormal workpiece moving stage images into a workpiece stage abnormal image set, and dividing the workpiece stage abnormal image set into an image data set to generate a model training set and a model test set;
[0121] Step S42: Performing model training on the model training set by using a support vector machine algorithm to generate a workpiece defect classification training model; performing model optimization iteration on the workpiece defect classification training model by using a model test set to generate a workpiece defect classification prediction model;
[0122] Step S43: Import the workpiece production stage image set into the workpiece defect classification prediction model to perform intelligent defect area image marking, generate a workpiece intelligent defect detection map, and perform workpiece production artificial intelligence visual inspection operations.
[0123] In an embodiment of the present invention, images of the abnormal workpiece feeding stage region, images of the abnormal workpiece cleaning stage region, images of the abnormal workpiece drying stage region, and images of the abnormal workpiece moving stage are integrated into a unified workpiece stage abnormal image set. The integration process includes image format unification, resolution standardization, and label integration. The workpiece stage abnormal image set is divided according to a certain ratio (e.g., 80% training set, 20% test set) to generate a model training set and a model test set. When dividing the data set, ensure that the image categories and quantities in the training set and the test set are balanced to avoid data deviation during the model training process. The model training set is trained using a support vector machine (SVM) algorithm. The training process includes feature extraction, feature standardization, training model construction, and model parameter tuning. Image features are extracted from the training set, and commonly used methods include SIFT, HOG, LBP, etc. The extracted features are standardized to ensure the balance of feature values. A workpiece defect classification training model is constructed using the support vector machine algorithm. Model parameters (such as C, γ) are optimized by cross-validation and other methods to improve the classification performance of the model. The workpiece defect classification training model obtained by training is verified and optimized using the model test set. Predict the images in the test set and calculate the model's classification accuracy, recall rate, F1 value and other performance indicators. According to the performance indicator results, adjust the model parameters and training strategy, and perform model optimization iterations until the model performance reaches the expected standard, generating the final workpiece defect classification prediction model.
[0124] In this specification, an artificial intelligence visual inspection system based on workpiece production is provided, which is used to execute the above-mentioned artificial intelligence visual inspection method based on workpiece production. The artificial intelligence visual inspection system based on workpiece production includes:
[0125] The workpiece stage division module is used to obtain workpiece production data; divide the workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage; based on the workpiece production stage data, stage image acquisition is performed to obtain a workpiece production stage image set;
[0126] The module for segmenting abnormal areas for loading and cleaning is used to segment the non-overlapping areas of the workpiece loading stage images in the workpiece production stage image set and the preset workpiece standard shape template, and generate the workpiece template matching non-overlapping area images; to mark the abnormal workpiece loading area on the workpiece template matching non-overlapping area images, and generate the abnormal workpiece loading stage area images; to perform abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set, and generate the abnormal workpiece cleaning stage area images;
[0127] The drying movement abnormal area segmentation module is used to perform grayscale conversion on the workpiece drying stage images in the workpiece production stage image set to generate the workpiece drying stage grayscale images; perform regional image segmentation of the local overheating area and the local cooling area on the workpiece drying stage grayscale images to generate the drying stage local overheating area image and the drying stage local cooling area image; perform abnormal area temperature distribution mapping and annotation on the drying stage local overheating area image and the drying stage local cooling area image to generate the abnormal workpiece drying stage area image; perform abnormal movement visual detection on the workpiece moving stage images in the workpiece production stage image set to generate the abnormal workpiece moving stage image;
[0128] The intelligent defect detection module is used to integrate the area images of the abnormal workpiece loading stage, the area images of the abnormal workpiece cleaning stage, the area images of the abnormal workpiece drying stage and the area images of the abnormal workpiece moving stage into a workpiece stage abnormal image set; to perform intelligent defect area image marking on the workpiece stage abnormal image set, and generate a workpiece intelligent defect detection map to perform artificial intelligence visual inspection operations for workpiece production.
[0129] The present invention also provides an artificial intelligence visual inspection device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, for use in the artificial intelligence visual inspection method based on workpiece production as described above.
[0130] The beneficial effect of the present invention is that by acquiring workpiece production data, detailed data in the workpiece production process is provided, laying a foundation for subsequent analysis and detection. By dividing the workpiece production stage, the production process is divided into feeding, cleaning, drying and moving stages, which can more accurately locate and analyze defects in different stages. By collecting images for each production stage, a workpiece production stage image set is generated to provide detailed visual data for subsequent defect detection. By comparing with the standard shape template, non-overlapping areas are identified, which helps to find abnormalities in the workpiece during the feeding stage. Marking abnormal areas in the feeding stage helps to identify and correct problems in the production process and ensure the quality of the workpiece. Detecting and marking abnormal areas in the cleaning stage helps to find problems in the cleaning process, thereby improving the cleaning effect and workpiece quality. Converting the drying stage image into a grayscale image and segmenting the overheating and cooling areas helps to identify temperature anomalies in the drying process and ensure the uniformity of the workpiece during the drying stage. By mapping and marking the temperature distribution of the local area, the abnormal temperature distribution area can be identified to prevent workpiece defects caused by temperature problems. Abnormal visual detection of the workpiece moving stage can find and correct problems in the moving process of the workpiece and ensure the smooth operation of the production line. Integrating abnormal images of each stage into a workpiece stage abnormal image set can provide a full range of abnormal detection perspectives. Abnormal images are marked and analyzed by intelligent models to generate intelligent defect detection maps of workpieces. This step can achieve efficient automatic defect detection, reduce manual intervention, and improve detection efficiency and accuracy. Through multi-stage image acquisition and analysis, various types of defects in the workpiece production process can be covered to provide comprehensive quality control. Through accurate abnormal detection and annotation, problems in production can be discovered and corrected in a timely manner, thereby improving the quality of the final product. Introducing intelligent defect detection technology, automatic marking and analysis of abnormal areas, reducing manual intervention, and improving the automation level of the production line. Through detailed defect detection and analysis, the production process can be optimized, the generation of unqualified products can be reduced, and production efficiency can be improved. Detailed abnormal detection data provides strong data support for production management and decision-making, helping to formulate improvement measures and optimize production strategies. Therefore, the present invention improves the accuracy and reliability of visual inspection of workpiece production by refining production stage detection, accurate template matching, accurate defect positioning, enhancing dynamic detection capabilities, and systematically integrating defect information.
[0131] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.
[0132] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. An artificial intelligence visual inspection method based on workpiece production, characterized in that: The following steps are involved: Step S1: Acquire workpiece production data; divide the workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage; perform stage image acquisition based on the workpiece production stage data to obtain a workpiece production stage image set; Step S2: performing non-overlapping area segmentation on the workpiece loading stage images in the workpiece production stage image set and the preset workpiece standard shape template to generate a workpiece template matching non-overlapping area image; performing abnormal workpiece loading area marking on the workpiece template matching non-overlapping area image to generate an abnormal workpiece loading stage area image; performing abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set to generate an abnormal workpiece cleaning stage area image; Step S3: grayscale conversion is performed on the workpiece drying stage image in the workpiece production stage image set to generate a workpiece drying stage grayscale image; regional image segmentation is performed on the local overheating area and the local cooling area of the workpiece drying stage grayscale image to generate a drying stage local overheating area image and a drying stage local cooling area image; abnormal area temperature distribution mapping and annotation are performed on the drying stage local overheating area image and the drying stage local cooling area image to generate an abnormal workpiece drying stage area image; abnormal movement visual detection is performed on the workpiece moving stage image in the workpiece production stage image set to generate an abnormal workpiece moving stage image; Step S4: Integrate the abnormal workpiece loading stage area images, abnormal workpiece cleaning stage area images, abnormal workpiece drying stage area images and abnormal workpiece moving stage images into a workpiece stage abnormal image set; perform intelligent defect area image marking on the workpiece stage abnormal image set to generate a workpiece intelligent defect detection map to perform artificial intelligence visual inspection operations for workpiece production.
2. The artificial intelligence visual inspection method based on workpiece production according to claim 1 is characterized in that: Step S1 includes the following steps: Step S11: Acquire workpiece production data; Step S12: performing data preprocessing on the workpiece production data to generate standard workpiece production data, wherein the data preprocessing includes data cleaning, data denoising, data missing value filling and data standardization; Step S13: dividing the standard workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes a workpiece loading stage, a workpiece cleaning stage, a workpiece drying stage, and a workpiece moving stage; Step S14: collecting stage images based on the workpiece production stage data to obtain a workpiece production stage image set.
3. The artificial intelligence visual inspection method based on workpiece production according to claim 1 is characterized in that: Stage image acquisition based on workpiece production stage data includes: The workpiece loading stage in the workpiece production stage data is photographed by an RGB camera to obtain an image of the workpiece loading stage; The workpiece cleaning stage in the workpiece production stage data is photographed by a thermal imaging camera to generate a workpiece cleaning stage image; The workpiece drying stage in the workpiece production stage data is photographed by an infrared camera to generate a workpiece drying stage image; The workpiece moving stage in the workpiece production stage data is photographed with a depth camera to generate a workpiece moving stage image; the workpiece loading stage image, workpiece cleaning stage image, workpiece drying stage image and workpiece moving stage image are integrated to generate a workpiece production stage image set.
4. The artificial intelligence visual inspection method based on workpiece production according to claim 1 is characterized in that: Step S2 includes the following steps: Step S21: performing workpiece contour segmentation on the workpiece loading stage image in the workpiece production stage image set to generate a workpiece contour segmentation area image; Step S22: performing image template matching on the workpiece contour segmentation area image and the preset workpiece standard shape template to generate a workpiece template matching image; performing non-overlapping area segmentation on the workpiece template matching image to generate a workpiece template matching non-overlapping area image; Step S23: performing shape detection on the workpiece template matching non-overlapping area image to generate workpiece abnormal missing detection data; performing key point position offset detection on the workpiece template matching non-overlapping area image to generate workpiece abnormal position offset data; performing workpiece direction calculation on the workpiece template matching non-overlapping area image based on the workpiece abnormal missing detection data and the workpiece abnormal position offset data to obtain workpiece direction error data; Step S24: marking abnormal image regions on the workpiece contour segmentation region image by using the workpiece abnormal missing detection data, the workpiece abnormal position offset data and the workpiece direction error data, and generating an abnormal workpiece feeding stage region image; Step S25: performing abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set to generate abnormal workpiece cleaning stage area images.
5. The artificial intelligence visual inspection method based on workpiece production according to claim 4 is characterized in that: Step S25 includes the following steps: Step S251: performing temperature gradient view conversion on the workpiece cleaning stage image in the workpiece production stage image set to generate a workpiece cleaning temperature gradient map; Step S252: performing pixel color difference uniformity analysis on the workpiece cleaning temperature gradient map to generate pixel color difference uniformity analysis data; performing first abnormal cleaning area segmentation and labeling on the workpiece cleaning stage image using the pixel color difference uniformity analysis data to generate a first abnormal cleaning area image; Step S253: performing pixel temperature extreme value analysis on the workpiece cleaning temperature gradient map to generate a pixel temperature extreme value region; performing region mapping and labeling on the workpiece cleaning stage image according to the pixel temperature extreme value region, thereby generating a second abnormal cleaning region image; Step S254: integrating the first abnormal cleaning region image and the second abnormal cleaning region image to generate an abnormal workpiece cleaning stage region image.
6. The artificial intelligence visual inspection method based on workpiece production according to claim 1 is characterized in that: Step S3 includes the following steps: Step S31: performing grayscale conversion on the workpiece drying stage image in the workpiece production stage image set to generate a workpiece drying stage grayscale image; Step S32: performing regional image segmentation of the local overheating area and the local cooling area of the grayscale image of the workpiece drying stage by a threshold segmentation method, and generating a drying stage local overheating area image and a drying stage local cooling area image; Step S33: performing temperature histogram calculation on the local overheating area image of the drying stage and the local cooling area image of the drying stage to generate a temperature histogram of the extreme value area of the drying stage; performing abnormal temperature distribution uniformity analysis on the temperature histogram of the extreme value area of the drying stage to generate an abnormal temperature distribution area of the drying stage; mapping and marking the abnormal temperature distribution area of the drying stage to the abnormal area of the workpiece drying stage image, thereby generating an abnormal workpiece drying stage area image; Step S34: performing visual detection of abnormal movement on the workpiece movement phase images in the workpiece production phase image set to generate abnormal workpiece movement phase images.
7. The artificial intelligence visual inspection method based on workpiece production according to claim 6 is characterized in that: Step S34 includes the following steps: Step S341: performing time series analysis on the workpiece moving phase images in the workpiece production phase image set to generate a workpiece moving phase time series image set; Step S342: performing inter-frame difference on the time-series image set in the workpiece moving stage to generate a differential image in the workpiece moving stage; performing workpiece motion analysis on the differential image in the workpiece moving stage to generate workpiece motion change data, wherein the workpiece motion change data includes workpiece static data and workpiece moving data; performing a first workpiece motion abnormality image annotation on the time-series image set in the workpiece moving stage by using the workpiece static data to generate a first workpiece motion abnormality image; Step S343: using the workpiece movement data to track the workpiece position of the time-series image set during the workpiece movement phase, and generating a workpiece position movement image; performing workpiece speed detection on the workpiece position movement image, and generating workpiece displacement speed detection data; performing a second workpiece movement abnormality image annotation on the time-series image set during the workpiece movement phase, and generating a second workpiece movement abnormality image by using the workpiece displacement speed detection data; Step S344: integrating the first workpiece movement abnormality image and the second workpiece movement abnormality image to generate an abnormal workpiece movement stage image.
8. The artificial intelligence visual inspection method based on workpiece production according to claim 1 is characterized in that: Step S4 includes the following steps: Step S41: integrating the abnormal workpiece loading stage area images, the abnormal workpiece cleaning stage area images, the abnormal workpiece drying stage area images and the abnormal workpiece moving stage images into a workpiece stage abnormal image set, and dividing the workpiece stage abnormal image set into an image data set to generate a model training set and a model test set; Step S42: Performing model training on the model training set by using a support vector machine algorithm to generate a workpiece defect classification training model; performing model optimization iteration on the workpiece defect classification training model by using a model test set to generate a workpiece defect classification prediction model; Step S43: Import the workpiece production stage image set into the workpiece defect classification prediction model to perform intelligent defect area image marking, generate a workpiece intelligent defect detection map, and perform workpiece production artificial intelligence visual inspection operations.
9. An artificial intelligence visual inspection system based on workpiece production, characterized in that: Used to execute the artificial intelligence visual inspection method based on workpiece production as claimed in claim 1, the artificial intelligence visual inspection system based on workpiece production comprises: The workpiece stage division module is used to obtain workpiece production data; divide the workpiece production data into workpiece production stages to generate workpiece production stage data, wherein the workpiece production stage division includes workpiece loading stage, workpiece cleaning stage, workpiece drying stage and workpiece moving stage; based on the workpiece production stage data, stage image acquisition is performed to obtain a workpiece production stage image set; The module for segmenting abnormal areas for loading and cleaning is used to segment the non-overlapping areas of the workpiece loading stage images in the workpiece production stage image set and the preset workpiece standard shape template, and generate the workpiece template matching non-overlapping area images; to mark the abnormal workpiece loading area on the workpiece template matching non-overlapping area images, and generate the abnormal workpiece loading stage area images; to perform abnormal cleaning visual inspection on the workpiece cleaning stage images in the workpiece production stage image set, and generate the abnormal workpiece cleaning stage area images; The drying movement abnormal area segmentation module is used to perform grayscale conversion on the workpiece drying stage images in the workpiece production stage image set to generate the workpiece drying stage grayscale images; perform regional image segmentation of the local overheating area and the local cooling area on the workpiece drying stage grayscale images to generate the drying stage local overheating area image and the drying stage local cooling area image; perform abnormal area temperature distribution mapping and annotation on the drying stage local overheating area image and the drying stage local cooling area image to generate the abnormal workpiece drying stage area image; perform abnormal movement visual detection on the workpiece moving stage images in the workpiece production stage image set to generate the abnormal workpiece moving stage image; The intelligent defect detection module is used to integrate the area images of the abnormal workpiece loading stage, the area images of the abnormal workpiece cleaning stage, the area images of the abnormal workpiece drying stage and the area images of the abnormal workpiece moving stage into a workpiece stage abnormal image set; to perform intelligent defect area image marking on the workpiece stage abnormal image set, and generate a workpiece intelligent defect detection map to perform artificial intelligence visual inspection operations for workpiece production.
10. An artificial intelligence visual inspection device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, and is used to execute the artificial intelligence visual inspection method based on workpiece production as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Workpiece positioning method and system based on active binocular vision technology
CN110136211A
Laser cleaning effect on-line monitoring method based on visual inspection
CN114119535A
Intelligent control system for surface defect detection of cylindrical roller of ceramic bearing
CN116713200A
Electronic component damage test method and system based on image recognition
CN118429270A
Yarn wrapping detection method and system based on multi-stage convolutional neural network
CN118470002A
Cited By
Visual inspection method and system for production quality of titanium alloy bar
CN120725992A
