Gluing line defect detection method and system based on multispectral image recognition

By using multispectral image recognition technology and convolutional neural network models, the problem of defect detection caused by warping deformation of the adhesive coating line after heat setting was solved, achieving high-precision defect identification and dynamic parameter adjustment of the warped adhesive coating line, thus improving the production quality of false eyelashes.

CN121883377APending Publication Date: 2026-04-17QINGDAO JIAHE YONGRUN BEAUTY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QINGDAO JIAHE YONGRUN BEAUTY TECH CO LTD
Filing Date
2025-12-19
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies cannot effectively identify changes in spectral reflectance characteristics caused by the warping deformation of the glue lines on false eyelashes after heat setting, resulting in a decrease in the accuracy of glue line defect detection. In particular, defects such as side glue overflow and edge roughness of warped glue lines cannot be fully represented by a single frontal view detection algorithm.

Method used

A multispectral image recognition method is adopted, which acquires multispectral images of the top surface and one side surface of the coating line through a circular stage and a multispectral imaging mechanism. Combining spectral correction algorithm, coating line feature band operation and multi-source image fusion algorithm, a convolutional neural network model is used for defect identification, and the coating parameters are dynamically adjusted by a PID controller.

Benefits of technology

It enables full-dimensional image acquisition of warped glue coating lines, improves the accuracy and precision of defect identification, reduces the defect missed rate, and ensures the quality control of glue coating lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121883377A_ABST
    Figure CN121883377A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of false eyelash image recognition, in particular to a gluing line defect detection method and system based on multispectral image recognition, and the method comprises the steps that false eyelash bases are attached to a heating aluminum ring, the false eyelash bases are connected in series through a silk thread, a gluing mechanism is used for gluing along the silk thread to form a gluing line, and the gluing line is connected with the heating aluminum ring; the gluing line is deformed by heating the aluminum ring, and eyelash is promoted to fill gaps of the gluing line; the platform deck rotates the glued false eyelashes to a detection area, the multispectral imaging mechanism obtains multispectral images of the top face and the single side face of a gluing line, the images are preprocessed, and the preprocessing on the images comprises the steps of eliminating ambient light interference through a spectrum correction algorithm and highlighting a defect area through a gluing line characteristic wave band operation enhancement algorithm; and integrating spectral image features by using a multi-source image fusion algorithm, generating a fusion feature map according to the preprocessed image, and inputting the fusion feature map into a convolutional neural network model to realize the detection of the defects of the gluing line with the radian.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of false eyelash image recognition technology, and in particular to a method and system for detecting defects in adhesive lines based on multispectral image recognition. Background Technology

[0002] The adhesive coating line of artificial eyelashes is the core structure connecting the lashes to the base. Its quality directly determines the adhesion and wearing comfort of the false eyelashes. Common defects in the adhesive coating line include broken glue, excess glue, and rough edges. In current false eyelash production and inspection technologies, the adhesive coating line remains horizontal after application, without curvature. Defect detection is only performed by acquiring images from a single frontal view. However, improved artificial eyelashes require a certain curvature in the base for a more natural and comfortable fit. This also necessitates a certain curvature in the adhesive coating line. This method of application makes the adhesive coating line more prone to defects, thus requiring defect identification to improve production quality. Specifically, as the requirements for the naturalness of false eyelashes increase, the adhesive coating line needs to be shaped by heating to conform to the curve of the eyelid. A single frontal view cannot adequately meet the detection requirements of curved adhesive coating lines.

[0003] Existing detection algorithms designed for planar adhesive lines do not consider the changes in spectral reflectance characteristics caused by warping and thermal curing of the adhesive line after heating. When the adhesive line warps, the contrast between the adhesive line and the substrate and threads is significantly reduced. Traditional front-view detection algorithms cannot effectively distinguish defects from the background. Furthermore, although defects in planar adhesive lines, such as adhesive breaks, can be clearly observed from the front view, defects such as side adhesive overflow and edge roughness of warped adhesive lines cannot be fully presented from a single front view. Existing technologies lack targeted multi-view image acquisition and processing solutions.

[0004] Therefore, in order to solve the problems of applying glue and heating to shape the base of false eyelashes after bending, the inaccuracy of single-view defect identification of glue lines, and the difficulty of identification due to the reduced spectral contrast of glue lines after heating and shaping, a method and system for detecting glue line defects with curvature is needed to achieve the detection of glue line defects based on multispectral image recognition. Summary of the Invention

[0005] To address the aforementioned problems, this invention provides a method and system for detecting defects in adhesive coating lines based on multispectral image recognition.

[0006] In a first aspect, the present invention provides a method for detecting defects in adhesive coating lines based on multispectral image recognition, comprising: S1. Configure a testing device, the testing device including a circular stage, a multispectral imaging mechanism, a glue application mechanism and a heating and shaping mechanism, the multispectral imaging mechanism including a vertical arm extending into the center of the circular stage and a horizontal arm placed above the circular stage, the vertical arm is equipped with a first multispectral camera and the horizontal arm is equipped with a second multispectral camera, the heating and shaping mechanism includes a heating aluminum ring placed on the circular stage; S2. The false eyelash base is attached to the heating aluminum ring. The false eyelash base is connected by threads. The glue is applied along the threads by the glue application mechanism to form a glue application line. The heating aluminum ring deforms the glue application line and promotes the eyelashes to fill the gaps in the glue application line. S3. The stage rotates the glued false eyelashes to the detection area. The multispectral imaging mechanism acquires multispectral images of the top surface and one side of the glued line. The images are preprocessed. The image preprocessing includes using a spectral correction algorithm to eliminate ambient light interference, using a glued line feature band operation enhancement algorithm to highlight the defect area, using a multi-source image fusion algorithm to integrate the spectral image features, generating a fusion feature map based on the preprocessed image, and inputting the fusion feature map into a convolutional neural network model. The convolutional neural network model, combined with a multi-scale feature extraction algorithm, outputs the defect type. S4. Based on the type of defect output, control the sorting mechanism to reject defective products, and dynamically adjust the glue application parameters of the glue application mechanism through a PID controller.

[0007] Furthermore, the method of eliminating ambient light interference using a spectral correction algorithm includes: Acquire ambient light images Image of the standard whiteboard after finalization The standard whiteboard image is a simulated image of the change in reflective properties after the glue coating line has been shaped using the same heat setting process; The formula for eliminating equipment noise and environmental interference is: ,in, These are the pixel values ​​of the original multispectral image of the adhesive coating line. For the spectral band, For pixel coordinates, The spectral response coefficient of the multispectral camera is... This is the reflection compensation coefficient after finalization; Calculate the deviation between the average spectral value of the adhesive coating area after eliminating equipment noise and environmental interference and the baseline spectral value of the training samples. Ensure the deviation is less than a preset value; otherwise, adjust accordingly. Value duplication correction.

