A method, system, and storage medium for defect detection in dispensing processes.
By using multi-angle shooting from the main camera and slave cameras, and pre-scanning from optical devices, combined with adaptive threshold segmentation and multi-branch feature fusion networks, the problems of poor parameter adaptability and difficulty in balancing detection accuracy and efficiency in dispensing defect detection are solved, achieving efficient and accurate dispensing defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN YITIAN TECH CO LTD
- Filing Date
- 2026-06-03
- Publication Date
- 2026-06-30
AI Technical Summary
Existing methods for detecting dispensing defects suffer from problems such as poor adaptability of fixed detection beam parameters, easy omissions due to single-angle shooting, and difficulty in balancing detection accuracy and efficiency, thus failing to meet the real-time detection needs of high-speed production lines.
By employing a main camera and a slave camera to capture images from different angles, and emitting a scanning beam through an optical device for pre-scanning, the scanned images are acquired to determine the illumination parameters of the detection beam. Defect detection is then performed by combining adaptive threshold segmentation and a multi-branch feature fusion network, achieving comprehensive coverage and accurate identification of multi-angle information.
It enables accurate acquisition of the morphology and material characteristics without damaging the dispensing, improving detection accuracy and efficiency, adapting to the real-time detection needs of high-speed production lines, and reducing the rate of missed detections and false alarms.
Smart Images

