Machine vision-based cleaning quality control method and system

CN122989593APending Publication Date: 2026-10-27SHENZHEN FUYANG TECH GRP CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202611124523.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

第一,清洗后工件表面状态的变化给视觉检测带来了固有困难

Benefits of technology

采用紫外荧光先验引导的可见光图像局部增强技术,在图像配准的同时,利用紫外荧光信号的空间分布信息,对可见光图像中对应区域的局部对比度进行自适应增强,使得在可见光下与基底对比度极低的透明残留物轮廓在融合后的双通道图像中得到显著增强,为后续语义分割网络提供了更高质量的特征输入。这一步骤同时实现了“空间位置对齐”和“微弱信号增强”两个技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989593A_ABST
    Figure CN122989593A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on machine vision's cleaning quality control method and system, method includes: the visible light band image and ultraviolet band image of workpiece surface after cleaning are synchronously collected;With ultraviolet fluorescence priori guide visible light image local enhancement after generation dual-channel image;Dual-channel image is input semantic segmentation network, and the segmentation mask that distinguishes base area, granular residual area and film-like residual area is directly output;Based on the area ratio of mask extraction, utilize pre-calibrated fluorescence gray-film thickness mapping relationship to convert ultraviolet gray value into film thickness estimation value and normalize to obtain residual concentration index;According to the ratio of two kinds of residual area ratio, dynamically adjust weighted weight, calculate cleanliness comprehensive score;When score is lower than qualified threshold, based on area ratio value determines residual dominant type, selects different adjustment strategy from preset strategy library to realize closed-loop control.The present application realizes the high sensitivity identification of transparent residue, the fine distinction of residual type and the self-adaptive optimization of cleaning process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically, to a cleaning quality control method and system based on machine vision. Background Technology

[0002] In the field of industrial cleaning, especially in industries with strict cleanliness requirements such as precision hardware, semiconductor electronics, optoelectronics, and medical and biological devices, ultrasonic cleaning equipment has been widely used. As the manufacturing industry continues to demand higher surface quality from products, effectively determining whether the cleaning process is "clean" has become a key focus of the industry.

[0003] In recent years, some technical solutions have attempted to introduce machine vision into the cleaning quality inspection process. For example, patent CN105231468A discloses an automated ultrasonic cleaning machine and its working method based on image processing, which judges the cleanliness of the workpiece surface through image acquisition and processing. Patent CN114589143A discloses an automated cleaning and inspection device and method for engine connecting rods, which uses machine vision to quickly inspect the surface quality of the inner surfaces of the large and small end through holes of the engine connecting rods, thereby simplifying the cleaning and inspection process. Patent CN115409836B discloses a metal workpiece inspection and cleaning control method and system based on image processing, which determines the cleaning time parameters and cleaning method parameters of each workpiece unit by acquiring metal workpiece image data and using a cleaning decision model, thus assisting in cleaning control through image data analysis. Patent CN121837113A discloses a visual inspection method for the cleanliness of workpieces cleaned in a hydrocarbon vacuum cleaner, used to detect the cleanliness of the cleaned workpieces. Patent CN223616366U discloses a visual inspection device for ultrasonic cleaning effects, allowing for effect detection after parts have undergone cleaning within the ultrasonic cleaning device. Patent CN119963514A discloses a method for detecting the cleaning quality of a supercavitating high-pressure water jet cleaner based on visual technology, judging cleaning quality by analyzing cleaning quality evaluation indicators for corresponding sub-regions of each specified object. Patent CN114119535A discloses an online monitoring method for laser cleaning effects based on visual inspection, used for online monitoring of laser cleaning effects. Patent CN121423290A discloses a visual inspection and adaptive cleaning method for pearl shell fouling, performing adaptive cleaning based on visual inspection results.

[0004] However, a comprehensive analysis of the existing technologies reveals that current visual cleaning and inspection solutions mostly operate on two models: one involves pre-inspecting the workpiece before cleaning and selecting cleaning parameters based on the initial level of dirt; the other involves judging the cleaning effect after cleaning, classifying the workpiece into "qualified" and "unqualified" categories. Both models essentially belong to a one-way open-loop "inspection-judgment" structure. In practical production applications, this technical approach exposes the following problems: First, the changes in the surface condition of workpieces after cleaning introduce inherent difficulties for visual inspection. The smoother surface of metal parts after cleaning makes the mirror-like reflections prone to causing localized overexposure or heavy shadows in the image, directly interfering with subsequent defect identification. Even more challenging is the fact that transparent or semi-transparent residual films—such as oil films, water stains, and residual solvent films—have extremely low contrast with the substrate material under ordinary visible light imaging, making it difficult for conventional machine vision systems to reliably identify them. Furthermore, industrial cleaning deals with residues of diverse forms and sizes, ranging from large areas of oil film to micron-sized particles, from regular blocky oxide scale to irregular water stains. Traditional image processing algorithms based on fixed rules often fall short in identifying these complex defects, and each time the type of workpiece changes, the algorithm needs to be re-adjusted, resulting in long development cycles and difficulty adapting to the flexible production needs of "multiple varieties, small batches."

[0005] Second, existing solutions generally lack a refined quantitative evaluation of cleaning quality. Most technologies only make a qualitative judgment of whether or not residues are present, without distinguishing or quantifying the type of residue (particulate, film-like, etc.), its area proportion, concentration, etc. When the workpiece is in a critical clean state, this either-or judgment method is prone to misjudgment—either judging an acceptable workpiece as unqualified and requiring rework, or releasing a workpiece with potential problems to the subsequent process.

[0006] Third, and most importantly, the existing solutions fail to form a closed loop from detection to process control. Even if quality problems are detected during the detection phase, it is impossible to automatically and specifically adjust cleaning process parameters, such as spray pressure, cleaning fluid temperature, ultrasonic power, or workpiece posture, based on specific defect characteristics—for example, whether the defect is particulate or film-like residue, whether it is a global problem or localized under-cleaning. Operators still need to rely on experience for manual adjustments, resulting in long process optimization cycles and poor consistency.

[0007] In summary, existing cleaning quality control technologies generally fail to effectively integrate the "detection" and "regulation" stages. The industry urgently needs a complete technical solution capable of achieving both online quantitative evaluation and adaptive closed-loop control of cleaning parameters. This solution must be able to achieve highly sensitive identification and classification of minute residues under conditions where the workpiece surface is reflective after cleaning and transparent residues are difficult to image, and it must also be able to automatically adjust cleaning process parameters based on quantitative detection results. This would upgrade the cleaning process from a one-way "detection-judgment" model to a closed-loop quality control model of "detection-analysis-regulation." Summary of the Invention

[0008] The present invention aims to solve the above-mentioned problems existing in the prior art and provide a cleaning quality control method and system based on machine vision to realize online, quantitative and closed-loop control of cleaning quality.