[0008] Furthermore, the algorithm for enhancing the highlighting of defect areas using the characteristic bands of the adhesive coating line includes: Determine the sensitive band of the adhesive coating line Threads distinguish wavebands and base reference band ; The contrast between the adhesive coating line and the substrate is enhanced using a band calculation formula, expressed as follows: ,in, For the enhanced feature image pixel values, , For band weights, for and The spectral covariance is used to compensate for changes in spectral correlation caused by modeling. This is the covariance adjustment factor; Using an adaptive threshold pruning algorithm Perform grayscale adjustment to limit pixel values ​​to the range [0, 255].

[0009] Further, the step of generating a fused feature map based on the preprocessed image includes: The multispectral images are divided into image pairs, including a top-side transmission image and a top-side reflection image. Each image pair includes two images with positional deviations. The defect types of the glued lines after shaping are initially classified, and either the first mode or the second mode is executed. The first mode includes performing an edge detection algorithm to extract candidate defect regions for each image pair, and integrating the two candidate regions through a weighted fusion algorithm. The first fused feature map is expressed by the formula: ,in, These are candidate defect images for the two sets of images. The first fusion weight; The second mode involves integrating each group of images using a pixel-level fusion algorithm, and the second fused feature map is expressed by the formula: ,in, This is a transmission image. For reflection images, ,right Execute the defect detection algorithm; Preliminary classification as glue breakage defect selects the first mode; preliminary classification as glue overflow defect selects the second mode.

[0010] Furthermore, the adjustment rule for the fusion weight α includes: The detection rates of glue breakage defects (R1) and glue overflow defects (R2) in the training set were statistically analyzed. By adjusting α, we ensure that image groups with high detection rates receive higher weights. ; The adjusted first fusion feature map Perform morphological closing operations to fill holes in defect areas and improve the integrity of defect contours.

[0011] Furthermore, the convolutional neural network model, combined with a multi-scale feature extraction algorithm, outputs defect types, including: Construct a suitable convolutional neural network model for the first fused feature map. Or the second fusion feature map Perform feature extraction; Using transfer learning to load ImageNet pre-trained weights, and employing a hybrid loss function: ,in For cross-entropy loss, For domain adaptation loss, For loss weights; in, , For one-hot tags, To predict probabilities; Using the AdamW optimizer, the learning rate is calculated as follows: attenuation, The iteration stops when the accuracy of the validation set reaches a preset value, and the model weights are saved.

[0012] Furthermore, the first fused feature map Or the second fusion feature map Feature extraction is performed, including feature enhancement algorithms utilizing coordinate attention layers, specifically including: Global average pooling is performed on the feature map output by the second convolutional layer to obtain horizontal or vertical channel features. Perform 1×1 convolution and Sigmoid activation on the horizontal or vertical channel features respectively to generate attention weights; The attention weights are multiplied element-wise by the original feature map to increase the focus on the width of the adhesive coating line, as expressed by the formula: ,in For the enhanced feature map, This is the feature map output by the second convolutional layer. The attention weights are for the horizontal channel features. The attention weights are for the vertical channel features.

[0013] Furthermore, the method of controlling the sorting mechanism to reject defective products based on defect type includes: Obtain the defect probability of the defect type output by the model. Where k=1 represents glue breakage, k=2 represents glue overflow, and k=3 represents rough edges, a probability threshold is set. The This indicates that the prediction confidence level for this type of defect has reached the preset confidence level. Joint determination based on spectral features of the fused feature map: like And the length of the glue break The defect type was determined to be glue breakage, among which, This represents the spectral brightness value of the current sample's coated area. The mean spectral brightness of the defect-free sample. The first preset ratio for determining glue breakage. A preset threshold is set for the length of the adhesive break; like The defect type was determined to be excess glue, among which, The spectral brightness value of the preset pixel region outside the current sample substrate edge. The second preset ratio for determining excess adhesive; Statistical glue application line edge satisfies The pixel percentage is considered as rough edges if it exceeds a preset percentage threshold. This represents the gradient value at the edge of the adhesive line in the current sample. The maximum gradient value for a defect-free sample. The third preset ratio for determining rough edges; The non-maximum suppression algorithm is used to remove defective regions with duplicate annotations to ensure the uniqueness of the judgment.

[0014] Furthermore, the step of dynamically adjusting the glue application parameters of the glue application mechanism via a PID controller includes: The defect rate of consecutive samples is calculated using a sliding window. The defect rate is expressed by the formula: ,in, This represents the number of non-compliant samples. Set threshold and ,like ≥ This triggers the adjustment of adhesive setting parameters. ≥ Trigger device alerts, Less than ; Adjustments are performed according to the defect type, prioritizing temperature for glue breakage, glue application amount for glue overflow, and setting pressure for burrs. The core error is calculated, with glue overflow corresponding to width error. Temperature error corresponding to glue breakage ; The PID algorithm outputs the adjustment values ​​for adhesive pressure and setting temperature.

[0015] Secondly, a coating line defect detection system based on multispectral image recognition includes: The testing device is configured to include an annular stage, a multispectral imaging mechanism, a glue application mechanism, and a heating and shaping mechanism. The image processing module is configured to acquire multispectral images of the top surface and one side surface of the adhesive coating line, perform preprocessing on the images, the preprocessing of the images includes using a spectral correction algorithm to eliminate ambient light interference, using a characteristic band operation enhancement algorithm of the adhesive coating line to highlight the defect area, using a multi-source image fusion algorithm to integrate the features of the spectroscopic image, generating a fused feature map based on the preprocessed image, inputting the fused feature map into a convolutional neural network model, the convolutional neural network model combining a multi-scale feature extraction algorithm to output the defect type; The sorting mechanism is configured to reject non-conforming products based on the type of defect. A PID controller is configured to dynamically adjust the glue application parameters of the glue application mechanism.

[0016] Thirdly, the present invention provides a computer-readable storage medium storing a plurality of instructions adapted to be loaded and executed by a processor of a terminal device as described in the method for detecting adhesive line defects based on multispectral image recognition.

[0017] Fourthly, the present invention provides a terminal device, including a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, the instructions being adapted to be loaded and executed by the processor to provide a method for detecting defects in glue coating lines based on multispectral image recognition.

[0018] In summary, the present invention has the following beneficial technical effects: 1. This invention solves the problem of missed detection of warped glue lines from a single perspective. By using the dual-view design of the top and single side of the L-shaped multispectral imaging mechanism, combined with the stepping rotation of the annular stage, it can achieve full-dimensional image acquisition of the glue line with warping after the heated aluminum ring has been shaped. It can capture the glue breakage defect on the top surface and fully present defects such as glue overflow and edge burrs on the side that cannot be observed from a single positive perspective, thus reducing the defect missed detection rate.

