Fresnel lens bubble defect detection method based on stripe light source lighting scheme and improved YOLOv8
By designing a tailored stripe light source and improving the YOLOv8 model, the problems of tooth pattern interference and missed detection of tiny bubbles in Fresnel lens bubble detection have been solved, achieving efficient and accurate bubble detection, which is suitable for industrial online inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-08
AI Technical Summary
In existing Fresnel lens bubble detection technologies, general-purpose light sources cannot distinguish between serrations and bubbles, existing stripe light source solutions are not adapted to Fresnel lens structures, and the original YOLO series and other general-purpose algorithms are not optimized for the stripe distortion characteristics of bubbles. This results in low bubble contrast, high false negative rate for tiny bubbles, and low detection efficiency, which cannot meet the needs of industrial online inspection.
A targeted striped light source design is adopted to enhance the visualization of bubble features, and the YOLOv8 model is improved. Through the combination of the Backbone network, Neck network and detection head, the accurate extraction and recognition of bubble features are achieved, including preprocessing, feature map enhancement and feature map fusion, and adaptation to the serration and bubble features of Fresnel lenses.
It achieves accurate and efficient detection of bubbles in Fresnel lenses, significantly improving detection precision and achieving a microbubble detection rate of 98%. It is highly adaptable, combining real-time performance with practicality, and meets the needs of industrial online inspection.
Smart Images