Figure CN122306827A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent manufacturing technology, and includes, but is not limited to, a defect detection method, system, and storage medium for dispensing processes. Background Technology
[0002] In the field of intelligent manufacturing, dispensing is a core process in industries such as electronics manufacturing, automotive parts, and new energy equipment, and is widely used in critical stages such as chip packaging, component fixing, and sealing and waterproofing. The quality of dispensing directly determines the sealing performance, conductivity, and structural stability of the product. In actual production, the dispensing process is easily affected by factors such as glue viscosity, dispensing speed, and ambient temperature, resulting in defects such as glue bubbles, glue breaks, uneven glue volume, and misalignment. Therefore, efficient and accurate defect detection of the dispensing area is an important step in ensuring product qualification rate.
[0003] Existing methods for detecting dispensing defects have several shortcomings: First, they lack a pre-adaptation mechanism, directly using a detection beam with fixed parameters for imaging, which easily leads to image blurring due to differences in adhesive reflectivity and material properties, making it impossible to accurately capture defect details; second, they mostly use a single camera and single angle for imaging, making it difficult to fully cover the three-dimensional morphology of the dispensing and easily resulting in missed defects; third, the detection algorithm does not achieve multimodal image fusion, resulting in low accuracy in identifying minute defects and a high false alarm rate; fourth, the fixed illumination parameters cannot adapt to changes in ambient light and parameter drift after long-term operation, making it difficult to meet the real-time detection needs of high-speed production lines. These problems are the core pain points that this application aims to solve. Summary of the Invention
[0004] In view of this, the present application provides a defect detection method, system, and storage medium for the dispensing process, which can solve the problems of poor adaptability of fixed detection beam parameters, easy omissions due to single-angle imaging, and difficulty in balancing detection accuracy and efficiency in the prior art, thus achieving efficient and accurate detection of dispensing defects. The technical solution provided by the present application is implemented as follows:
[0005] A first aspect of this application provides a defect detection method for a dispensing process, which is applied to a defect detection system for a dispensing process. The system includes a main camera, a slave camera, and an optical device. The main camera and the slave camera are used to capture images of the target micelles from different shooting angles. The method includes: during the initial defect detection, emitting a scanning beam towards the target dispensing via the optical device, wherein the intensity of the scanning beam is less than the intensity of the detection beam used for formal defect detection; acquiring scanning images of the target dispensing under the illumination of the scanning beam via the main camera and the slave camera respectively; determining the illumination parameters of the detection beam during defect detection based on the scanning images; and emitting the detection beam towards the target dispensing via the optical device based on the illumination parameters.
[0006] The detection images of the target dispensing under the illumination of the detection beam are acquired by the main camera and the slave camera respectively; the dispensing quality of the target dispensing is determined based on the detection images.
[0007] In this embodiment, the weak light pre-scanning mechanism can accurately acquire the morphology and material characteristics of the adhesive without damaging the dispensing, thereby determining the appropriate detection beam irradiation parameters, which solves the problem of poor adaptability of fixed irradiation parameters in the prior art; the master and slave cameras acquire scanning images from multiple angles, avoiding the loss of information from a single angle, and providing comprehensive support for the determination of irradiation parameters; the overall process takes into account both detection accuracy and efficiency, adapts to the needs of high-speed production lines, and lays the foundation for subsequent accurate detection.
[0008] In some possible implementations, the above-mentioned determination of the dispensing quality of the target adhesive based on the detection image includes: preprocessing the detection image of the main camera using adaptive threshold segmentation combined with connected component analysis based on a feature extraction network to obtain a feature segmentation image of the target adhesive; inputting the feature segmentation image, as well as the detection images corresponding to the main camera and the slave camera respectively, into a multi-branch feature fusion network, and determining the dispensing quality of the target adhesive based on the multi-branch feature fusion network. In this embodiment, adaptive threshold segmentation combined with connected component analysis can quickly remove background noise and accurately locate the dispensing area, while the multi-branch feature fusion network can make full use of multi-angle image information, effectively improving the accuracy of dispensing quality judgment and reducing missed detections and false detections.
[0009] In some possible implementations, the multi-branch feature fusion network includes a main branch discriminant network and a fusion discriminant network. The aforementioned determination of the dispensing quality of the target adhesive based on the multi-branch feature fusion network includes: classifying and recognizing the feature segmentation image using the main branch discriminant network; when the main branch discriminant network determines that the current target adhesive is an abnormal dispensing, the fusion discriminant network performs fusion discrimination based on the detection images corresponding to the main camera and the slave camera respectively, to further determine whether the abnormal dispensing is unqualified. In the embodiments of this application, the main branch can quickly complete the preliminary classification, improving detection efficiency, while the fusion branch accurately verifies abnormal dispensing, reducing the false alarm rate, achieving a dual improvement in detection efficiency and accuracy.
[0010] In some possible implementations, the above-mentioned fusion discrimination network performs fusion discrimination based on the feature segmentation images corresponding to the main camera and the slave camera respectively, to further determine whether the abnormal dispensing is unqualified dispensing. This includes: constructing a spatial coordinate transformation matrix between the images captured by the main camera and the slave camera; determining the potential coordinate regions of the abnormal dispensing features on the detection images corresponding to the main camera and the slave camera respectively based on the spatial coordinate transformation matrix and the coordinate information of the abnormal dispensing features in the feature segmentation image; extracting the corresponding region images from the detection images corresponding to the main camera and the slave camera respectively according to the potential coordinate regions; and processing the region images corresponding to the main camera and the slave camera respectively based on the dual-stream collaborative fusion network to further determine whether the abnormal dispensing is unqualified dispensing. In this embodiment, the spatial coordinate transformation matrix can achieve accurate mapping of dual-camera images, quickly locate abnormal regions, reduce redundant calculations, provide efficient support for subsequent accurate discrimination, and improve the reliability of abnormal dispensing determination.
[0011] In some possible implementations, the above-mentioned processing of the region images corresponding to the main camera and the slave camera based on the dual-stream collaborative fusion network to further determine whether abnormal dispensing is unqualified dispensing includes: extracting global contour features from the region image of the main camera and extracting local texture features from the region image of the slave camera based on the dual-stream convolution module; aligning the global contour features and local texture features based on the feature fusion module; and performing channel superposition on the aligned feature maps, and further determining whether abnormal dispensing is unqualified based on the superimposed feature maps. In the embodiments of this application, the global contour and local texture features are complementary, feature alignment ensures fusion accuracy, and channel superposition enhances defect discrimination, which can accurately identify minute defects and improve the accuracy of unqualified dispensing determination.
[0012] In some possible implementations, the scanning beam is used to project a grating pattern onto the area where the target dispensing is located. The grating pattern is used to indicate the morphological features and optical properties of the target dispensing. In this embodiment, the grating pattern can accurately reflect the three-dimensional morphology and material properties of the dispensing, providing accurate and reliable data support for the determination of subsequent irradiation parameters and helping to improve the accuracy of subsequent detection.
[0013] In some possible implementations, the illumination parameters include at least one of the following: the selection of the scanning beam source, the scanning illumination angle, the pulse width, the exposure duration, the pulse width modulation parameters, and the light source exposure sequence. In the embodiments of this application, diverse illumination parameters can be specifically adapted to different adhesive materials, dispensing methods, and shooting scenarios to optimize imaging effects and avoid problems such as image blurring and missed defect detection caused by single parameters.
[0014] In some possible implementations, after the illumination parameters are determined, the scanning beam is re-emitted via the optical device after a fixed working time to update the illumination parameters; or, in response to changes in ambient light, the scanning beam is re-emitted via the optical device to update the illumination parameters. In this embodiment, the dynamic updating of the illumination parameters can compensate for the effects of changes in ambient light and parameter drift, without the need for manual intervention, ensuring long-term stability of detection accuracy and adapting to the complex and ever-changing production environment of the workshop.
[0015] Secondly, embodiments of this application also provide a defect detection system for a dispensing process. This system includes a main camera, a slave camera, an optical device, and a controller. The main camera and slave camera are used to capture images of the target micelles from different shooting angles. The controller is used to: during the initial defect detection, control the optical device to emit a scanning beam towards the target dispensing, the intensity of which is less than the intensity of the detection beam used for formal defect detection; control the main camera and slave camera to acquire scanning images of the target dispensing under the illumination of the scanning beam; determine the illumination parameters of the detection beam during defect detection based on the scanning images; control the optical device to emit the detection beam towards the target dispensing based on the illumination parameters; control the main camera and slave camera to acquire detection images of the target dispensing under the illumination of the detection beam; and determine the dispensing quality of the target dispensing based on the detection images.
[0016] Thirdly, embodiments of this application also provide a computer-readable storage medium including instructions that, when executed on a processor, cause the processor to perform a defect detection method for a dispensing process as described in the first aspect above.
[0017] Fourthly, embodiments of this application also provide a computer device, which may be a server. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it performs the functions required for control in the aforementioned defect detection method for dispensing processes.
[0018] The technical principles and beneficial effects of the second, third, and fourth aspects can be referred to the description in the first aspect above, and will not be repeated here. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A schematic flowchart of a defect detection method for a dispensing process provided in an embodiment of this application;
[0021] Figure 2 A schematic diagram of the model architecture of an algorithm model for a defect detection method in a dispensing process provided in an embodiment of this application;
[0022] Figure 3 A flowchart illustrating a defect detection method for a dispensing process provided in this application embodiment. Figure 2 ;
[0023] Figure 4 A flowchart illustrating a defect detection method for a dispensing process provided in this application embodiment. Figure 3 ;
[0024] Figure 5 A schematic diagram of a defect detection system for dispensing processes provided in an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0028] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0029] It should be noted that the terms "first, second, third" used in the embodiments of this application are used to distinguish similar or different objects and do not represent a specific order of objects. It can be understood that "first, second, third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0030] As a core foundational process in intelligent manufacturing, dispensing technology has permeated numerous key sectors, including electronics manufacturing, automotive, new energy, aerospace, and medical devices. In electronics manufacturing, it's widely used for component mounting, pin packaging, and circuit board waterproofing in products such as smartphones, computers, and chips. In the automotive industry, it's suitable for battery tab packaging, mounting on-board electronic modules, and sealing of body components. In new energy, it enables functions such as sealing photovoltaic module junction boxes and fixing energy storage device interfaces. In aerospace and medical device fields, it's used for precision dispensing of high-precision components, requiring extremely high consistency and stability in dispensing quality. Dispensing quality directly impacts product reliability, lifespan, and safety. Defects such as glue bubbles, glue breaks, uneven glue application, and misalignment can not only lead to product scrap but also cause serious problems like equipment malfunctions and safety hazards. Therefore, real-time and accurate detection of dispensing defects has become an indispensable key link in large-scale production across various industries. However, current dispensing defect detection still faces many pressing problems: First, dispensing scenarios vary significantly across different fields, with different adhesive materials (such as epoxy, silicone, and UV adhesives), dispensing forms (dispensing, line dispensing, and surface dispensing), and workpiece surface materials, making it difficult to universally adapt detection solutions. Second, with the continuous increase in production pace on high-speed production lines, traditional detection methods have slow response times and cannot meet real-time detection needs, easily leading to missed defects in batches. Third, the detection process is easily affected by external factors such as ambient light, workshop temperature, and humidity, resulting in large fluctuations in detection accuracy. Fourth, existing detection methods lack the ability to identify minute defects (such as tiny glue bubbles and minor glue breaks), leading to high false alarm and false alarm rates, making it difficult to adapt to the high-precision detection needs of high-end fields. These problems severely restrict the intelligent upgrading of dispensing processes and also drive the development of dispensing defect detection technology towards self-adaptability, high precision, and high efficiency.
[0031] To achieve high-precision, efficient, and rapid dispensing defect detection, in a first aspect, embodiments of this application provide a defect detection method for the dispensing process. This method is applied to a defect detection system for the dispensing process, the system including a main camera, a slave camera, and optical devices. The main camera and slave camera are used to capture images of the target micelles from different shooting angles. Figure 1 As shown, the method includes the following steps S100-S600:
[0032] S100: A scanning beam is emitted toward the target dispensing via an optical device.
[0033] For example, after the system is powered on, during the first defect detection, a scanning beam is emitted towards the target dispensing via an optical device. The intensity of the scanning beam is less than the intensity of the detection beam used for formal defect detection.
[0034] For example, a scanning beam is used to project a grating pattern onto the area where the target dispensing is located. The grating pattern is used to indicate the morphological features and material optical properties of the target dispensing. In this embodiment, after the grating pattern is projected onto the surface of the target dispensing, it will be refracted according to the material properties of the dispensing (such as refractive index, viscosity, and surface roughness), causing the originally regular grating lines to bend and deform to varying degrees. The degree of bending of the grating lines is directly related to the morphological features of the dispensing, such as thickness and contour, and the bending shape corresponds to the differences in the material optical properties of the dispensing. By capturing this bending change, the three-dimensional morphological information and material property parameters of the target dispensing can be accurately obtained, providing a reliable basis for determining the subsequent detection beam irradiation parameters.
[0035] S200: The main camera and the slave camera respectively acquire scanned images of the target dispensing material under the illumination of the scanning beam.
[0036] S300. Based on the scanned image, determine the illumination parameters of the detection beam during defect detection.
[0037] In the embodiments of steps S100-S300 of this application, the above operations achieve adaptive determination of the detection beam irradiation parameters through a pre-scanning mechanism, which has significant beneficial effects: First, the scanning beam adopts a weak light design, which can accurately capture the morphology and material characteristics of the target dispensing without damaging the dispensing itself, avoiding problems such as glue denaturation and morphological changes caused by strong light irradiation; Second, the main camera and the slave camera acquire scanning images from different angles, which can comprehensively cover the three-dimensional morphology of the target dispensing, avoiding the loss of information from single-angle shooting, and providing more comprehensive data support for the determination of irradiation parameters; Third, based on the analysis of information such as the reflectivity and material characteristics of the dispensing based on the scanning images, irradiation parameters suitable for the current dispensing scenario can be determined in a targeted manner, solving the problem of poor adaptability of fixed irradiation parameters and easy image blurring in the prior art, laying the foundation for high precision in subsequent formal testing; Fourth, the pre-scanning process is fast and efficient, and will not affect the cycle time of the high-speed production line, achieving a balance between detection accuracy and detection efficiency.
[0038] For example, the core formula for determining illumination parameters based on scanned images is as follows:
[0039] ;
[0040] In the formula, each parameter is defined as follows: Para is the final set of irradiation parameters. Let I be the candidate set of illumination parameters, which contains all possible combinations of illumination parameters; I(p) is the scanned image under the corresponding parameter p. std The standard clear imaging template is a pre-calibrated, defect-free, clear image of the adhesive application. Loss is the image sharpness loss function, used to quantify the difference in sharpness between the scanned image and the standard template. The smaller the loss value, the clearer the image. This formula is used to select the optimal irradiation parameters that make the scanned image closest to the standard template.
[0041] S400: Based on illumination parameters, a detection beam is emitted towards the target dispensing via an optical device.
[0042] In some possible implementations, the illumination parameters include at least one of the following: the selection of the scanning beam source, the scanning illumination angle, the pulse width, the exposure duration, the pulse width modulation parameter, and the light source exposure sequence. The roles of each parameter in setting the detection beam are as follows:
[0043] The selection of light source is to adapt to the target dispensing of different materials. Different wavelengths of light source have different penetration and reflectivity for different types of adhesives such as epoxy, silicone, and UV adhesive. The appropriate selection of light source can effectively improve the contrast between dispensing and the workpiece background, and avoid defects that are missed due to reflection or insufficient light transmission.
[0044] The scanning illumination angle needs to be matched with the shooting angles of the main camera and the slave camera. By adjusting the illumination angle, the shadow blind spots on the dispensing surface can be eliminated, ensuring the complete presentation of the three-dimensional shape of the dispensing and providing a clear imaging basis for multi-angle image fusion.
[0045] Pulse width is used to control the intensity concentration of the detection beam. An excessively wide pulse width can easily cause localized heating and denaturation of the adhesive, while an excessively narrow pulse width will reduce the brightness of the beam. A proper setting can ensure image clarity while avoiding damage to the adhesive. Exposure time is linked to the camera's shooting speed to adapt to the cycle time requirements of high-speed production lines. Excessive exposure will result in overexposed images and loss of details, while excessively short exposure will result in dark images and difficulty in identifying defects. Precise settings can obtain clear inspection images.
[0046] The pulse width modulation parameter is used to adjust the duty cycle of the pulse beam, enabling precise control of the light intensity. This allows for adaptation to different ambient light intensities and adhesive surface roughness, further optimizing the imaging effect.
[0047] The light source exposure sequence is used to coordinate with the dispensing production cycle, so as to realize the synchronous linkage between the detection beam and the dispensing action, avoid image blurring caused by dispensing movement, and ensure that every dispensing area can be accurately illuminated and photographed, thus ensuring the continuity and comprehensiveness of the inspection.
[0048] The S500 acquires detection images of the target dispensing material under the illumination of the detection beam using both the main camera and the slave camera.
[0049] S600. Determine the dispensing quality of the target adhesive based on the detection image.
[0050] In some possible implementations, such as Figure 2 As shown, defect detection and discrimination can be achieved based on the following discriminant network, specifically: the discriminant network includes a lightweight feature extraction network and a multi-branch feature fusion network.
[0051] In some possible implementations, the morphology-based feature extraction network can employ a lightweight morphological feature segmentation algorithm (LRP) to meet the requirements of quickly locating the adhesive path region and removing irrelevant background interference in dispensing defect detection. The specific formula is as follows:
[0052] 1. Dynamic thresholding formula based on adaptive threshold of local mean:
[0053] Let the grayscale value of pixel (x,y) be f(x,y), and the mean of the local window be m(x,y). Then the binarization result g(x,y) is:
[0054] ;
[0055] The parameters are defined as follows: f(x,y) is the gray value of the pixel at coordinates (x,y) in the detected image; m(x,y) is the average gray value of all pixels within the local window centered at pixel (x,y). The bias parameter is set based on the reflectivity feedback from the scanned image, and is used to adjust the threshold for different reflectivity adhesives; g(x,y) is the pixel value after binarization, where 1 represents the dispensing area and 0 represents the background area.
[0056] 2. Morphological closing operation formula (dilation followed by erosion):
[0057] ;
[0058] In the formula, the parameters are defined as follows: The input detection image; For morphological operations, the structural element is a pre-defined regular shape used for erosion and dilation operations; I dilate (I,B) represents the result of dilution operation on image I. erode (I,B) represents the result after performing an erosion operation on image I; close (i,b) is the image after the closing operation, used to connect the broken areas in the adhesive path caused by reflection.
[0059] 3. Multi-scale morphological gradient formula:
[0060] ;
[0061] In the formula, the parameters are defined as follows: Grad(I) is the extracted morphological gradient image, used to highlight the edge features of the adhesive application; n is the preset number of scales; B k is the structuring element at the k-th scale, with different scales used to accommodate dispensing defects of different sizes; this formula is used to extract candidate region ROI_mask.
[0062] In some possible implementations, the multi-branch feature fusion network includes a main branch discriminant network and a fusion discriminant network.
[0063] For example, the main branch discriminant network adopts the improved Mobile NetV3-Small, which has a simple structure and high computational efficiency, enabling rapid classification and recognition of feature-segmented images (e.g., identifying normal / abnormal dispensing), thus meeting the real-time inspection requirements of high-speed production lines. Its specific formula is as follows:
[0064] 1. Discriminant function formula:
[0065] Let the main branch network be f_main, the input be the feature segmentation image M, and the output be the confidence vector Y. m :
[0066] ;
[0067] In the formula, the parameters are defined as follows: f main The mapping relationship of the main branch discriminant network; M is the feature segmentation image, and the mask image of the glue-dispensing area; Y m W is the confidence vector output by the network, containing confidence scores for both normal and abnormal dispensing. m The convolutional kernel weights of the main branch network are learned during network training; q(M) is the feature mapping of the feature segmentation image M, which converts the image into a high-dimensional feature vector; b m The bias term of the main branch network is used to correct the offset of the feature map.
[0068] 2. Cascaded gating decision formula:
[0069] Define a decision function H(Ym), and use double threshold logic [T low , T high ]
[0070] ;
[0071] In the formula, the parameters are defined as follows: H(Y) m ) is the decision function, used to output the dispensing quality judgment result; max(Y) m Y is the confidence vector.m The maximum value in T corresponds to the most likely quality category; high The threshold value for determining pass / fail is a preset value; values greater than this threshold are considered pass / fail. low The threshold for determining non-compliance is a preset value; if the value is less than this threshold, the product is considered non-compliance. When a suspected anomaly is detected, the fusion discrimination logic is triggered. This setting ensures that no potential defects are overlooked, balancing detection speed and recall rate.
[0072] For example, such as Figure 2 As shown, the fusion discriminant network can include a two-stream convolutional module and a feature fusion module. It adopts a two-stream collaborative fusion network structure, which is specifically adapted to the fusion discriminant requirements of multi-angle images from master and slave cameras. The specific formula is as follows:
[0073] 1. Spatial isomorphism mapping formula (based on homography matrix H):
[0074] If the main camera detects an abnormal center point Pm(xm, ym), its corresponding center point Ps(xs, ys) in the slave camera satisfies:
[0075] ;
[0076] In the formula, each parameter is defined as follows: P m (x m ,y m ) are the coordinates of the center point of the anomalous feature in the main camera image; P s (x s ,y s H represents the coordinates of the center point of the anomalous feature in the image captured by the main camera; H is the spatial coordinate transformation matrix between the images captured by the main camera and the images captured by the secondary camera, used to map the pixel coordinates of the two cameras; in the matrix, h 00 -h 21 These are matrix elements, obtained through camera calibration operations.
[0077] 2. Feature alignment formula (based on STN module):
[0078] ;
[0079] In the formula, the parameters are defined as follows: F align The aligned feature maps are from the camera branch; STN is a spatial transformation network used to correct the spatial offset of the feature maps; F s The original feature map is extracted from the camera branch; θ is a fine-tuned parameter automatically learned by the sub-network based on the correlation between master and slave features, used to compensate for the mapping offset caused by mechanical errors.
[0080] 3. Adaptive weight fusion formula:
[0081] ;
[0082] In the formula, the parameters are defined as follows: Z is the final judgment result (qualified / unqualified) of the fusion discriminant network; MLP is a multilayer perceptron used to classify and discriminate the fused features; α is a weight coefficient controlled by the material reflectivity R, with a value range of 0 < <1, used to adjust the ratio of features between the master and slave cameras; The global contour features of the main camera area image are used to extract features such as the shape and size of the adhesive dots. This method extracts microscopic features such as surface roughness and reflectivity of the adhesive from the local texture features of the camera area image.
[0083] In some possible implementations, such as Figure 3 As shown, step S600 further includes the following sub-operations: steps S610-S620:
[0084] S610. Based on the feature extraction network, adaptive threshold segmentation combined with connected component analysis is used to preprocess the detection image of the main camera to obtain the feature segmentation image of the target dispensing.
[0085] The specific formula for connected component analysis is as follows:
[0086] 1. Connected component labeling formula:
[0087] ;
[0088] In the formula, the parameters are defined as follows: L(x,y) is the connected component label of pixel (x,y), used to distinguish different connected regions; new_label is the label value of the new connected component, which is an integer that increments sequentially, used to mark the newly discovered connected region; g(x,y) is the binarized pixel value, with a value of 1 indicating the glue application area and a value of 0 indicating the background area; neighbor(x,y) is the neighboring pixel of pixel (x,y), usually 8-neighbor or 4-neighbor, that is, the surrounding adjacent pixels.
[0089] 2. Connected component filtering formula:
[0090] ;
[0091] In the formula, the parameters are defined as follows: ROI is the set of effective dispensing areas after screening; L j S(L) is the label of the i-th connected component; j S is the area of the i-th connected component (the total number of pixels within that region); min The minimum connected component area threshold is a preset value used to remove connected components with minor noise such as dust. Let R be the aspect ratio of the i-th connected component, that is, the ratio of the length to the width of the bounding box of the connected component;min ,R max [ ] represents the reasonable aspect ratio range of the dispensing connected regions, which is a preset value used to filter connected regions that conform to the dispensing pattern; this formula is used to eliminate noisy connected regions and retain the effective dispensing area.
[0092] S620. Input the feature segmentation image, as well as the detection images corresponding to the main camera and the slave camera, into the multi-branch feature fusion network, and determine the dispensing quality of the target dispensing based on the multi-branch feature fusion network.
[0093] In some possible implementations, such as Figure 4 As shown, step S620 further includes the following sub-operations: steps S621-S622:
[0094] S621. The feature segmentation image is classified and recognized by the main branch discriminant network.
[0095] S622. When the main branch discrimination network determines that the current target dispensing is abnormal, the fusion discrimination network performs fusion discrimination based on the detection images corresponding to the main camera and the slave camera respectively, so as to further determine whether the abnormal dispensing is unqualified dispensing.
[0096] In some examples, such as Figure 4 As shown, the operation of step S622 also includes the following sub-operations from steps S6221 to S6224:
[0097] S6221. Construct the spatial coordinate transformation matrix between the images captured by the main camera and the slave camera.
[0098] The specific formula for constructing the spatial coordinate transformation matrix (homography matrix H) is as follows:
[0099] ;
[0100] The solution formula is as follows:
[0101] ;
[0102] In the formula, the parameters are defined as follows: H is the homography matrix (a 3×3 matrix used to implement the projection transformation of the pixel coordinates of the master and slave cameras); h 00 -h 21 The matrix elements are obtained through camera calibration operations; (x mi ,y mi ) is the coordinate of the i-th feature point in the main camera image; (x si ,y si (i) represents the coordinates of the feature point corresponding to the i-th feature point in the camera image; n is the number of feature point pairs used for calibration, which is a preset value; the more pairs, the higher the calibration accuracy. L2 norm and Euclidean norm are used to calculate the distance between two vectors, i.e., the coordinate mapping error; this formula is used to solve for the homography matrix H that minimizes the coordinate mapping error.
[0103] S6222. Based on the spatial coordinate transformation matrix and the coordinate information of the abnormal dispensing features in the feature segmentation image, determine the potential coordinate regions of the abnormal dispensing features on the detection images corresponding to the main camera and the slave camera, respectively.
[0104] S6223. Based on the potential coordinate regions, extract the corresponding region images from the detection images corresponding to the main camera and the slave camera respectively.
[0105] S6224. Based on the dual-stream collaborative fusion network, the regional images corresponding to the main camera and the slave camera are processed respectively to further determine whether the abnormal dispensing is unqualified dispensing.
[0106] In this application, Figure 3 and Figure 4 In the embodiments described above, the hierarchical and refined detection process design achieves efficient and accurate detection of dispensing defects, resulting in significant beneficial effects:
[0107] First, step S610 uses adaptive threshold segmentation combined with connected component analysis to preprocess the detection image, which can quickly lock the target dispensing area, effectively remove irrelevant noise interference such as dust, reduce the impact of background information on subsequent detection, and accurately preserve the complete features of the dispensing area, providing high-quality feature input for subsequent defect discrimination and improving detection accuracy.
[0108] Second, in step S620, the feature segmentation image and the detection images from the master and slave cameras are jointly input into the multi-branch feature fusion network, which realizes the full utilization of multi-dimensional image information and avoids the failure to detect defects due to insufficient information from a single image.
[0109] Third, steps S621-S622 adopt a hierarchical mechanism of rapid discrimination by the main branch and precise verification by the fusion branch. The main branch can quickly screen out normal dispensing and abnormal dispensing, which greatly improves detection efficiency and adapts to the cycle time of high-speed production lines. The fusion branch further discriminates abnormal dispensing, effectively reducing the false alarm rate and achieving a balance between detection efficiency and accuracy.
[0110] Fourth, steps S6221-S6224 construct a spatial coordinate transformation matrix to achieve accurate spatial mapping of the master and slave camera images, which can quickly locate the corresponding area of abnormal dispensing in the dual-camera images, avoiding redundant calculation of invalid areas. At the same time, based on the dual-stream collaborative fusion network, global contour and local texture features are extracted and fused respectively, which can accurately identify minute defects (such as minor glue breaks and tiny glue bubbles), further improving the discrimination accuracy of unqualified dispensing and ensuring the reliability of the detection results.
[0111] For example, in step S6224, based on the dual-stream convolution module, global contour features are extracted from the region image of the main camera, and local texture features are extracted from the region image of the camera; based on the feature fusion module, the global contour features and local texture features are aligned; the aligned feature maps are channel-overlayed, and based on the overlay feature map, it is further determined whether the abnormal dispensing is unqualified dispensing. The specific formulas for extracting global contour features and local texture features are as follows:
[0112] 1. Global contour feature extraction formula:
[0113] ;
[0114] In the formula, the parameters are defined as follows: The global contour feature vector of the main camera region image; Image patches of abnormal regions extracted from the main camera; The convolutional module consists of convolutional layers, batch normalization layers, and activation function layers, and is used for feature extraction. is the contour feature convolution kernel, and is a preset value used to capture macroscopic features such as the contour and edges of the adhesive application.
[0115] 2. Formula for extracting local texture features:
[0116] ;
[0117] In the formula, the parameters are defined as follows: This is a local texture feature vector from the camera region image; Image patches of anomalous regions extracted from the camera; This is a Gabor filtering operation used to extract texture features from an image; This is the standard deviation of the filter, used to control the smoothness of the filter. The filtering direction is used to capture texture details in different directions; this formula is used to extract subtle texture features from the dispensing surface.
[0118] In this embodiment, the above steps extract the global contour features of the main camera region image and the local texture features of the slave camera region image through a dual-stream convolution module, respectively, achieving comprehensive capture of the macroscopic shape and microscopic detail features of the dispensing. The two are highly complementary and can effectively compensate for the limitations of single feature extraction. Feature alignment operation can correct feature offset caused by mechanical errors in the main and slave camera images, ensuring the accuracy of feature fusion. Deep feature fusion is achieved through channel overlay, which enhances the distinguishability of defect features and can accurately identify minute defects, such as tiny glue bubbles and surface scratches, further improving the accuracy of abnormal dispensing judgment, reducing the false alarm rate, and providing reliable support for the final judgment of unqualified dispensing, while adapting to the real-time detection requirements of high-speed production lines.
[0119] In some possible implementations, changes in ambient light can affect the accuracy of detection. Therefore, the illumination parameters can be updated periodically. Alternatively, an ambient light detection module can be configured to trigger updates to the illumination parameters based on changes in ambient light. For example, after determining the illumination parameters, a scanning beam is re-emitted via an optical device after a fixed working time to update the illumination parameters; or, in response to changes in ambient light, a scanning beam is re-emitted via an optical device to update the illumination parameters. The specific formula for updating the ambient light-responsive parameters is as follows:
[0120] ;
[0121] In the formula, the parameters are defined as follows: For the updated set of irradiation parameters; This is the original set of irradiation parameters before the update; This represents the change in ambient light intensity, specifically the difference between the current ambient light intensity and the initial ambient light intensity. This is the ambient light correction factor, used to compensate for the impact of ambient light variations on imaging; it satisfies... Where k is a correction coefficient, experimentally calibrated, used to adjust the correction amplitude to adapt to different ambient light variation ranges. In this embodiment, by updating the irradiation parameters periodically or in response to ambient light, the parameter drift caused by changes in ambient light and long-term operation can be dynamically compensated, avoiding problems such as image blurring and defect misjudgment caused by ambient light fluctuations. The parameter correction is performed using a preset formula to ensure that the updated irradiation parameters are accurately adapted to the current environment without manual intervention, thus improving the automation level of the inspection. At the same time, the update process is achieved by re-emitting the scanning beam, which continues the advantages of weak light pre-scanning, does not damage the dispensing, and the update process is fast, does not affect the cycle time of the high-speed production line, ensures long-term stable detection accuracy, and adapts to the complex and ever-changing environment of the workshop.
[0122] Secondly, embodiments of this application provide a defect detection system 1 for the dispensing process, such as... Figure 5As shown, the defect detection system 1 for the dispensing process includes a main camera 10, a slave camera 20, an optical device 30, and a controller 40. The main camera 10 and slave camera 20 are used to capture images of the target micelles from different shooting angles. The controller 40 is used to: during the initial defect detection, control the optical device 30 to emit a scanning beam towards the target dispensing D, the intensity of which is less than the intensity of the detection beam used for formal defect detection; control the main camera 10 and slave camera 20 to acquire scanning images of the target dispensing D under the illumination of the scanning beam; determine the illumination parameters of the detection beam during defect detection based on the scanning images; control the optical device 30 to emit a detection beam towards the target dispensing based on the illumination parameters; control the main camera 10 and slave camera 20 to acquire detection images of the target dispensing D under the illumination of the detection beam; and determine the dispensing quality of the target dispensing D based on the detection images.
[0123] Regarding Figure 5 The technical principles and specific implementation techniques of the defect detection system 1 for the dispensing process shown can be found in the description of the above-described embodiment of the defect detection method for the dispensing process, and will not be repeated here.
[0124] Thirdly, embodiments of this application also provide a computer-readable storage medium including instructions that, when executed on a processor, cause the processor to perform a defect detection method for a dispensing process as described in the first aspect above (e.g., Figure 1 , Figure 3 He Ru Figure 4 The documented defect detection method for the dispensing process.
[0125] Fourthly, embodiments of this application also provide a computer device, which may be a server, and its internal structure diagram may be as follows. Figure 6 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it performs the control functions required in the aforementioned defect detection method for the dispensing process.
[0126] For example, embodiments of this application also provide a controller, which includes a processor, a memory, a bus, and a device interface.
[0127] The processor calls executable program code stored in the memory to execute any of the defect detection methods for the dispensing process disclosed in the embodiments of this application. The memory stores executable program code, which, when executed by the processor, can implement any of the defect detection methods for the dispensing process disclosed in the embodiments of this application. A bus is used to transfer program code data stored in the memory to the processor for execution. A device interface is connected to the bus to enable connection between the processor and the memory and other devices.
[0128] Optionally, the memory may include read-only memory and random access memory, and provide instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor can be used to execute instructions stored in the memory, and when the processor executes the instructions, the processor can perform the various steps and / or processes corresponding to the controller in the above method embodiments.
[0129] Optionally, the memory can be located outside the controller and communicate with the controller.
[0130] It should be understood that, in the embodiments of this application, the processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0131] It should be noted that the controller may also include components not shown, such as a power supply, which will not be elaborated upon in this embodiment. The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0132] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0133] It should be understood that the phrases "one embodiment," "an embodiment," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment," "in one embodiment," or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The descriptions of the various embodiments above tend to emphasize the differences between the various embodiments; their similarities or commonalities can be referred to mutually, and for the sake of brevity, they will not be repeated here.
[0134] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0135] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or modules can be electrical, mechanical, or other forms.
[0136] The modules described above as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network units; some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional modules in the various embodiments of this application may all be integrated into one processing unit, or each module may be a separate unit, or two or more modules may be integrated into one unit; the integrated modules may be implemented in hardware or in a combination of hardware and software functional units. Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions, and the aforementioned program may be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments; the aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks. Alternatively, if the integrated units of this application are implemented as software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0137] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict. The features disclosed in the several product embodiments provided in this application can be arbitrarily combined to obtain new product embodiments without conflict. The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined to obtain new method embodiments or device embodiments without conflict. The above descriptions are merely embodiments of this application, but the protection scope of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A defect detection method for dispensing processes, characterized in that, A defect detection system for a dispensing process is provided, the system comprising a main camera, a slave camera, and optical devices, wherein the main camera and the slave camera are used to image the target micelles from different shooting angles; the method includes: During the initial defect detection, a scanning beam is emitted toward the target dispensing via the optical device. The intensity of the scanning beam is less than the intensity of the detection beam used for formal defect detection. The main camera and the slave camera respectively acquire scan images of the target dispensing material under the illumination of the scanning beam; Based on the scanned image, determine the illumination parameters of the detection beam during defect detection; Based on the irradiation parameters, a detection beam is emitted toward the target dispensing via the optical device; The main camera and the slave camera respectively acquire detection images of the target dispensing under the illumination of the detection beam; The dispensing quality of the target adhesive is determined based on the detected image.
2. The defect detection method for dispensing process according to claim 1, characterized in that, Determining the dispensing quality of the target adhesive based on the detected image includes: Based on the feature extraction network, adaptive threshold segmentation combined with connected component analysis is used to preprocess the detection image of the main camera to obtain the feature segmentation image of the target dispensing. The feature segmentation image, as well as the detection images corresponding to the main camera and the slave camera, are input into a multi-branch feature fusion network, and the dispensing quality of the target dispensing is determined based on the multi-branch feature fusion network.
3. The defect detection method for dispensing process according to claim 2, characterized in that, The multi-branch feature fusion network includes a main branch discriminant network and a fusion discriminant network; The determination of the dispensing quality of the target dispensing based on the multi-branch feature fusion network includes: The feature segmentation image is classified and identified using the main branch discriminant network. When the main branch discrimination network determines that the current target dispensing is abnormal, the fusion discrimination network performs fusion discrimination based on the detection images corresponding to the main camera and the slave camera respectively, in order to further determine whether the abnormal dispensing is unqualified dispensing.
4. The defect detection method for dispensing process according to claim 3, characterized in that, The step of fusing and discriminating based on the feature segmentation images corresponding to the main camera and the slave camera through the fusion discriminating network to further determine whether the abnormal glue dispensing is unqualified glue dispensing includes: Construct a spatial coordinate transformation matrix between the images captured by the main camera and the images captured by the slave camera; Based on the spatial coordinate transformation matrix and the coordinate information of the abnormal glue dispensing feature in the feature segmentation image, the potential coordinate region of the abnormal glue dispensing feature on the detection images corresponding to the main camera and the slave camera respectively is determined; Based on the potential coordinate region, the corresponding region images are extracted from the detection images corresponding to the main camera and the slave camera, respectively; The images of the regions corresponding to the main camera and the slave camera are processed based on the dual-stream collaborative fusion network to further determine whether the abnormal dispensing is unqualified dispensing.
5. The defect detection method for dispensing process according to claim 4, characterized in that, The process of processing the region images corresponding to the main camera and the slave camera respectively based on the dual-stream collaborative fusion network to further determine whether the abnormal dispensing is unqualified dispensing includes: Based on the dual-stream convolution module, global contour features are extracted from the region image of the main camera, and local texture features are extracted from the region image of the secondary camera; Based on the feature fusion module, the global contour features and the local texture features are aligned; the aligned feature maps are then overlaid with channels, and the abnormal dispensing is further determined based on the overlaid feature maps to determine whether the dispensing is defective.
6. A defect detection method for a dispensing process according to any one of claims 1-5, characterized in that, The scanning beam is used to project a grating pattern onto the area where the target adhesive is located. The grating pattern is used to indicate the morphological features and optical properties of the target adhesive.
7. The defect detection method for dispensing process according to claim 6, characterized in that, The illumination parameters include at least one of the following: light source selection of the scanning beam, scanning illumination angle, pulse width, exposure duration, pulse width modulation parameters, and light source exposure sequence.
8. The defect detection method for dispensing process according to claim 7, characterized in that, Once the illumination parameters are determined, the scanning beam is re-emitted through the optical device after a fixed working time to update the illumination parameters; or, in response to a change in ambient light, the scanning beam is re-emitted through the optical device to update the illumination parameters.
9. A defect detection system for dispensing processes, characterized in that, The system includes a main camera, a slave camera, optical devices, and a controller; wherein the main camera and the slave camera are used to image the target micelles from different shooting angles; the controller is used for: During the initial defect detection, the optical device is controlled to emit a scanning beam toward the target dispensing, and the intensity of the scanning beam is less than the intensity of the detection beam used for formal defect detection. The main camera and the slave camera are controlled to acquire scanned images of the target adhesive dispensing under the illumination of the scanning beam; Based on the scanned image, determine the illumination parameters of the detection beam during defect detection; Based on the irradiation parameters, the optical device is controlled to emit a detection beam toward the target dispensing; The main camera and the slave camera are controlled to acquire detection images of the target dispensing material under the illumination of the detection beam, respectively. The dispensing quality of the target adhesive is determined based on the detected image.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on a processor, cause the processor to perform a defect detection method for a dispensing process as described in any one of claims 1-8.