[0019] 2. This invention solves the problem of reduced spectral contrast of the glue coating line after shaping, which leads to difficulty in identification. By introducing a reflection compensation coefficient after shaping through a spectral correction algorithm, it compensates for the changes in spectral characteristics caused by heating curing and warping deformation. Combined with band operations of the sensitive band of the glue coating line, the distinguishing band of the thread, and the reference band of the substrate, the contrast between the glue coating line and the substrate and the thread is enhanced. Furthermore, a differentiated fusion mode is designed for the differentiated characteristics of glue breakage and glue overflow. Glue breakage is given priority for edge detection fusion, and glue overflow is given priority for pixel-level fusion, ensuring that defect features are not blurred or lost, thereby improving the defect identification accuracy of warped glue coating lines after shaping.

[0020] 3. This invention improves the accuracy of identifying fine-sized defects. The convolutional neural network model loads pre-trained weights through transfer learning and combines a hybrid loss function of cross-entropy loss and domain adaptation loss to adapt to the feature distribution of the glue-coating line after shaping. The coordinate attention layer strengthens the feature weights of the horizontal and vertical channels, focusing on fine-sized defects in the width direction of the glue-coating line, solving the problem that defect features are easily interfered with by the background in the warped state, and further ensuring the accuracy of defect identification. Combined with the dynamic output of glue-coating parameters and shaping parameter adjustment values ​​by the PID controller, the defect rate of the glue-coating line is continuously reduced. Attached Figure Description

[0021] Figure 1 This is a flowchart of a glue coating line defect detection method based on multispectral image recognition according to Embodiment 1 of the present invention.

[0022] Figure 2 This is a structural diagram of the detection device according to Embodiment 1 of the present invention.

[0023] Figure 3 This is Embodiment 1 of the present invention. Figure 2 A magnified view of part A in the image.

[0024] Figure 4 This is a module diagram of a glue coating line defect detection system based on multispectral image recognition according to Embodiment 2 of the present invention.

[0025] Among them, 1. Circular stage; 2. Multispectral imaging mechanism; 201. Horizontal arm; 202. Vertical arm; 203. First multispectral camera; 204. Second multispectral camera; 3. Glue application mechanism; 4. Heating and shaping mechanism; 401. Heating aluminum ring; 5. False eyelashes; 501 False eyelash base; 502. Silk thread. Detailed Implementation

[0026] The present invention will be further described in detail below with reference to the accompanying drawings. Example 1

[0027] Reference Figure 1 and Figure 2 This embodiment of a method for detecting adhesive coating line defects based on multispectral image recognition includes: S1. Configure a testing device, which includes a circular stage 1, a multispectral imaging mechanism 2, an adhesive application mechanism 3, and a heating and setting mechanism 4. The circular stage 1 has 18 fixed positions evenly distributed along its circumference. The stage is driven by a stepper motor with a step angle of 20° and a rotation speed adjustable within the range of 5-10 r / min. It is used to support the heating and setting mechanism 4 and drive the false eyelashes 5 to each station. The multispectral imaging mechanism 2 includes a vertical arm 202 extending into the center of the annular stage 1 and a horizontal arm 201 placed above the annular stage 1. A first multispectral camera 203 is provided on the side of the vertical arm 202 near the fixed position of the stage, and a second multispectral camera 204 is provided directly below the horizontal arm 201 at the position corresponding to the fixed position of the stage. All false eyelashes 5 are distributed in an 18-sided shape. The first multispectral camera 203 can illuminate the side of the false eyelash base 501, and the second multispectral camera 204 can illuminate the front of the false eyelashes 5 from above. The spectral detection range of both cameras is 450-900nm, and they are used to acquire multispectral images of the single side and top surface of the adhesive line, respectively. The heating and shaping mechanism 4 includes a heating aluminum ring 401 that is detachably fixed to the fixed position of the annular platform 1. The heating aluminum ring 401 is made of high thermal conductivity aluminum alloy, with a radius of curvature of 8-12mm and a width of 3-5mm. The heating aluminum ring 401 has a built-in heating wire and a temperature sensor, with a temperature control range of 40-80℃, and is used to heat and shape the glue coating line to give it a preset curl.

[0028] Reference Figure 3 S2. The false eyelash base 501 is attached to the outer arc surface of the heating aluminum ring 401 by vacuum adsorption. Alternatively, vacuum adsorption can be omitted, ensuring a tight fit between the false eyelash base 501 and the heating aluminum ring 401. All false eyelash bases 501 are connected in series by threads 502 to form an integral structure. The threads 502 are made of PET chemical fiber with a diameter of 0.1-0.2mm. One to two threads are arranged parallel to the length of the false eyelash base 501, with a spacing of 0.3-0.5mm between adjacent threads, serving as a supporting skeleton for the adhesive lines to improve bonding strength.

[0029] The glue application mechanism 3 is activated. Equipped with a precision dispensing valve, the glue is applied at a uniform speed along the extension direction of the thread 502. The glue pressure is adjusted to 0.15-0.25MPa, and the glue application speed is 5-8mm / s, forming a continuous glue application line with a width of 0.5-0.8mm. The stage is driven by a stepper motor to rotate to the glue application position to begin the glue application process. The heating and shaping mechanism 4 is activated throughout the process. The heating temperature of the heating aluminum ring 401 is set to 50-60℃ according to the characteristics of the glue material. The heat conduction of the heating aluminum ring 401 maintains the softening deformation of the glue application line, and the curvature of the heating aluminum ring 401 is used to form a preset curl that conforms to the eyelid curve. At the same time, the heating promotes the uniform filling of the gaps inside the glue application line by the surrounding eyelashes, reduces air bubbles and voids inside the glue line, and improves the uniformity of the glue application line surface and the bonding firmness of the subsequent eyelashes. The machine rotates to the next false eyelash 5 to be glued. One of the false eyelashes 5 that has been glued is rotated to the glue application line defect detection station.

[0030] S3. The stage, driven by a stepper motor, precisely rotates the applied false eyelashes to the detection area, at which point the annular stage stops rotating. The matching ring-shaped LED light source of the multispectral imaging mechanism is activated, with the light source's spectral range matching the detection range of the multispectral camera to ensure uniform illumination and no shadows in the adhesive-coated area. The distance between the first multispectral camera and the side of the false eyelash base is controlled at 5-8mm, and the distance between the second multispectral camera and the top surface of the false eyelashes is controlled at 10-15mm. Both cameras are synchronously triggered to acquire multispectral images of one side and the top surface of the adhesive-coated line, respectively. Each frame is associated with the stage fixing position number, acquisition time, and base type information of the false eyelashes and stored.

[0031] The acquired multispectral images undergo systematic preprocessing. First, a spectral correction algorithm is used to eliminate interference from ambient light and equipment noise. Then, a feature band enhancement algorithm for the adhesive coating line is used to strengthen the grayscale contrast between the adhesive coating line and the substrate and threads, highlighting the characteristic differences of defect areas such as adhesive breakage and adhesive overflow. Finally, a multi-source image fusion algorithm is used to integrate the spectroscopic image features of the top surface and one side surface to compensate for the lack of information from a single viewpoint. A fused feature map is generated based on the preprocessed image. The fused feature map is scaled to a preset size (256×256 pixels) and then input into a convolutional neural network model. The convolutional neural network model uses a multi-scale feature extraction algorithm to capture the features of fine-sized defects (adhesive breakage) and regional defects (adhesive overflow) in the adhesive coating line. Combined with the defect discrimination rules learned during model training, the model outputs the defect type: adhesive breakage, adhesive overflow, rough edges, or no defect, along with the corresponding confidence level.

