Magnet surface defect detection equipment control method for AI optimization and controller
Through the analysis of adaptive light source controller and plating type, the light source parameters are dynamically adjusted, which solves the problem that fixed light source parameters are difficult to adapt to magnets of different plating types, improves the accuracy of magnet surface defect detection and system stability, and achieves efficient detection and Production optimization.
Patent Information
- Application Number
- CN202411552092.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-01-10
AI Technical Summary
The existing AI-optimized magnet surface defect detection system is difficult to adapt to the fixed light source parameters under magnets with different coatings or different reflectivity, resulting in poor detection effect, inability to accurately extract features, and low detection accuracy.
Adaptive light source controller is adopted to monitor the surface brightness information of magnets in real time, dynamically adjust the detection light source parameters to ensure the best imaging effect, and establish a light parameter mapping model in combination with plating type analysis, optimize the lighting conditions, and detect the credibility of the model through AI Evaluate and defect feature extraction to generate process optimization suggestions.
It improves the accuracy and adaptability of AI detection, realizes accurate detection of magnets of different coating types, improves the stability and reliability of the detection system, reduces the leakage detection rate, and improves production efficiency.
Smart Images

Figure CN119290894A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of control and regulation systems, and in particular to a control method and controller for magnet surface defect detection equipment optimized for AI. Background Art
[0002] With the widespread application of permanent magnet materials in new energy vehicles, industrial automation, consumer electronics and other fields, the quality control requirements of magnets are constantly increasing. Surface defects such as cracks, blistering, and chipping not only affect the appearance of the product, but also reduce the service life and performance of the magnet. Therefore, in the magnet production process, the detection of surface defects has become a key link to ensure product quality.
[0003] In the related art, AI-based machine vision technology is used to detect magnet surface defects. This type of detection system usually consists of an industrial camera, a fixed light source, and an image processing unit. The industrial camera collects images of the magnet surface, and the image processing unit automatically identifies surface defects through AI algorithms (including but not limited to edge detection, region segmentation, etc.). The fixed light source in the related art is generally used for fill light according to fixed lighting parameters.
[0004] However, magnets with different coatings or reflectivities have large differences in their images under fixed lighting, which makes it impossible for AI detection to accurately extract corresponding features based on a limited sample database, resulting in poor detection results. Summary of the invention
[0005] The present application provides a control method and controller for magnet surface defect detection equipment optimized for AI, which are used to improve the detection effect of different magnets.
[0006] In the first aspect, the present application provides a control method for magnet surface defect detection equipment optimized for AI, which is applied to an adaptive light source controller, and the method includes: determining the surface brightness information of the magnet to be tested on the conveying platform according to the conveying monitoring image; determining the detection light source parameters according to the surface brightness information, and adjusting the irradiation light source of the detection station with the detection light source parameters; when the magnet to be tested arrives at the detection station, collecting the surface image of the magnet to be tested, and calculating the grayscale eigenvalue of the surface image in real time; when the numerical deviation between the grayscale eigenvalue and the preset grayscale target exceeds the preset deviation threshold, fine-tuning the detection light source parameters according to the numerical deviation to determine the target light source parameters; controlling the irradiation light source of the detection station to irradiate with the target light source parameters, and obtaining the surface image of the magnet to be tested again as the target image; inputting the target image into the AI detection model to obtain the defect detection result.
[0007] In the above embodiment, the adaptive light source controller first obtains brightness information, presets the light source parameters based on this information, compares the grayscale feature values in real time during the detection process, and fine-tunes the light source to ultimately ensure the best imaging effect, thereby improving the accuracy and adaptability of AI detection.
[0008] In combination with some embodiments of the first aspect, in some embodiments, when the numerical deviation between the grayscale characteristic value and the preset grayscale target exceeds the preset deviation threshold, the detection light source parameters are fine-tuned according to the numerical deviation, and the step of determining the target light source parameters specifically includes: when the numerical deviation between the grayscale characteristic value and the preset grayscale target exceeds the preset deviation threshold, determining the deviation direction and deviation amount of the numerical deviation; determining the initial adjustment step size according to the deviation direction, deviation amount and historical adjustment records of the detection light source parameters; adjusting the illumination light source of the detection station with the initial adjustment step size, and calculating the numerical correction value of the adjusted numerical deviation; when the numerical correction value is greater than the preset fluctuation threshold, adjusting the initial adjustment step size to the correction step size; performing parameter adjustment with the correction step size until the numerical deviation is less than the preset deviation threshold, and determining the final light source parameters as the target light source parameters.
[0009] In the above embodiment, the adaptive light source controller determines the initial adjustment step by analyzing the deviation direction and deviation amount between the grayscale characteristic value and the target value, combining the historical adjustment records, and realizes precise adjustment by dynamically correcting the step, thereby ensuring the stability of the illumination parameter adjustment.
[0010] In combination with some embodiments of the first aspect, in some embodiments, before the step of determining the surface brightness information of the magnet to be tested on the conveying platform based on the conveying monitoring image, the method also includes: collecting surface reference images of reference magnets of different coating types, and determining the grayscale feature distribution corresponding to each coating type; clustering each coating type according to the grayscale feature distribution to obtain multiple coating feature categories; based on the coating feature categories, establishing a mapping relationship model between illumination parameters and grayscale feature values; based on the mapping relationship model, determining the optimal illumination parameters and preset grayscale targets corresponding to each coating feature category.
[0011] In the above embodiment, the adaptive light source controller collects reference images, analyzes the grayscale feature distribution, and determines the optimal illumination parameters for different coating types, thereby improving the versatility and adaptability of the detection system.
[0012] In combination with some embodiments of the first aspect, in some embodiments, the steps of collecting surface reference images of reference magnets of different coating types and determining the grayscale feature distribution corresponding to each coating type specifically include: collecting local surface images of reference magnets of different coating types at multiple preset sampling positions under different lighting angles and lighting intensities; gridding the local surface images and calculating the grayscale mean and grayscale variance of each grid; and determining the grayscale feature distribution of the reference magnets of each coating type based on the grayscale mean and grayscale variance.
[0013] In the above embodiment, the adaptive light source controller constructs a comprehensive grayscale feature distribution model by performing grid analysis on the local surface image, calculating the grayscale mean and variance, so as to make the lighting parameters more accurate and improve the detection effect.
[0014] In combination with some embodiments of the first aspect, in some embodiments, after the step of inputting the target image into the AI detection model to obtain the defect detection result, the method also includes: determining the workstation light source parameters and magnet image features corresponding to the defect detection result; determining the credibility index of the defect detection result based on the workstation light source parameters and magnet image features; when the credibility index is lower than a preset credibility threshold, adjusting the model parameters of the AI detection model.
[0015] In the above embodiment, the adaptive light source controller analyzes the workstation light source parameters and magnet image features, and the system can evaluate the reliability of the detection results and automatically adjust the AI model parameters, thereby improving the stability and reliability of the detection system.
[0016] In combination with some embodiments of the first aspect, in some embodiments, after the step of inputting the target image into the AI detection model to obtain the defect detection result, the method also includes: performing feature extraction on the defect detection result to obtain a defect feature vector; and generating process optimization suggestions based on the defect feature vector and the corresponding process parameters.
[0017] In the above embodiment, the adaptive light source controller extracts and analyzes features of defect detection results, establishes a correlation with process parameters, and provides data support for improving production quality.
[0018] In combination with some embodiments of the first aspect, in some embodiments, after the step of generating a process optimization suggestion based on the defect feature vector and the corresponding process parameters, the method also includes: statistically analyzing the changing trend of the defect feature vector in the time dimension, and establishing a time series evolution model of the defect feature based on the changing trend; determining the degree of defect improvement based on the time series evolution model and the process parameter adjustment amount in the process optimization suggestion; prioritizing the process parameter adjustment schemes according to the degree of defect improvement, and generating a graded implementation plan including adjustment steps and target parameters.
[0019] In the above embodiment, the adaptive light source controller realizes the quantitative record of defect development trend by establishing a time-series evolution model of defect characteristics, making process parameter optimization more forward-looking, ensuring the controllability and systematicness of the optimization process, and reducing optimization risks.
[0020] In a second aspect, an embodiment of the present application provides an adaptive light source controller, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the adaptive light source controller to perform the method described in the first aspect and any possible implementation manner of the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, and when the computer program product runs on an adaptive light source controller, the adaptive light source controller executes the method described in the first aspect and any possible implementation manner of the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions. When the instructions are executed on an adaptive light source controller, the adaptive light source controller performs the method described in the first aspect and any possible implementation manner of the first aspect.
[0023] It can be understood that the adaptive light source controller provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Due to the use of an adaptive light source control mechanism based on real-time monitoring and feedback, it is able to automatically adjust the optimal lighting conditions for magnets with different surface characteristics, effectively solving the problem in the existing technology that fixed light source parameters are difficult to adapt to the surface characteristics of different magnets, thereby achieving improved detection image quality and improved AI detection accuracy, making the detection system more adaptable and reliable.
[0025] 2. Due to the use of a parameter mapping model construction method based on coating type analysis, a correspondence between different coating types and optimal lighting parameters can be established, which effectively solves the problem in the prior art that it is difficult to determine appropriate lighting parameters for different coating types, thereby realizing the detection system's accurate detection of different types of magnets.
[0026] 3. Due to the adoption of an AI model adaptive optimization mechanism based on credibility assessment, the reliability of the detection results can be evaluated in real time and corresponding adjustments can be made, which effectively solves the problem that the AI model in the existing technology is difficult to maintain a stable detection effect, thereby achieving the optimization and improvement of the detection system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flow chart of a control method for a magnet surface defect detection device optimized for AI in an embodiment of the present application; Figure 2 is another flow chart of a method for controlling a magnet surface defect detection device optimized for AI in an embodiment of the present application; Figure 3 It is a schematic diagram of a physical device structure of an adaptive light source controller in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.
[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0030] For ease of understanding, the application scenarios of the embodiments of the present application are introduced below.
[0031] In a new energy vehicle motor manufacturing company, the surface quality of permanent magnets directly affects the performance and life of the motor. The company needs to inspect more than 10,000 permanent magnets of different specifications and different coating processes every day. The surfaces of these magnets have undergone different treatment processes such as nickel plating, zinc plating, and chrome plating, resulting in significant differences in surface reflective properties. During the inspection process, under the same lighting conditions, nickel-plated magnets were overexposed, while zinc-plated magnets were underexposed, causing the inspection system to be unable to accurately identify surface defects, with a missed detection rate of up to 5%. Especially when the production line frequently switches between different product models, the inspection effect is more unstable, which seriously affects product quality control.
[0032] In the related art, the automatic detection of magnet surface defects is achieved by adopting fixed light source parameters and a single AI model. The following describes a scenario in which the control method for magnet surface defect detection equipment optimized for AI in the related art is used.
[0033] A magnet manufacturer uses a traditional fixed light source visual inspection system and installs four sets of fixed-angle LED light sources at the inspection station. The light intensity is pre-set to a fixed value. When inspecting nickel-plated magnets, the system can obtain clear surface images, but after replacing them with chrome-plated magnets, the image has severe mirror reflections due to differences in surface reflectivity, causing the AI algorithm to be unable to identify subtle surface cracks. Operators need to manually adjust the lighting parameters, which not only reduces production efficiency, but also the adjustment results rely on personal experience and lack standardization and repeatability. Even for experienced operators, it takes more than 15 minutes to complete a lighting parameter adjustment.
[0034] By adopting the control method for the magnet surface defect detection device optimized for AI in the embodiment of the present application, the illumination parameters are dynamically adjusted by real-time monitoring of the magnet surface image, thereby achieving accurate detection of magnets with different coating types and improving the detection accuracy. The following describes the scenario in which the control method for the magnet surface defect detection device optimized for AI in the present application is used.
[0035] After adopting the AI-optimized magnet surface defect detection equipment control method of this application, the company's detection system is equipped with an adaptive light source controller, which can automatically identify the type of magnet entering the detection area. When a galvanized magnet is detected entering, the system calls the pre-established galvanized type lighting parameter model to complete the pre-adjustment of the light source within 0.5 seconds. During the actual detection process, the system will also automatically fine-tune the lighting parameters according to the grayscale characteristics of the image collected in real time to ensure the best imaging effect. For example, when it is detected that the grayscale value of a local area is low, the system will accurately adjust the angle and intensity of the light source in the corresponding area to make the surface defect characteristics more prominent and improve the detection accuracy.
[0036] It can be seen that the use of the AI-optimized magnet surface defect detection equipment control method in the embodiment of the present application can not only achieve accurate detection of magnet surface defects, but also effectively solve the problem of light adaptability of magnets with different coating types.
[0037] For ease of understanding, the following describes the process of the method provided by this implementation in combination with the above scenario. Figure 1 , which is a flow chart of a control method for a magnet surface defect detection device optimized for AI in an embodiment of the present application.
[0038] S101. Determine surface brightness information of a magnet to be measured on a conveying platform according to a conveying monitoring image.
[0039] Among them, the conveying monitoring image represents the operating status image of the conveying platform collected in real time by an industrial camera; the surface brightness information is used to represent the reflection characteristics of the magnet surface to light, including optical characteristics such as reflection intensity and uniformity; the magnet to be tested represents a magnet sample that has not yet undergone defect detection.
[0040] The adaptive light source controller starts this step when the magnet enters the conveying platform area of the detection system. Specifically, the controller first collects real-time images of the conveying platform through an industrial camera, uses an image processing algorithm to identify the magnet area in the image, and extracts the position information such as the center coordinates, shape contour, and direction angle of the magnet. At the same time, the pixel brightness distribution on the surface of the magnet is analyzed, and characteristic parameters such as regional average brightness and brightness variance are calculated to establish an optical property description of the magnet surface.
[0041] S102, determining detection light source parameters according to surface brightness information, and adjusting the irradiation light source of the detection station according to the detection light source parameters.
[0042] Among them, the detection light source parameters represent the various configuration indicators for controlling the irradiation light source; the irradiation light source refers to the light source equipment used to provide detection lighting; and the detection station represents a fixed position for defect detection.
[0043] The adaptive light source controller performs this step after obtaining the surface brightness information. Specifically, the controller first selects the closest parameter configuration from the preset light source parameter database based on the reflective characteristics of the magnet surface. Then it calculates the optimal light source intensity, projection angle, irradiation range and other parameters. At the same time, the controller sends adjustment instructions to the irradiation light source through the communication interface, and adjusts the various parameters of the light source in real time to ensure that the lighting conditions of the inspection station meet the inspection requirements.
[0044] In some embodiments, the detection light source parameters can be determined and adjusted according to the surface brightness information in a variety of ways. Optionally, a deep learning-assisted parameter optimization scheme is adopted: establish a lighting effect database containing magnets with different surface characteristics; train a deep neural network model to learn the mapping relationship between surface characteristics and optimal lighting parameters; input the surface brightness information collected in real time to predict the initial light source parameter configuration; optimize the light source parameter prediction model through the back propagation algorithm; send the optimized parameters to the light source controller through the high-speed communication interface. Optionally, an adaptive iterative parameter adjustment scheme is adopted: construct a light source parameter adjustment rule base based on the expert system; analyze the surface brightness distribution characteristics in real time and calculate the brightness index of the key area; select the appropriate parameter adjustment strategy according to the rule base; gradually optimize the light source parameter configuration through the gradient descent algorithm; establish a parameter adjustment effect evaluation mechanism and dynamically update the adjustment strategy.
[0045] S103, when the magnet to be tested arrives at the testing station, a surface image of the magnet to be tested is collected, and a grayscale feature value of the surface image is calculated in real time.
[0046] The surface image represents a high-definition detection image of the surface of the magnet to be tested; and the grayscale eigenvalue refers to a quantitative index of the brightness and darkness of the image.
[0047] The adaptive light source controller triggers this step when it senses that the magnet has reached the detection station. Specifically, the controller starts the high-speed camera to capture a detailed image of the magnet surface, uses image preprocessing technology to eliminate noise and distortion, and calculates the image's average grayscale value, grayscale distribution histogram and other feature parameters. The controller also analyzes the image by region, obtains the grayscale feature differences in different regions, and establishes a complete grayscale feature description.
[0048] In some embodiments, magnet surface image acquisition and grayscale feature value calculation can be achieved in a variety of ways. Optionally, a multi-scale image analysis scheme is adopted: using a high-resolution camera array to acquire local detail images of the magnet surface; constructing an image pyramid structure to achieve feature extraction at different scales; calculating the grayscale statistical features of each scale level, including mean, variance, skewness, etc.; fusing multi-scale features to generate a global grayscale feature description; establishing a real-time feature update mechanism to dynamically track grayscale changes. Optionally, a regional adaptive analysis scheme is adopted: dividing the magnet surface into multiple regions of interest (ROIs); independently calculating local grayscale features for each ROI; establishing a regional weight model to highlight the feature contribution of key areas; achieving parallel processing of feature calculations to improve computational efficiency; dynamically adjusting the ROI division strategy to adapt to different types of magnets; it is understandable that other methods can also be used to achieve image acquisition and feature calculation, such as deep learning feature extraction, statistical learning, etc., which are not limited here.
[0049] S104. When the numerical deviation between the grayscale characteristic value and the preset grayscale target exceeds a preset deviation threshold, fine-tune the detection light source parameters according to the numerical deviation to determine the target light source parameters.
[0050] The preset grayscale target represents the optimal grayscale level of the image that is expected to be obtained; the numerical deviation refers to the difference between the actual grayscale value and the target value; and the preset deviation threshold represents the maximum acceptable error range.
[0051] The adaptive light source controller executes this step when it detects that the grayscale eigenvalue exceeds the expected range. Specifically, the controller compares the calculated grayscale eigenvalue with the preset target value. When the difference exceeds the allowable range, it analyzes the direction and size of the deviation and calculates the optimal adjustment amount based on historical adjustment experience. The controller gradually adjusts the light source parameters through algorithms such as gradient descent until the grayscale eigenvalue converges to the target range.
[0052] In some embodiments, grayscale eigenvalue deviation analysis and light source parameter fine-tuning can be achieved in a variety of ways. Optionally, an adaptive PID control solution is adopted: establish a PID control model for grayscale deviation; dynamically adjust PID parameters according to the deviation size; calculate the control output in real time to generate the light source parameter adjustment amount; monitor the system response characteristics and optimize the control strategy; establish an anti-oscillation mechanism for parameter adjustment. Optionally, a fuzzy control solution is adopted: design a fuzzy rule library for grayscale deviation; perform fuzzy reasoning calculations to determine the adjustment direction and amplitude; achieve smooth transition of continuous parameter adjustment; dynamically update fuzzy rules to improve control accuracy; and finally establish an AI evaluation mechanism for control effect.
[0053] S105 , controlling the illumination light source of the detection station to illuminate with the target light source parameters, and acquiring the surface image of the magnet to be detected again as the target image.
[0054] Among them, the target light source parameters represent the final lighting parameters after optimization; the target image refers to the detection image obtained under the optimal lighting conditions.
[0055] The adaptive light source controller performs this step after determining the target light source parameters. Specifically, the controller first applies the finalized light source parameters to the illumination light source, ensures that the lighting conditions are stable, and then triggers the camera to perform a new round of image acquisition. The controller evaluates the quality of the new image collected, and after confirming that it meets the detection requirements, it marks it as the target image and temporarily stores it for subsequent analysis.
[0056] S106: Input the target image into the AI detection model to obtain defect detection results.
[0057] Among them, the AI detection model refers to the deep learning model used for defect identification; the defect detection result refers to the evaluation conclusion of the surface quality of the magnet.
[0058] The adaptive light source controller performs this step after obtaining a qualified target image. Specifically, the controller first standardizes the target image to ensure that it meets the input requirements of the AI model. The processed image data is then input into a pre-trained deep learning model, which extracts and analyzes multiple layers of features to output detailed information such as the type, location, and severity of the defect, forming a complete inspection report.
[0059] It should be noted that the AI detection model in this application inputs a large number of magnet surface images with labeled defect locations and types during training. The images collected under different lighting conditions are used as training samples, and the model learns defect features through deep learning methods. The training standard is to minimize the false detection rate and missed detection rate of defect detection. The AI detection model is an image segmentation and defect recognition network based on deep learning, which includes multiple functional modules such as feature extraction, region segmentation and defect classification. By inputting the target image after lighting optimization, the AI detection model can output the detection results such as the location, type, severity, etc. of the defect, and calculate the credibility index of the detection result. When the credibility is low, the model parameters are adaptively adjusted.
[0060] In the above embodiment, the adaptive light source controller realizes accurate defect detection through real-time illumination optimization. In practical applications, the method can also provide data support for production process optimization and ensure process quality by analyzing the correlation between defect characteristics and process parameters.
[0061] The following is a supplement to the scenario of this embodiment.
[0062] The detection system equipped with an adaptive light source controller has accumulated detection data of different types of magnets during long-term operation and established a complete product feature library. When the newly developed double-layer composite coated magnet is put into production, the system can build a new illumination parameter model based on existing experience. At the same time, by analyzing the correlation between defect detection results and process parameters, the system automatically generates optimization suggestions. For example, when it is found that the surface microcracks of a batch of magnets are correlated with the electroplating temperature, the system will recommend adjusting the process parameter range.
[0063] After combining the above scenarios, the following is a more detailed description of the process of the method provided by this implementation. Figure 2 , which is another flow chart of the control method of the magnet surface defect detection equipment optimized for AI in an embodiment of the present application.
[0064] S201. Determine the surface brightness information of the magnet to be measured on the conveying platform according to the conveying monitoring image.
[0065] Referring to step S101 , the adaptive light source controller determines the surface brightness information of the magnet to be tested.
[0066] In some embodiments, the adaptive light source controller collects surface reference images of reference magnets of different coating types, and determines the grayscale feature distribution corresponding to each coating type; then clusters each coating type according to the grayscale feature distribution to obtain multiple coating feature categories; the adaptive light source controller establishes a mapping relationship model between illumination parameters and grayscale feature values based on the coating feature categories; finally, based on the mapping relationship model, determines the optimal illumination parameters and preset grayscale targets corresponding to each coating feature category.
[0067] Among them, the reference magnet refers to a sample magnet with standard characteristics; the surface reference image refers to the magnet surface image collected under standard conditions; the coating type is used to represent different surface treatment processes; the grayscale feature distribution represents the statistical characteristics of the image brightness; the coating feature category refers to the coating group with similar optical properties; the mapping relationship model is used to represent the correspondence between illumination parameters and imaging effects.
[0068] The adaptive light source controller performs this process during the system initialization phase. Specifically, the controller first collects images of standard samples of different coating processes and analyzes the grayscale distribution characteristics of each coating through image processing algorithms. Then, a clustering algorithm is used to classify similar coating types and establish a correlation model between coating characteristics and lighting effects. Based on this model, the controller determines the most suitable lighting parameter configuration and expected grayscale target value for each type of coating, providing a parameter benchmark for the subsequent detection process.
[0069] It should be noted that the coating feature mapping relationship model inputs the local surface images and grayscale feature data (grayscale mean, variance) of reference magnets of different coating types under various lighting conditions (angles, intensities) during training, classifies the coating types through grid analysis and clustering algorithms, and establishes the characteristic distribution pattern of each type of coating. The training standard is to optimize the clustering effect of different coating types, minimize the intra-class difference, and maximize the inter-class difference. The coating feature mapping relationship model is a mapping function from coating features to optimal lighting parameters, which includes two core components: a coating classifier and a parameter optimizer. By inputting the surface brightness information of the magnet to be tested, the coating feature mapping relationship model can first determine the coating category to which it belongs, and then output the optimal lighting parameters and expected grayscale target values corresponding to the category.
[0070] In some embodiments, the adaptive light source controller will also collect local surface images of reference magnets with different coating types at multiple preset sampling positions under different lighting angles and light intensities; and grid the local surface images to calculate the grayscale mean and grayscale variance of each grid; finally, based on the grayscale mean and grayscale variance, determine the grayscale feature distribution of the reference magnets with each coating type.
[0071] Among them, the preset sampling position is used to represent the predetermined image acquisition point; the local surface image represents the local detail image of the magnet surface; grid division refers to dividing the image into multiple small areas; the grayscale mean and variance are used to represent the statistical characteristics of the image brightness.
[0072] The adaptive light source controller performs this process when establishing the reference database. Specifically, the controller collects local images of the magnet surface under different lighting conditions by adjusting the angle and intensity of the light source. The collected images are divided into regular grids, and the statistical characteristics of the pixels in each grid are calculated, including the average brightness and the degree of brightness change. By comprehensively analyzing these characteristic data, a complete grayscale feature description of the coating type is established.
[0073] S202, determining detection light source parameters according to surface brightness information, and adjusting the irradiation light source of the detection station according to the detection light source parameters.
[0074] Referring to step S102 , the adaptive light source controller adjusts the illumination light source of the inspection station.
[0075] S203, when the magnet to be tested arrives at the testing station, a surface image of the magnet to be tested is collected, and a grayscale feature value of the surface image is calculated in real time.
[0076] Referring to step S103, the adaptive light source controller determines the grayscale characteristic value.
[0077] S204: When the numerical deviation between the grayscale feature value and the preset grayscale target exceeds a preset deviation threshold, determine the deviation direction and deviation amount of the numerical deviation.
[0078] Among them, the preset grayscale target represents the optimal image grayscale level expected to be obtained; the numerical deviation refers to the difference between the actual value and the target value; the preset deviation threshold is used to indicate the maximum acceptable error range; the deviation direction indicates the relative relationship between the actual value and the target value; the deviation amount refers to the specific numerical size of the actual deviation from the target value.
[0079] The adaptive light source controller performs this step after obtaining the new grayscale eigenvalue. Specifically, the controller first compares the grayscale eigenvalue calculated in real time with the preset target value. When the difference exceeds the threshold set by the system, the controller analyzes whether the grayscale eigenvalue is higher or lower than the target value, determines the positive and negative direction of the deviation, and calculates the specific deviation value to provide a basis for subsequent parameter adjustment.
[0080] S205: Determine an initial adjustment step length according to the deviation direction, deviation amount and historical adjustment records of the detection light source parameters.
[0081] Among them, the historical adjustment record is used to represent the effect data of the past light source parameter adjustment; the initial adjustment step refers to the change in the first parameter adjustment; and the light source parameter represents the various configuration values for controlling the lighting.
[0082] The adaptive light source controller performs this step after determining the deviation characteristics. Specifically, the controller first analyzes the adjustment effects under similar deviation conditions in the historical adjustment records, and evaluates the sensitivity of the adjustment based on the direction and size of the current deviation. Then, based on historical experience, the controller calculates an initial step value that can both ensure adjustment efficiency and avoid over-adjustment. This step value meets the system response characteristics and stability requirements.
[0083] S206, adjusting the illumination light source of the detection station with the initial adjustment step length, and calculating the numerical correction value of the adjusted numerical deviation.
[0084] The numerical correction value is used to indicate the degree of change of the deviation after adjustment.
[0085] The adaptive light source controller performs this step after determining the initial adjustment step. Specifically, the controller first calculates the new light source parameter value according to the initial adjustment step, and sends an adjustment instruction to the irradiation light source through the communication interface. After the light source parameter adjustment is completed, the controller re-captures the image and calculates the grayscale feature value, compares the new grayscale feature value with the preset target value, calculates the deviation change after adjustment, and evaluates the adjustment effect.
[0086] S207: When the numerical correction value is greater than the preset fluctuation threshold, adjust the initial adjustment step length to the correction step length.
[0087] The preset fluctuation threshold refers to the maximum allowed fluctuation range; the revised step size is used to represent the adjusted new step size value.
[0088] The adaptive light source controller performs this step after obtaining the numerical correction value. Specifically, the controller first compares the calculated numerical correction value with the fluctuation threshold preset by the system. When the correction value exceeds the threshold, it indicates that the current adjustment step may not be appropriate. The controller then calculates a new adjustment step based on the correction value and the system response characteristics to ensure that subsequent adjustments are more accurate and stable.
[0089] S208 , performing parameter adjustment with a correction step size until the numerical deviation is less than a preset deviation threshold, and determining the final light source parameters as target light source parameters.
[0090] The adaptive light source controller performs this step after determining the correction step size. Specifically, the controller uses the corrected step size value to continuously adjust the light source parameters, and recalculates the deviation between the grayscale feature value and the target value after each adjustment. Through multiple rounds of iterative adjustments, until the deviation value is reduced to within the preset threshold, the controller records the current light source parameters as the final target parameters, completing the parameter optimization process.
[0091] S209, controlling the illumination light source of the detection station to illuminate with the target light source parameters, and acquiring the surface image of the magnet to be detected again as the target image.
[0092] Referring to step S105 , the adaptive light source controller acquires a target image.
[0093] S210: Input the target image into the AI detection model to obtain defect detection results.
[0094] Referring to step S106 , the adaptive light source controller generates a defect detection result.
[0095] In some embodiments, the adaptive light source controller determines the workstation light source parameters and magnet image features corresponding to the defect detection results; then determines the credibility index of the defect detection results based on the workstation light source parameters and magnet image features; when the credibility index is lower than a preset credibility threshold, adjusts the model parameters of the AI detection model.
[0096] Among them, the magnetic image feature refers to the image characteristics of the magnet to be detected; the credibility index is used to indicate the reliability of the detection result; the preset credibility threshold represents the minimum acceptable credibility level; and the model parameter refers to the configuration parameters of the AI detection model.
[0097] The adaptive light source controller performs this process after obtaining the AI detection results. Specifically, the controller first records the lighting conditions and image features when the detection results are generated, and calculates the credibility score of the detection results based on these data. When the credibility is lower than the threshold set by the system, the controller will analyze the possible reasons and adjust the internal parameters of the AI model accordingly to improve the accuracy of subsequent detections.
[0098] S211. Perform feature extraction on the defect detection result to obtain a defect feature vector.
[0099] Among them, the defect detection result represents the detection information output by the AI model; feature extraction refers to the process of obtaining key feature information from the detection results; and the defect feature vector is used to represent the mathematical description of the defect.
[0100] The adaptive light source controller performs this step after obtaining the AI detection results. Specifically, the controller conducts in-depth analysis of the detection results and extracts multi-dimensional feature information such as the location, size, shape, and depth of the defects. These feature data are then standardized and mathematically modeled to construct a feature vector containing complete defect information, providing data support for subsequent process optimization.
[0101] S212. Generate process optimization suggestions based on the defect feature vector and corresponding process parameters.
[0102] Among them, the defect feature vector refers to the mathematical expression of the defect characteristics; the process parameters represent the various control parameters of the production process; and the process optimization suggestion is used to represent the specific plan to improve the production process.
[0103] The adaptive light source controller performs this step after obtaining the defect feature vector. Specifically, the controller first analyzes the correspondence between the defect feature vector and the current process parameters, and evaluates the potential process causes of the defects by combining historical data and expert experience. Then, based on the evaluation results, the controller generates targeted process parameter adjustment suggestions, including detailed information such as the specific adjustment direction, adjustment amount, and expected effect.
[0104] It should be noted that the analysis of the correspondence between the above-mentioned defect feature vector and the current process parameters can use a process optimization model. During the training of the process optimization model, the defect feature vector and the corresponding process parameter records in the historical detection data are input, and the association model between the defect features and the process parameters is established through data mining. The training standard is to maximize the correlation and prediction accuracy between the features and parameters. The process optimization model is a multivariate association analysis model that can identify the causal relationship between defect features and process parameters. By inputting the currently detected defect feature vector, the process optimization model can analyze its correlation with the process parameters and output targeted process parameter optimization suggestions to guide production process improvements.
[0105] In some embodiments, the adaptive light source controller will also count the changing trends of the defect feature vector in the time dimension, and establish a time-series evolution model of the defect feature based on the changing trends; based on the time-series evolution model, combined with the process parameter adjustment amount in the process optimization suggestion, determine the degree of defect improvement; prioritize the process parameter adjustment plans according to the degree of defect improvement, and generate a graded implementation plan including adjustment steps and target parameters.
[0106] Among them, the change trend refers to the development law of defect characteristics in a continuous time period; the time series evolution model is a mathematical model used to represent the change of defect characteristics over time; the defect improvement degree refers to the defect reduction effect expected to be achieved through parameter adjustment.
[0107] The adaptive light source controller executes this process after completing defect detection and generating preliminary optimization suggestions. Specifically, the controller first collects defect feature vector data at multiple consecutive time points, extracts defect development trend characteristics through time series analysis methods, and establishes a mathematical model that describes the law of defect evolution. Then, the controller inputs the parameter adjustment plan in the process optimization suggestion into the model, predicts the defect status after adjustment, and calculates the improvement effect. Based on the quantitative indicators of the improvement effect, the controller prioritizes the adjustment plans of different parameters and forms a hierarchical implementation plan including specific execution steps, target parameter values, and time nodes.
[0108] Among them, the hierarchical implementation plan refers to a systematic plan that divides the process parameter optimization measures into different priorities and formulates corresponding implementation plans according to the expected effect of defect improvement, implementation difficulty and production impact. The plan contains three core levels: the first level is emergency optimization items, which are aimed at parameter adjustments with significant expected improvement effects (defect improvement rate>50%) and low implementation difficulty, such as light angle fine-tuning, detection position compensation, etc., and are required to be implemented within 24 hours; the second level is important optimization items, which are aimed at parameter adjustments with medium expected improvement effects (defect improvement rate 20%-50%) or medium implementation difficulty, such as temperature control range adjustment, current density optimization, etc., and are planned to be implemented step by step within a week; the third level is conventional optimization items, including parameter adjustments with small expected improvement effects (defect improvement rate <20%) or requiring major process changes, such as process route optimization, equipment upgrade, etc., which are arranged to be implemented step by step in the monthly maintenance plan. The specific implementation plan for each level includes the following elements: the specific numerical range and adjustment step of the target parameter; the time node and verification method for step-by-step implementation; possible risk points and response plans; effect evaluation standards and feedback mechanisms; and cooperation matters of relevant departments. This hierarchical implementation approach ensures both the controllability of the optimization process and maximizes resource utilization efficiency.
[0109] It should be noted that when training the time series evolution model, a large amount of defect feature vector sequences (including defect type, location, area, depth and other features) and corresponding process parameter records (such as coating temperature, time, current density, etc.) in historical inspection data are input, and the evolution data of these defects at different time points (such as crack growth rate, corrosion depth growth, etc.) are combined to establish the change law of defect features in the time dimension through deep learning methods. The training standard is to minimize the prediction error and maximize the trend prediction accuracy. The time series evolution model is essentially a sequence prediction model based on LSTM (Long Short-Term Memory Network), which includes three core modules: feature extraction, time series dependency analysis and multi-step prediction, and can capture the nonlinear characteristics and long-term dependencies of defect development. When in use, the model receives the currently detected defect feature vector and the process parameters to be adjusted as input, predicts the defect state evolution trend at multiple time points in the future through the trained network structure, and outputs the prediction results containing the defect feature prediction value and the development trend confidence, which are used to guide the formulation and priority sorting of process parameter optimization schemes.
[0110] In the embodiments of the present application, due to the use of an adaptive light source control mechanism based on real-time image analysis, combined with a multi-level parameter optimization strategy and AI detection model dynamic adjustment technology, it is possible to automatically optimize lighting parameters for magnets with different coating types, achieve accurate defect detection, and effectively solve the problem that traditional fixed light source systems are difficult to adapt to the detection of magnets with different surface characteristics, thereby achieving a significant improvement in detection accuracy and an improvement in detection efficiency.
[0111] The following describes the adaptive light source controller in the embodiment of the present invention from the perspective of hardware processing. Figure 3 , is a schematic diagram of a physical device structure of an adaptive light source controller in an embodiment of the present application.
[0112] It should be noted that Figure 3 The structure of the adaptive light source controller shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0113] like Figure 3As shown, the adaptive light source controller includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0114] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0115] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are performed.
[0116] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.
[0118] Specifically, the adaptive light source controller of this embodiment includes a processor and a memory, and a computer program is stored in the memory. When the computer program is executed by the processor, the control method of the magnet surface defect detection equipment optimized for AI provided in the above embodiment is implemented.
[0119] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the adaptive light source controller described in the above embodiment; or may exist independently without being assembled into the adaptive light source controller. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the adaptive light source controller, the adaptive light source controller implements the control method for the magnet surface defect detection device optimized for AI provided in the above embodiment.
[0120] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0121] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0122] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A control method for a magnet surface defect detection device optimized for AI, characterized in that: Applied to an adaptive light source controller, the method comprises: According to the conveying monitoring image, the surface brightness information of the magnet to be measured on the conveying platform is determined; Determine detection light source parameters according to the surface brightness information, and adjust the illumination light source of the detection station according to the detection light source parameters; When the magnet to be tested arrives at the detection station, a surface image of the magnet to be tested is collected, and a grayscale feature value of the surface image is calculated in real time; When the numerical deviation between the grayscale characteristic value and the preset grayscale target exceeds a preset deviation threshold, fine-tuning the detection light source parameter according to the numerical deviation to determine the target light source parameter; Controlling the illumination light source of the detection station to illuminate with the target light source parameters, and acquiring the surface image of the magnet to be detected again as the target image; The target image is input into the AI detection model to obtain the defect detection result.
2. The method according to claim 1, characterized in that When the numerical deviation between the grayscale characteristic value and the preset grayscale target exceeds a preset deviation threshold, the step of fine-tuning the detection light source parameter according to the numerical deviation to determine the target light source parameter specifically includes: When the numerical deviation between the grayscale characteristic value and the preset grayscale target exceeds a preset deviation threshold, determining the deviation direction and deviation amount of the numerical deviation; Determining an initial adjustment step length according to the deviation direction, the deviation amount and the historical adjustment record of the detection light source parameter; Adjusting the illumination light source of the detection station with the initial adjustment step length, and calculating a numerical correction value of the adjusted numerical deviation; When the numerical correction value is greater than a preset fluctuation threshold, adjusting the initial adjustment step length to a correction step length; Parameter adjustment is performed with the correction step size until the numerical deviation is less than the preset deviation threshold, and the final light source parameters are determined as target light source parameters.
3. The method according to claim 1, characterized in that Before the step of determining the surface brightness information of the magnet to be measured on the conveying platform according to the conveying monitoring image, the method further includes: Collecting surface reference images of reference magnets of different coating types, and determining the grayscale feature distribution corresponding to each coating type; Clustering each coating type according to the grayscale feature distribution to obtain a plurality of coating feature categories; Based on the coating feature category, a mapping relationship model between illumination parameters and grayscale feature values is established; Based on the mapping relationship model, the optimal illumination parameters and preset grayscale targets corresponding to each coating feature category are determined.
4. The method according to claim 3, characterized in that The step of acquiring the surface reference images of reference magnets of different coating types and determining the grayscale feature distribution corresponding to each coating type specifically includes: Under different illumination angles and illumination intensities, local surface images of reference magnets with different coating types are collected at multiple preset sampling positions; Dividing the local surface image into grids, and calculating the grayscale mean and grayscale variance of each grid; Based on the grayscale mean and the grayscale variance, the grayscale characteristic distribution of the reference magnet of each coating type is determined.
5. The method according to claim 1, characterized in that: After the step of inputting the target image into the AI detection model to obtain the defect detection result, the method further includes: Determining the station light source parameters and magnet image features corresponding to the defect detection result; Determining a credibility index of the defect detection result according to the station light source parameters and the magnet image features; When the credibility index is lower than a preset credibility threshold, the model parameters of the AI detection model are adjusted.
6. The method according to claim 1, characterized in that After the step of inputting the target image into the AI detection model to obtain the defect detection result, the method further includes: Performing feature extraction on the defect detection result to obtain a defect feature vector; A process optimization suggestion is generated based on the defect feature vector and the corresponding process parameters.
7. The method according to claim 6, characterized in that After the step of generating a process optimization suggestion according to the defect feature vector and the corresponding process parameters, the method further includes: Counting the variation trend of the defect feature vector in the time dimension, and establishing a time series evolution model of the defect feature based on the variation trend; Determine the degree of defect improvement based on the timing evolution model and in combination with the process parameter adjustment amount in the process optimization suggestion; The process parameter adjustment schemes are prioritized according to the defect improvement degree, and a hierarchical implementation plan including adjustment steps and target parameters is generated.
8. An adaptive light source controller, characterized in that: The adaptive light source controller comprises: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions so that the adaptive light source controller executes the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on an adaptive light source controller, the adaptive light source controller is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product runs on an adaptive light source controller, the adaptive light source controller is enabled to perform the method according to any one of claims 1 to 7.
Citation Information
Cited By
UV light source accurate regulation and control method for wafer defect detection and related equipment
CN119946949A
UV light source precise control method and related equipment for wafer defect detection
CN119946949B
Door and window surface tiny flaw detection method and device, electronic equipment and storage medium
CN120070831A
Method and device for detecting surface smoothness of optical lens
CN120084761A
Method and apparatus for detecting surface finish of optical lens
CN120084761B