Figure CN121994824A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, specifically to a Fresnel lens bubble defect detection method based on a striped light source illumination scheme and an improved YOLOv8. Background Technology
[0002] Fresnel lenses, as optical components characterized by their thinness, low cost, and excellent light-gathering / diffusing effects, are widely used in various optical systems due to their densely concentric serrated surface. During the injection molding and pressing processes of Fresnel lenses, air bubble defects can easily form inside or on the lens due to factors such as raw material purity and improper control of processing parameters. These bubbles disrupt the optical uniformity of the lens, leading to abnormal light refraction and scattering, severely affecting the lens's imaging quality and optical performance, and potentially even reducing the reliability and lifespan of related equipment. Therefore, accurate and efficient detection of air bubble defects is a crucial step in ensuring product quality during Fresnel lens production.
[0003] Currently, Fresnel lens bubble detection mainly relies on traditional optical inspection methods and conventional machine vision inspection methods. Existing technologies have the following prominent problems: Traditional optical inspection methods (such as manual visual inspection and ordinary light source-assisted inspection): Manual visual inspection relies on the experience of the inspectors, is highly subjective, has low inspection efficiency, and cannot meet the batch inspection needs of industrial production lines; Under the projection of ordinary light sources (natural light, surface light source, point light source), the dense serrations of the Fresnel lens will form a large number of shadows, which will be confused with the grayscale characteristics of the bubble, resulting in extremely low bubble contrast. In particular, tiny bubbles with a diameter of less than 50μm and hidden bubbles embedded inside are very easy to be missed, and the inspection accuracy is difficult to guarantee.
[0004] Current machine vision inspection often employs general-purpose object detection algorithms (such as the original YOLO v3 / v5 / v7, SSD, etc.) combined with general-purpose light sources. The core problem lies in the lack of compatibility between the algorithm, the light source, and the object being detected. On one hand, the poor imaging quality of general-purpose light sources results in low signal-to-noise ratios for bubble features in the input image, increasing the difficulty of algorithm recognition. More importantly, general-purpose algorithms such as the original YOLO series have not been optimized for the jagged interference of Fresnel lenses and the stripe distortion features of bubbles. Their anchor frame parameters and feature extraction network structures are all general designs, which cannot accurately capture the specific distortion features of bubbles under stripe light, resulting in low bubble recognition accuracy and a high false detection rate, especially for tiny bubbles. At the same time, existing detection schemes based on the original YOLO series algorithms have not undergone lightweight optimization, making it difficult to balance detection accuracy and speed, and failing to meet the speed requirements of ≥30 frames / second for industrial online inspection.
[0005] While striped light sources have been attempted for defect detection in transparent parts, existing solutions suffer from two major flaws: First, they are limited to a single application, primarily targeting flat, transparent parts such as glass plates and films. They fail to consider the dense concentric serrations of Fresnel lenses and lack specific design matching for key parameters like stripe width, spacing, and contrast, making it impossible to distinguish between serrations and bubbles through striped light projection. Second, the projection angle design is haphazard, failing to optimize the angle based on the extension direction of the Fresnel lens's serrations and its light transmission characteristics. Current methods often employ oblique projection, leading to interference between stripes and serrations. Vertical projection, without matching parameters, also fails to distinguish defects. Consequently, striped light projection not only fails to highlight the light and shadow distortion characteristics of bubbles but may also create new interfering textures due to interference between serrations and stripes, further reducing the discernibility of bubble features. Existing striped light source solutions are completely unsuitable for the bubble detection requirements of Fresnel lenses, failing to leverage the advantages of striped light sources in enhancing defect features.
[0006] Industrial production lines have specific requirements for detection speed (usually ≥30 frames / second). Existing high-precision detection methods (such as microscopic imaging detection) are extremely inefficient and cannot meet the needs of online detection. On the other hand, efficient detection methods cannot guarantee the detection accuracy of tiny bubbles, making it difficult to balance the contradiction between detection speed and accuracy.
[0007] In summary, in existing Fresnel lens bubble detection technologies, general-purpose light sources cannot distinguish between serrations and bubbles, while existing stripe light source solutions are not designed to adapt to the Fresnel lens structure; the original YOLO series and other general-purpose algorithms are not optimized for the stripe distortion characteristics of bubbles, and cannot solve the problem of serration interference, ultimately resulting in low bubble contrast, high false negative rate of small bubbles, and low detection efficiency. Summary of the Invention
[0008] To overcome the shortcomings of the above technologies, this invention provides a method that enhances the visualization of bubble features through targeted adaptation design of striped light sources, and then uses an improved YOLO v8 model to achieve accurate extraction and recognition of bubble features, ultimately achieving accurate and efficient detection of Fresnel lens bubbles while balancing detection accuracy and real-time performance.
[0009] The technical solution adopted by this invention to overcome its technical problems is: A Fresnel lens bubble defect detection method based on a striped light source illumination scheme and an improved YOLOv8 includes: S1. Obtain Zhang Fresnel lens image, to obtain the original Fresnel lens bubble image set , , For the first Zhang Fresnel lens bubble image; S2. For the first Zhang Fresnel lens bubble image Preprocessing is performed to obtain the preprocessed Fresnel lens bubble image. All preprocessed Fresnel lens bubble images constitute a preprocessed Fresnel lens bubble image set. , ; S3. Assemble the preprocessed Fresnel lens bubble images. It is divided into training set, test set, and validation set; S4. Establish an improved YOLOv8 model consisting of a backbone network, a Neck network, and a detection head of the YOLOv8 model; S5. The training set of the first Zhang's processed Fresnel lens bubble image The input is fed into the backbone network of the improved YOLOv8 model, and the output is the core feature map. ; S6. Transfer the core feature map The input is fed into the Neck network of the improved YOLOv8 model, and the output is the feature map. ; S7. Transfer the feature map The input is fed into the detection head of the improved YOLOv8 model, and the output is a recognition image of the detected Fresnel lens bubble defect.
[0010] Furthermore, step S1 includes the following steps: S1-1. Selection A Fresnel lens with bubble defects; S1-2. Using an industrial camera positioned directly below the Fresnel lens and directly above it, each Fresnel lens with bubble defects is photographed to obtain... Zhang Fresnel lens image.
[0011] Furthermore, step S2 includes the following steps: S2-1. The first Zhang Fresnel lens bubble image By using the `flip` function in the OpenCV library of Python and setting the coordinate axis parameter to 1, a horizontal flip is performed to obtain the flipped Fresnel lens bubble image. ; S2-2. The inverted Fresnel lens bubble image The cropped Fresnel lens bubble image is obtained by using the getRectSubPix function from the OpenCV library in Python. ; S2-3. The cropped Fresnel lens bubble image The contrast was adjusted using the convertScaleAbs function in the OpenCV library of Python to obtain the adjusted Fresnel lens bubble image. ; S2-4. Adjusted Fresnel lens bubble image The Fresnel lens bubble image is obtained by rotating it within a range of ±5° using the warpAffine function in the OpenCV library of Python. ; S2-5. Rotated Fresnel lens bubble image The Fresnel lens bubble image is obtained by converting it to grayscale using the cvtColor function in the OpenCV library of Python. ; S2-6. Process the Fresnel lens bubble image Random noise was removed using the GaussianBlur function from the OpenCV library in Python, resulting in a denoised Fresnel lens bubble image. ; S2-7. Denoising the Fresnel lens bubble image The contrast is enhanced using the `createCLAHE` function from the OpenCV library in Python, resulting in a preprocessed Fresnel lens bubble image. .
[0012] Preferably, in step S2-6, the GaussianBlur function uses a 5×5 Gaussian kernel convolution kernel and the standard deviation is set to 1.5; in step S2-7, the createCLAHE function sets clipLimit to 2.0 and the grid size to 8×8.
[0013] Preferably, in step S3, the preprocessed Fresnel lens bubble image set is... The dataset is divided into training, testing, and validation sets in a ratio of 8:1:1.
[0014] Furthermore, step S5 includes the following steps: S5-1. The improved YOLOv8 model's backbone network consists of a first convolutional Conv module, a second convolutional Conv module, a first stripe distortion feature enhancement module, a third convolutional Conv module, a second stripe distortion feature enhancement module, a fourth convolutional Conv module, a third stripe distortion feature enhancement module, a fifth convolutional Conv module, a fourth stripe distortion feature enhancement module, and a sixth convolutional Conv module. The first, second, third, fourth, fifth, and sixth convolutional Conv modules are sequentially composed of convolutional layers, batch normalization layers, and SiLU activation functions. The first, second, third, and fourth stripe distortion feature enhancement modules are sequentially composed of a first convolutional layer, a first batch normalization layer, a first SiLU activation function, a second convolutional layer, a second batch... The system consists of a normalization layer, a second SiLU activation function, and a stripe distortion feature enhancement unit. The stripe distortion feature enhancement unit consists of a convolutional layer, a distortion extraction branch, a background suppression branch, a fusion layer, and a residual output layer. S5-2. The training set of the first Zhang's processed Fresnel lens bubble image The input is fed into the first convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-3. Feature Map The input is fed into the second convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-4. Feature Map The inputs are sequentially fed into the first convolutional layer, the first batch normalization layer, the first SiLU activation function, the second convolutional layer, the second batch normalization layer, and the second SiLU activation function of the first stripe distortion feature enhancement module of the backbone network, and the output is the feature map. , feature map The input is fed into the convolutional layer of the stripe distortion feature enhancement unit, and the output is the feature map. Using the Sobel operator on the feature map Gradient calculations are performed in both the horizontal and vertical directions to obtain the feature map. The Middle Horizontal gradient of each pixel and vertical gradient Through formula Calculation yields the first gradient direction of each pixel For feature maps The gradient directions of all pixels are statistically analyzed to construct an orientation histogram. The orientation histogram is then normalized, and the direction with the highest frequency in the normalized orientation histogram is taken as the main direction of the stripes. , feature map The feature map is input into the distortion extraction branch of the stripe distortion feature enhancement unit. The Middle Each pixel is along the main direction of the stripes. Calculate the gradient change and take the average of the gradient transformation magnitudes. Set a threshold TG, where TG is the mean. 1.5-2.0 times that of the feature map The Middle If the magnitude of the gradient change of a pixel is greater than or equal to the threshold TG, then the feature value of that pixel is multiplied by 2-3 times the weight. If the feature map... The Middle If the magnitude of the gradient change of a pixel is less than the threshold TG, then the feature value of that pixel remains unchanged, thus obtaining a preliminary distortion enhancement weight map. The initial distortion enhancement weight map The input is fed into a convolutional layer, and the output is a distortion enhancement weight map. , feature map The input is fed into the background suppression branch of the stripe distortion feature enhancement unit, and the feature map is obtained by the sliding window method. The texture consistency value of each window is calculated, and the mean texture consistency value of all windows is calculated. Set a threshold TS, where TS is the mean. 0.3-0.5 times that of the feature map The Middle If the texture consistency value of a window is greater than or equal to the threshold TS, then the feature values of all pixels in that window are multiplied by a weight of 0.1-0.3. If the feature map... The Middle If the texture consistency value of a window is less than the threshold TS, then the feature values of all pixels in that window remain unchanged, resulting in a preliminary background suppression weight map. The initial background suppression weight map The input is fed into a convolutional layer, and the output is a background suppression weight map. , enhance the weighted graph of distortion Background suppression weight map The distortion enhancement weight map, multiplied by a weight of 0.65, is input into the fusion layer of the stripe distortion feature enhancement unit. Background suppression weight map multiplied by 0.35 Perform element-wise addition to obtain the weighted feature map. Weighted feature map The input is fed into a convolutional layer, and the output is the fused feature map. , feature map The feature map is input into the residual output layer of the stripe distortion feature enhancement unit. With feature map After element-wise addition, the input is fed into a BN layer, and the output is the enhanced feature map. ; S5-5. Feature Map The input is fed into the third convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-6. Feature Map The input is fed into the second stripe distortion feature enhancement module of the Backbone network, and the enhanced feature map is output. ; S5-7. Feature Map The input is fed into the fourth convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-8. Feature Map The input is fed into the third stripe distortion feature enhancement module of the Backbone network, and the enhanced feature map is output. ; S5-9. Feature Map The input is fed into the fifth convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-10. Feature Map The input is fed into the fourth stripe distortion feature enhancement module of the backbone network, and the output is the enhanced feature map. ; S5-11. Feature Map The input is fed into the sixth convolutional Conv module of the Backbone network, and the output is the core feature map. .
[0015] Preferably, the kernel size of the convolutional layers of the first, second, third, fourth, fifth, and sixth convolutional Conv modules of the Backbone backbone network is 3×3, the padding is 1, and the stride is 1. The kernel size of the first and second convolutional layers of the first, second, third, and fourth stripe distortion feature enhancement modules of the Backbone backbone network is 3×3, the padding is 1, and the stride is 1.
[0016] Furthermore, step S6 includes the following steps: S6-1. The improved YOLOv8 model's Neck network consists of a first convolutional Conv module, a first stripe distortion feature enhancement module, a second convolutional Conv module, a third convolutional Conv module, a second stripe distortion feature enhancement module, a fourth convolutional Conv module, a first stripe distortion feature enhancement unit, a third stripe distortion feature enhancement module, a fifth convolutional Conv module, a second stripe distortion feature enhancement unit, a fourth stripe distortion feature enhancement module, and a cross-scale feature enhancement unit. The first, second, third, fourth, and fifth convolutional Conv modules are composed of convolutional layers, batch normalization layers, and SiLU activation functions, respectively. The first, second, third, and fourth stripe distortion feature enhancement modules are composed of a first convolutional layer, a first batch normalization layer, a first SiLU activation function, a second convolutional layer, and a second batch normalization layer, respectively. The system consists of a normalization layer, a second SiLU activation function, and a stripe distortion feature enhancement unit. The stripe distortion feature enhancement unit consists of a convolutional layer, a distortion extraction branch, a background suppression branch, a fusion layer, and a residual output layer. S6-2. Transfer the core feature map The input is fed into the first convolutional Conv module of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-3. Feature Map The input is fed into the first stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-4. Feature Map The input is fed into the second convolutional Conv module of the Neck network, and the output is the feature map. ; S6-5. Feature Map The input is fed into the third convolutional Conv module of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-6. Feature Map The input is fed into the second stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-7. Feature Map The input is fed into the fourth convolutional Conv module of the Neck network, and the output is the feature map. ; S6-8. Feature Map The input is fed into the first stripe distortion feature enhancement unit of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-9. Feature Map The input is fed into the third stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-10. Feature Map The input is fed into the fifth convolutional Conv module of the Neck network, and the output is the feature map. ; S6-11. Feature Map The input is fed into the second stripe distortion feature enhancement unit of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-12. Feature Map The input is fed into the fourth stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-13. The cross-scale feature enhancement unit of the Neck network consists of an attention mechanism that integrates feature maps. The input is fed into a cross-scale feature enhancement unit, and the output is a feature map. .
[0017] Preferably, the kernel size of the convolutional layers of the first, second, third, fourth, and fifth convolutional Conv modules of the Neck network is 3×3, the padding is 1, and the stride is 1. The kernel size of the first and second convolutional layers of the first, second, third, and fourth stripe distortion feature enhancement modules of the Neck network is 3×3, the padding is 1, and the stride is 1.
[0018] Furthermore, it also includes training an improved YOLOv8 model using the Adam optimizer with the overbounded box regression loss Shape-IOU after step S7.
[0019] The beneficial effects of this invention are: (1) It effectively solves the problem of tooth pattern interference. By designing a stripe light source that adapts to Fresnel lens parameters, it achieves accurate differentiation between tooth pattern and bubble features from the imaging source, and completely solves the problem of missed detection and false detection caused by the confusion between tooth pattern shadow and bubble features in traditional detection.
[0020] (2) The detection accuracy is significantly improved. The improved YOLO v8 model can accurately capture the stripe distortion features of bubbles, especially for tiny bubbles with a diameter ≤50μm, the detection rate can reach ≥98%, which is far superior to the existing detection scheme.
[0021] (3) Strong adaptability and wide versatility. By adjusting the core parameters of the stripe light source, it can quickly adapt to the detection needs of Fresnel lenses with different tooth spacing, different thicknesses and different materials, without the need to frequently change detection equipment, which greatly reduces the cost of industrial applications. Fourth, it takes into account both real-time performance and practicality. The lightweight and optimized model can meet the speed requirements of industrial online detection. At the same time, the diverse result output formats and data storage functions facilitate quality auditing and production traceability. Fifth, the synergistic effect of hardware and software is significant. This invention is not a simple superposition of stripe light source and YOLO v8 model, but a deep adaptation design of hardware and algorithm to form a synergistic effect, achieving a detection effect of "1+1>2". The detection performance far exceeds the existing single hardware improvement or single algorithm optimization scheme. Attached Figure Description
[0022] Figure 1 This is a structural diagram of the present invention. Detailed Implementation
[0023] The following is in conjunction with the appendix Figure 1 The present invention will be further described below.
[0024] A Fresnel lens bubble defect detection method based on a striped light source illumination scheme and an improved YOLOv8 includes: S1. Obtain Zhang Fresnel lens image, to obtain the original Fresnel lens bubble image set , , For the first Zhang Fresnel lens bubble image.
[0025] S2. For the first Zhang Fresnel lens bubble image Preprocessing is performed to obtain the preprocessed Fresnel lens bubble image. All preprocessed Fresnel lens bubble images constitute a preprocessed Fresnel lens bubble image set. , .
[0026] S3. Assemble the preprocessed Fresnel lens bubble images. It is divided into training set, test set and validation set.
[0027] S4. Establish an improved YOLOv8 model consisting of a Backbone network, a Neck network, and a YOLOv8 model detection head.
[0028] S5. The training set of the first Zhang's processed Fresnel lens bubble image The input is fed into the backbone network of the improved YOLOv8 model, and the output is the core feature map. .
[0029] S6. Transfer the core feature map The input is fed into the Neck network of the improved YOLOv8 model, and the output is the feature map. .
[0030] S7. Transfer the feature map The input is fed into the detection head of the improved YOLOv8 model, and the output is a recognition image of the detected Fresnel lens bubble defect.
[0031] By enhancing the visualization of bubble features through targeted adaptation design of the striped light source, and then using an improved YOLOv8 model to achieve accurate extraction and recognition of bubble features, the system ultimately achieves accurate and efficient detection of Fresnel lens bubbles, balancing detection accuracy and real-time performance to meet the actual needs of online batch inspection in industrial production lines. The core process is "vertical projection of striped light source - imaging acquisition - improved YOLO v8 model detection - result output," with each step closely linked and clearly designed for adaptation. Vertical projection of the striped light source is the fundamental step for effectively distinguishing bubble features. Specifically, the key structural parameters of the Fresnel lens to be inspected, including the tooth spacing and lens thickness, are first obtained using precision measurement tools. Then, based on these parameters, the core parameters of the striped light source are specifically matched and set, ensuring that the striped light is projected vertically onto the bottom of the Fresnel lens. The vertical projection direction is perpendicular to the tooth extension direction (tangent direction of the concentric circles) of the Fresnel lens, avoiding interference between the stripes and the teeth, while also highlighting bubble distortion through parameter matching. The stripe width is strictly matched to the minimum serration spacing of the Fresnel lens to avoid confusion between serrations and bubble features; the stripe spacing is set to 1.2-2.5 times the stripe width to balance the integrity of the serrations and the highlighting of bubble distortion features; the contrast ratio can be flexibly adjusted within the range of 30:1-80:1 to adapt to Fresnel lens materials with different light transmission characteristics. This invention uses a vertical projection method, combined with the above parameter design, to create a continuous and regular striped background from the concentric serrations of the Fresnel lens. Bubbles disrupt this regularity, forming clearly distinguishable distortion features, thus completely solving the problem of confusion between serrations and bubbles. This invention uses an industrial area scan camera to acquire images of the Fresnel lens after serrated light projection. Industrial cameras have high resolution and high frame rate characteristics, enabling rapid capture of light and shadow changes on and inside the lens surface, ensuring the complete preservation of bubble distortion features. The acquired images are transmitted in real time to the image processing module via a high-speed data interface (such as USB 3.0, GigE), providing high-quality image data support for subsequent algorithm detection. The improved YOLO v8 model is the core component of this invention for achieving accurate bubble detection. This step first preprocesses the acquired image, specifically including three steps: grayscale conversion, 3×3 Gaussian denoising, and adaptive histogram equalization. Grayscale conversion uses a weighted average method to preserve the image's brightness information and reduce data processing volume. 3×3 Gaussian denoising effectively removes random noise from the image, preventing noise interference with the recognition of stripe distortion features. Adaptive histogram equalization specifically enhances the local contrast of the image, further highlighting the difference between the distortion features of the bubble region and the background. The preprocessed image is then input into the pre-trained improved YOLO v8 model, which has undergone three targeted improvements based on the original YOLO v8 model to adapt to the bubble detection requirements under stripe light source imaging.
[0032] In one embodiment of the present invention, step S1 includes the following steps: S1-1. Selection A Fresnel lens with bubble defects.
[0033] S1-2. Using an industrial camera positioned directly below the Fresnel lens and directly above it, each Fresnel lens with bubble defects is photographed to obtain... Zhang Fresnel lens image.
[0034] The acquisition process strictly adheres to a hardware layout scheme of "striped light source arranged vertically below + industrial camera arranged directly above" to ensure effective highlighting of bubble distortion features. Furthermore, the industrial camera used is a Hikvision MV-CS200-10GM, equipped with an MVL-KF1224M-25MP lens. Camera parameters are set to BMP image output format, resolution adapted to inspection requirements, and frame rate adjusted to meet industrial online inspection speeds. The striped light source is an RSEE-programmable striped light source with a PC-48W100-1TL controller, supporting precise programmable adjustment of stripe width, spacing, and contrast. Power and luminous area size are adapted to the lens inspection range to ensure striped light covers the entire lens inspection area.
[0035] In one embodiment of the present invention, step S2 includes the following steps: S2-1. The first Zhang Fresnel lens bubble image By using the `flip` function in the OpenCV library of Python and setting the coordinate axis parameter to 1, a horizontal flip is performed to obtain the flipped Fresnel lens bubble image. This simulates the horizontal placement deviation of lenses from different batches at the inspection station, improving the model's adaptability to lens placement positions.
[0036] S2-2. The inverted Fresnel lens bubble image The cropped Fresnel lens bubble image is obtained by using the getRectSubPix function from the OpenCV library in Python. Focus on the core detection area of the lens and remove invalid background interference at the edges.
[0037] S2-3. The cropped Fresnel lens bubble image The contrast was adjusted using the convertScaleAbs function in the OpenCV library of Python to obtain the adjusted Fresnel lens bubble image. This enhances the grayscale difference between the striped background and the bubble distortion, adapting to scenes with fluctuating striped light source parameters.
[0038] S2-4. Adjusted Fresnel lens bubble image The Fresnel lens bubble image is obtained by rotating it within a range of ±5° using the warpAffine function in the OpenCV library of Python. The simulated lens position angular deviation complements the horizontal flip, further covering the placement scenarios in actual testing and improving the model's generalization ability.
[0039] S2-5. Rotated Fresnel lens bubble image The Fresnel lens bubble image is obtained by converting it to grayscale using the cvtColor function in the OpenCV library of Python. This preserves brightness information and reduces the computational load of the model.
[0040] S2-6. Process the Fresnel lens bubble image Random noise was removed using the GaussianBlur function from the OpenCV library in Python, resulting in a denoised Fresnel lens bubble image. .
[0041] S2-7. Denoising the Fresnel lens bubble image The contrast is enhanced using the `createCLAHE` function from the OpenCV library in Python, resulting in a preprocessed Fresnel lens bubble image. It adapts the model to the recognition needs of bubbles of different sizes.
[0042] In step S2-6, the GaussianBlur function uses a 5×5 Gaussian kernel convolution and sets the standard deviation to 1.5. This parameter can smooth out the subtle interference of the tooth pattern while completely preserving the stripe distortion contour caused by the bubble. In step S2-7, the createCLAHE function sets clipLimit to 2.0 and the mesh size to 8×8. This parameter can avoid the detail saturation caused by excessive enhancement of the stripe area, while highlighting the local stripe distortion features caused by the small bubble, thus solving the problem of weak distortion signal of small bubble.
[0043] In one embodiment of the present invention, step S3 involves assembling the preprocessed Fresnel lens bubble image set. The dataset is divided into training, testing, and validation sets in a ratio of 8:1:1.
[0044] In one embodiment of the present invention, step S5 includes the following steps: S5-1. The improved YOLOv8 model's backbone network consists of a first convolutional Conv module, a second convolutional Conv module, a first stripe distortion feature enhancement module, a third convolutional Conv module, a second stripe distortion feature enhancement module, a fourth convolutional Conv module, a third stripe distortion feature enhancement module, a fifth convolutional Conv module, a fourth stripe distortion feature enhancement module, and a sixth convolutional Conv module. The first, second, third, fourth, fifth, and sixth convolutional Conv modules are sequentially composed of convolutional layers, batch normalization layers, and SiLU activation functions. The first, second, third, and fourth stripe distortion feature enhancement modules are sequentially composed of a first convolutional layer, a first batch normalization layer, a first SiLU activation function, a second convolutional layer, a second batch... The system consists of a normalization layer, a second SiLU activation function, and a stripe distortion feature enhancement unit. The stripe distortion feature enhancement unit comprises a convolutional layer, a distortion extraction branch, a background suppression branch, a fusion layer, and a residual output layer. By weighting the gradient information along the stripe direction, the stripe distortion feature enhancement unit highlights the stripe distortion region caused by bubbles, suppresses the uniform texture signal of the lens serrations, specifically captures the distortion features of bubbles under striped light, filters out serration interference, and provides dedicated feature basis for subsequent bubble recognition by the detection head.
[0045] S5-2. The training set of the first Zhang's processed Fresnel lens bubble image The input is fed into the first convolutional Conv module of the Backbone network to initially extract basic texture features of the image, and the output is a feature map. .
[0046] S5-3. Feature Map The input is fed into the second convolutional Conv module of the Backbone network to deepen the extraction of basic features, filter out shallow noise, and output the feature map. .
[0047] S5-4. Feature Map The inputs are sequentially fed into the first convolutional layer, the first batch normalization layer, the first SiLU activation function, the second convolutional layer, the second batch normalization layer, and the second SiLU activation function of the first stripe distortion feature enhancement module of the backbone network, and the output is the feature map. , feature map The input is fed into the convolutional layer of the stripe distortion feature enhancement unit, and the output is the feature map. Using the Sobel operator on the feature map Gradient calculations are performed in both the horizontal and vertical directions to obtain the feature map. The Middle Horizontal gradient of each pixel and vertical gradient Through formula Calculation yields the first gradient direction of each pixel For feature maps The gradient directions of all pixels are statistically analyzed to construct an orientation histogram. The orientation histogram is then normalized, and the direction with the highest frequency in the normalized orientation histogram is taken as the main direction of the stripes. , feature map The feature map is input into the distortion extraction branch of the stripe distortion feature enhancement unit. The Middle Each pixel is along the main direction of the stripes. Calculate the gradient change and take the average of the gradient transformation magnitudes. Set a threshold TG, where TG is the mean. 1.5-2.0 times that of the feature map The Middle If the magnitude of the gradient change of a pixel is greater than or equal to the threshold TG, then the feature value of that pixel is multiplied by 2-3 times the weight. If the feature map... The Middle If the magnitude of the gradient change of a pixel is less than the threshold TG, then the feature value of that pixel remains unchanged, thus obtaining a preliminary distortion enhancement weight map. The initial distortion enhancement weight map The input is fed into a convolutional layer, and the output is a distortion enhancement weight map. , feature map The input is fed into the background suppression branch of the stripe distortion feature enhancement unit, and the feature map is obtained by the sliding window method. The texture consistency value of each window is calculated, and the mean texture consistency value of all windows is calculated. Set a threshold TS, where TS is the mean. 0.3-0.5 times that of the feature map The Middle If the texture consistency value of a window is greater than or equal to the threshold TS, then the feature values of all pixels in that window are multiplied by a weight of 0.1-0.3. If the feature map... The Middle If the texture consistency value of a window is less than the threshold TS, then the feature values of all pixels in that window remain unchanged, resulting in a preliminary background suppression weight map. The initial background suppression weight map The input is fed into a convolutional layer, and the output is a background suppression weight map. , enhance the weighted graph of distortion Background suppression weight map The distortion enhancement weight map, multiplied by a weight of 0.65, is input into the fusion layer of the stripe distortion feature enhancement unit. Background suppression weight map multiplied by 0.35 Perform element-wise addition to obtain the weighted feature map. Weighted feature map The input is fed into a convolutional layer, and the output is the fused feature map. , feature map The feature map is input into the residual output layer of the stripe distortion feature enhancement unit. With feature map After element-wise addition, the input is fed into a BN layer, and the output is the enhanced feature map. Gradient-weighted calculations using the first fringe distortion feature enhancement module are employed to initially highlight the bubble distortion region and suppress tooth pattern interference.
[0048] S5-5. Feature Map The input is fed into the third convolutional Conv module of the Backbone network to consolidate the feature extraction effect, and the output is the feature map. Feature map This is a shallow enhancement feature, adapted for subsequent fusion of small-sized bubble features.
[0049] S5-6. Feature Map The input is fed into the second stripe distortion feature enhancement module of the Backbone network, and the enhanced feature map is output. The processing method of the second fringe distortion feature enhancement module is exactly the same as that of the first fringe distortion feature enhancement module in step S5-4, and will not be repeated here.
[0050] S5-7. Feature Map The input is fed into the fourth convolutional Conv module of the Backbone network, and the output is the feature map. .
[0051] S5-8. Feature Map The input is fed into the third stripe distortion feature enhancement module of the Backbone network, and the enhanced feature map is output. The processing method of the third fringe distortion feature enhancement module is exactly the same as that of the first fringe distortion feature enhancement module in step S5-4, and will not be repeated here.
[0052] S5-9. Feature Map The input is fed into the fifth convolutional Conv module of the Backbone network to deepen feature extraction and output the feature map. Feature map This is to adapt the deep features, which have undergone three distortion enhancements, to the subsequent fusion of large-size bubble features.
[0053] S5-10. Feature Map The input is fed into the fourth stripe distortion feature enhancement module of the backbone network, and the output is the enhanced feature map. The processing method of the fourth fringe distortion feature enhancement module is exactly the same as that of the first fringe distortion feature enhancement module in step S5-4, and will not be repeated here.
[0054] S5-11. Feature Map The input is fed into the sixth convolutional Conv module of the Backbone network, and the output is the core feature map. .
[0055] In this embodiment, the kernel size of the convolutional layers of the first, second, third, fourth, fifth, and sixth convolutional Conv modules of the Backbone backbone network is 3×3, the padding is 1, and the stride is 1. The kernel size of the first and second convolutional layers of the first, second, third, and fourth stripe distortion feature enhancement modules of the Backbone backbone network is 3×3, the padding is 1, and the stride is 1, ensuring size stability and information integrity during feature extraction.
[0056] In one embodiment of the present invention, step S6 includes the following steps: S6-1. The improved YOLOv8 model's Neck network consists of a first convolutional Conv module, a first stripe distortion feature enhancement module, a second convolutional Conv module, a third convolutional Conv module, a second stripe distortion feature enhancement module, a fourth convolutional Conv module, a first stripe distortion feature enhancement unit, a third stripe distortion feature enhancement module, a fifth convolutional Conv module, a second stripe distortion feature enhancement unit, a fourth stripe distortion feature enhancement module, and a cross-scale feature enhancement unit. The first, second, third, fourth, and fifth convolutional Conv modules are composed of convolutional layers, batch normalization layers, and SiLU activation functions, respectively. The first, second, third, and fourth stripe distortion feature enhancement modules are composed of a first convolutional layer, a first batch normalization layer, a first SiLU activation function, a second convolutional layer, and a second batch normalization layer, respectively. The system consists of a normalization layer, a second SiLU activation function, and a stripe distortion feature enhancement unit. The stripe distortion feature enhancement unit consists of a convolutional layer, a distortion extraction branch, a background suppression branch, a fusion layer, and a residual output layer.
[0057] S6-2. Transfer the core feature map The input is fed into the first convolutional Conv module of the Neck network to initially optimize the feature dimensions, and the output is the feature map. , feature map With feature map Perform a stitching operation to supplement deep distortion feature information and obtain a feature map. .
[0058] S6-3. Feature Map The input is fed into the first stripe distortion feature enhancement module of the Neck network, and the output is the feature map. The processing method of the first fringe distortion feature enhancement module is exactly the same as that of the first fringe distortion feature enhancement module in step S5-4, and will not be repeated here.
[0059] S6-4. Feature Map The input is fed into the second convolutional Conv module of the Neck network, and the output is the feature map. .
[0060] S6-5. Feature Map The input is fed into the third convolutional Conv module of the Neck network to optimize the feature fusion effect, and the output is the feature map. , feature map With feature map Perform a stitching operation to supplement the mid-layer distortion features and obtain the feature map. .
[0061] S6-6. Feature Map The input is fed into the second stripe distortion feature enhancement module of the Neck network, and the output is the feature map. The processing method of the second fringe distortion feature enhancement module is exactly the same as that of the first fringe distortion feature enhancement module in step S5-4, and will not be repeated here.
[0062] S6-7. Feature Map The input is fed into the fourth convolutional Conv module of the Neck network, and the output is the feature map. .
[0063] S6-8. Feature Map The input is fed into the first stripe distortion feature enhancement unit of the Neck network to enhance the discriminative power of the distortion features, and the output is the feature map. , feature map With feature map Perform a stitching operation to supplement shallow distortion features and obtain a feature map. .
[0064] S6-9. Feature Map The input is fed into the third stripe distortion feature enhancement module of the Neck network, and the output is the feature map. The processing method of the third fringe distortion feature enhancement module is exactly the same as that of the first fringe distortion feature enhancement module in step S5-4, and will not be repeated here.
[0065] S6-10. Feature Map The input is fed into the fifth convolutional Conv module of the Neck network, and the output is the feature map. .
[0066] S6-11. Feature Map The input is fed into the second stripe distortion feature enhancement unit of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. .
[0067] S6-12. Feature Map The input is fed into the fourth stripe distortion feature enhancement module of the Neck network, and the output is the feature map. The processing method of the fourth fringe distortion feature enhancement module is exactly the same as that of the first fringe distortion feature enhancement module in step S5-4, and will not be repeated here.
[0068] S6-13. The cross-scale feature enhancement unit of the Neck network consists of an attention mechanism that integrates feature maps. The input is fed into a cross-scale feature enhancement unit, and the output is a feature map. .
[0069] In this embodiment, the kernel size of the convolutional layers in the first, second, third, fourth, and fifth convolutional Conv modules of the Neck network is 3×3, the padding is 1, and the stride is 1. Similarly, the kernel size of the first and second convolutional layers in the first, second, third, and fourth striped distortion feature enhancement modules of the Neck network is 3×3, the padding is 1, and the stride is 1. The number of iterations during training can be set to 300, and the initial learning rate is set to... The learning rate decays to half its original value every 20 iterations, and the batch size is set to 16.
[0070] In one embodiment of the invention, the improved YOLOv8 model is trained using the Adam optimizer with the overbounded box regression loss Shape-IOU after step S7.
[0071] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A Fresnel lens bubble defect detection method based on a striped light source illumination scheme and an improved YOLOv8, characterized in that, include: S1. Obtain Zhang Fresnel lens image, obtain the original Fresnel lens bubble image set , , For the first Zhang Fresnel lens bubble image; S2. For the first Zhang Fresnel lens bubble image Preprocessing is performed to obtain the preprocessed Fresnel lens bubble image. All preprocessed Fresnel lens bubble images constitute a preprocessed Fresnel lens bubble image set. , ; S3. Assemble the preprocessed Fresnel lens bubble images. It is divided into training set, test set, and validation set; S4. Establish an improved YOLOv8 model consisting of a backbone network, a Neck network, and a detection head of the YOLOv8 model; S5. The training set of the first Zhang's processed Fresnel lens bubble image The input is fed into the backbone network of the improved YOLOv8 model, and the output is the core feature map. ; S6. Transfer the core feature map The input is fed into the Neck network of the improved YOLOv8 model, and the output is the feature map. ; S7. Transfer the feature map The input is fed into the detection head of the improved YOLOv8 model, and the output is a recognition image of the detected Fresnel lens bubble defect.
2. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 1, characterized in that, Step S1 includes the following steps: S1-1. Selection A Fresnel lens with bubble defects; S1-2. Using an industrial camera positioned directly below the Fresnel lens and directly above it, each Fresnel lens with bubble defects is photographed to obtain... Zhang Fresnel lens image.
3. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 1, characterized in that, Step S2 includes the following steps: S2-1. The first Zhang Fresnel lens bubble image By using the `flip` function in the OpenCV library of Python and setting the coordinate axis parameter to 1 to perform a horizontal flip, we obtain the flipped Fresnel lens bubble image. ; S2-2. The inverted Fresnel lens bubble image The cropped Fresnel lens bubble image is obtained by using the getRectSubPix function from the OpenCV library in Python. ; S2-3. The cropped Fresnel lens bubble image The contrast was adjusted using the convertScaleAbs function in the OpenCV library of Python to obtain the adjusted Fresnel lens bubble image. ; S2-4. Adjusted Fresnel lens bubble image The Fresnel lens bubble image is obtained by rotating it within a range of ±5° using the warpAffine function in the OpenCV library of Python. ; S2-5. Rotated Fresnel lens bubble image The Fresnel lens bubble image is obtained by converting it to grayscale using the cvtColor function in the OpenCV library of Python. ; S2-6. Process the Fresnel lens bubble image Random noise was removed using the GaussianBlur function from the OpenCV library in Python, resulting in a denoised Fresnel lens bubble image. ; S2-7. Denoising the Fresnel lens bubble image The contrast is enhanced using the `createCLAHE` function from the OpenCV library in Python, resulting in a preprocessed Fresnel lens bubble image. .
4. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 3, characterized in that: In step S2-6, the GaussianBlur function uses a 5×5 Gaussian kernel convolution and sets the standard deviation to 1.5; in step S2-7, the createCLAHE function sets clipLimit to 2.0 and the grid size to 8×8.
5. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 1, characterized in that: In step S3, the preprocessed Fresnel lens bubble images are collected. The dataset is divided into training, testing, and validation sets in an 8:1:1 ratio.
6. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 1, characterized in that, Step S5 includes the following steps: S5-1. The improved YOLOv8 model's backbone network consists of a first convolutional Conv module, a second convolutional Conv module, a first stripe distortion feature enhancement module, a third convolutional Conv module, a second stripe distortion feature enhancement module, a fourth convolutional Conv module, a third stripe distortion feature enhancement module, a fifth convolutional Conv module, a fourth stripe distortion feature enhancement module, and a sixth convolutional Conv module. The first, second, third, fourth, fifth, and sixth convolutional Conv modules are sequentially composed of convolutional layers, batch normalization layers, and SiLU activation functions. The first, second, third, and fourth stripe distortion feature enhancement modules are sequentially composed of a first convolutional layer, a first batch normalization layer, a first SiLU activation function, a second convolutional layer, a second batch... The system consists of a normalization layer, a second SiLU activation function, and a stripe distortion feature enhancement unit. The stripe distortion feature enhancement unit consists of a convolutional layer, a distortion extraction branch, a background suppression branch, a fusion layer, and a residual output layer. S5-2. The training set of the first Zhang's processed Fresnel lens bubble image The input is fed into the first convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-3. Feature Map The input is fed into the second convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-4. Feature Map The inputs are sequentially fed into the first convolutional layer, the first batch normalization layer, the first SiLU activation function, the second convolutional layer, the second batch normalization layer, and the second SiLU activation function of the first stripe distortion feature enhancement module of the backbone network, and the output is the feature map. , feature map The input is fed into the convolutional layer of the stripe distortion feature enhancement unit, and the output is the feature map. The Sobel operator is used on the feature map. Gradient calculations are performed in both the horizontal and vertical directions to obtain the feature map. The Middle Horizontal gradient of each pixel and vertical gradient Through formula Calculate the first gradient direction of each pixel For feature maps The gradient directions of all pixels are statistically analyzed to construct an orientation histogram. The orientation histogram is then normalized, and the direction with the highest frequency in the normalized orientation histogram is taken as the main direction of the stripes. , feature map The feature map is input into the distortion extraction branch of the stripe distortion feature enhancement unit. The Middle Each pixel is along the main direction of the stripe. Calculate the gradient change and take the average of the gradient transformation magnitudes. Set a threshold TG, where TG is the mean. 1.5-2.0 times that of the feature map The Middle If the magnitude of the gradient change of a pixel is greater than or equal to the threshold TG, then the feature value of that pixel is multiplied by 2-3 times the weight. If the feature map... The Middle If the magnitude of the gradient change of a pixel is less than the threshold TG, then the feature value of that pixel remains unchanged, thus obtaining a preliminary distortion enhancement weight map. The initial distortion enhancement weight map The input is fed into a convolutional layer, and the output is a distortion enhancement weight map. , feature map The input is fed into the background suppression branch of the stripe distortion feature enhancement unit, and the feature map is obtained by the sliding window method. The texture consistency value of each window is calculated, and the mean texture consistency value of all windows is calculated. Set a threshold TS, where TS is the mean. 0.3-0.5 times that of the feature map The Middle If the texture consistency value of a window is greater than or equal to the threshold TS, then the feature values of all pixels in that window are multiplied by a weight of 0.1-0.
3. If the feature map... The Middle If the texture consistency value of a window is less than the threshold TS, then the feature values of all pixels in that window remain unchanged, resulting in a preliminary background suppression weight map. The initial background suppression weight map The input is fed into a convolutional layer, and the output is a background suppression weight map. , enhance the weighted graph of distortion Background suppression weight map The distortion enhancement weight map, multiplied by a weight of 0.65, is input into the fusion layer of the stripe distortion feature enhancement unit. Background suppression weight map multiplied by 0.35 Perform element-wise addition to obtain the weighted feature map. Weighted feature map The input is fed into a convolutional layer, and the output is the fused feature map. , feature map The feature map is input into the residual output layer of the stripe distortion feature enhancement unit. With feature map After element-wise addition, the input is fed into a BN layer, and the output is the enhanced feature map. ; S5-5. Feature Map The input is fed into the third convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-6. Feature Map The input is fed into the second stripe distortion feature enhancement module of the Backbone network, and the enhanced feature map is output. ; S5-7. Feature Map The input is fed into the fourth convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-8. Feature Map The input is fed into the third stripe distortion feature enhancement module of the Backbone network, and the enhanced feature map is output. ; S5-9. Feature Map The input is fed into the fifth convolutional Conv module of the Backbone network, and the output is the feature map. ; S5-10. Feature Map The input is fed into the fourth stripe distortion feature enhancement module of the backbone network, and the output is the enhanced feature map. ; S5-11. Feature Map The input is fed into the sixth convolutional Conv module of the Backbone network, and the output is the core feature map. .
7. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 6, characterized in that: The convolutional kernels of the first, second, third, fourth, fifth, and sixth convolutional Conv modules of the Backbone backbone network are all 3×3, with padding of 1 and stride of 1. The convolutional kernels of the first and second convolutional layers of the first, second, third, and fourth stripe distortion enhancement modules of the Backbone backbone network are all 3×3, with padding of 1 and stride of 1.
8. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 6, characterized in that, Step S6 includes the following steps: S6-1. The improved YOLOv8 model's Neck network consists of a first convolutional Conv module, a first stripe distortion feature enhancement module, a second convolutional Conv module, a third convolutional Conv module, a second stripe distortion feature enhancement module, a fourth convolutional Conv module, a first stripe distortion feature enhancement unit, a third stripe distortion feature enhancement module, a fifth convolutional Conv module, a second stripe distortion feature enhancement unit, a fourth stripe distortion feature enhancement module, and a cross-scale feature enhancement unit. The first, second, third, fourth, and fifth convolutional Conv modules are composed of convolutional layers, batch normalization layers, and SiLU activation functions, respectively. The first, second, third, and fourth stripe distortion feature enhancement modules are composed of a first convolutional layer, a first batch normalization layer, a first SiLU activation function, a second convolutional layer, and a second batch normalization layer, respectively. The system consists of a normalization layer, a second SiLU activation function, and a stripe distortion feature enhancement unit. The stripe distortion feature enhancement unit consists of a convolutional layer, a distortion extraction branch, a background suppression branch, a fusion layer, and a residual output layer. S6-2. Transfer the core feature map The input is fed into the first convolutional Conv module of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-3. Feature Map The input is fed into the first stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-4. Feature Map The input is fed into the second convolutional Conv module of the Neck network, and the output is the feature map. ; S6-5. Feature Map The input is fed into the third convolutional Conv module of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-6. Feature Map The input is fed into the second stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-7. Feature Map The input is fed into the fourth convolutional Conv module of the Neck network, and the output is the feature map. ; S6-8. Feature Map The input is fed into the first stripe distortion feature enhancement unit of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-9. Feature Map The input is fed into the third stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-10. Feature Map The input is fed into the fifth convolutional Conv module of the Neck network, and the output is the feature map. ; S6-11. Feature Map The input is fed into the second stripe distortion feature enhancement unit of the Neck network, and the output is the feature map. , feature map With feature map Perform a stitching operation to obtain the feature map. ; S6-12. Feature Map The input is fed into the fourth stripe distortion feature enhancement module of the Neck network, and the output is the feature map. ; S6-13. The cross-scale feature enhancement unit of the Neck network consists of an attention mechanism that integrates feature maps. The input is fed into a cross-scale feature enhancement unit, and the output is a feature map. .
9. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 8, characterized in that: The convolutional kernels of the first, second, third, fourth, and fifth convolutional Conv modules of the Neck network are all 3×3, with padding of 1 and stride of 1. The convolutional kernels of the first and second convolutional layers of the first, second, third, and fourth stripe distortion enhancement modules of the Neck network are all 3×3, with padding of 1 and stride of 1.
10. The Fresnel lens bubble defect detection method based on the striped light source illumination scheme and improved YOLOv8 according to claim 1, characterized in that: It also includes training an improved YOLOv8 model using the Adam optimizer with the overbounded box regression loss Shape-IOU after step S7.