Appearance defect detection method, system and device based on AI algorithm
By quantifying the accuracy of defect identification in highly reflective, shadowed, and recessed areas, and optimizing image contrast, angle, light source, and camera parameters, the problem of low accuracy in identifying appearance defect features in recessed areas of high-transparency and highly reflective metal products was solved, achieving a more efficient detection effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2026-04-10
AI Technical Summary
In the process of detecting appearance defects in high-transparency and high-reflectivity metal products, the accuracy of identifying appearance defect features in recessed areas is not high. Affected by ambient lighting conditions and mutual interference between multiple defect areas, it is difficult for AI models to accurately extract feature information.
By using intelligent vision sensors to acquire the appearance defect areas of the metal product under test, the accuracy of defect identification in highly reflective, shadow and dented areas is quantified, and the image contrast, angle light source and camera parameters are optimized to improve the contrast of each area and build a full-scene defect assessment system.
It enables accurate identification of appearance defects in recessed areas of high-transparency, high-reflectivity metal products, improving the accuracy and efficiency of detection and solving the problem of low identification accuracy in existing technologies.
Smart Images

Figure CN120801314B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of appearance defect detection, in particular to an appearance defect detection method, system and device based on an AI algorithm. BACKGROUND
[0002] In the field of industrial production, high-transmission high-reflectivity metal products are widely used in key industries such as precision manufacturing due to their unique optical properties and mass production, and are highly demanding on detection efficiency. As a key means, industrial visual detection needs to quickly and accurately identify defects to ensure production quality and efficiency. However, appearance defects such as scratches, pits, cracks, and oxidation spots affect the accuracy of quality control of high-transmission high-reflectivity metal products. Existing technologies use trained AI (Artificial Intelligence) models, such as convolutional neural network models, to extract defect features from preprocessed product images based on grayscale feature extraction algorithms, and input the extracted defect features into a classifier to output defect detection results and accurately mark the location and type of defects, providing intuitive and accurate defect information to production personnel to take timely repair or scrap measures to ensure product quality.
[0003] For example, the AI visual detection method, system and readable storage medium based on deep learning disclosed in patent CN114705685B include: acquiring the appearance surface image of the shell structure through the appearance surface visual detection device, the first side surface visual detection device and the second side surface visual detection device of the AI visual detection equipment, and simultaneously acquiring the structure surface image of the shell structure; determining the appearance defect detection result of the shell structure according to the appearance surface image and the appearance defect detection model, and simultaneously determining the structure defect detection result of the shell structure according to the structure surface image and the structure defect detection model; determining the quality detection result of the shell structure according to the appearance defect detection result and the structure defect detection result.
[0004] For example, the AI algorithm-based full-appearance visual detection system for terminal connectors disclosed in patent CN118671091A includes: a plurality of detection stations; analyzing product defect factor data of historical terminal connectors, obtaining historical defect images and historical qualified images of the historical terminal connectors, and performing model training of the AI algorithm to obtain a preliminary detection model; acquiring images captured by cameras at different detection stations as labeled images; acquiring product defects corresponding to the labeled images, and simultaneously acquiring predicted defect results according to the detection model; comparing the product defect results and the predicted defect results to generate a deviation value; and modifying the preliminary detection model according to the deviation value to obtain a detection model.
[0005] However, in the process of implementing the technical solutions in the embodiments of the present application, the above-mentioned technologies at least have the following technical problems:
[0006] The defect detection process of high-transmission and high-reflectivity metal products has high requirements on environmental lighting conditions, and the effects of high-transmission and high-reflectivity characteristics are particularly significant. For example, when environmental light shines on a high-transmission and high-reflectivity metal product, refraction occurs when the light enters and passes through the imaging area inside the metal product. Due to the mutual interference between the defect detection areas, multiple different types of defect areas may exist in the corresponding defect detection area when detecting appearance defects, which makes the same type of defect in different defect detection areas exhibit completely different characteristic performances. For example, when a defect detection area (such as a concave area) is surrounded by other defect areas (such as high-transmission and high-reflectivity areas), the light reflected or scattered by the surrounding defects may mix with the light of the appearance defect, causing the imaging characteristics of the appearance defect to change. This complex characteristic performance greatly reduces the contrast between the appearance defect characteristics and the corresponding image background, and further causes the edge detection algorithm of the AI model to often fail to accurately extract the corresponding characteristic information when processing images of high-transmission and high-reflectivity metal products. There is a problem of low accuracy of appearance defect feature recognition in the corresponding concave area of high-transmission and high-reflectivity metal in the appearance defect detection process. SUMMARY
[0007] The embodiments of the present application provide an appearance defect detection method, system and device based on AI algorithm, which solves the problem of low accuracy of appearance defect feature recognition in the corresponding concave area of high-transmission and high-reflectivity metal in the appearance defect detection process of the prior art, and improves the accuracy of specified appearance defect feature recognition in the corresponding concave area of high-transmission and high-reflectivity metal.
[0008] The embodiments of the present application provide an appearance defect detection method based on AI algorithm, which includes the following steps:
[0009] Step one, acquiring the appearance defect area of the metal product to be tested by the intelligent visual sensor, quantifying the recognition accuracy of the specified appearance defect area in the high light reflection area based on the high light reflection area detection data, and simultaneously performing image contrast optimization determination, the metal product to be tested has high light transmission and high light reflection characteristics, the appearance defect area includes a high light reflection area, a shadow area and a recessed area, and the image contrast optimization determination is used to determine whether to adjust the image contrast to improve the contrast between the specified appearance defect in the high light reflection area and the corresponding background image; Step two, quantifying the recognition accuracy of the specified appearance defect area in the shadow area based on the shadow area detection data, and simultaneously performing angle light source optimization determination, the angle light source optimization determination is used to determine whether to adjust the angle light source parameters to improve the contrast between the specified appearance defect in the shadow area and the corresponding background image; Step three, in the recessed area detection stage, quantifying the specified appearance defect recognition accuracy of the specified appearance defect area in the recessed area based on the recessed area detection data, and simultaneously performing camera parameter optimization determination, the camera parameter optimization determination is used to determine whether to adjust the camera angle and exposure time to improve the contrast between the specified appearance defect in the recessed area and the corresponding background image.
[0010] The embodiment of the application provides an appearance defect detection system based on an AI algorithm, and an appearance defect detection method based on the AI algorithm is applied, which comprises a high light reflection area defect detection module, a shadow area defect detection module and a recessed area defect detection module; wherein the high light reflection area defect detection module is used for quantifying the recognition accuracy of the specified appearance defect area in the high light reflection area based on high light reflection area detection data, and simultaneously performing image contrast optimization determination; the shadow area defect detection module is used for quantifying the recognition accuracy of the specified appearance defect area in the shadow area based on shadow area detection data, and simultaneously performing angle light source optimization determination; and the recessed area defect detection module is used for quantifying the specified appearance defect recognition accuracy of the specified appearance defect area in the recessed area based on recessed area detection data in the recessed area detection stage, and simultaneously performing camera parameter optimization determination.
[0011] The embodiment of the application provides an appearance defect detection system based on an AI algorithm, and an appearance defect detection method based on the AI algorithm is applied, which comprises a high light reflection area defect detection module, a shadow area defect detection module and a recessed area defect detection module; wherein the high light reflection area defect detection module is used for quantifying the recognition accuracy of the specified appearance defect area in the high light reflection area based on high light reflection area detection data, and simultaneously performing image contrast optimization determination; the shadow area defect detection module is used for quantifying the recognition accuracy of the specified appearance defect area in the shadow area based on shadow area detection data, and simultaneously performing angle light source optimization determination; and the recessed area defect detection module is used for quantifying the specified appearance defect recognition accuracy of the specified appearance defect area in the recessed area based on recessed area detection data in the recessed area detection stage, and simultaneously performing camera parameter optimization determination.
[0012] The one or more technical solutions provided in the embodiment of the application have at least the following technical effects or advantages:
[0013] 1. The AI vision sensor obtains the appearance defect area of the metal product to be tested, quantifies the defect area recognition accuracy in the high-reflectivity area, optimizes the image contrast, accurately grasps the defect capture ability of the current detection system in this area, then quantifies the area recognition accuracy in the shadow area and optimizes the angle light source, can clearly show the performance of the current detection system in the shadow environment, finally quantifies the defect area recognition accuracy in the recessed area and optimizes the camera parameters, can accurately evaluate the performance bottleneck of the current detection system in this area, so as to more effectively detect the potential defects in the recessed area, and thus realize the improvement of the specified appearance defect feature recognition accuracy in the corresponding recessed area of the high-transparency high-reflectivity metal, effectively solving the problem of low appearance defect feature recognition accuracy in the corresponding recessed area of the high-transparency high-reflectivity metal in the appearance defect detection process.
[0014] 2. By introducing shadow area detection data compensation values from the database, the brightness difference, shadow area positioning error value, and average pixel area are quantified, and the difference between the maximum allowed shadow area detection data in the database is processed to obtain the shadow defect recognition interference degree. Compared with the single parameter consideration method in the prior art, the parameters in this method quantitatively analyze the shadow area from different dimensions. These parameters complement each other and together build a more comprehensive shadow area feature description system, thereby improving the accuracy of shadow defect detection on the surface of high-transparency high-reflectivity metal.
[0015] 3. By harmonically averaging the sum of the high-reflectivity area positioning error value and the recessed area positioning error value with the shadow defect recognition interference degree, the recessed defect recognition interference degree is obtained, which further quantifies the interference degree of the corresponding shadow area of high-transparency high-reflectivity on the recessed defect recognition. Compared with the single parameter or simple combination parameter method in the prior art, the harmonic average processing in this method can consider the mutual influence between parameters, making the quantification of the interference degree of recessed defect recognition more accurate, so as to more truly reflect the comprehensive interference of high-reflectivity area, shadow area and other factors on the recessed defect recognition in the actual recessed detection environment. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 High-transparency high-reflectivity metal product image sample provided for the embodiments of the present application;
[0017] Figure 2 High-transparency high-reflectivity metal product image enhancement effect diagram provided for the embodiments of the present application;
[0018] Figure 3 Appearance defect area detection diagram of high-transparency high-reflectivity metal product provided for the embodiments of the present application;
[0019] Figure 4The flowchart of the appearance defect detection method based on the AI algorithm provided by the embodiment of the present application is shown in the following figure:
[0020] Figure 5 The flowchart of the high-reflective area defect detection judgment and optimization provided by the embodiment of the present application is shown in the following figure:
[0021] Figure 6 The flowchart of the shadow area defect detection judgment and optimization provided by the embodiment of the present application is shown in the following figure:
[0022] Figure 7 The flowchart of the recessed area defect detection judgment and optimization provided by the embodiment of the present application is shown in the following figure:
[0023] Figure 8 The structural schematic diagram of the appearance defect detection system based on the AI algorithm provided by the embodiment of the present application is shown in the following figure:
[0024] Figure 9 The interface diagram of the intelligent detection platform for industrial products provided by the embodiment of the present application is shown in the following figure:
[0025] Figure 10 The interface diagram of the recessed area detection for industrial products provided by the embodiment of the present application is shown in the following figure:
[0026] Figure 11 The interface diagram of the recessed area detection for industrial products provided by the embodiment of the present application is shown in the following figure: DETAILED DESCRIPTION
[0027] The embodiment of the present application provides an appearance defect detection method, system and device based on an AI algorithm, solves the problem of low accuracy of feature recognition of appearance defects in the corresponding recessed area of high-transparency high-reflective metal in the appearance defect detection process, acquires the appearance defect area of the metal product to be detected through an intelligent visual sensor, first, in the high-reflective area detection stage, quantifies the recognition accuracy of the specified appearance defect area in the high-reflective area based on high-reflective area detection data, and simultaneously performs image contrast optimization judgment, then, in the shadow area detection stage, quantifies the recognition accuracy of the specified appearance defect area in the shadow area based on shadow area detection data, and simultaneously performs angle light source optimization judgment, finally, in the recessed area detection stage, quantifies the specified appearance defect recognition accuracy of the specified appearance defect area in the recessed area based on recessed area detection data, and simultaneously performs camera parameter optimization judgment, thereby improving the accuracy of feature recognition of specified appearance defects in the corresponding recessed area of high-transparency high-reflective metal.
[0028] The technical solution in the embodiment of the present application is to solve the problem of low accuracy of feature recognition of appearance defects in the corresponding recessed area of high-transparency high-reflective metal in the appearance defect detection process, and the general idea is as follows:
[0029] The appearance defect area of the metal product to be measured is acquired through an AI vision sensor, the defect area recognition accuracy in a high-reflective area is quantified and image contrast optimization is determined, then the area recognition accuracy in a shadow area is quantified and angle light source optimization is determined, finally the defect area recognition accuracy in a recessed area is quantified and camera parameter optimization is determined, so that the effect of improving the specified appearance defect feature recognition accuracy of high-transparency high-reflective metal in the corresponding recessed area is achieved.
[0030] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in combination with the drawings in the specification and specific embodiments.
[0031] As shown in Figure 1 , a high-transparency high-reflective metal product image sample diagram provided by the embodiment of the present application contains metal parts with complex geometric shapes, including normal products and images with defects, providing a source of training data and presenting its general shape; as shown in Figure 2 , a high-transparency high-reflective metal product image enhancement effect diagram provided by the embodiment of the present application, through rotation, flipping, scaling and other operations on the open source data set, increases the diversity of data and improves the contrast of the appearance defect area and the background image; as shown in Figure 3 , an appearance defect area detection diagram of a high-transparency high-reflective metal product provided by the embodiment of the present application, which labels defects in a standardized manner, such as using a bounding box, etc., to facilitate the detection of specified appearance defects of high-transparency high-reflective metal products, from left to right, the corresponding defects are inclusion, dent, and cut_marks.
[0032] As shown in Figure 4As shown, a flowchart of an appearance defect detection method based on an AI algorithm is provided, and the method comprises the following steps: step one, acquiring an appearance defect area of a to-be-tested metal product through an intelligent visual sensor, in a high-reflective area detection stage, quantifying the recognition accuracy of a specified appearance defect area in the high-reflective area based on high-reflective area detection data, and simultaneously performing image contrast optimization determination, the intelligent visual sensor (i.e. AI visual sensor) is responsible for collecting images of the appearance defect area, and the AI algorithm is used to process and analyze the data in the collected images, the to-be-tested metal product has high-transmission and high-reflective characteristics (such as high-reflective metal parts on the surface of a satellite or a solar reflector), the appearance defect area includes a high-reflective area, a shadow area and a recessed area, the high-reflective area represents a highlight area of the to-be-tested metal product due to light reflection, and usually only contains one defect position, one defect position contains different types of appearance defects (such as scratches, pits and cracks), the shadow area represents a dark area of the to-be-tested metal product due to light blocking or angle problems, the recessed area represents a local concave area of the to-be-tested metal product, the image contrast optimization determination is used to determine whether to adjust the image contrast to improve the contrast between the specified appearance defect in the high-reflective area and the corresponding background image, and the high-reflective area detection data includes an incident light angle and a high-reflective area positioning error value.
[0033] Step two, in a shadow area detection stage, quantifying the recognition accuracy of a specified appearance defect area in the shadow area based on shadow area detection data, and simultaneously performing angle light source optimization determination, the angle light source optimization determination is used to determine whether to adjust the angle light source parameters to improve the contrast between the specified appearance defect in the shadow area and the corresponding background image, and the shadow area detection data includes a brightness difference degree, a shadow area positioning error value and an average pixel area.
[0034] Step three, in a recessed area detection stage, quantifying the specified appearance defect recognition accuracy of a specified appearance defect area in the recessed area based on recessed area detection data, and simultaneously performing camera parameter optimization determination, the camera parameter optimization determination is used to determine whether to adjust the camera angle and the exposure time to improve the contrast between the specified appearance defect in the recessed area and the corresponding background image, and the recessed area detection data includes a high-reflective area positioning error value, a shadow defect recognition interference degree and a recessed area positioning error value.
[0035] In this embodiment, the specified appearance defects of high-transparency and high-reflectivity metal products generally include 8 types, including inclusion, cut marks, dent, stamp collapse, mould scuffing, pockmarks, parting line crack, and misrun. The same metal surface can have both high-reflectivity areas and shadow areas, both of which are affected by the angle and intensity of the light source. For example, when detecting a car hub, the spoke edge may be obscured by scratches due to high reflectivity, while the center concave area of the hub may be obscured by defects due to shadows. The light source and camera parameters need to be adjusted in coordination because the high-reflectivity area may cover the edge features of the concave area, resulting in an increased positioning error value of the concave area, while the shadow area may amplify the visual contrast of the scratches but at the same time reduce the visibility of the concave area. The true defects and artifacts need to be distinguished by interference quantification.
[0036] The aforementioned database is a database for storing various types of setting data established before designing the appearance defect detection method based on the AI algorithm. The database includes, but is not limited to, the allowed range of light source angles, the set shadow defect recognition interference degree, and the shadow defect recognition period. The various values in the database are directly set by technical personnel. The set shadow defect recognition interference degree can be determined based on the actual defect detection scene of the high-transparency and high-reflectivity metal product. For example, the set shadow defect recognition interference degree is represented by the result of summing and averaging the historical shadow defect recognition interference degrees of the metal product in the database at the end of the historical shadow defect recognition period. In addition, the various values in the database can be set and fine-tuned by technical personnel according to the actual debugging.
[0037] This example builds a full-scene defect evaluation system by combining the quantitative data of high-reflectivity areas, shadow areas, and concave areas, eliminating the limitations of single-dimensional errors. Secondly, through real-time determination and adjustment of image contrast, light source angle, and camera parameters, the distinction between defects and background is enhanced, especially for the problem of local overexposure caused by high reflectivity and shadow obstruction, which realizes the precise extraction of defect features. In addition, through the coupling analysis of the positioning error value of the concave area and the shadow defect interference degree, the camera exposure and angle are optimized, significantly improving the detection rate of small defects such as scratches. This method provides an efficient and accurate solution for the industrial quality inspection of high-transparency and high-reflectivity metals.
[0038] As Figure 5As shown, the high-reflective area defect detection judgment and optimization flowchart provided by the embodiment of the application first acquires the appearance defect area and performs high-reflective area detection, if the incident light angle is less than a set value, light parameter optimization is performed, whether the condition is met is judged after adjusting the light source parameter; if yes, image contrast optimization is performed, and the shadow area is recorded after optimization; if no, light source intensity warning is issued and the light source is prompted to be replaced, if the incident light angle is not less than the set value, the shadow area detection is directly entered. The whole process aims to accurately identify the shadow area through light parameter adjustment and image contrast optimization, to ensure the detection effect, and to give corresponding warning and prompt if the condition cannot be met.
[0039] Further, the recognition accuracy of the specified appearance defect area in the high-reflective area is quantified based on the high-reflective area detection data, specifically: whether there is a light parameter optimization requirement is determined according to the acquired incident light angle, if it is determined that there is a light parameter optimization requirement, that is, the acquired incident light angle is less than the set incident light angle in the database, light parameter optimization is performed, otherwise the shadow area detection stage is entered, the incident light angle represents the angle between the light emitted by the light source in the high-reflective area and the surface normal of the high-reflective area, the smaller the incident light angle, the more intense the high-reflective, that is, the closer to the light source lens direction, resulting in larger defect recognition difficulty.
[0040] First, light parameter optimization, specifically: based on the light source angle step adjustment value obtained by mapping the acquired incident light angle deviation in the database, the structure optimization algorithm can fine-tune the camera axial angle step deviation according to the input light source angle step adjustment value, gradually approach the optimal light source angle, thereby avoiding the parameter shock problem caused by direct large-scale adjustment, and obtaining the light source angle change curve in the light source angle step adjustment process, usually using professional drawing software (such as MATLAB) to draw the acquired incident light angle, camera axial angle and light source angle into a curve, taking time as the horizontal coordinate and light source angle as the vertical coordinate, connecting each data point by interpolation and the like to obtain the light source angle change curve, the incident light angle deviation represents the difference between the set incident light angle (set by the pre-set personnel) in the database and the acquired incident light angle, the light source angle change curve is used to visualize the change of each parameter with the light source angle in the light source angle step adjustment process; if the light source angle obtained from the light source angle change curve (that is, the data corresponding to the minimum incident light angle in the light source angle change curve) is within the light source angle range in the database, the light source angle optimization is completed and the image contrast optimization judgment is performed, otherwise the light source intensity optimization is performed, the light source angle range represents the closed interval corresponding to the maximum and minimum values of the historical light source angle in the historical high-reflective area defect detection process in the database.
[0041] Secondly, the light source intensity is optimized. Specifically, the harmonic average of the re-acquired incident light angle deviation and the light source angle deviation after adjusting the light source angle step is taken as the light source intensity adjustment value. The light source control algorithm is based on the input light source intensity adjustment value to accurately control the brightness of the camera ring light. This operation can improve the lighting conditions and effectively balance the light distribution in the high-reflectivity area, thereby significantly enhancing the contrast and clarity of the specified appearance defects in the area, improving the detection effect. If the acquired light source angle is greater than the maximum value of the historical light source angle in the database, the light source intensity adjustment value is recorded as the light source intensity reduction value, that is, the light source angle deviation represents the difference between the acquired light source angle and the maximum value of the historical light source angle. If the acquired light source angle is less than the minimum value of the historical light source angle in the database, the light source intensity adjustment value is recorded as the light source intensity increase value, that is, the light source angle deviation represents the difference between the minimum value of the historical light source angle and the acquired light source angle. If the re-acquired incident light angle after adjusting the light source intensity is less than the set incident light angle in the database, the light source intensity optimization is completed and the image contrast optimization determination is performed. Otherwise, the light source intensity warning is performed.
[0042] In addition, the image contrast optimization determination is performed. Specifically, whether there is a need for image contrast optimization is determined according to the acquired high-reflectivity area positioning error value. If it is determined that there is a need for image contrast optimization, that is, the acquired high-reflectivity area positioning error value is greater than the set high-reflectivity area positioning error value in the database, the image contrast optimization is performed. Otherwise, the shadow area detection stage is entered. The high-reflectivity area positioning error value represents the straight-line distance between the actual position of the specified appearance defect in the high-reflectivity area mapped on the image recognition lens and the reference position (usually the center position of the image recognition lens) in the database. The image contrast optimization is performed. Specifically, the image contrast adjustment amount is obtained based on the high-reflectivity area positioning error value deviation mapped in the database. The image enhancement algorithm is based on the input image contrast adjustment amount to dynamically adjust the camera light source cooperative energy. Through this accurate control, the lighting effect can be optimized, the contrast between the defects and the background can be effectively enhanced, and the originally blurred defect area in the high-reflectivity area can be clearly presented, thereby improving the detection quality. The high-reflectivity area positioning error value deviation represents the difference between the acquired high-reflectivity area positioning error value and the set high-reflectivity area positioning error value in the database. If the re-acquired high-reflectivity area positioning error value after adjusting the image contrast determines that there is no need for image contrast optimization, the specified appearance defect area corresponding to the specified appearance defect region of the overlapping pixel area is recorded as the shadow area. Otherwise, the preset personnel is prompted to replace the light source type. The set high-reflectivity area positioning error value is represented by the result of the summation and average of the historical high-reflectivity area positioning error values in the historical high-reflectivity area defect detection process in the database.
[0043] In this embodiment, the light source angle and intensity are dynamically adjusted based on the incident light angle deviation, the high light interference is reduced, the defect features such as scratches and pits are clearer, secondly, the camera light source cooperative energy is intelligently adjusted combined with the high light area positioning error value, the contrast between the defect and the background is optimized, the detection ability of the micro defect is improved, in addition, through the light source angle range judgment and intensity early warning mechanism, the robustness of parameter adjustment is ensured, the secondary interference caused by over optimization is avoided, the automatic and unmanned detection is realized, and the production efficiency and yield are improved.
[0044] As shown in Figure 6 the shadow area defect detection judgment and optimization flowchart provided by the embodiment of the application, the shadow area detection is performed first, whether the shadow defect recognition interference degree is greater than the set value is judged, if greater, the angle light source optimization is implemented, the camera tilt angle and light source intensity are dynamically adjusted, then whether the center light source angle is within the allowed range is checked, if yes, the optimization is completed and is recorded as a pit area; if not, the angle light source early warning is issued, if the shadow defect recognition interference degree is not greater than the set value, the pit area detection stage is directly entered. This process dynamically adjusts the light source and camera angle, ensures that the detection can be effectively optimized when the interference degree is out of limit, and the pit area can be accurately identified, and abnormal situations can be timely warned.
[0045] Further, the recognition accuracy of the specified appearance defect area in the shadow area is quantified based on the shadow area detection data, specifically: the difference degree between the shadow area detection data and the maximum allowed shadow area detection data in the database is quantified by introducing the shadow area detection data compensation value from the database, and the influence degree of each difference degree on the specified appearance defect recognition accuracy of the shadow area is obtained, and the obtained influence degrees are coupled to obtain the shadow defect recognition interference degree. The maximum allowed shadow area detection data includes the maximum allowed brightness difference degree, the maximum allowed shadow area positioning error value and the maximum allowed average pixel area, the shadow area detection data compensation value includes the brightness difference degree compensation value, the shadow area positioning error value compensation value and the average pixel area compensation value, the shadow defect recognition interference degree represents the coupling processing result of the brightness difference degree interference degree, the shadow area positioning error value interference degree and the average pixel area interference degree, the brightness difference degree represents the ratio of the absolute value of the difference between the average brightness of the shadow area in the shadow defect recognition period and the average brightness of the corresponding background image to the average brightness of the background image, the shadow area positioning error value represents the straight line distance between the actual position of the specified appearance defect in the shadow area mapped on the image recognition lens and the reference position in the database, and the average pixel area is used to quantify the deviation degree of the specified appearance defect corresponding edge distance in the shadow area.
[0046] Among them, the specific limit expression of the brightness difference degree interference degree LCY is: In the formula, LCY represents the brightness difference degree interference degree of the specified appearance defect in the shadow area of the metal product under test at the end of the shadow defect identification period, n1 represents the brightness difference degree compensation value, LCY1 represents the brightness difference degree of the specified appearance defect in the shadow area of the metal product under test at the end of the shadow defect identification period, LCY max represents the maximum allowable brightness difference degree, which is represented by the result of summing and averaging the maximum values of the historical brightness difference degrees of the metal products in the database at the end of each historical shadow defect identification period.
[0047] The specific limiting expression of the shadow area positioning error value interference degree DWC is: In the formula, DWC represents the shadow area positioning error value interference degree of the specified appearance defect in the shadow area of the metal product under test at the end of the shadow defect identification period, n2 represents the shadow area positioning error value compensation value, DWC1 represents the shadow area positioning error value of the specified appearance defect in the shadow area of the metal product under test at the end of the shadow defect identification period, DWC max represents the maximum allowable shadow area positioning error value, which is represented by the result of summing and averaging the maximum values of the historical shadow area positioning error values of the metal products in the database at the end of each historical shadow defect identification period.
[0048] The specific limiting expression of the average pixel area interference degree XMD is: In the formula, XMD represents the average pixel area interference degree of the specified appearance defect in the shadow area of the metal product under test at the end of the shadow defect identification period, n3 represents the average pixel area compensation value, XMD1 represents the average pixel area of the specified appearance defect in the shadow area of the metal product under test at the end of the shadow defect identification period, XMD max represents the maximum allowable average pixel area, which is represented by the result of summing and averaging the maximum values of the historical pixel areas of the metal products in the database at the end of each historical shadow defect identification period.
[0049] The specific limiting expression of the shadow defect identification interference degree LDX is: LDX = LCY + DWC + XMD, in which, LDX represents the shadow defect identification interference degree of the specified appearance defect in the shadow area of the metal product under test at the end of the shadow defect identification period.
[0050] The database stores preset compensation values closely related to the interference degree of shadow defect recognition, and a preset mapping relationship is established among the compensation values, the corresponding brightness difference degree, the shadow area positioning error value, and the average pixel area. The mapping is not random, and its form is flexible, which can be one-to-one precise matching or many-to-one inductive association. For example, in an actual scene, when evaluating the recognition accuracy of a specific appearance defect area in a high-reflectivity area, only by inputting the real-time collected brightness difference degree, shadow area positioning error value, and average pixel area data into the preset mapping relationship, the corresponding brightness difference degree compensation value, shadow area positioning error value compensation value, and average pixel area compensation value can be quickly and accurately obtained.
[0051] It is particularly critical to strictly limit the value range of the brightness difference degree compensation value, the shadow area positioning error value compensation value, and the average pixel area compensation value to be between 0 and 1 in order to ensure the uniformity and comparability of the evaluation results, and the sum of the three compensation values is required to be 1.
[0052] In the embodiment, the shadow defect recognition interference degree increases with the increase of the brightness difference degree, the shadow area positioning error value, and the average pixel area. When the brightness difference degree increases, the boundary between the shadow area and the surrounding normal area becomes more blurred, which not only directly increases the difficulty of shadow area positioning, leading to an increase in the shadow area positioning error value, but also makes the distribution of pixels inside the shadow area more complex, thereby affecting the statistical accuracy of the average pixel area.
[0053] An increase in the shadow area positioning error value means that there is a deviation between the actual shadow area and the shadow area recognized by the algorithm, which will cause some non-shadow area pixels to be included or some shadow area pixels to be missed when calculating the average pixel area, so that the average pixel area cannot truly reflect the situation of the shadow area. At the same time, the positioning error will further interfere with the accurate judgment of the brightness difference degree, because the wrong positioning will cause deviation in the analysis of the brightness contrast between the shadow area and the surrounding area.
[0054] When the average pixel area abnormally increases, it may be due to the incorrect expansion of the shadow area, which will increase the shadow area positioning error value and interfere with the accurate measurement of the brightness difference degree due to the inclusion of more non-shadow area pixels. Conversely, an excessively small average pixel area may mean that the shadow area is excessively compressed, which will also affect the accuracy of the shadow area positioning and the judgment of the brightness difference degree.
[0055] The example comprehensively considers the complex relationship among the brightness difference degree, the shadow area positioning error value and the average pixel area, more accurately evaluates and classifies the shadow defects, and effectively solves the problem that the feature recognition accuracy of the appearance defects in the corresponding recessed area is not high in the appearance defect detection process of the high-transmission high-reflective metal in the prior art.
[0056] Further, the angle light source optimization determination is specifically as follows: whether there is an angle light source optimization requirement is determined according to the obtained shadow defect recognition interference degree; if it is determined that there is an angle light source optimization requirement, that is, the obtained shadow defect recognition interference degree is greater than the shadow defect recognition interference degree set in the database, at this time, the specified appearance defect position in the shadow area is mapped in the shadow area detection area of the image recognition lens, which is not equal to the shadow area detection area set in the database, then angle light source optimization is performed, otherwise, the recessed area detection stage is entered; the angle light source optimization is used for dynamically adjusting the camera tilt angle light source intensity based on the obtained angle light source adjustment amount (including angle light source increase amount and angle light source decrease amount); after the angle light source adjustment, if the center light source angle in the shadow area is not within the light source angle allowable range (usually set to between 30° and 60°) in the database, then angle light source warning is performed, otherwise, the angle light source optimization is completed and the specified appearance defect region corresponding to the specified appearance defect area of the superimposed pixel area is recorded as a recessed area; the center light source angle refers to the angle of the light source relative to the center position of the shadow area, and the center angle here usually sets a certain fixed point (set by a pre-set person) of the high-transmission high-reflective metal product as the coordinate origin, at this time, the center light source angle is the included angle of the direction vector corresponding to the planar projection of the actual light source position on the camera and the line connecting the center point of the shadow area.
[0057] The angle light source optimization is specifically as follows: if the obtained shadow area detection area is greater than the shadow area detection area set in the database, then the angle light source increase amount is obtained in the database based on the sum average result of the shadow defect recognition interference degree deviation and the first shadow area detection area fraction deviation; the histogram equalization algorithm is originally used for image contrast enhancement, and in this case, the light source intensity corresponding to the camera tilt angle is dynamically adjusted based on the input angle light source increase amount; through this associated adjustment, the lighting can be targeted optimized, the contrast of the shadow defect recognition area can be improved, and the defects can be more accurately recognized; if the obtained shadow area detection area is not greater than the shadow area detection area set in the database, then the angle light source decrease amount is obtained in the database based on the sum average result of the shadow defect recognition interference degree deviation and the second shadow area detection area fraction deviation; the histogram equalization algorithm is originally used for image contrast enhancement, and the light source intensity corresponding to the camera tilt angle is reduced; by reasonably reducing the light source intensity, the lighting distribution of the shadow area can be improved, the excessive exposure or uneven light can be reduced, and the contrast of the shadow defect recognition area can be effectively improved, which is beneficial to accurately detecting defects.
[0058] The shadow defect recognition interference deviation represents the difference between the obtained shadow defect recognition interference and the shadow defect recognition interference set in the database. The first shadow area detection area fraction deviation represents the difference between the obtained first shadow area detection area fraction and the set shadow area detection area fraction at the end of the shadow defect recognition period. The first shadow area detection area fraction represents the ratio of the obtained shadow area detection area to the set shadow area detection area. The set shadow area detection area fraction is represented by the sum and average of the absolute values of the historical shadow area detection area deviations at the end of the historical shadow defect recognition periods in the database. The set shadow area detection area is represented by the sum and average of the historical shadow area detection areas at the end of the historical shadow defect recognition periods in the database. The second shadow area detection area fraction deviation represents the ratio of the set shadow area detection area deviation to the obtained second shadow area detection area deviation at the end of the shadow defect recognition period. The second shadow area detection area deviation represents the difference between the set shadow area detection area and the obtained shadow area detection area.
[0059] In this embodiment, this example determines whether angle light source optimization is needed based on the interference level of shadow defect identification. It can make timely adjustments when the detected area of the shadow area does not match the set value, effectively improving the accuracy of shadow defect identification. This mechanism significantly improves the accuracy and reliability of shadow defect identification and recessed area detection through a scientific and reasonable judgment and optimization process, which helps to improve the product quality inspection level and reduce losses caused by defect misjudgment.
[0060] like Figure 7 The diagram shows a flowchart for the detection, judgment, and optimization of recessed areas provided in this application embodiment. First, shadow area detection is performed to determine if the shadow defect identification interference exceeds a set value. If it does, angle light source optimization is implemented, dynamically adjusting the camera tilt angle and light source intensity. Then, the angle of the central light source is checked to see if it is within the allowable range. If it is, optimization is completed and the area is recorded as a recessed area; otherwise, an angle light source warning is issued. If the shadow defect identification interference does not exceed the set value, the process directly proceeds to the recessed area detection stage. This process, by dynamically adjusting the light source and camera angle, ensures effective optimization and accurate identification of recessed areas when interference exceeds limits, while also providing timely warnings for abnormal situations.
[0061] Further, the specified appearance defect recognition accuracy of the specified appearance defect area in the concave area is quantified based on the concave area detection data, specifically: obtaining the concave defect recognition interference degree of the specified appearance defect in the concave area of the metal product to be tested at the end of the concave defect recognition period, the concave defect recognition interference degree, representing the harmonic average result of the high-reflective area positioning error value and the concave area positioning error value, and the shadow defect recognition interference degree, the concave area positioning error value representing the straight-line distance between the actual position of the specified appearance defect in the concave area mapped on the image recognition lens and the reference position in the database; camera parameter optimization determination, specifically: determining whether there is a camera parameter optimization requirement according to the obtained concave defect recognition interference degree, if it is determined that there is a camera parameter optimization requirement, that is, the obtained concave defect recognition interference degree is greater than the set concave defect recognition interference degree in the database, then the camera parameter optimization is performed, otherwise the specified appearance defect detection instruction of the next high-reflective area of the metal product to be tested is sent, the camera parameters include camera angle and exposure time, and the set concave defect recognition interference degree is represented by the result of summing and averaging the historical concave defect recognition interference degrees of the metal product in the database at the end of the historical concave defect recognition period.
[0062] The camera parameter optimization is specifically: taking the sum average of the obtained recess defect recognition interference degree deviation and the camera angle score deviation as the camera angle adjustment value, the image feature recognition algorithm combines the input camera angle adjustment value, analyzes the correlation between image feature change and angle, and dynamically and accurately regulates the camera tilt angle, ensures that the camera is at the best shooting angle, provides high-quality and clear image data for subsequent image processing and analysis, and takes the sum average of the obtained recess defect recognition interference degree deviation and the exposure time score deviation as the exposure time adjustment value. The image feature recognition algorithm analyzes the relationship between the image feature and the exposure time according to the input exposure time adjustment value, and adjusts the exposure time accurately based on this, avoids overexposure or underexposure, and ensures that the image clearly presents the target feature. The recess defect recognition interference degree deviation represents the difference between the obtained recess defect recognition interference degree and the set recess defect recognition interference degree. The camera angle score deviation represents the difference between the obtained camera angle score at the end of the recess defect recognition period and the set camera angle score. The camera angle score represents the ratio of the obtained camera angle to the set camera angle. The exposure time score deviation represents the difference between the obtained exposure time score at the end of the recess defect recognition period and the set exposure time score. The exposure time score represents the ratio of the obtained exposure time to the set exposure time. The camera parameter fitting curve in the camera parameter optimization process is obtained, the camera angle and exposure time corresponding to the coincidence point in the camera parameter fitting curve are obtained, and the recess defect recognition interference degree is obtained again. One camera parameter optimization includes one camera angle optimization and one exposure time optimization. The camera parameter fitting curve is used to visualize the change relationship between the camera angle, exposure time and image contrast in the one camera parameter optimization process. Whether there is a camera parameter warning requirement is determined according to the obtained recess defect recognition interference degree. If it is determined that there is a camera parameter warning requirement, the camera parameter warning is performed (the camera parameter warning is also performed when there is no coincidence point in the camera parameter fitting curve), otherwise the camera parameter optimization is completed and the specified appearance defect detection instruction of the next high-reflectivity area of the metal product to be tested is sent.
[0063] In the embodiment, the recess defect recognition interference degree increases with the increase of the high-reflectivity area positioning error value, the recess area positioning error value and the shadow defect recognition interference degree. When the high-reflectivity area positioning error value increases, the imaging range of the camera on the high-reflectivity area will deviate, causing the imaging of the recess area originally in the clear imaging area to be blurred, thereby indirectly affecting the positioning accuracy of the recess area, causing the recess area positioning error value to increase. At the same time, this imaging deviation will change the boundary and morphology of the shadow area, increase the difficulty of shadow defect recognition, and cause the shadow defect recognition interference degree to rise.
[0064] The increase of the recessed area positioning error value means that the position of the recessed area in the image is inaccurate, which will affect the definition of the high-reflective area around the recessed area, further increase the positioning difficulty of the high-reflective area, and make the high-reflective area positioning error value also increase. Moreover, the inaccurate positioning of the recessed area will interfere with the association judgment of the shadow defect and the recessed area, and increase the shadow defect recognition interference degree.
[0065] The increase of the shadow defect recognition interference degree indicates that there are many interference factors in the imaging of the shadow area, which will affect the judgment of the relative position of the recessed area and the shadow area, and lead to the increase of the recessed area positioning error value. At the same time, the large shadow defect recognition interference degree also reflects that the overall quality of the image is not good, which may affect the accurate recognition of the boundary of the high-reflective area, and thus increase the high-reflective area positioning error value.
[0066] The present example comprehensively considers the complex relationship among the high-reflective area positioning error value, the recessed area positioning error value and the shadow defect recognition interference degree, more accurately evaluates and classifies the recessed defect, and thus improves the identification accuracy of the specified appearance defect features in the corresponding recessed area of the high-transparency high-reflective metal, and effectively solves the problem of low appearance defect feature identification accuracy in the corresponding recessed area of the high-transparency high-reflective metal in the appearance defect detection process in the prior art.
[0067] Compared with the prior art, the optimization method provided by the present example can accurately adjust the camera parameters, effectively reduce the recessed defect recognition interference degree, and improve the detection accuracy. The relationship between the parameters and the image contrast is intuitively presented through the camera parameter fitting curve, which provides a scientific basis for parameter adjustment. The camera parameter abnormality is timely warned to avoid detection failure caused by improper parameters, and to ensure the stability and reliability of the detection process, and to improve the overall quality and efficiency of the appearance defect detection of the high-reflective metal.
[0068] As an embodiment of the second aspect, as shown in Figure 8 The structure schematic diagram of the appearance defect detection system based on the AI algorithm provided by the present application is shown. The appearance defect detection system based on the AI algorithm provided by the present application includes a high-reflective area defect detection module, a shadow area defect detection module and a recessed area defect detection module. The high-reflective area defect detection module is used to quantify the identification accuracy of the specified appearance defect area in the high-reflective area based on high-reflective area detection data, and simultaneously perform image contrast optimization judgment. The shadow area defect detection module is used to quantify the identification accuracy of the specified appearance defect area in the shadow area based on shadow area detection data, and simultaneously perform angle light source optimization judgment. The recessed area defect detection module is used to quantify the specified appearance defect identification accuracy of the specified appearance defect area in the recessed area based on recessed area detection data in the recessed area detection stage, and simultaneously perform camera parameter optimization judgment.
[0069] In the embodiment, by setting the high-reflective area, shadow area and recessed area defect detection module, the system can specifically process the defect detection problems of different areas, effectively improve the recognition accuracy of the specified appearance defects of each area, enhance the adaptability and reliability of the detection system, and improve the overall detection effect.
[0070] As an embodiment of the third aspect, the appearance defect detection device based on an AI algorithm provided by the embodiment of the application comprises: an intelligent visual sensor, an angle sensor, a brightness sensor, a timer and a light intensity sensor; the intelligent visual sensor is used to acquire the appearance defect area of the metal product to be measured, the positioning error value of the high-reflective area, the positioning error value of the shadow area, the positioning error value of the recessed area, the average pixel area and the image contrast; the angle sensor is used to acquire the incident light angle, the light source angle and the camera angle; the brightness sensor is used to acquire the brightness difference; the timer is used to acquire the exposure time; and the light intensity sensor is used to acquire the light source intensity.
[0071] It should be noted that, as shown in Figure 9 Fig. 1 is an interface diagram of an industrial product intelligent detection platform provided by the embodiment of the application, the left side is a navigation bar, containing a homepage, a detection center and other function entrances; the top of the homepage has operation buttons, which can start, pause detection and perform parameter setting, etc.; the middle part shows the detection state monitoring, including the light source state, the camera parameter, the detection progress, etc.; the right side is a defect preview area, which can view the product image and the defect position; the lower part has light source intensity, camera angle alarm prompts, and state normal feedback. The interface is convenient for the operator to master the detection situation in real time, timely handle the exception, and guarantee the efficiency and accuracy of the industrial product detection.
[0072] As shown in Figure 10 Fig. 4 is one of the interface diagrams of the recessed area detection of the industrial product provided by the embodiment of the application, the key parameter area lists the parameters such as the recessed defect detection recognition interference degree, the camera tilt angle and the exposure time and the corresponding numerical value and standard suggestion; the right side is a parameter fitting curve, the horizontal and vertical coordinates are the camera angle and the exposure time respectively, the curve shows the relationship between the two, and some points have annotations; the lower part has light source intensity early warning, camera parameter early warning and state normal prompt; the lowermost part gives parameter optimization suggestion, points out that the continuous 3 times optimization does not meet the standard, suggests adjusting the camera angle ± 3°, and displays the current camera angle and the increase / decrease operation button, which is convenient for adjusting the camera angle, helps to improve the detection precision and efficiency, and is overall beneficial to the efficient development of the recessed area detection work of the industrial product.
[0073] As shown in Figure 11As shown, the interface diagram two of the industrial product recess area detection provided by the embodiment of the application is divided into multiple areas in the middle part: the labeling personnel, the labeling process, and the labeling statistics are presented in the form of cards, the labeling statistics are displayed with a purple progress bar to show the completion degree; the labeling mode, the defect type, the labeling personnel, and other information are displayed in the form of a table below, showing that the today's labeling amount is 72, the average accuracy is 97.2%, and the average labeling time is 45 seconds; the bottom is a defect detection image area, which displays six different types of color images of recess defects, such as IMG-001 inclusions and IMG-002 cutting marks, the image color is rich, and the defect features are highlighted, and there is a page number navigation in the lower right corner, which helps to improve the efficiency and accuracy of the industrial product recess area detection work.
[0074] In summary, the embodiment of the application can accurately grasp the current detection system's ability to capture defects in the area by acquiring the appearance defect area of the metal product to be measured by the AI vision sensor, quantifying the defect area recognition accuracy in the high-reflective area and performing image contrast optimization determination, quantifying the area recognition accuracy in the shadow area and performing angle light source optimization determination, and quantifying the defect area recognition accuracy in the recess area and performing camera parameter optimization determination, thereby more effectively detecting potential defects in the recess area, and thereby improving the specified appearance defect feature recognition accuracy in the recess area of the high-transparency high-reflective metal, effectively solving the problem of low appearance defect feature recognition accuracy in the recess area of the high-transparency high-reflective metal in the appearance defect detection process.
[0075] Those skilled in the art will appreciate that embodiments of the application can be provided as methods, systems, or computer program products. Accordingly, the application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) having computer-usable program code embodied therein.
Claims
1. An appearance defect detection method based on an AI algorithm, characterized by, The method comprises the following steps: Step 1: obtaining an appearance defect area of a metal product to be tested by an intelligent visual sensor, quantifying the recognition accuracy of a specified appearance defect area in a high-reflective area based on high-reflective area detection data, and simultaneously performing image contrast optimization determination, wherein the metal product to be tested has high-transmission and high-reflective characteristics, the appearance defect area comprises a high-reflective area, a shadow area and a recessed area, and the image contrast optimization determination is used to determine whether to adjust the image contrast to improve the contrast between the specified appearance defect in the high-reflective area and the corresponding background image; Step 2: quantifying the recognition accuracy of a specified appearance defect area in a shadow area based on shadow area detection data, and simultaneously performing angle light source optimization determination, wherein the angle light source optimization determination is used to determine whether to adjust the angle light source parameters to improve the contrast between the specified appearance defect in the shadow area and the corresponding background image; Step 3: in the recessed area detection stage, quantifying the specified appearance defect recognition accuracy of a specified appearance defect area in a recessed area based on recessed area detection data, and simultaneously performing camera parameter optimization determination, wherein the camera parameter optimization determination is used to determine whether to adjust the camera angle and the exposure time to improve the contrast between the specified appearance defect in the recessed area and the corresponding background image; The quantification of the recognition accuracy of the specified appearance defect area in the high-reflective area based on the high-reflective area detection data specifically comprises: determining whether there is a light parameter optimization requirement according to the obtained incident light angle, if it is determined that there is a light parameter optimization requirement, performing light parameter optimization, otherwise entering the shadow area detection stage; The light parameter optimization specifically comprises: mapping the obtained incident light angle deviation in the database to obtain a light source angle step adjustment value to adjust the camera axial angle step, and simultaneously obtaining a light source angle change curve in the light source angle step adjustment process; if the light source angle obtained from the light source angle change curve is within the light source angle range in the database, the light source angle optimization is completed and the image contrast optimization determination is performed, otherwise the light source intensity optimization is performed; The quantification of the recognition accuracy of the specified appearance defect area in the shadow area based on the shadow area detection data specifically comprises: introducing a shadow area detection data compensation value from the database to quantify the difference degree between the shadow area detection data and the maximum allowed shadow area detection data in the database, and obtaining the influence degree of each difference degree on the specified appearance defect recognition accuracy of the shadow area, and simultaneously coupling the obtained influence degrees to obtain a shadow defect recognition interference degree; The quantification of the specified appearance defect recognition accuracy of the specified appearance defect area in the recessed area based on the recessed area detection data specifically comprises: obtaining a recessed defect recognition interference degree of the specified appearance defect in the recessed area of the metal product to be tested at the end of the recessed defect recognition period, wherein the recessed defect recognition interference degree represents the harmonic average result of the sum average result of the high-reflective area positioning error value and the recessed area positioning error value and the shadow defect recognition interference degree. The camera parameter optimization determination is specifically: whether there is a camera parameter optimization demand is determined according to the obtained recess defect recognition interference degree, if it is determined that there is a camera parameter optimization demand, camera parameter optimization is performed, otherwise a specified appearance defect detection instruction of the next high light reflection area of the metal product under test is sent, and the camera parameters include a camera angle and an exposure time. 2.The appearance defect detection method based on an AI algorithm of claim 1, wherein, The light source intensity optimization is specifically: The harmonic average result of the incident light angle deviation and the light source angle deviation reacquired after the light source angle step is adjusted is taken as a light source intensity adjustment value to adjust the camera ring light source brightness, if the incident light angle reacquired after the light source intensity adjustment is less than the set incident light angle in the database, the light source intensity optimization is completed and image contrast optimization determination is performed, otherwise light source intensity warning is performed; The image contrast optimization determination is specifically: whether there is an image contrast optimization demand is determined according to the obtained high light reflection area positioning error value, if it is determined that there is an image contrast optimization demand, image contrast optimization is performed, otherwise a shadow area detection stage is entered, and the high light reflection area positioning error value represents the straight line distance between the actual position of the specified appearance defect position in the high light reflection area mapped on the image recognition lens and the reference position in the database. 3.The appearance defect detection method based on an AI algorithm of claim 1, wherein, The image contrast optimization is specifically: The image contrast adjustment amount is obtained based on the high light reflection area positioning error value deviation mapped in the database to adjust the camera light source cooperative energy, if the high light reflection area positioning error value reacquired after the image contrast adjustment determines that there is no image contrast optimization demand, the image contrast optimization is completed and the specified appearance defect area corresponding to the specified appearance defect pixel area of coincidence is recorded as a shadow area, otherwise a preset personnel is prompted to replace the light source type. 4.The appearance defect detection method based on an AI algorithm of claim 1, wherein, The angle light source optimization determination is specifically: Whether there is an angle light source optimization demand is determined according to the obtained shadow defect recognition interference degree, if it is determined that there is an angle light source optimization demand, angle light source optimization is performed, otherwise a recess area detection stage is entered; The angle light source optimization is used to dynamically adjust the camera tilt angle light source intensity based on the obtained angle light source adjustment amount; After the angle light source adjustment, if the center light source angle in the shadow area is not in the light source angle allowable range in the database, angle light source warning is performed, otherwise angle light source optimization is completed and the specified appearance defect area corresponding to the specified appearance defect pixel area of coincidence is recorded as a recess area. 5.The appearance defect detection method based on an AI algorithm of claim 1, wherein, The camera parameter optimization is specifically: The sum average result of the recess defect recognition interference degree deviation and the camera angle score deviation is taken as a camera angle adjustment value to adjust the camera tilt angle, and the sum average result of the recess defect recognition interference degree deviation and the exposure time score deviation is taken as an exposure time adjustment value to adjust the camera exposure time; Obtain a camera parameter fitting curve in a first camera parameter optimization process, obtain a camera angle and an exposure time corresponding to a coincidence point in the camera parameter fitting curve, and reacquire a concave defect recognition interference degree, the first camera parameter optimization including a first camera angle optimization and a first exposure time optimization, and the camera parameter fitting curve is used to visualize the change relationship between the camera angle, the exposure time, and the image contrast in the first camera parameter optimization process; Determine whether there is a camera parameter warning requirement according to the reacquired concave defect recognition interference degree, if it is determined that there is a camera parameter warning requirement, perform camera parameter warning, otherwise, complete camera parameter optimization and send a specified appearance defect detection instruction of a next high-reflectivity area of the metal product to be tested.
6. A system for appearance defect detection based on AI algorithm, applying the method for appearance defect detection based on AI algorithm according to any one of claims 1-5, characterized in that, Comprise: a high-reflectivity area defect detection module, a shadow area defect detection module, and a concave area defect detection module; The high-reflectivity area defect detection module is used to quantify the recognition accuracy of the specified appearance defect area in the high-reflectivity area based on high-reflectivity area detection data, and simultaneously perform image contrast optimization determination; The shadow area defect detection module is used to quantify the recognition accuracy of the specified appearance defect area in the shadow area based on shadow area detection data, and simultaneously perform angle light source optimization determination; The concave area defect detection module is used to quantify the specified appearance defect recognition accuracy of the specified appearance defect area in the concave area based on concave area detection data in the concave area detection stage, and simultaneously perform camera parameter optimization determination.
7. An apparatus for appearance defect detection based on an AI algorithm, applying the appearance defect detection method based on an AI algorithm according to any one of claims 1 to 5, characterized by, Comprise: an intelligent vision sensor and an angle sensor; The intelligent vision sensor is used to obtain the appearance defect area of the metal product to be tested, the high-reflectivity area positioning error value, the shadow area positioning error value, the concave area positioning error value, the average pixel area, and the image contrast; The angle sensor is used to obtain the incident light angle, the light source angle, and the camera angle.
Citation Information
Patent Citations
AI visual inspection methods, systems, and readable storage media based on deep learning
CN114705685B
Wiring terminal full-appearance visual inspection system based on AI algorithm
CN118671091A
High-reflection multi-curved-surface product surface defect detection method
CN116448671A
Fireplace surface defect detection method and system driven by machine vision
CN119624914A