[0009] To achieve the above objectives, the present invention provides the following technical solution: A machine vision-based cleaning quality control method includes the following steps: During the intervals between cleaning processes or after cleaning, images of the surface of the cleaned workpiece are acquired using an imaging device, simultaneously obtaining visible light and ultraviolet light images; wherein, the ultraviolet light image is acquired by irradiating the surface of the cleaned workpiece with an ultraviolet light source to excite transparent or translucent residues to generate fluorescence signals. The visible light band image and the ultraviolet band image are registered to generate a registered dual-channel image. During the image registration process, the spatial distribution of fluorescence signal in the ultraviolet band image is used as a priori to perform local contrast adaptive enhancement on the visible light band image, so that the outline of the residue with a contrast with the substrate below a first threshold in the visible light band is enhanced in the dual-channel image. The dual-channel image is input into a pre-trained semantic segmentation network model, which performs pixel-level multi-class semantic segmentation on the dual-channel image and directly outputs a segmentation mask that marks the category to which each pixel belongs. The category includes at least the basal region, the granular residual region, and the film-like residual region. Based on the segmentation mask, the area ratio of particulate residue region and the area ratio of film residue region are extracted, and the fluorescence gray value of each residue pixel is extracted from the ultraviolet band image using the segmentation mask as an index. Based on the pre-calibrated nonlinear mapping relationship between fluorescence gray value and residue film thickness, the fluorescence gray value is converted into a film thickness estimate and then normalized to obtain the residue concentration index. After normalizing the area ratio of the particulate residue area, the area ratio of the membrane residue area, and the residue concentration index, the weighting is dynamically adjusted according to the ratio of the area ratio of the particulate residue area and the membrane residue area. The weighted sum is then used to obtain the comprehensive cleanliness score, so that the residue type that has a greater impact on cleanliness receives a higher weight. When the overall cleanliness score is lower than the preset qualified threshold, the dominant type of residue is determined based on the ratio of the area of ​​particulate residue to the area of ​​film residue. Based on the dominant type of residue, a corresponding adjustment strategy is selected from the preset cleaning parameter adjustment strategy library to adjust at least one cleaning process parameter of the next cleaning cycle or subsequent batch.

[0010] Further, the visible light band image and the ultraviolet band image are registered to generate a registered dual-channel image; during the image registration process, the spatial distribution of fluorescence signals in the ultraviolet band image is used as a priori to perform local contrast adaptive enhancement on the visible light band image, specifically including: Multiple corner points on the outer contour of the workpiece in the visible light band image are extracted as a first control point set, and the corresponding corner points on the outer contour of the workpiece in the ultraviolet band image are extracted as a second control point set. Based on the first control point set and the second control point set, the affine transformation matrix from the ultraviolet band image to the visible light band image is calculated, and the affine transformation matrix is ​​used to map the ultraviolet band image to the coordinate system of the visible light band image to achieve spatial geometric registration. In the ultraviolet band image after spatial geometric registration, the pixel region with a gray value higher than the preset fluorescence threshold is determined as the fluorescence prior region. A local enhancement window of a preset size is generated, centered on the spatial location of the fluorescence prior region in the visible light band image. For visible light image pixels within each of the aforementioned local enhancement windows, a contrast-limited adaptive histogram equalization algorithm is used to enhance local contrast. The cropping limit value of the contrast-limited adaptive histogram equalization algorithm is adaptively adjusted according to the average intensity of ultraviolet fluorescence within the window, so that the stronger the ultraviolet fluorescence, the greater the contrast enhancement. The dual-channel image is generated by overlaying the visible light band image with enhanced local contrast and the ultraviolet band image with spatial geometric registration.

[0011] Furthermore, the construction and training process of the semantic segmentation network model includes: A multi-category labeled dataset is constructed. Dual-channel images of cleaned workpieces with different types and degrees of contamination are collected as sample images. A pixel-level labeled mask is made for each sample image. The labeled mask marks each pixel as a base region, a particulate residue region, or a film residue region. A semantic segmentation network structure is constructed, with Unet++ as the backbone network. A channel attention module is introduced at the end of the encoder, and three parallel independent classification heads are set at the end of the decoder to predict the probability that each pixel belongs to the basal region, the granular residual region, or the film residual region, respectively. A transfer learning strategy is adopted to pre-train the encoder part of the semantic segmentation network on a publicly available surface defect image dataset. After obtaining the pre-trained weights, they are loaded into the constructed semantic segmentation network. A combined loss function is used to fine-tune the semantic segmentation network after loading pre-trained weights. The combined loss function is a weighted sum of cross-entropy loss and Dice loss. The Dice loss is calculated separately for granular residual regions and membrane residual regions and then averaged. In the cross-entropy loss, the pixels in the membrane residual region are assigned a first loss weight and the pixels in the granular residual region are assigned a second loss weight. The first loss weight is greater than the second loss weight, so as to force the network to focus on the membrane residual region with blurred boundaries and difficult segmentation.

[0012] Furthermore, the step of converting the fluorescence grayscale value into a film thickness estimate based on a pre-calibrated nonlinear mapping relationship between the fluorescence grayscale value and the residual film thickness, and then normalizing it to obtain the residue concentration index, specifically includes: A set of standard residual film samples with known different thicknesses was prepared, and standard fluorescence images of each standard residual film sample were acquired under the same ultraviolet excitation wavelength and irradiation power as those acquired for workpiece image acquisition. The mean fluorescence grayscale value of the residual film region in each standard fluorescence image was extracted. With film thickness as the independent variable and mean fluorescence grayscale value as the dependent variable, an exponential function model I = I_max × (1 - e^(-k·h)) was used for curve fitting, where I is the mean fluorescence grayscale value, I_max is the saturated fluorescence grayscale value, h is the known film thickness, and k is the absorption coefficient related to the material of the residue. I_max and k were solved by the least squares method to obtain the fluorescence grayscale-film thickness mapping curve. In actual testing, the pixel position marked as the film-like residual area in the segmentation mask is used as an index to read the fluorescence gray value of the corresponding position in the ultraviolet band image; Substitute the fluorescence grayscale value of each residual pixel into the fluorescence grayscale-film thickness mapping curve, and interpolate to obtain the estimated film thickness value corresponding to each pixel. The arithmetic mean of the estimated film thickness values ​​of all film-like residual pixels is calculated, and the arithmetic mean is mapped to the 0-100 range using the Min-Max normalization method to obtain the residual concentration index.

[0013] Further, after normalizing the area proportions of the particulate residue region, the area proportions of the film-like residue region, and the residue concentration index, the weighting is dynamically adjusted based on the ratio of the area proportions of the particulate residue region and the film-like residue region, and the weighted sum is used to obtain the comprehensive cleanliness score, specifically including: The area ratio of the particulate residue region, the area ratio of the film-like residue region, and the residue concentration index are respectively mapped to the 0-100 score range to obtain the particulate score A_p, the film-like score A_f, and the concentration score C; Calculate the area ratio of particulate residue region to film residue region R = A_p_raw / A_f_raw, where A_p_raw is the original value of the area ratio of particulate residue region before normalization, and A_f_raw is the original value of the area ratio of film residue region before normalization. The particulate weight w_p and the membrane weight w_f are dynamically calculated based on the ratio R: w_p = R / (R+ 1) × (1 - w_c), w_f = 1 / (R + 1) × (1 - w_c), where w_c is a preset fixed weight for the concentration score. The overall cleanliness score S is calculated using the formula S = 100 - (w_p × A_p + w_f × A_f + w_c × C).

[0014] Furthermore, when the overall cleanliness score is lower than a preset acceptable threshold, the dominant type of residue is determined based on the ratio of the area ratio of particulate residue to the area ratio of film-like residue. Based on the dominant type of residue, a corresponding adjustment strategy is selected from a preset cleaning parameter adjustment strategy library to adjust at least one cleaning process parameter for the next cleaning cycle or subsequent batches, specifically including: Set the acceptable threshold as S_th. When the overall cleanliness score S < S_th, trigger the quality anomaly adjustment process. Calculate the ratio R of the area of ​​particulate residue to the area of ​​film residue in this test; The ratio R is compared with the preset first threshold T1 and second threshold T2, where T1 < T2: if R ≤ T1, the dominant residue type is determined to be film-like residue; if R ≥ T2, the dominant residue type is determined to be particulate residue; if T1 < R < T2, the dominant residue type is determined to be mixed residue. The cleaning parameter adjustment strategy library is constructed, wherein: the adjustment strategy corresponding to the dominant film residue is to increase the cleaning fluid temperature or extend the soaking time; the adjustment strategy corresponding to the dominant particulate residue is to increase the spray pressure or ultrasonic power; the adjustment strategy corresponding to the mixed residue is to perform the above two adjustment operations simultaneously, but the adjustment range of each parameter is lower than the adjustment range corresponding to the single dominant type. Based on the dominant type of residue, the corresponding adjustment strategy is retrieved from the cleaning parameter adjustment strategy library, a cleaning parameter adjustment instruction is generated, and sent to the programmable logic controller of the cleaning equipment to execute the parameter change for the next cleaning cycle.