[0032] S31. The method of eliminating ambient light interference using a spectral correction algorithm includes: S311. Acquire ambient light image Image of the standard whiteboard after finalization The standard whiteboard image is a simulated image of the change in reflective properties after the glue coating line has been shaped using the same heat setting process; Under environmental conditions identical to those used for acquiring images of the coating line, including identical light source brightness, distance, and temperature, ambient light images were acquired. Image of the standard whiteboard after finalization The standard white board has a reflectivity of ≥99% and undergoes the same heat-setting treatment as the glue-coating line to simulate the change in reflectivity after the glue-coating line is set, ensuring the consistency between the calibration model and the actual testing scenario.

[0033] S312. Eliminate equipment noise and environmental interference. The formula is: ,in, These are the pixel values ​​of the original multispectral image of the adhesive coating line. For the spectral band, For pixel coordinates, The spectral response coefficient of the multispectral camera is... This is the reflection compensation coefficient after finalization; in, The value ranges from 450 to 900 nm, and the wavelengths are divided into bands in 10 nm intervals. The values ​​were obtained through calibration using the spectral response curve provided by the camera manufacturer, with a range of 0.9-1.1. The initial value range is 0.8-1.2, which is used to compensate for the reflectivity shift of the coating line caused by heat setting. This step eliminates the interference of ambient light fluctuations and equipment noise on the spectral data through standardization, ensuring the accuracy of the spectral information of the coating line.

[0034] S313. Calculate the deviation between the average spectral value of the adhesive coating line area after eliminating equipment noise and environmental interference and the baseline spectral value of the training samples, ensuring the deviation is less than a preset value; otherwise, adjust... Value duplication correction.

[0035] Extract the pixels in the glued line region of the corrected image and calculate the average spectral value of that region. .Will Compared with the baseline spectral values ​​of the training samples Compare the two and calculate their relative deviation. If the relative deviation If the correction is valid, the corrected image is retained; otherwise, the relative deviation is considered valid. Then adjust in steps of 0.05. Repeat steps S312 to S313 until the relative deviation meets the requirements. The maximum number of adjustments is 3 to ensure that the accuracy of the corrected spectral data meets the requirements for subsequent feature extraction.

[0036] S32, The algorithm for highlighting defect areas using the characteristic band calculation of the glue coating line includes: S321. Determine the sensitive wavelength of the adhesive coating line. Threads distinguish wavebands and base reference band ; By acquiring multispectral images of 100 defect-free samples, the spectral response curves of the adhesive-coated line, the filament, and the substrate in the 450-900 nm wavelength range were analyzed. The reflectance of the adhesive-coated line in the 550-600 nm wavelength range was significantly higher than that of the substrate and the filament. Therefore, [the following text is incomplete and requires further context: "to collect multispectral images of 100 defect-free samples, the spectral response curves of the adhesive-coated line, the filament, and the substrate in the 450-900 nm wavelength range were analyzed."] The wavelength was set to 580nm, the sensitive band for the coating line, to highlight the main features of the coating line; PET yarns have a characteristic absorption peak in the 700-750nm band, and their reflectivity is lower than that of the coating line and the substrate, therefore... The wavelength is set to 720nm, used to distinguish between the fiber lines and the coated lines. The substrate has stable reflectivity in the 480-520nm wavelength range and the difference from the coated lines is small, therefore... Set to 500n, the base reference band, to provide a background reference.

[0037] S322. Enhance the contrast between the adhesive coating line and the substrate using a band calculation formula, expressed as follows: ,in, For the enhanced feature image pixel values, , For band weights, for and The spectral covariance is used to compensate for changes in spectral correlation caused by modeling. This is the covariance adjustment factor; Based on feature importance Enhance the contribution of the coating line to the sensitive band. To suppress interference in the filament band; Through 1000 sets of samples in the training set and The calculated value, ranging from 0.1 to 0.3, is used to quantify the spectral correlation between the two bands and compensate for the correlation shift caused by heating and shaping. It is set to 0.15 to balance the impact of the covariance term on the overall contrast. , , They are respectively , , Image pixel values ​​after spectral correction. The above operations enhance the grayscale difference between the glue-coated area and the background, significantly highlighting the boundary features of defects such as glue breakage and glue overflow.

[0038] S323, Using an adaptive threshold pruning algorithm to... Perform grayscale adjustment to limit pixel values ​​to the range [0, 255].

[0039] Using an adaptive threshold pruning algorithm Perform grayscale adjustment to match the grayscale range requirements of subsequent image processing. The specific steps are: calculate... The gray-level histogram is used to determine the 99.9th percentile of the gray-level distribution. and 0.1% quantile ,like Then all pixel values ​​greater than 255 will be cropped to 255. This will crop all pixel values ​​less than 0 to 0. For grayscale values ​​in... Pixels within the specified interval are linearly stretched and mapped to the interval [0, 255] using the following formula: in These are the adjusted pixel values ​​of the feature image. This processing preserves defect details while avoiding feature loss due to grayscale overflow, ensuring that the enhanced image's grayscale dynamic range meets machine recognition requirements.

[0040] S33. The step of generating a fusion feature map based on the preprocessed image includes adapting a differentiated fusion strategy by distinguishing defect types, and integrating multispectral information from the top surface and one side surface to improve the integrity of defect features. Specifically, it includes: S331. Divide the multispectral image into image pairs including a top-side transmission image and a top-side reflection image. The image pair includes two images with positional deviations. Perform preliminary classification of the defect type of the glued line after shaping and execute the first mode or the second mode. The initial classification of defect types aims to adapt to differentiated fusion strategies, ensuring that the fusion mode accurately matches the characteristic differences of glue breakage and glue overflow. This avoids the loss or interference of defect features caused by a single fusion method, thereby improving the accuracy and efficiency of subsequent identification. The specific reasons are as follows: The core characteristic of glue breakage is the interruption of edge continuity. The defective area exhibits a significant abrupt change in grayscale due to the lack of glue layer. The detection requirement is to enhance the edge contour to accurately locate the breakage position. The core characteristic of glue overflow is the outward expansion of the area. The defective area exhibits a high proportion of edge pixels due to the diffusion of the glue layer. The detection requirement is to preserve the grayscale distribution of the area to accurately identify the extent of the overflow. If a single fusion mode is used without preliminary classification, the regional characteristics of the overflow area will be weakened. If pixel-level fusion is used for both, the edge characteristics of the glue breakage will be blurred, and neither type of defect can be accurately identified.