[0015] Furthermore, it also includes a step for detecting and adjusting the uniformity of cleaning, which is performed when the overall cleanliness score reaches a preset acceptable threshold: The workpiece surface area corresponding to the dual-channel image is uniformly divided into a grid of M rows × N columns, generating M × N local sub-regions with the same shape; Based on the segmentation mask, the total number of pixels marked as granular residual regions and film-like residual regions in each local sub-region is counted, and the residual area ratio of each local sub-region is calculated. Calculate the global standard deviation of the area ratio of residue in all local sub-regions, and use it as the quantitative index U of cleaning uniformity; When the cleaning uniformity quantification index U exceeds the preset uniformity threshold U_th, it is determined that there is regional under-cleaning. A flipping operation command for the workpiece or an angle adjustment command for the nozzle is generated and output to the cleaning equipment to improve the cleaning uniformity of the next cleaning cycle.

[0016] Furthermore, it also includes a pre-recommendation step for cleaning parameters based on historical data, which is performed before a new batch of workpieces first enters the cleaning process: Establish a historical batch process database, collect and store data records of completed cleaning batches. Each data record includes the initial contamination state characteristics of the workpiece, the actual combination of cleaning parameters used, and the comprehensive cleanliness score obtained after processing by the method described above. The initial contamination state characteristics and the cleaning parameters are combined to form a feature vector. The comprehensive cleanliness score is used as the regression prediction target to train a gradient boosting tree regression model. The hyperparameter combination of the gradient boosting tree regression model is automatically searched and optimized using the Hyperopt Bayesian optimization framework, with the optimization objective being the minimization of the root mean square error of five-fold cross-validation. Before a new batch of workpieces enters the cleaning process, the initial contamination state characteristics of the batch of workpieces are obtained. Using the initial contamination state characteristics as a fixed input, within the preset range of cleaning parameter values, the trained gradient boosting tree regression model is used to search for the optimal cleaning parameter combination that maximizes the predicted value of the comprehensive cleanliness score. The optimal combination of cleaning parameters is used as the recommended initial cleaning parameter setting value for the current batch and written into the process parameter register of the cleaning equipment.

[0017] Furthermore, the step of acquiring images of the surface of the workpiece being cleaned using an imaging device, simultaneously obtaining visible light and ultraviolet light images, specifically includes: A beam splitter is set in the imaging device. The beam splitter is used to split the light beam from the same acquisition optical path from the surface of the workpiece being cleaned into a transmitted visible light beam and a reflected ultraviolet light beam. The visible light beam is guided to a visible light camera for imaging, and the ultraviolet light beam is guided to an ultraviolet camera for imaging. The two cameras are synchronously exposed under the control of the same trigger signal to eliminate the inter-frame deviation of the image caused by workpiece vibration or transmission motion. The emission wavelength of the ultraviolet excitation source is matched with the fluorescence excitation peak wavelength of common organic residues on the surface of the workpiece being cleaned.

[0018] A machine vision-based cleaning quality control system, used to implement the machine vision-based cleaning quality control method described in any one of the above embodiments, comprising: The synchronous imaging subsystem includes a beam splitter, a visible light camera, an ultraviolet camera, a visible light ring light source, an ultraviolet excitation light source, a polarization filter assembly, and a light controller. The beam splitter divides the same light acquisition path from the workpiece surface into a visible light path and an ultraviolet light path. The visible light camera and the ultraviolet camera perform synchronous exposure imaging of the same field of view under the same trigger signal. The image enhancement and registration module is used to perform local contrast adaptive enhancement on the visible light band image based on the spatial distribution of fluorescence signals in the ultraviolet band image as a priori, and to perform geometric registration between the enhanced visible light band image and the ultraviolet band image to generate a dual-channel image. The semantic segmentation inference module embeds a trained semantic segmentation network model, which is used to perform pixel-level multi-class semantic segmentation on the dual-channel image and directly outputs segmentation masks that label the base region, granular residual region and membrane residual region. The physical quantification and scoring module includes a fluorescence grayscale-film thickness mapping model, which is used to convert the ultraviolet fluorescence grayscale value into the estimated film thickness value based on the segmented mask, calculate the residue concentration index, and calculate the comprehensive cleanliness score after dynamically adjusting the weighting weight according to the ratio of the area ratio of particulate residue area to film residue area. The defect attribution and control module is used to determine the dominant type of residue based on the ratio of the area ratio of particulate residue area to the area ratio of film residue area, and select the corresponding adjustment strategy from the preset cleaning parameter adjustment strategy library to generate cleaning process parameter adjustment instructions and send them to the programmable logic controller of the cleaning equipment for execution.

[0019] Beneficial effects Compared with the prior art, the present invention has the following beneficial effects: A visible light image local enhancement technique guided by ultraviolet fluorescence prior is employed. Simultaneously with image registration, the spatial distribution information of the ultraviolet fluorescence signal is used to adaptively enhance the local contrast of corresponding regions in the visible light image. This significantly enhances the outline of transparent residues, which exhibit extremely low contrast with the substrate under visible light, in the fused dual-channel image, providing higher-quality feature input for subsequent semantic segmentation networks. This step simultaneously achieves the effects of both "spatial alignment" and "weak signal enhancement."

[0020] A multi-class semantic segmentation network is constructed, directly outputting pixel-level classification masks containing basal regions, granular residue regions, and membrane residue regions. This integrates the traditional sequential steps of "binary segmentation followed by rule-based type determination" into an end-to-end parallel inference process. Through the design of a channel attention mechanism and a combined loss function, the network can adaptively focus on weak signals in the ultraviolet fluorescence channel and prioritize learning for membrane residue regions with blurred boundaries, significantly improving the segmentation accuracy of multi-class residues.

[0021] A physical model-based film thickness estimation method is introduced. By using a pre-calibrated fluorescence grayscale-film thickness nonlinear mapping curve, ultraviolet fluorescence grayscale values ​​are converted into physically meaningful film thickness estimates, which are then used to calculate the residue concentration index. Compared to directly using the original fluorescence grayscale values, the film thickness estimates more accurately reflect the actual contamination level of transparent or semi-transparent film-like residues, significantly improving the alignment between cleanliness scores and the actual physical state.

[0022] A dynamic weighted scoring mechanism based on the proportion of residue types is proposed. This mechanism adaptively adjusts the weighting factors of particulate and film-like residues in the overall cleanliness score according to the area ratio of these two types of residues, giving higher scoring sensitivity to the currently dominant residue type that has a greater impact on the final cleanliness. This dynamic weighting strategy makes the scoring results highly adaptable to changes in contamination types between batches.

[0023] A complete closed-loop control chain was constructed, encompassing multispectral image acquisition, semantic segmentation, physical quantization, dynamic scoring, defect attribution, and adaptive adjustment of process parameters. Based on the scoring results and residue type determination, differentiated adjustment strategies were automatically selected from a pre-set strategy library, enabling online full inspection, accurate grading, and closed-loop optimization of process parameters for cleaning quality. This significantly reduced the need for manual intervention and rework rates. Attached Figure Description

[0024] Figure 1 This is a schematic flowchart of the cleaning quality control method based on machine vision in Embodiment 1 of the present invention. Detailed Implementation

[0025] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0026] Reference Figure 1 A machine vision-based cleaning quality control method includes: acquiring images of the surface of the workpiece being cleaned using an imaging device during cleaning process intervals or after cleaning, simultaneously acquiring visible light and ultraviolet (UV) band images; performing image registration on the visible light and UV band images to generate a registered dual-channel image; during image registration, using the spatial distribution of fluorescence signals in the UV band image as a priori, adaptively enhancing the local contrast of the visible light band image; inputting the dual-channel image into a pre-trained semantic segmentation network model, directly outputting a segmentation mask labeling the category of each pixel, wherein the category includes at least a base region, a particulate residue region, and a film-like residue region; extracting the area ratio of the particulate residue region and the film-like residue region based on the segmentation mask, and using the segmentation mask as an index to extract the area ratio from the UV band image. Fluorescent grayscale values ​​are extracted from the image. Based on the pre-calibrated nonlinear mapping relationship between fluorescent grayscale values ​​and residual film thickness, the fluorescent grayscale values ​​are converted into estimated film thickness values ​​and then normalized to obtain the residue concentration index. The area ratios of particulate residue regions, film residue regions, and residue concentration index are normalized respectively. The weighting weights are dynamically adjusted according to the ratio of the area ratios of particulate residue regions and film residue regions, and the weighted sum is used to obtain the comprehensive cleanliness score. When the comprehensive cleanliness score is lower than the preset qualified threshold, the dominant residue type is determined according to the ratio of the area ratio of particulate residue regions to the area ratio of film residue regions. Based on the dominant residue type, the corresponding adjustment strategy is selected from the preset cleaning parameter adjustment strategy library to adjust at least one cleaning process parameter in the next cleaning cycle or subsequent batch.

[0027] Furthermore, the image registration of the visible light band image and the ultraviolet band image generates a registered dual-channel image. During the image registration process, the spatial distribution of the fluorescence signal in the ultraviolet band image is used as a priori, and local contrast adaptive enhancement is performed on the visible light band image. Specifically, this includes: extracting multiple corner points on the outer contour of the workpiece in the visible light band image as a first control point set, and extracting the corresponding corner points on the outer contour of the workpiece in the ultraviolet band image as a second control point set; based on the first and second control point sets, calculating the affine transformation matrix from the ultraviolet band image to the visible light band image, and using the affine transformation matrix to map the ultraviolet band image to the coordinate system of the visible light band image, achieving spatial geometric registration; and then... In the registered ultraviolet image, pixel regions with gray values ​​higher than a preset fluorescence threshold are identified as fluorescence prior regions. Local enhancement windows of a preset size are generated, centered on the spatial location of the fluorescence prior region in the visible image. For the visible image pixels within each local enhancement window, a contrast-limited adaptive histogram equalization algorithm is used for local contrast enhancement. The cropping limit of the contrast-limited adaptive histogram equalization algorithm is adaptively adjusted based on the average ultraviolet fluorescence intensity within the window, ensuring a greater contrast enhancement in areas with stronger ultraviolet fluorescence. The locally contrast-enhanced visible image is then overlaid with the spatially geometrically registered ultraviolet image to generate a dual-channel image.

[0028] In one example, the resolution of both the visible light and ultraviolet images is 2048×2048 pixels. The Harris corner detection algorithm is used for extracting the workpiece's outer contour corners, with a corner response function threshold of 0.01, a non-maximum suppression window of 5×5 pixels, and each of the first and second control point sets containing at least 8 pairs of matching corners. The affine transformation matrix is ​​estimated using the RANSAC algorithm, with an interior point distance threshold of 2 pixels and a maximum iteration count of 2000. The preset fluorescence threshold is set to 50 (8-bit image grayscale range 0-255), determined by statistical analysis of the grayscale values ​​of pre-collected ultraviolet images of the clean workpiece surface, taking twice the average grayscale value of the clean surface. The preset size of the local enhancement window is set to 64×64 pixels. The clipping limit value `clip_limit` of the contrast-adaptive histogram equalization algorithm is adaptively adjusted according to the following formula: clip_limit = clip_base + (I_uv_avg / 255) × clip_delta Where clip_base = 2.0, clip_delta = 2.0, and I_uv_avg is the average grayscale value of the ultraviolet band image pixels within this enhancement window. When I_uv_avg = 200, clip_limit = 2.0 + (200 / 255)×2.0 ≈3.57, indicating a significant contrast enhancement; when I_uv_avg = 60, clip_limit = 2.0 + (60 / 255)×2.0 ≈2.47, indicating a more moderate contrast enhancement.

[0029] To further clarify, this step introduces ultraviolet fluorescence prior into the local contrast enhancement process of visible light images, directly addressing the problem raised in the background technique that "the contrast between transparent or translucent residual films and the substrate material is extremely low under ordinary visible light imaging, making it difficult for conventional machine vision systems to reliably identify them." By applying a greater contrast enhancement amplitude to areas with strong ultraviolet fluorescence signals, the outline of the transparent oil film, which is almost invisible under visible light, is significantly enhanced in the dual-channel image. Simultaneously, image registration achieves precise spatial alignment of dual-band information. This step simultaneously completes the two key tasks of "spatial alignment" and "weak residual signal enhancement" in a single processing flow, providing high-quality dual-channel fusion input for subsequent semantic segmentation networks.

[0030] Furthermore, the construction and training process of the semantic segmentation network model includes: constructing a multi-class labeled dataset, collecting dual-channel images of cleaned workpieces with different contamination types and degrees as sample images, creating a pixel-level labeled mask for each sample image, and labeling each pixel as a basal region, granular residue region, or film residue region; constructing a semantic segmentation network structure, using Unet++ as the backbone network, introducing a channel attention module at the encoder end, and setting three parallel independent classification heads at the decoder end, respectively used to predict the probability that each pixel belongs to a basal region, granular residue region, or film residue region; and employing a transfer learning strategy, based on publicly available... The encoder part of the semantic segmentation network is pre-trained on the surface defect image dataset. After obtaining the pre-trained weights, they are loaded into the constructed semantic segmentation network. The semantic segmentation network with the pre-trained weights is fine-tuned using a combined loss function. The combined loss function is a weighted sum of cross-entropy loss and Dice loss. The Dice loss is calculated separately for granular and film-like residual regions and then averaged. In the cross-entropy loss, the pixels in the film-like residual region are assigned a first loss weight, and the pixels in the granular residual region are assigned a second loss weight. The first loss weight is greater than the second loss weight, so as to force the network to focus on the film-like residual region with blurred boundaries and difficult segmentation.

[0031] In one example, the multi-class labeled dataset contains 3000 dual-channel image samples, covering different workpiece materials (bearing steel, aluminum alloy, copper alloy), different contamination types (cutting fluid film, rust-preventive film, metal particles, mixed contamination), and different contamination levels (slight, moderate, severe). The labeling masks were annotated by three engineers with over five years of quality inspection experience, and the final class label for each pixel was determined using majority voting to eliminate individual labeling bias. The Unet++ network's encoder uses EfficientNet-B3 as the feature extraction backbone, and the channel attention module employs a Squeeze-and-Excitation structure with a reduction ratio r set to 8. Each of the three parallel classification heads consists of a 1×1 convolutional layer and a Softmax activation layer, with three output channels. The publicly available surface defect image dataset used for pre-training is ImageNet-Defect, with 50 epochs and an initial learning rate of 1e-3. During fine-tuning, the weights of the combined loss function were set to λ_ce = 0.6 and λ_dice = 0.4. In the cross-entropy loss, the first loss weight for pixels in the membrane-like residual region is 3.0, the second loss weight for pixels in the granular residual region is 2.0, and the loss weight for pixels in the basal region is 0.5. The optimizer used is Adam, with an initial learning rate of 1e-4, training for 200 epochs, and a batch size of 8. Early stopping is triggered when the Dice coefficient on the validation set does not improve for 20 consecutive epochs, and the model weight with the highest Dice coefficient on the validation set is saved as the final weight.