[0041] Performing a preliminary assessment reduces computational complexity. Preliminary classification is based on simple and quickly computable features such as grayscale variance and edge pixel proportion, requiring no complex calculations to complete the determination and quickly redirecting data to the corresponding fusion mode. If preliminary classification is omitted, both fusion modes must be applied to all images simultaneously before selecting the optimal result, which would double the computational load and fail to meet the real-time detection requirements of continuous flow on a circular platform.

[0042] The initial classification only covers designs involving glue breakage and excess glue, excluding burrs. This is because the characteristics of burrs are fundamentally different from those of glue breakage and excess glue, making it unnecessary to adapt the fusion mode through the initial classification. Furthermore, their characteristics can be accurately captured in subsequent processes. The specific logic is as follows: The core characteristic of rough edges is the fine protrusions or burrs at the edge of the glue coating line. It manifests as a local anomaly in the edge gradient value. Unlike glue breakage, it does not cause a significant abrupt change in the gray-scale variance of the glue coating line area, nor does it show obvious outward expansion of the area like glue overflow. It cannot be distinguished from defect-free areas by the preliminary classification rules of gray-scale variance or edge pixel ratio.

[0043] Whether it's the enhanced edge contour in the first mode or the grayscale distribution preserved in the second mode, the gradient features of the rough edges can be accurately extracted through subsequent gradient calculations. This can also be understood as rough edges still existing even when there is glue breakage, and rough edges may also exist even when there is glue overflow. The defect probability of the rough edges will be output synchronously with glue breakage and glue overflow in the convolutional neural network model.

[0044] The preprocessed multispectral images were divided into image pairs. The top-side transmission image was acquired by setting a light source on the side of the false eyelash base away from the camera, used to present the internal structural features of the adhesive coating line. The top-side reflection image was acquired by setting a light source on the same side of the camera, used to present the surface morphology features of the adhesive coating line. Due to a 1-3 pixel positional deviation caused by dual-view acquisition, the image pairs were initially aligned using a SIFT feature point registration algorithm, with the registration error controlled within 1 pixel. Preliminary classification of defects in the shaped adhesive coating line was performed: the gray-level variance of the adhesive coating line region in the image was calculated. If the gray-level variance ≥ 50 (a sudden change in gray-level due to missing adhesive layer in the broken area), it was initially determined to be a broken adhesive defect; if the gray-level variance < 50 and the pixel proportion at the edge of the adhesive coating line ≥ 15% (caused by edge diffusion in the overflow area), it was initially determined to be an overflow adhesive defect. The corresponding fusion mode was then executed based on the preliminary classification results.

[0045] S332, The first mode includes performing an edge detection algorithm to extract candidate defect regions for each image pair, and integrating the two candidate regions through a weighted fusion algorithm. The first fused feature map is expressed by the formula: ,in, These are candidate defect images for the two sets of images. The first fusion weight; The first mode is suitable for feature fusion of glue breakage defects. It improves the accuracy of glue breakage localization by strengthening edge features. Specifically, it includes: performing the Canny edge detection algorithm to extract candidate defect regions for each image pair, with a high threshold set to 80 and a low threshold set to 40, preserving edge contours with significant gradient changes; performing morphological erosion on the detected edges to remove noise, and then restoring edge continuity through dilation operation to generate two sets of candidate defect images. (Candidate images of transmission) and (Candidate regions for reflection image). The two sets of candidate regions are integrated using a weighted fusion algorithm. For a binarized image, the pixel value is 255 for edges and 0 for non-edges; Used to balance the edge contribution of the two sets of images.

[0046] The adjustment rules for the fusion weight α include: The detection rates R1 for glue breakage defects and R2 for glue overflow defects in the training set were statistically analyzed. α was adjusted to ensure that image groups with higher detection rates received higher weights. The adjusted first fusion feature map Perform morphological closing operations to fill holes in defect areas and improve the integrity of defect contours.

[0047] 2000 samples containing glue breakage defects were selected from the training set, and the detection rates R1 and R2 of glue breakage in the transmission image group and the reflection image group were statistically analyzed; by adjusting... The image group with the highest detection rate is given a higher weight, with a value ranging from 0.3 to 0.7, and this is applied to the adjusted first fused feature map. Perform morphological closing operations, iterate twice using 5×5 elliptical structuring elements, and fill the holes formed by edge breakage in the broken glue area, improving the integrity of the broken glue outline by more than 40%.

[0048] S333, The second mode includes integrating each group of images through a pixel-level fusion algorithm, and the second fused feature map is expressed by the formula: ,in, This is a transmission image. For reflection images, ,right The defect detection algorithm is executed. If the defect is initially classified as a glue breakage defect, the first mode is selected. If the defect is initially classified as a glue overflow defect, the second mode is selected.

[0049] Reflects the internal density distribution of the overflow adhesive. Reflects the outline of the overflowing adhesive surface; The information entropy is calculated based on both images, with images having higher information entropy receiving higher weights, ranging from 0.2 to 0.5. Perform defect detection based on the Otsu algorithm, automatically determine the threshold to segment the glue overflow area from the background, and improve the grayscale contrast of the glue overflow area by more than 25%.

[0050] Preliminary classification is essentially a rapid segmentation based on simple features. Its core function is to improve fusion efficiency, not to make the final determination. Even if the preliminary classification is flawed, such as misclassifying excess glue as broken glue, subsequent processes can effectively correct this through multi-level verification mechanisms, ensuring the accuracy of the final defect type determination. Preliminary classification only determines whether to use the first mode (edge ​​fusion) or the second mode (pixel-level fusion), but the output feature maps of both fusion modes retain the core defect features of the glue application line: edge interruption of broken glue, outward expansion of the excess glue area, and gradient anomalies of burrs. The only difference lies in the emphasis of feature enhancement. The convolutional neural network model can adaptively identify the true defect features under different fusion modes through multi-scale feature extraction and coordinate attention mechanisms. The core value of preliminary classification is to rapidly segment the data using simple features, reduce unnecessary computation, and improve detection speed to adapt to continuous platform rotation. Any potential biases will be completely covered by the adaptive recognition mechanism of the subsequent model, ultimately ensuring that the accuracy of defect type determination is not affected by the error in preliminary classification.

[0051] S34. The convolutional neural network model, combined with a multi-scale feature extraction algorithm, outputs defect types, including: S341. Construct a suitable convolutional neural network model and process the first fused feature map. Or the second fusion feature map Perform feature extraction; The model is based on an improved ResNet18 architecture, with the input layer receiving a first fused feature map of size 256×256×3. Or the second fusion feature map The feature extraction is performed through four convolutional modules, each containing two 3×3 convolutional layers, a batch normalization layer, and a ReLU activation function. The output feature maps of each module are 128×128×64, 64×64×128, 32×32×256, and 16×16×512, respectively. Multi-scale feature capture is achieved through max pooling layers, with a scale range of 8-128 pixels.

[0052] The first fusion feature map Or the second fusion feature map Feature extraction is performed, including feature enhancement algorithms utilizing coordinate attention layers, specifically including: Global average pooling is performed on the feature map output by the second convolutional layer to obtain horizontal or vertical channel features. Perform 1×1 convolution and Sigmoid activation on the horizontal or vertical channel features respectively to generate attention weights; The attention weights are multiplied element-wise by the original feature map to increase the focus on the width of the adhesive coating line, as expressed by the formula: ,in For the enhanced feature map, This is the feature map output by the second convolutional layer. The attention weights are for the horizontal channel features. The attention weights are for the vertical channel features.

[0053] After the output feature map (64×64×128) from the second convolutional module, a coordinate attention layer is inserted. Global average pooling is performed on the feature map along the horizontal (width) and vertical (height) directions respectively, resulting in horizontal channel features of dimension 1×64×128 and vertical channel features of dimension 64×1×128. The horizontal and vertical channel features are then compressed in dimension by a 1×1 convolutional layer (output channels 32), and attention weights in the range [0,1] are generated by the Sigmoid activation function. (Horizontal direction) and (Vertical direction), where c is the feature channel index; the attention weight is multiplied element-wise with the original feature map to enhance the feature response in the width direction (horizontal) and length direction (vertical) of the glue coating line. This operation increases the model's attention to fine-sized defects (such as glue breakage) in the 0.1-0.5mm range by 30% and reduces background noise interference.

[0054] S342. Utilize transfer learning to load ImageNet pre-trained weights and employ a hybrid loss function: ,in For cross-entropy loss, For domain adaptation loss, To balance classification performance and domain adaptability by using loss weights; in, , For one-hot tags, The probability is the prediction value; N is the training batch size, which takes the value 32; k=0, k=1, k=2, k=3 correspond to the four categories of labels: no defects, broken glue, overflow glue, and rough edges, respectively. This is used to avoid numerical instability caused by the occurrence of zero values ​​in logarithmic operations.

[0055] S343, Using the AdamW optimizer, the learning rate is... attenuation, The iteration stops when the accuracy of the validation set reaches a preset value, and the model weights are saved.

[0056] epoch represents the current iteration round, and maxepoch=100 represents the maximum number of iteration rounds. During model training, validation is performed every 5 rounds. Iteration stops when the validation set accuracy is ≥95% for 3 consecutive rounds, and the model weights are saved to ensure that the model's accuracy in identifying glue breakage, glue overflow, and rough edges is ≥94%, 93%, and 92%, respectively.

[0057] S4. Based on the output defect type, the sorting mechanism removes defective products, and the glue application parameters of the glue application mechanism are dynamically adjusted through a PID controller. The platform carries the inspected false eyelashes to the sorting and parameter control station. Based on the defect type and confidence level output by the convolutional neural network model, defective product removal and dynamic adjustment of process parameters are performed. The sorting mechanism accurately removes defective products confirmed by joint judgment. Alternatively, they can be marked for removal in subsequent processes. At the same time, defect type, defect rate, and other data are fed back to the PID controller in real time. The PID controller dynamically adjusts the glue application parameters of the glue application mechanism and the setting parameters of the heating and setting mechanism according to the priority corresponding to the defect type, thereby reducing the recurrence of the same type of defect.

[0058] S41. The method of controlling the sorting mechanism to reject defective products according to the defect type includes: S411. Obtain the defect probability of the defect type output by the model. Where k=1 represents glue breakage, k=2 represents glue overflow, and k=3 represents rough edges, a probability threshold is set. The This indicates that the prediction confidence level for this type of defect has reached the preset confidence level. Set probability threshold =0.85, this threshold was determined based on ROC curve analysis of 10,000 samples in the training set. When the prediction confidence of the model for this defect type reaches a high confidence level, it can proceed to subsequent joint validation using spectral features; if If the result is negative, it is directly determined to be defect-free, thus avoiding misjudgments caused by low-confidence predictions.

[0059] S412. Joint determination based on spectral features of the fused feature map: like And the length of the glue break The defect type was determined to be glue breakage, among which, This represents the spectral brightness value of the current sample's coated area. The mean spectral brightness of the defect-free sample. The first preset ratio for determining glue breakage. A preset threshold is set for the length of adhesive breakage; adhesive breakage determination: For the first fusion feature map Spectral brightness value of the intermediate coating line area; The mean spectral brightness of the glue-coated area of ​​1000 defect-free samples is used, with outliers removed during the calculation. The value is set to 0.7, meaning that the spectral brightness is significantly reduced in the area where the adhesive layer is missing due to the lack of adhesive. ≤0.7× At that time, the spectral characteristics of the adhesive breakage condition are met; A preset threshold for the adhesive breakage length is set to 0.1mm (corresponding to 3 pixels in the image, based on an image resolution of 300 dpi). The adhesive breakage length is calculated through pixel connectivity analysis. ,like , ≤ × and ≥ If so, it is determined to be a glue breakage defect.

[0060] like The defect type was determined to be excess glue, among which, The spectral brightness value of the preset pixel region outside the current sample substrate edge. The second preset ratio for determining excess adhesive; Excess adhesive determination: the... For the second fusion feature map Spectral brightness value of the 5-pixel region outside the mid-base edge; The second preset ratio for determining adhesive overflow is set to 1.2, meaning that the spectral brightness of the overflow area is higher than the substrate background due to the outward expansion of the adhesive layer. and ≥1.2× At that time, it was determined to be a defect of glue overflow.

[0061] S413, Statistical glue application line edge satisfies The pixel percentage is considered as rough edges if it exceeds a preset percentage threshold. This represents the gradient value at the edge of the adhesive line in the current sample. The maximum gradient value for a defect-free sample. This is the third preset ratio for edge detection. Edge detection: The Sobel operator is used to calculate the gradient value of the adhesive line edge of the current sample. Specifically, 3×3 Sobel convolution kernels are used for convolution along the horizontal and vertical directions respectively, and the gradient magnitude is taken as... ; The mean of the maximum gradient values ​​at the edge of the adhesive line in 1000 defect-free samples. The third preset ratio for rough edge detection is set to 0.4; statistical analysis is conducted on the glue line edge area (3 pixels wide) that meets the following criteria. ≥0.4× The number of pixels is calculated, and its proportion to the total number of pixels at the edge of the adhesive line is determined. A preset proportion threshold of 15% is set. If the value is ≥T and the percentage exceeds 15%, it is judged as a burr defect. This judgment logic can accurately identify minute burrs at the level of 0.05mm.

[0062] S414. A non-maximum suppression algorithm is used to remove duplicate labeled defect regions, ensuring uniqueness of the judgment. An intersection-to-union (IOU) threshold of 0.3 is set. All initially judged defect regions are traversed. If the IOU of two defect regions is ≥ 0.3, they are judged as duplicate labels, retaining the defect label with higher confidence and discarding the duplicate label with lower confidence. If IOU < 0.3, all are retained as independent defect labels. Through this process, the duplicate labeling rate is reduced to below 1%, ensuring that the sorting mechanism only performs rejection operations on non-conforming products corresponding to genuine defects.