[0032] To further illustrate, this step, by constructing a multi-class semantic segmentation network, integrates the two-stage sequential process of "first performing binary segmentation of the residue, then determining the residue type based on manual rules" in traditional schemes into an end-to-end pixel-level multi-class parallel inference process. The design of the combined loss function directly addresses the characteristics of blurred boundaries and high annotation uncertainty in membrane-like residue regions—assigning higher cross-entropy loss weights to membrane-like residue pixels, forcing the network to focus on these difficult-to-segment regions during training. This effectively solves the problems in the background technology where "traditional image processing algorithms based on fixed rules are not ideal for identifying complex defects" and "most techniques only make qualitative judgments about the residue without distinguishing the residue type."

[0033] Furthermore, the step of converting the fluorescence grayscale value into a film thickness estimate based on a pre-calibrated nonlinear mapping relationship between the fluorescence grayscale value and the residual film thickness, and then normalizing it to obtain the residue concentration index, specifically includes: preparing a set of standard residual film samples with known different thicknesses; acquiring standard fluorescence images of each standard residual film sample under the same ultraviolet excitation wavelength and irradiation power as the workpiece image acquisition conditions; extracting the mean fluorescence grayscale value of the residual film region in each standard fluorescence image; and using the film thickness as the independent variable and the mean fluorescence grayscale value as the dependent variable, employing the exponential function model I = I_max × (1 - Curve fitting was performed using e^(-k·h), where I is the mean fluorescence gray value, I_max is the saturated fluorescence gray value, h is the known film thickness, and k is the absorption coefficient related to the material of the residue. I_max and k were solved using the least squares method to obtain the fluorescence gray value-film thickness mapping curve. During actual detection, the pixel positions marked as film-like residue areas in the segmentation mask were used as indices to read the corresponding fluorescence gray values ​​in the ultraviolet band image. The fluorescence gray values ​​of each film-like residue pixel were substituted into the fluorescence gray value-film thickness mapping curve, and interpolation was used to calculate the estimated film thickness for each pixel. The arithmetic mean of the estimated film thickness values ​​for all film-like residue pixels was calculated, and the Min-Max normalization method was used to map the arithmetic mean to the 0-100 range to obtain the residue concentration index.

[0034] In one example, standard residual film samples were prepared using a spin-coating method. The same cutting fluid and rust-preventive oil used in the production line were employed as residue materials. Five sets of standard films with different thicknesses (0.1 μm, 0.5 μm, 1.0 μm, 2.0 μm, and 5.0 μm) were prepared on a clean bearing steel surface. Three parallel samples were prepared for each set to improve calibration reliability. The UV excitation conditions were consistent with the actual detection: excitation wavelength 365 nm, irradiation power density 50 mW / cm². 2 Ultraviolet fluorescence images of each standard sample were acquired using the same imaging equipment. Five images were taken for each sample at different locations, and the average gray value of the film region in all images was taken as the fluorescence gray value corresponding to that thickness. The five sets of data points (film thickness h, average gray value I) were: (0.1, 42), (0.5, 128), (1.0, 185), (2.0, 215), and (5.0, 228). The Levenberg-Marquardt algorithm was used to perform least-squares fitting on the exponential model I = I_max × (1 - e^(-k·h)), resulting in I_max = 230 and k = 0.95μm. -1 Fitted curve R 2 = 0.987. The parameters for Min-Max normalization are set according to the film thickness range in the calibration experiment: min = 0 μm, max = 5 μm.

[0035] To further clarify, this step converts the UV fluorescence grayscale value into a film thickness estimate with length dimensions through a physical model, rather than directly using dimensionless grayscale values ​​as a quantitative indicator. Its core advantage lies in establishing a deterministic mapping relationship between the detection signal and physical parameters. The background technology points out that "existing solutions generally lack refined quantitative evaluation of cleaning quality." This step, through a physical model-driven quantification method, enables the residue concentration index to more accurately reflect the actual thickness trend of the residual film, providing a physically interpretable input parameter for subsequent cleanliness scoring.

[0036] Furthermore, after normalizing the area proportions of particulate residue areas, film residue areas, and residue concentration index, the weighting is dynamically adjusted based on the ratio of the area proportions of particulate residue areas and film residue areas, and the weighted sum is used to obtain the comprehensive cleanliness score. Specifically, this includes: mapping the area proportions of particulate residue areas, film residue areas, and residue concentration index to a score range of 0-100, obtaining the particulate score A_p, the film score A_f, and the concentration score C; calculating the ratio of the area proportions of particulate residue areas to film residue areas R = A_p_raw / A_f_raw, where A_p_raw is the original value of the area proportion of particulate residue areas before normalization, and A_f_raw is the original value of the area proportion of film residue areas before normalization; and dynamically calculating the weights w_p for the particulate score and w_f for the film score based on the ratio R: w_p = R / (R+1) × (1-w_c), w_f = 1 / (R+1) × (1-w_c), where w_c is the preset fixed weight of the concentration score; the overall cleanliness score S is calculated according to the formula S = 100 - (w_p × A_p + w_f × A_f + w_c × C).

[0037] In one example, the area percentage normalization uses the Min-Max method, with min set to 0% and max set to 10% (based on the bearing industry cleanliness standard JB / T 7050-2005, an area percentage exceeding 10% is considered severe contamination). The concentration index C has already been normalized in the previous treatment step. The preset fixed weight w_c is 0.3. When A_p_raw = 2.0% and A_f_raw = 1.0%, R = 2.0 / 1.0 = 2.0, then w_p = 2.0 / (2.0+1) × (1-0.3) ≈ 0.467, w_f = 1 / (2.0+1)× (1-0.3) ≈ 0.233. At this point, particulate residue is dominant, with its weight w_p approximately twice that of the membrane-like residue weight w_f, making the scoring more sensitive to particulate residue. When A_p_raw = 0.5% and A_f_raw = 4.0%, R = 0.5 / 4.0 = 0.125, then w_p = 0.125 / (0.125+1) × 0.7 ≈ 0.078, w_f = 1 / (0.125+1) × 0.7 ≈ 0.622. At this point, film residue dominates, with its weight w_f approximately 8 times that of particulate residue w_p, making the score more sensitive to film residue. When A_f_raw = 0, R reaches its maximum value of 100, w_p ≈ 0.7, and w_f ≈ 0.

[0038] To further clarify, this step abandons the traditional fixed-weight scoring approach and proposes an adaptive dynamic weighting mechanism based on the proportion of residue types. The technical logic is that different types of residues have varying degrees of actual impact on product performance when they occupy the same area, and the dominant residue type in the current batch should receive higher scoring sensitivity. By driving the adaptive adjustment of weights through the ratio R of particulate to film-like residue area, the overall cleanliness score can automatically adjust the evaluation criteria according to the actual contamination characteristics of each batch of workpieces, solving the problem in the background technology of "easily causing misjudgment when the workpiece is in a critical clean state."

[0039] Furthermore, when the overall cleanliness score is lower than a preset acceptable threshold, the dominant residue type is determined based on the ratio of the area ratio of particulate residue to the area ratio of film-like residue. Based on the dominant residue type, a corresponding adjustment strategy is selected from a preset cleaning parameter adjustment strategy library to adjust at least one cleaning process parameter for the next cleaning cycle or subsequent batch. Specifically, this includes: setting the acceptable threshold as S_th; triggering a quality anomaly adjustment process when the overall cleanliness score S < S_th; calculating the ratio R of the area ratio of particulate residue to the area ratio of film-like residue in this test; comparing the ratio R with a preset first threshold T1 and a second threshold T2, where T1 < T2: if R ≤ T1, the dominant residue type is determined to be film-like residue; if R ≥ T2, the dominant residue type is determined to be particulate residue; if T1 < R < T2, the dominant residue type is determined to be particulate residue. If T2 is selected, the dominant residue type is determined to be mixed residue. A cleaning parameter adjustment strategy library is constructed, wherein: the adjustment strategy corresponding to the dominant film residue is to increase the cleaning solution temperature or extend the soaking time; the adjustment strategy corresponding to the dominant particulate residue is to increase the spray pressure or ultrasonic power; the adjustment strategy corresponding to the mixed residue is to perform the above two adjustment operations simultaneously, but the adjustment range of each parameter is lower than the adjustment range corresponding to a single dominant type. Based on the dominant residue type, the corresponding adjustment strategy is retrieved from the cleaning parameter adjustment strategy library, a cleaning parameter adjustment instruction is generated, and sent to the programmable logic controller of the cleaning equipment to execute the parameter change for the next cleaning cycle.

[0040] In one example, the acceptable threshold S_th is set to 85 points (out of 100). The first threshold T1 = 0.33 and the second threshold T2 = 3.0. The thresholds are set based on the following: when the area of ​​particulate residue is less than 1 / 3 of the area of ​​film residue (R ≤ 0.33), film residue is absolutely dominant; when the area of ​​particulate residue is more than 3 times the area of ​​film residue (R ≥ 3.0), particulate residue is absolutely dominant; when it is between the two, the two types of residue have a comparable impact on cleanliness. In the cleaning parameter adjustment strategy library, the specific adjustment strategies corresponding to film-like residue as the main type are: increasing the cleaning solution temperature by 3℃ or extending the soaking time by 30 seconds. This strategy is based on the physical mechanism that the removal of film-like residue mainly depends on the chemical dissolution capacity of the cleaning solution and the soaking time. The specific adjustment strategies corresponding to particulate residue as the main type are: increasing the spray pressure from 0.5MPa to 0.6MPa or increasing the ultrasonic power by 10%. This strategy is based on the physical mechanism that the removal of particulate residue mainly depends on the physical mechanism of fluid mechanical impact force and ultrasonic cavitation effect. The adjustment strategies corresponding to mixed residue are: increasing the cleaning solution temperature by 2℃ and increasing the spray pressure by 0.05MPa. The adjustment ranges for each type are lower than those for the single dominant type to avoid instability caused by over-adjustment.

[0041] To further clarify, this step establishes a closed-loop decision-making chain from detection results to process control. Its core innovation lies in not simply dividing detection results into "qualified / unqualified," but rather, after determining unqualified, further attributing the anomaly to the area ratio R of particulate and film-like residues, distinguishing three different dominant residue types, and selecting adjustment strategies with differentiated physical mechanisms from a strategy library accordingly. This directly addresses the core pain point in the background technology: "Even if quality problems are detected during the detection process, it is impossible to automatically and specifically adjust cleaning process parameters based on specific defect characteristics."

[0042] Furthermore, the process includes a step for detecting and adjusting the uniformity of cleaning. This step is executed when the overall cleanliness score reaches a preset acceptable threshold: the workpiece surface area corresponding to the dual-channel image is uniformly divided into a grid of M rows × N columns, generating M × N local sub-regions with the same shape; based on the segmentation mask, the total number of pixels marked as particulate residue areas and film residue areas in each local sub-region is counted, and the residue area ratio of each local sub-region is calculated; the global standard deviation of the residue area ratio of all local sub-regions is calculated as the cleaning uniformity quantification index U; when the cleaning uniformity quantification index U exceeds the preset uniformity threshold U_th, it is determined that there is regional under-cleaning, and a workpiece flipping operation command or a nozzle angle adjustment command is generated and output to the cleaning equipment to improve the cleaning uniformity of the next cleaning cycle.

[0043] In one example, the workpiece surface is uniformly divided into 16 local sub-regions of 4×4. The preset uniformity threshold U_th is set to 0.8%. When the overall cleanliness score of a workpiece is 88 points (qualified), but the residual area percentages of the 16 sub-regions are {0.3%, 0.2%, 0.4%, 0.3%, 0.2%, 0.5%, 1.8%, 0.3%, 0.4%, 0.2%, 0.3%, 0.5%, 0.2%, 0.4%, 0.3%, 0.4%} respectively, the global standard deviation U is calculated to be ≈ 0.42%, which is lower than U_th, indicating good cleaning uniformity. When the area percentage of a sub-region reaches 2.5%, the standard deviation U rises to approximately 0.9%, exceeding U_th, indicating that the sub-region is under-cleaned. The system generates an operation command to rotate the workpiece basket 180 degrees, causing the workpiece to change its orientation in the next cleaning cycle to improve the cleaning effect of that area.

[0044] To further clarify, this step addresses the problem in the background technology of "focusing only on overall cleanliness while neglecting local uniformity." In actual production, it is not uncommon for workpieces to meet overall cleanliness standards but have under-cleaned areas—for example, cleaning blind spots caused by fixed nozzle pointing or complex workpiece shapes. By introducing a quantitative index for uniformity and triggering local detection after the overall score is satisfactory, a more comprehensive evaluation and control of cleaning quality is achieved.

[0045] Furthermore, the process includes a pre-recommendation step for cleaning parameters based on historical data. This step is performed before a new batch of workpieces enters the cleaning process for the first time: A historical batch process database is established, collecting and storing data records of completed cleaning batches. Each data record includes the initial contamination state characteristics of the workpiece, the actual combination of cleaning parameters used, and the comprehensive cleanliness score obtained after processing by the method described above. A feature vector is constructed by concatenating the initial contamination state characteristics and the cleaning parameter combination, and a gradient boosting tree regression model is trained using the comprehensive cleanliness score as the regression prediction target. The hyperparameter combination of the gradient boosting tree regression model is automatically searched and optimized using the Hyperopt Bayesian optimization framework, with the optimization objective being the minimization of the root mean square error of five-fold cross-validation. Before a new batch of workpieces enters the cleaning process, the initial contamination state characteristics of that batch are obtained. Using these initial contamination state characteristics as fixed inputs, within a preset range of cleaning parameter values, the trained gradient boosting tree regression model employs a genetic algorithm to search for the optimal cleaning parameter combination that maximizes the predicted comprehensive cleanliness score. The optimal cleaning parameter combination is then used as the recommended initial cleaning parameter setting for the current batch and written into the process parameter register of the cleaning equipment.

[0046] In one example, the historical batch process database has accumulated more than 500 valid data records. Initial contamination status characteristics include: workpiece material code (using unique thermal encoding, e.g., bearing steel [1,0,0], aluminum alloy [0,1,0], copper alloy [0,0,1]), surface oil contamination level (levels 1-5, input by the operator based on the incoming material condition), and geometric complexity score (1-10 points, automatically calculated based on the number of surfaces and aspect ratio of the workpiece's CAD model). Cleaning parameter combinations include cleaning fluid temperature (range 40-70℃), spray pressure (range 0.3-0.8MPa), ultrasonic power (range 200-500W), and cleaning duration (range 120-600 seconds). The hyperparameter space for Hyperopt Bayesian optimization includes: number of decision trees (100-500), maximum depth (3-10), learning rate (0.01-0.3), subsampling rate (0.6-1.0), and the optimization iteration count is set to 100. During the genetic algorithm search, the population size was set to 50, the crossover probability to 0.8, the mutation probability to 0.1, the maximum number of iterations to 100 generations, and the search stopped when the optimal fitness did not improve for 20 consecutive generations. The recommended initial cleaning parameters found were written to the cleaning equipment's process parameter register interface as the default process formula for the current batch.

[0047] To further clarify, this step upgrades the cleaning quality control from a closed-loop model of "passive detection-adjustment" to a feedforward model of "proactive prediction-recommendation." By training a gradient boosting tree regression model using historical production data, the system can predictively recommend a set of cleaning parameters that maximize the desired cleanliness level based on the initial contamination state of the incoming materials before a new batch of workpieces is put into production. This effectively solves the problems of high trial-and-error costs and long cycles to achieve steady-state cleaning quality caused by improper initial parameter settings.

[0048] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A machine vision-based cleaning quality control method, characterized in that, Includes the following steps: During the intervals between cleaning processes or after cleaning, images of the surface of the cleaned workpiece are acquired using an imaging device, simultaneously obtaining visible light and ultraviolet light images; wherein, the ultraviolet light image is acquired by irradiating the surface of the cleaned workpiece with an ultraviolet light source to excite transparent or translucent residues to generate fluorescence signals. The visible light band image and the ultraviolet band image are registered to generate a registered dual-channel image. During the image registration process, the spatial distribution of fluorescence signal in the ultraviolet band image is used as a priori to perform local contrast adaptive enhancement on the visible light band image, so that the outline of the residue with a contrast with the substrate below a first threshold in the visible light band is enhanced in the dual-channel image. The dual-channel image is input into a pre-trained semantic segmentation network model, which performs pixel-level multi-class semantic segmentation on the dual-channel image and directly outputs a segmentation mask that marks the category to which each pixel belongs. The category includes at least the basal region, the granular residual region, and the film-like residual region. Based on the segmentation mask, the area ratio of particulate residue region and the area ratio of film residue region are extracted, and the fluorescence gray value of each residue pixel is extracted from the ultraviolet band image using the segmentation mask as an index. Based on the pre-calibrated nonlinear mapping relationship between fluorescence gray value and residue film thickness, the fluorescence gray value is converted into a film thickness estimate and then normalized to obtain the residue concentration index. After normalizing the area ratio of the particulate residue area, the area ratio of the membrane residue area, and the residue concentration index, the weighting is dynamically adjusted according to the ratio of the area ratio of the particulate residue area and the membrane residue area. The weighted sum is then used to obtain the comprehensive cleanliness score, so that the residue type that has a greater impact on cleanliness receives a higher weight. When the overall cleanliness score is lower than the preset qualified threshold, the dominant type of residue is determined based on the ratio of the area of ​​particulate residue to the area of ​​film residue. Based on the dominant type of residue, a corresponding adjustment strategy is selected from the preset cleaning parameter adjustment strategy library to adjust at least one cleaning process parameter of the next cleaning cycle or subsequent batch.

2. The machine vision-based cleaning quality control method according to claim 1, characterized in that, The visible light band image and the ultraviolet band image are registered to generate a registered dual-channel image. During the image registration process, based on the spatial distribution of fluorescence signals in the ultraviolet band image as a priori, local contrast adaptive enhancement is performed on the visible light band image, specifically including: Multiple corner points on the outer contour of the workpiece in the visible light band image are extracted as a first control point set, and the corresponding corner points on the outer contour of the workpiece in the ultraviolet band image are extracted as a second control point set. Based on the first control point set and the second control point set, the affine transformation matrix from the ultraviolet band image to the visible light band image is calculated, and the affine transformation matrix is ​​used to map the ultraviolet band image to the coordinate system of the visible light band image to achieve spatial geometric registration. In the ultraviolet band image after spatial geometric registration, the pixel region with a gray value higher than the preset fluorescence threshold is determined as the fluorescence prior region. A local enhancement window of a preset size is generated, centered on the spatial location of the fluorescence prior region in the visible light band image. For visible light image pixels within each of the local enhancement windows, a contrast-limited adaptive histogram equalization algorithm is used to enhance local contrast. The cropping limit value of the contrast-limited adaptive histogram equalization algorithm is adaptively adjusted according to the average intensity of ultraviolet fluorescence within the window, so that the stronger the ultraviolet fluorescence, the greater the contrast enhancement. The dual-channel image is generated by overlaying the visible light band image with enhanced local contrast and the ultraviolet band image with spatial geometric registration.

3. The machine vision-based cleaning quality control method according to claim 1, characterized in that, The construction and training process of the semantic segmentation network model includes: A multi-category labeled dataset is constructed. Dual-channel images of cleaned workpieces with different types and degrees of contamination are collected as sample images. A pixel-level labeled mask is made for each sample image. The labeled mask marks each pixel as a base region, a particulate residue region, or a film residue region. A semantic segmentation network structure is constructed, with Unet++ as the backbone network. A channel attention module is introduced at the end of the encoder, and three parallel independent classification heads are set at the end of the decoder to predict the probability that each pixel belongs to the basal region, the granular residual region, or the film residual region, respectively. A transfer learning strategy is adopted to pre-train the encoder part of the semantic segmentation network on a publicly available surface defect image dataset. After obtaining the pre-trained weights, they are loaded into the constructed semantic segmentation network. A combined loss function is used to fine-tune the semantic segmentation network after loading pre-trained weights. The combined loss function is a weighted sum of cross-entropy loss and Dice loss. The Dice loss is calculated separately for granular residual regions and membrane residual regions and then averaged. In the cross-entropy loss, the pixels in the membrane residual region are assigned a first loss weight and the pixels in the granular residual region are assigned a second loss weight. The first loss weight is greater than the second loss weight, so as to force the network to focus on the membrane residual region with blurred boundaries and difficult segmentation.

4. The machine vision-based cleaning quality control method according to claim 1, characterized in that, The method, based on a pre-calibrated nonlinear mapping relationship between fluorescence grayscale values ​​and residual film thickness, converts fluorescence grayscale values ​​into estimated film thickness values ​​and then normalizes them to obtain a residual concentration index, specifically including: A set of standard residual film samples with known different thicknesses was prepared, and standard fluorescence images of each standard residual film sample were acquired under the same ultraviolet excitation wavelength and irradiation power as those acquired for workpiece image acquisition. The mean fluorescence grayscale value of the residual film region in each standard fluorescence image was extracted. With film thickness as the independent variable and mean fluorescence grayscale value as the dependent variable, an exponential function model I = I_max × (1 - e^(-k·h)) was used for curve fitting, where I is the mean fluorescence grayscale value, I_max is the saturated fluorescence grayscale value, h is the known film thickness, and k is the absorption coefficient related to the material of the residue. I_max and k were solved by the least squares method to obtain the fluorescence grayscale-film thickness mapping curve. In actual testing, the pixel position marked as the film-like residual area in the segmentation mask is used as an index to read the fluorescence gray value of the corresponding position in the ultraviolet band image; Substitute the fluorescence grayscale value of each residual pixel into the fluorescence grayscale-film thickness mapping curve, and interpolate to obtain the estimated film thickness value corresponding to each pixel. The arithmetic mean of the estimated film thickness values ​​of all film-like residual pixels is calculated, and the arithmetic mean is mapped to the 0-100 range using the Min-Max normalization method to obtain the residual concentration index.

5. The machine vision-based cleaning quality control method according to claim 1, characterized in that, After normalizing the area proportions of the particulate residue region, the area proportions of the film-like residue region, and the residue concentration index, the weighting is dynamically adjusted based on the ratio of the area proportions of the particulate residue region and the film-like residue region. The weighted sum is then used to obtain a comprehensive cleanliness score, specifically including: The area ratio of the particulate residue region, the area ratio of the film-like residue region, and the residue concentration index are respectively mapped to the 0-100 score range to obtain the particulate score A_p, the film-like score A_f, and the concentration score C; Calculate the area ratio of particulate residue region to film residue region R = A_p_raw / A_f_raw, where A_p_raw is the original value of the area ratio of particulate residue region before normalization, and A_f_raw is the original value of the area ratio of film residue region before normalization. The particulate weight w_p and the membrane weight w_f are dynamically calculated based on the ratio R: w_p = R / (R + 1) × (1 - w_c), w_f = 1 / (R + 1) × (1 - w_c), where w_c is the preset fixed weight of the concentration score; The overall cleanliness score S is calculated using the formula S = 100 - (w_p × A_p + w_f × A_f + w_c × C).

6. The machine vision-based cleaning quality control method according to claim 1, characterized in that, When the overall cleanliness score is lower than a preset acceptable threshold, the dominant type of residue is determined based on the ratio of the area ratio of particulate residue to the area ratio of film-like residue. Based on the dominant type of residue, a corresponding adjustment strategy is selected from a preset cleaning parameter adjustment strategy library to adjust at least one cleaning process parameter for the next cleaning cycle or subsequent batches, specifically including: Set the acceptable threshold as S_th. When the overall cleanliness score S < S_th, trigger the quality anomaly adjustment process. Calculate the ratio R of the area of ​​particulate residue to the area of ​​film residue in this test; The ratio R is compared with the preset first threshold T1 and second threshold T2, where T1 < T2: if R ≤ T1, the dominant residue type is determined to be film-like residue; if R ≥ T2, the dominant residue type is determined to be particulate residue; if T1 < R < T2, the dominant residue type is determined to be mixed residue. The cleaning parameter adjustment strategy library is constructed, wherein: the adjustment strategy corresponding to the dominant film residue is to increase the cleaning fluid temperature or extend the soaking time; the adjustment strategy corresponding to the dominant particulate residue is to increase the spray pressure or ultrasonic power; the adjustment strategy corresponding to the mixed residue is to perform the above two adjustment operations simultaneously, but the adjustment range of each parameter is lower than the adjustment range corresponding to the single dominant type. Based on the dominant type of residue, the corresponding adjustment strategy is retrieved from the cleaning parameter adjustment strategy library, a cleaning parameter adjustment instruction is generated, and sent to the programmable logic controller of the cleaning equipment to execute the parameter change for the next cleaning cycle.

7. The machine vision-based cleaning quality control method according to claim 1, characterized in that, It also includes a step for detecting and adjusting the uniformity of cleaning, which is performed when the overall cleanliness score reaches a preset acceptable threshold: The workpiece surface area corresponding to the dual-channel image is uniformly divided into a grid of M rows × N columns, generating M × N local sub-regions with the same shape; Based on the segmentation mask, the total number of pixels marked as granular residual regions and film-like residual regions in each local sub-region is counted, and the residual area ratio of each local sub-region is calculated. Calculate the global standard deviation of the area ratio of residue in all local sub-regions, and use it as the quantitative index U of cleaning uniformity; When the cleaning uniformity quantification index U exceeds the preset uniformity threshold U_th, it is determined that there is regional under-cleaning. A flipping operation command for the workpiece or an angle adjustment command for the nozzle is generated and output to the cleaning equipment to improve the cleaning uniformity of the next cleaning cycle.

8. The machine vision-based cleaning quality control method according to claim 1, characterized in that, It also includes a pre-recommendation step for cleaning parameters based on historical data, which is performed before a new batch of workpieces first enters the cleaning process: Establish a historical batch process database, collect and store data records of completed cleaning batches. Each data record includes the initial contamination state characteristics of the workpiece, the actual combination of cleaning parameters used, and the comprehensive cleanliness score obtained after processing by the method described above. The initial contamination state characteristics and the cleaning parameter combination are concatenated to form a feature vector, and the comprehensive cleanliness score is used as the regression prediction target to train a gradient boosting tree regression model; wherein, the hyperparameter combination of the gradient boosting tree regression model is automatically searched and optimized using the Hyperopt Bayesian optimization framework, with the minimization of the root mean square error of five-fold cross-validation as the optimization objective. Before a new batch of workpieces enters the cleaning process, the initial contamination state characteristics of the batch of workpieces are obtained. Using the initial contamination state characteristics as a fixed input, within the preset range of cleaning parameter values, the trained gradient boosting tree regression model is used to search for the optimal cleaning parameter combination that maximizes the predicted value of the comprehensive cleanliness score. The optimal combination of cleaning parameters is used as the recommended initial cleaning parameter setting value for the current batch and written into the process parameter register of the cleaning equipment.

9. The machine vision-based cleaning quality control method according to claim 1, characterized in that, The process of acquiring images of the workpiece surface being cleaned using an imaging device, simultaneously obtaining visible light and ultraviolet light images, specifically includes: A beam splitter is set in the imaging device. The beam splitter is used to split the light beam from the same acquisition optical path from the surface of the workpiece being cleaned into a transmitted visible light beam and a reflected ultraviolet light beam. The visible light beam is guided to a visible light camera for imaging, and the ultraviolet light beam is guided to an ultraviolet camera for imaging. The two cameras are synchronously exposed under the control of the same trigger signal to eliminate the inter-frame deviation of the image caused by workpiece vibration or transmission motion. The emission wavelength of the ultraviolet excitation source is matched with the fluorescence excitation peak wavelength of common organic residues on the surface of the workpiece being cleaned.

10. A machine vision-based cleaning quality control system, characterized in that, A cleaning quality control method based on machine vision as described in any one of claims 1 to 9, comprising: The synchronous imaging subsystem includes a beam splitter, a visible light camera, an ultraviolet camera, a visible light ring light source, an ultraviolet excitation light source, a polarization filter assembly, and a light controller. The beam splitter divides the same light acquisition path from the workpiece surface into a visible light path and an ultraviolet light path. The visible light camera and the ultraviolet camera perform synchronous exposure imaging of the same field of view under the same trigger signal. The image enhancement and registration module is used to perform local contrast adaptive enhancement on the visible light band image based on the spatial distribution of fluorescence signals in the ultraviolet band image as a priori, and to perform geometric registration between the enhanced visible light band image and the ultraviolet band image to generate a dual-channel image. The semantic segmentation inference module embeds a trained semantic segmentation network model, which is used to perform pixel-level multi-class semantic segmentation on the dual-channel image and directly outputs segmentation masks that label the base region, granular residual region and membrane residual region. The physical quantification and scoring module includes a fluorescence grayscale-film thickness mapping model, which converts ultraviolet fluorescence grayscale values ​​into estimated film thickness values ​​based on the segmented mask, calculates the residue concentration index, and dynamically adjusts the weighting weights according to the ratio of the area proportions of particulate residue areas and film residue areas to calculate the comprehensive cleanliness score. The defect attribution and control module is used to determine the dominant type of residue based on the ratio of the area proportions of particulate residue areas to the area proportions of film residue areas, selects the corresponding adjustment strategy from the preset cleaning parameter adjustment strategy library, generates cleaning process parameter adjustment instructions, and sends them to the programmable logic controller of the cleaning equipment for execution.

Citation Information

Patent Citations

  • Automatic ultrasound cleaning machine based on image processing and operating method thereof

    CN105231468A

  • Laser cleaning effect on-line monitoring method based on visual inspection

    CN114119535A

  • Automatic cleaning and detecting device and method for engine connecting rod

    CN114589143A

  • A method and system for metal workpiece inspection and cleaning control based on image processing

    CN115409836B

  • Supercavitation high-pressure water jet machine cleaning quality detection method based on visual technology

    CN119963514A