[0063] The sorting mechanism can use a pneumatic adsorption rejection device to accurately adsorb and remove unqualified false eyelashes according to the fixed position number of the platform marked with the defect. Alternatively, the eyelashes can be marked first and then manually removed later.

[0064] S42. The method of dynamically adjusting the glue application parameters of the glue application mechanism through a PID controller includes: S421. A fixed-size sliding window statistical algorithm is adopted to calculate the defect rate of continuous production samples in real time, reflecting the recent process stability. The sliding window size is set to 50 samples (i.e., N=50). The window slides by automatically removing the oldest sample in the window as soon as a new sample is completed, ensuring that the defect rate can track the latest production status in real time. The defect rate calculation formula is: ,in, This represents the total number of non-compliant samples confirmed through joint judgment in step S41 within the sliding window. The value range is [0,1], which is used to quantify the degree of defects in recent processes.

[0065] S422, Set threshold and ,like ≥ This triggers the adjustment of adhesive setting parameters. ≥ Trigger device alerts, Less than ; Two threshold levels are set to differentiate control levels: the first threshold Based on production qualification standards, the corresponding maximum allowable normal defect rate is set, and the second threshold is determined. Based on the equipment fault warning threshold setting. If ≥ and < The PID controller automatically triggers the glue application and setting parameter adjustment process without manual intervention; if ≥ In addition to adjusting the trigger parameters, the equipment early warning mechanism is activated simultaneously, and the control system issues an audible and visual alarm signal. The "High Defect Rate Warning" and the main defect types are displayed on the operation interface. If there are three consecutive sliding windows, totaling 150 samples... ≥ The glue application mechanism automatically stops operating, waiting for manual troubleshooting of equipment malfunctions, such as blockage of the glue dispensing valve or abnormal temperature of the heating aluminum ring.

[0066] S423. Prioritize adjustments based on the degree of impact of defects on product quality: Adhesive breakage defects affect bonding strength and have the highest priority; adhesive overflow defects affect wearing comfort and have a medium priority; burr defects affect appearance and have a low priority. Ensure that critical defects are improved first. Calculate the core error for each corresponding defect: Glue overflow defect: The core error is the width error of the glue overflow. ,in The actual glue overflow width of the current sample is determined by the second fusion feature map. The edge detection results are converted so that 1 pixel corresponds to 0.033 mm, based on a 300 dpi image resolution calibration. The target width is designed to achieve an ideal, adhesive-free finish. Glue breakage defect: The core error is the setting temperature error. ,in The real-time actual temperature of the heating aluminum ring is collected by a built-in temperature sensor. The optimal setting temperature with the lowest glue breakage defect rate verified in production; Burr defect: The core error is the shaping pressure error. ,in The real-time actual shaping pressure of the heated aluminum ring is collected by a pressure sensor. The optimal shaping pressure is the one with the lowest burr defect rate, as verified in production.

[0067] S424. The PID algorithm outputs adjustment values ​​for the adhesive pressure and setting temperature, ensuring a smooth adjustment process without sudden changes. The PID algorithm formula is: ; in, This is the adjustment value output by the PID controller; The core error corresponding to the defect includes , or ; , The standard deviation of the core error within the sliding window is used to adaptively adjust the degree of matching error fluctuation. (Integral coefficient) (Differential coefficients); This is the integral attenuation coefficient, used to avoid integral saturation; This is the differential smoothing coefficient, used to suppress differential oscillations.

[0068] Adjust the value according to the defect type. Converted to corresponding process parameters, the glue overflow defect corresponds to the glue dispensing pressure adjustment value of the glue coating mechanism. (Range 0.01-0.05MPa), temperature adjustment value of the heating and setting mechanism corresponding to glue breakage defects. (Range 1-3℃), the setting pressure adjustment value of the heating and setting mechanism corresponding to burr defects. (Range 0.02-0.08MPa). The adjustment value is sent in real time to the glue application mechanism and the heating and setting mechanism via the industrial communication interface to update the equipment operating parameters. Example 2

[0069] Reference Figure 4 This embodiment provides a system, a glue coating line defect detection system based on multispectral image recognition, comprising: The testing device is configured to include an annular stage, a multispectral imaging mechanism, a glue application mechanism, and a heating and shaping mechanism. The image processing module is configured to acquire multispectral images of the top surface and one side surface of the adhesive coating line, perform preprocessing on the images, the preprocessing of the images includes using a spectral correction algorithm to eliminate ambient light interference, using a characteristic band operation enhancement algorithm of the adhesive coating line to highlight the defect area, using a multi-source image fusion algorithm to integrate the features of the spectroscopic image, generating a fused feature map based on the preprocessed image, inputting the fused feature map into a convolutional neural network model, the convolutional neural network model combining a multi-scale feature extraction algorithm to output the defect type; The sorting mechanism is configured to reject non-conforming products based on the type of defect. A PID controller is configured to dynamically adjust the glue application parameters of the glue application mechanism.

[0070] A computer-readable storage medium storing a plurality of instructions adapted for loading and execution by a processor of a terminal device of the method for detecting adhesive lines based on multispectral image recognition.

[0071] A terminal device includes a processor and a computer-readable storage medium, the processor being configured to implement various instructions; the computer-readable storage medium being configured to store multiple instructions adapted for loading and execution by the processor of the aforementioned method for detecting adhesive lines based on multispectral image recognition.

[0072] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting defects in a glue line based on multispectral image recognition, characterized in that, include: The device includes a testing apparatus comprising a circular stage, a multispectral imaging mechanism, a glue application mechanism, and a heating and shaping mechanism. The multispectral imaging mechanism comprises a vertical arm extending into the center of the circular stage and a horizontal arm positioned above the circular stage. A first multispectral camera is mounted on the vertical arm, and a second multispectral camera is mounted on the horizontal arm. The heating and shaping mechanism comprises a heating aluminum ring placed on the circular stage. The false eyelash base is attached to a heated aluminum ring. The false eyelash base is connected by threads. The glue is applied along the threads by a glue application mechanism to form a glue application line. The heated aluminum ring deforms the glue application line and promotes the eyelashes to fill the gaps in the glue application line. The stage rotates the coated false eyelashes to the detection area. The multispectral imaging mechanism acquires multispectral images of the top surface and one side of the coated line. The images are preprocessed, including using a spectral correction algorithm to eliminate ambient light interference, using a coated line feature band operation enhancement algorithm to highlight the defect area, using a multi-source image fusion algorithm to integrate the spectral image features, generating a fusion feature map based on the preprocessed image, and inputting the fusion feature map into a convolutional neural network model. The convolutional neural network model, combined with a multi-scale feature extraction algorithm, outputs the defect type. The sorting mechanism rejects defective products based on the type of defect output, and the glue application parameters of the glue application mechanism are dynamically adjusted by a PID controller.

2. The method for detecting defects in a glue line based on multispectral image recognition according to claim 1, characterized in that, The method of eliminating ambient light interference using a spectral correction algorithm includes: Capturing an ambient light image with a standard whiteboard image after shaping , the standard whiteboard image is a reflection characteristic change image after the same heating shaping treatment simulation of the glue line shaping The formula for eliminating equipment noise and environmental interference is: ,in, These are the pixel values ​​of the original multispectral image of the adhesive coating line. For the spectral band, For pixel coordinates, The spectral response coefficient of the multispectral camera is... This is the reflection compensation coefficient after finalization; Calculate the deviation between the average spectral value of the adhesive coating area after eliminating equipment noise and environmental interference and the baseline spectral value of the training samples. Ensure the deviation is less than a preset value; otherwise, adjust accordingly. Value duplication correction.

3. The method for detecting coating line defects based on multispectral image recognition according to claim 1, characterized in that, The algorithm for highlighting defect areas using the characteristic bands of the glue coating line includes: determining a glue line sensitive band , a filament distinguishing band and a substrate reference band ; The contrast between the adhesive coating line and the substrate is enhanced using a band calculation formula, expressed as follows: ,in, For the enhanced feature image pixel values, , For band weights, for and The spectral covariance is used to compensate for changes in spectral correlation caused by modeling. This is the covariance adjustment factor; Using an adaptive threshold pruning algorithm Perform grayscale adjustment to limit pixel values ​​to the range [0, 255].

4. The method for glue line defect detection based on multispectral image recognition according to claim 1, characterized in that, The step of generating a fused feature map based on the preprocessed image includes: The multispectral images are divided into image pairs, including a top-side transmission image and a top-side reflection image. Each image pair includes two images with positional deviations. The defect types of the glued lines after shaping are initially classified, and either the first mode or the second mode is executed. The first mode includes performing an edge detection algorithm to extract candidate defect regions for each image pair, and integrating the two candidate regions through a weighted fusion algorithm. The first fused feature map is expressed by the formula: ,in, These are candidate defect images for the two sets of images. The first fusion weight; The second mode involves integrating each group of images using a pixel-level fusion algorithm, and the second fused feature map is expressed by the formula: ,in, This is a transmission image. For reflection images, ,right Execute the defect detection algorithm; Preliminary classification as glue breakage defect selects the first mode; preliminary classification as glue overflow defect selects the second mode.

5. The method for glue line defect detection based on multispectral image recognition according to claim 4, characterized in that, The adjustment rules for the fusion weight α include: The detection rates of glue breakage defects (R1) and glue overflow defects (R2) in the training set were statistically analyzed. By adjusting a, the image groups with high recall rates are ensured to have higher weights, wherein ; the adjusted first fused feature map Perform morphological closing operation, fill the defect area hole, and improve the defect contour integrity.

6. The method for glue line defect detection based on multispectral image recognition according to claim 1, characterized in that, The convolutional neural network model, combined with a multi-scale feature extraction algorithm, outputs defect types, including: A suitable convolutional neural network model is constructed to perform feature extraction on the first fusion feature map or the second fusion feature map ​ Using transfer learning to load ImageNet pre-trained weights, and employing a hybrid loss function: ,in For cross-entropy loss, For domain adaptation loss, For loss weights; wherein, , is a one-hot label, is a predicted probability; With AdamW optimizer, learning rate is decayed by , , and the model weights are saved when the validation accuracy reaches the preset value.

7. The method for detecting defects of a gluing line based on multispectral image recognition according to claim 6, characterized in that, The first fusion feature map Or the second fusion feature map Perform feature extraction, including a feature enhancement algorithm using a coordinate attention layer, specifically including: Global average pooling is performed on the feature map output by the second convolutional layer to obtain horizontal or vertical channel features. Perform 1×1 convolution and Sigmoid activation on the horizontal or vertical channel features respectively to generate attention weights; The attention weight is multiplied with the original feature map element by element to improve the attention to the width of the glue line, and is expressed by a formula as follows: wherein is the enhanced feature map, is the feature map output by the second convolutional layer, is the attention weight of the horizontal direction channel feature, is the attention weight of the vertical direction channel feature.

8. The method for glue line defect detection based on multispectral image recognition according to claim 1, characterized in that, The method of controlling the sorting mechanism to reject defective products based on defect type includes: Obtain the defect probability of the defect type output by the model. Where k=1 represents glue breakage, k=2 represents glue overflow, and k=3 represents rough edges, a probability threshold is set. The This indicates that the prediction confidence level for this type of defect has reached the preset confidence level; Joint determination based on spectral features of the fused feature map: like And the length of the glue break The defect type was determined to be glue breakage, among which, This represents the spectral brightness value of the coating area of ​​the current sample. The mean spectral brightness of the defect-free sample. The first preset ratio for determining glue breakage. A preset threshold is set for the length of the adhesive break; If , the defect type is determined as overflow glue, wherein, is a spectral brightness value of a preset pixel region outside the edge of the current sample substrate, is a second preset proportion for overflow glue determination; Statistical glue application line edge satisfies The pixel percentage is considered as rough edges if it exceeds a preset percentage threshold. This represents the gradient value at the edge of the adhesive line in the current sample. The maximum gradient value for a defect-free sample. The third preset ratio for determining rough edges; The non-maximum suppression algorithm is used to remove defective regions with duplicate annotations to ensure the uniqueness of the judgment.

9. The method for glue line defect detection based on multispectral image recognition according to claim 1, characterized in that, The method of dynamically adjusting the glue application parameters of the glue application mechanism through a PID controller includes: The defect rate of continuous samples is calculated using a sliding window method. The defect rate is expressed by the formula: ,in, This represents the number of non-compliant samples. Set threshold and ,like ≥ This triggers the adjustment of adhesive setting parameters. ≥ Trigger device alerts, Less than ; Adjustments are performed according to the defect type, prioritizing temperature for glue breakage, glue application amount for glue overflow, and setting pressure for burrs. The core error is calculated, with glue overflow corresponding to width error. Temperature error corresponding to glue breakage ; The PID algorithm outputs the adjustment values ​​for adhesive pressure and setting temperature.

10. A coating line defect detection system based on multispectral image recognition, characterized in that, The method for detecting adhesive coating line defects based on multispectral image recognition according to any one of claims 1-9 includes: The testing device is configured to include an annular stage, a multispectral imaging mechanism, a glue application mechanism, and a heating and shaping mechanism. The image processing module is configured to acquire multispectral images of the top surface and one side surface of the adhesive coating line, perform preprocessing on the images, the preprocessing of the images includes using a spectral correction algorithm to eliminate ambient light interference, using a characteristic band operation enhancement algorithm of the adhesive coating line to highlight the defect area, using a multi-source image fusion algorithm to integrate the features of the spectroscopic image, generating a fused feature map based on the preprocessed image, inputting the fused feature map into a convolutional neural network model, the convolutional neural network model combining a multi-scale feature extraction algorithm to output the defect type; The sorting mechanism is configured to reject non-conforming products based on the type of defect. A PID controller is configured to dynamically adjust the glue application parameters of the glue application mechanism.