Columnar transparent part defect detection method
By improving the YOLOv8 model by combining coaxial pose design with a composite structured light source, the problem of high-precision and full-type defect detection of cylindrical transparent parts in complex optical environments is solved, achieving efficient and robust detection results.
Patent Information
- Application Number
- CN202510761396.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-19
AI Technical Summary
Existing technologies make it difficult to achieve high-precision, full-type defect detection in the complex optical environment of cylindrical transparent parts, and there is a contradiction between detection efficiency and hardware cost.
The system adopts coaxial posture design, composite structured light source and improved YOLOv8 deep learning model, combined with industrial cameras for defect recognition. Through the synergistic effect of binary fringes and cosine fringes, it achieves efficient detection of geometric and chromatic aberration defects.
It achieves high-precision detection of tiny defects, meets high industrial standards, and has the ability to efficiently detect all types of defects, improving detection efficiency and robustness. It is suitable for the detection of cylindrical transparent parts in multiple industries.
Smart Images

Figure CN120668677A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical detection and machine vision technology, and in particular to a method for detecting defects in a columnar transparent part. Background Art
[0002] In industries with extremely high product quality requirements, such as high-end optical component manufacturing, medical packaging, and food and beverages, surface and internal defect detection of cylindrical transparent parts is a key step in quality control. Defects in cylindrical transparent parts, such as precision optical lenses, injection glass bottles, and carbonated beverage bottles, can have serious consequences. For example, tiny surface pits on optical lenses can cause significant light refraction deviations, significantly reducing imaging resolution. Tiny impurities on the inner surface of medical glass bottles can pose a risk of drug contamination. According to industry statistics, drug recalls due to missed defects can result in significant economic losses. In the food packaging sector, tiny cracks in PET bottles can cause them to explode under filling pressure. Actual data from a beverage company shows that the explosion rate of undetected microcracked parts far exceeds the industry safety threshold.
[0003] However, cylindrical transparent parts have special optical properties and structural complexity, which makes existing detection technology face many bottlenecks:
[0004] (1) Detection signal distortion caused by curved optical effects
[0005] The interaction between the curved surface structure and high light transmittance of cylindrical transparent parts causes light to produce a complex refraction-reflection coupling effect. Specifically, when inspecting glass test tubes of a certain size, traditional line structured light projection will show obvious stripe deformation at the edge of the curved surface, resulting in large errors in defect feature extraction; and when inspecting glass bottles with a certain wall thickness, the secondary reflected light intensity on the inner and outer surfaces is high, which will significantly reduce the signal-to-noise ratio of the image captured by the industrial camera.
[0006] (2) Difficulty in separating features of multiple types of defects
[0007] The optical responses of geometric defects (such as bulges, pits, and cracks) and chromatic aberration defects (such as impurities, discoloration, and uneven transmittance) are quite different. Traditional single-modal detection solutions are difficult to take both into account. For geometric defect detection, the detection system based on laser triangulation has large errors in the depth measurement of tiny pits and cannot detect chromatic aberration defects with abnormal transmittance. In terms of chromatic aberration defect detection, the threshold segmentation algorithm based on RGB color space has low detection accuracy for impurities of the same color in transparent media. Even the improved algorithm based on HSV space still has a certain misjudgment rate.
[0008] (3) The contradiction between production line real-time performance and detection accuracy
[0009] Industrial production scenarios have strict requirements on detection efficiency, and usually require the detection cycle to be controlled within a relatively short time. However, existing solutions have obvious performance deficiencies. Traditional vision solutions are based on edge detection and template matching algorithms. The detection time for a single part is long, and it can only identify defects of larger sizes. The missed detection rate for curved transition areas (such as the connection between the bottle body and the bottom of the bottle) is high. In deep learning solutions, although the original YOLOv8 model can detect subtle defects, the single-image inference time is long. In high-speed production line scenarios, multiple sets of parallel detection units need to be deployed, which will lead to a significant increase in hardware costs.
[0010] In summary, existing technologies have difficulty achieving high-precision, full-type detection of geometric and chromatic defects in the complex optical environment of cylindrical transparent parts. In addition, there is an irreconcilable contradiction between detection efficiency and hardware cost. To this end, we propose a defect detection method for cylindrical transparent parts. Summary of the Invention
[0011] (1) Technical problems solved
[0012] In view of the shortcomings of the existing technology, the present invention provides a method for detecting defects in cylindrical transparent parts, which solves the technical problems of the existing cylindrical transparent parts in detection, such as complex optical properties, diverse defect types, and the contradiction between real-time performance and accuracy.
[0013] (2) Technical solution
[0014] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0015] A method for detecting defects in a cylindrical transparent part, the method comprising the following steps:
[0016] During the inspection preparation phase, the cylindrical transparent parts are cleaned and pre-treated. Then, based on the light transmittance of the part material and the minimum defect size expected to be detected, the appropriate industrial camera resolution, structured light source wavelength, and power parameters are selected.
[0017] During the detection pose configuration phase, the industrial camera and structured light source are spatially arranged so that their axes are precisely coaxial with the axis of the cylindrical part. The distance between the lens focus and the part surface is determined by comprehensively considering the focal length of the industrial camera, the target surface size, and the part radius and height parameters. The spacing between the light source and the part is then set based on the fringe resolution and the established defect detection accuracy requirements.
[0018] During the structured light fringe excitation phase, a composite structured light source, integrating binary fringes and cosine fringes, is used to project a fringe pattern onto the part surface in a configured coaxial position. Multi-view fringe images are acquired through the relative motion of the part and the light source, and the fringe parameters are adjusted according to the specific characteristics of the part.
[0019] During the machine vision inspection phase, an industrial camera is used to capture the aforementioned stripe images, which are then fed into the improved YOLOv8 network model for defect recognition.
[0020] In the model optimization and evaluation phase, the training effect of the network model is evaluated based on the constructed joint loss function and combined with the detection accuracy index, and then the type and location information of the defect is output;
[0021] In the post-inspection processing stage, the detected defects are graded, and then combined with the actual usage scenarios and quality standard requirements of the parts to generate a corresponding defect handling recommendation report.
[0022] Preferably, in the detection posture configuration stage, the distance between the lens focus and the part surface is determined based on the focal length of the industrial camera, the target surface size, and the part radius and height parameters;
[0023] The distance between the light source and the part is set based on the relationship between fringe resolution and the minimum resolvable fringe width, combined with the distance between the lens focus and the part surface.
[0024] Preferably, in the structured light fringe excitation stage, multi-view fringe images are acquired by rotating the part or translating the light source, wherein the binary fringe is used to modulate and generate the edge features of the geometric defect, and the cosine fringe is used to modulate and generate the grayscale gradient features of the chromatic aberration defect;
[0025] When inspecting parts with large curvature changes, adjust the binary fringe period and cosine fringe frequency according to the curvature change rate of the part surface;
[0026] When inspecting slender cylindrical parts, the light source layout and movement mode are adjusted, and an axial scanning process is added.
[0027] Preferably, in the machine vision detection stage, the improved YOLOv8 network model includes the following modules:
[0028] A feature extraction module integrating deformable convolution, which calculates the sampling point offset according to the normal direction of the part surface;
[0029] Small target detection head, whose receptive field size is related to the distance from the lens focus to the part surface and the distance from the light source to the part;
[0030] The enhanced spatial pyramid pooling module outputs feature map resolution that matches the number of viewing angles of the stripe image acquisition. At the same time, the model training adopts a transfer learning strategy, first pre-training using a public industrial defect dataset, and then fine-tuning based on actual part images.
[0031] Preferably, in the model optimization and evaluation stage, a joint loss function including geometric defect edge loss and chromatic aberration defect grayscale loss is constructed;
[0032] The geometric defect detection results are associated with the fringe distortion model under the coaxial posture. By adjusting the distance between the lens focus and the part surface, and the distance between the light source and the part, the reflection interference of the part surface is suppressed.
[0033] The color difference defect detection results are correlated and verified with the grayscale gradient threshold of the cosine fringe, and an ambient light interference compensation model is established.
[0034] Preferably, the coaxial posture is solved for external parameters through the plane mirror assisted calibration method. In the specific calibration process, at least three calibration plate images at different angles are first collected, and the Zhang Zhengyou calibration method is used to obtain the internal parameter matrix of the industrial camera. Then, combined with the plane mirror reflection principle, the external parameter conversion matrix between the industrial camera and the structured light source is calculated.
[0035] A columnar transparent part defect detection system, the system comprising:
[0036] Inspection preparation unit: It consists of a cleaning device and a parameter configuration module. The cleaning device is used to clean parts, and the parameter configuration module is used to select parameters related to industrial cameras and structured light sources based on part characteristics.
[0037] Coaxial position adjustment subsystem: includes a three-axis translation stage and a rotary indexing stage, used to adjust the coaxial position of industrial cameras, structured light sources, and parts;
[0038] Composite structured light projection subsystem: an arched array light source integrating a binary fringe generator and a cosine fringe generator, which performs relative motion fringe excitation by cooperating with a translation guide or a part rotation axis;
[0039] Multimodal visual inspection subsystem: This includes an industrial camera and plane mirror calibration module, and uses an improved YOLOv8 network model to perform fringe image acquisition and defect feature detection.
[0040] Parameter linkage control subsystem: This subsystem establishes the distance between the lens focus and the part surface, the distance between the light source and the part, and the mapping relationship table between the fringe encoding parameters and the network model detection parameters, and implements closed-loop control of the detection process through the PLC controller.
[0041] Post-detection processing unit: It consists of a defect grading module and a report generation module. The defect grading module is used for defect grading processing, and the report generation module is used to generate a processing suggestion report based on the defect situation.
[0042] Preferably, the coaxial posture adjustment subsystem and the composite structure light projection subsystem realize motion-projection coordination through a synchronous trigger module, controlling each rotation angle of the part to correspond to a specific stripe projection state, and are also provided with an emergency stop device and a safety protection module.
[0043] Preferably, the parameter linkage control subsystem has a built-in defect detection accuracy optimization algorithm. When the missed detection rate is detected to be greater than 3%, the distance between the lens focus and the part surface, the distance between the light source and the part, or the fringe frequency are automatically adjusted, and the parameters of the small target detection head of the network model are synchronously updated.
[0044] At the same time, the system has data storage and traceability functions, which can save original images, test results and related parameters during the detection process.
[0045] (3) Beneficial effects
[0046] (1) Detection accuracy reaches high industrial standards:
[0047] Through the coaxial posture design of industrial cameras, structured light source and parts, the interference of light refraction and reflection is effectively suppressed, and high-precision detection of tiny defects is achieved. The coaxial layout keeps the distance between the lens focus and the part surface stable. Combined with the fringe modulation technology of composite structured light, the edge features of geometric defects and the grayscale changes of chromatic aberration defects can be clearly presented. The detection capability covers all kinds of tiny defects required by industry standards and meets the high-precision requirements of precision manufacturing scenarios.
[0048] (2) Efficient detection capability for all types of defects:
[0049] A composite structured light source with an alternating array of binary stripes and cosine stripes is used to achieve feature separation and collaborative detection of geometric and chromatic defects. Binary stripes highlight surface undulation defects through light and dark contrast, while cosine stripes reflect material uniformity defects through grayscale gradient changes. The synergistic effect of the two stripes enables the system to effectively identify various types of surface and sub-surface defects, covering all common defect forms in the production process, and solving the problem of incomplete coverage of traditional single detection methods.
[0050] (3) Industrial-grade detection efficiency and real-time performance:
[0051] By designing the relative motion between parts and structured light sources, combined with high-frame-rate industrial cameras and optimized deep learning models, rapid full inspection of part surfaces is achieved. The high-speed acquisition capabilities of industrial cameras combined with the efficient inference performance of the improved YOLOv8 model can complete image acquisition and defect identification of the entire surface of parts in a short period of time, meeting the production line's strict requirements for inspection efficiency and significantly improving the level of automation in industrial inspection.
[0052] (4) Strong robustness and wide adaptability:
[0053] Through the parameter linkage control mechanism and environmental adaptability design, the system can maintain stable performance in the detection scenarios of cylindrical parts of different materials and sizes. The high-precision calibration of coaxial pose, dynamic adjustment of structured light stripe parameters and adaptive feature extraction capabilities of the deep learning model enable the system to have strong anti-interference capabilities against interference factors such as changes in part surface curvature and ambient light fluctuations. It can be flexibly applied to the detection of cylindrical transparent parts in multiple industries such as optics, medical care, and food packaging.
[0054] (5) Intelligent and automated upgrades:
[0055] The deep learning-based defect recognition model uses an optimization strategy driven by small sample data to achieve intelligent learning and accurate classification of complex defect features. The model's end-to-end detection capabilities reduce the traditional algorithm's reliance on manual feature engineering. Combined with the automated defect grading and report generation functions of post-detection processing, it builds a full-process intelligent detection system from image acquisition to result output, reducing the cost of manual intervention and improving the consistency and reliability of detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention with reference to the accompanying drawings.
[0057] Figure 1 This is a flowchart of the overall process in an embodiment of the present invention;
[0058] Figure 2 Schematic diagram of a general system for structured light stripe transmission in an embodiment of the present invention;
[0059] Figure 3 Schematic diagram of the optimal posture structure in an embodiment of the present invention;
[0060] Figure 4 This is a schematic diagram of the structure of an embodiment of the present invention in which a plane mirror is introduced as an auxiliary calibration tool;
[0061] Figure 5 Schematic diagram of light stripes in an embodiment of the present invention;
[0062] Figure 6 Schematic diagram of a glass defect detection system according to an embodiment of the present invention;
[0063] Figure 7 Schematic diagram of imaging effects of different types of defects in an embodiment of the present invention;
[0064] Figure 8 : This is an imaging effect diagram of the same defect in different areas in an embodiment of the present invention;
[0065] Figure 9 Graph showing the loss function of the training results in an embodiment of the present invention;
[0066] Figure 10 This is a graph of the model training accuracy in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The embodiment of the present application provides a method for detecting defects in columnar transparent parts, which effectively solves the technical problems of complex optical properties, diverse defect types, and the contradiction between real-time performance and accuracy in the detection of existing columnar transparent parts. Through the synergistic effect of coaxial pose optimization, composite structured light source design and improved YOLOv8 deep learning model, the comprehensive performance of defect detection in columnar transparent parts is significantly improved: high-precision recognition of tiny geometric and chromatic aberration defects is achieved, covering various common surface and sub-surface defects in production; through the relative motion of parts and light sources and high-speed image acquisition and processing, the real-time detection needs of industrial production lines are met; the system has strong anti-interference ability and can adapt to detection scenarios under different materials, sizes and environmental conditions, and realizes automatic learning and classification processing of defect characteristics through intelligent models, constructing a high-precision, high-efficiency and high-robust full-process automated detection system, effectively improving the intelligence level of product quality control.
[0068] Example: The technical solution in the embodiment of the present application effectively solves the technical problems of the existing cylindrical transparent parts in the detection of complex optical characteristics, various defect types and the contradiction between real-time performance and accuracy. The overall idea is as follows: Figure 1 The specific introduction is as follows:
[0069] 1. Design Idea
[0070] The fringe transmission principle plays a central role in defect detection on the highly transparent inner surfaces of cylindrical parts. This principle is based on the fact that when light passes through a highly transparent object containing defects, the geometric or chromatic aberrations caused by the defects cause the transmitted light to exhibit fringe deflection or grayscale gradient changes in the image. This allows the type, size, and location of surface defects on the cylindrical part to be determined. However, in industrial applications, high-transmittance surface defect detection on cylindrical parts focuses on the aesthetic properties of the part surface. While its defect detection accuracy is at the 0.1mm level, it still faces multiple challenges. The primary challenge lies in the complex optical properties of cylindrical parts, such as high transmittance, reflection, and refraction. These characteristics lead to complex optical interactions of light on the surface, significantly increasing the difficulty of detection. Secondly, the variety of defects on the highly transparent surfaces of cylindrical parts is diverse, and the characteristics of each defect vary significantly. This requires a highly robust detection algorithm to effectively identify various defects. Furthermore, on-line cylindrical part inspection must balance real-time performance and accuracy. Improving detection speed often comes at the expense of accuracy. How to improve detection speed while ensuring accuracy has become a major challenge in technical implementation.
[0071] For defect detection of cylindrical transparent parts, they may be distributed in three main areas of the parts: the outer surface, the inner surface and the interior of the parts. When the defect is located on the outer surface of the cylindrical part, the difference in optical detection between it and the defect located on the inner surface is mainly due to the difference in part thickness. However, considering that the thickness of the part is usually small relative to its radius, the impact on light propagation can be approximately ignored. Therefore, in theory, the optical responses of defects on the outer and inner surfaces can be considered similar. If the defect is located inside the part, from a process perspective, it generally exists in the form of tiny bubbles. These bubbles are equivalent to forming a vacuum area inside the part. In order to simplify the analysis, the optical impact of this internal defect can be equivalent to the defect being located on the inner and outer surfaces of the part, because the presence of bubbles will also cause the light to refract and change when passing through. In view of the above analysis, the focus is on the theoretical discussion of defect detection on the inner surface of cylindrical transparent parts. In the subsequent experimental stages, the results of the theoretical analysis will be comprehensively applied to conduct a comprehensive evaluation of its defects to verify the accuracy and practicality of the theoretical model.
[0072] In view of this, based on the principle of fringe transmission, in-depth analysis and verification are carried out in specific industrial detection scenarios, including:
[0073] Through theoretical analysis of the optimal detection posture and spatial posture calibration, an imaging model suitable for high-transparency internal surface defect detection of cylindrical parts is derived. Combined with error analysis, the feasibility of the proposed method is theoretically verified.
[0074] To achieve diverse defect detection, the structure of the structured light stripes is optimized, using an alternating array of binary stripes and cosine stripes. Through the relative displacement of the structured light source and the cylindrical part, both geometric and chromatic aberration defects can be imaged.
[0075] Considering the diversity of defects and environmental interference, traditional defect detection methods will reduce detection capabilities due to their lack of robustness. Therefore, a YOLOv8 network structure was built and optimized based on small sample data to achieve high-performance online detection of high-transparency inner surface defects on cylindrical parts.
[0076] To verify the effectiveness of the theoretical method, actual tests were conducted on the defects on the surface of high-transmittance glass cylindrical parts. It was proved that this method has a wide range of applications for cylindrical parts in industrial scenarios. It can accurately and efficiently detect defects on the surface of cylindrical parts, providing strong technical support for improving the quality of cylindrical parts and reducing production costs. Figure 1 shown.
[0077] 2 High-transparency inner surface defect detection model for cylindrical parts
[0078] In the high-transmittance part surface defect detection based on the principle of structured light fringe transmission, part surface defects are often manifested as local light transmittance reduction or changes in light deflection effect. Therefore, structured light fringe transmission technology is used to capture the fringe image formed after the light source passes through the part through an industrial camera, so as to directly and effectively present the defects on the part surface. The general system structure of structured light fringe transmission is as follows: Figure 2 As shown in the figure, by using the optical path reverse tracing technology, the correspondence between the stripe shape and grayscale gradient information in the industrial camera and the part defects is established, thereby realizing the detection of part surface defects.
[0079] Structured light stripe transmission technology has achieved breakthrough progress in the field of high-transmittance material defect detection and has been widely used in multiple industries such as smartphone displays, ophthalmic optical lenses, and glass products. However, when addressing the challenge of surface defect detection on cylindrical parts, given the essential difference between the cylindrical structure and the plane-like optical properties, a set of defect detection models will be constructed based on existing theoretical practices to meet the needs of various industries for high-transmittance inner surface defect detection of cylindrical parts.
[0080] 2.1 Spatial pose calibration of high-transmittance inner surface defect detection system
[0081] 2.1.1 Theoretical Analysis of Optimal Spatial Position
[0082] When constructing a high-transmittance inner surface defect detection system for cylindrical parts, the industrial camera lens will be parallel to the upper end face of the cylindrical part and the structured light source will maintain a coaxial position with the cylindrical part, where the cylindrical part has an inner diameter R, a wall thickness D, and a height H. The distance between its upper end face and the x-axis in space is H1, and the radius of the structured light source is L. For the reverse propagation of light, points P1 and P2 on the structured light source intersect with the outer surface of the cylindrical part at points O1 and O2 respectively, and are captured by the industrial camera and intersect with the CCD target surface at points Q1 and Q2. The distances between points P1 and P2 and the x-axis in space are d1 and d2 respectively. From the perspective of defect resolution, the wall thickness D value of the cylindrical part is relatively small, and after refraction, the light will deviate downward according to the change of the refractive index and the incident angle, but its direction remains parallel, and its offset value is relatively small. Therefore, in industrial scenarios, in order to determine the optimal detection position, its wall thickness will be close to 0. Its structure is shown in the figure below. Figure 3 shown.
[0083] based on Figure 3 As shown in the figure, the spatial position of cylindrical parts in industrial camera detection and the size of detectable parts (diameter and height) are limited by the imaging target size, lens focal length setting and lens depth of field capability of the industrial camera. Its optimal posture should meet the following requirements:
[0084] The optical axis of the industrial camera lens, the axis of the cylindrical part, and the axis of the structured light source coincide with each other;
[0085] The distance H1 between the geometric focus of the lens and the upper surface of the cylindrical part is limited by the radius of the cylindrical part, the focal length of the industrial camera, the target surface size of the industrial camera, and the height information of the cylindrical part;
[0086] For structured light sources, as L increases, that is, the distance between the structured light source and the cylindrical part increases, the overall volume of the structured light source increases, which is not conducive to structural design; conversely, when the L value decreases to close to the diameter of the cylindrical part, higher fringe resolution is required to reflect the surface details of the cylindrical part. Therefore, under the premise of ensuring mechanical structure compatibility, the distance between the structured light source and the cylindrical part should be reasonably set according to the fringe resolution, defect detection capability and industrial camera lens parameters.
[0087] 2.1.2 Spatial Position Calibration of High-Transparency Inner Surface Detection System
[0088] When discussing the surface defect detection technology of cylindrical parts based on the structured light stripe transmission model, obtaining information about the surface defects of cylindrical parts becomes the key. Since the calibration of the intrinsic parameters of industrial cameras has been quite mature in the field of machine vision, we will not elaborate on this. Instead, we will focus on the external parameter calibration between the structured light source and the industrial camera. When designing the detection system, the structured light source and the target surface of the industrial camera are perpendicular to each other. However, although this layout makes it easier for the industrial camera to capture the structured light stripes, it inevitably reduces the accuracy of the external parameter calibration. To overcome this challenge, a plane mirror is introduced as an auxiliary calibration tool. Its design layout is as follows: Figure 4 As shown, the aim is to indirectly improve the calibration accuracy through a plane mirror.
[0089] The introduction of a plane mirror becomes an additional variable in the calibration process due to its unknown posture state. To solve this problem, a new calibration strategy is proposed: a series of feature points are arranged on the surface of the plane mirror, and an industrial camera is used to capture the feature points and calculate the posture information of the plane mirror. Then, based on the acquired plane mirror posture, the position of the structured light source is further solved, laying a solid foundation for achieving high detection capabilities of surface defects of cylindrical parts.
[0090] The calibration method based on reflective targets aims to determine the relative spatial pose relationship between the industrial camera and the structured light source. In the actual imaging process, the structured light source is reflected by the plane mirror to form a virtual image, which satisfies:
[0091]
[0092] P′ is the coordinate of the feature point on the virtual image of the structured light source, Q is the pixel coordinate of the industrial camera, R v2c and T v2cis the transformation matrix from the screen virtual image coordinate system to the industrial camera coordinate system, which can be obtained by decomposing the homography matrix. Since it has been mirrored by a plane mirror, R v2c The determinant is -1. Similarly, the transformation matrix from the plane mirror coordinate system to the industrial camera coordinate system can be constructed:
[0093]
[0094] Where O1 is the coordinate of the characteristic point of the plane mirror, R m2c and T m2c is the transformation matrix from the plane mirror coordinate system to the industrial camera coordinate system, which is further calculated as follows:
[0095]
[0096] d=nT m2c (10)
[0097] Where n is the normal vector of the plane mirror, d is the distance between the optical center of the industrial camera and the plane mirror, then:
[0098]
[0099] Through the above method, the transformation matrix R between the structured light source coordinate system and the industrial camera coordinate system is calculated s2c and T s2c The advantage of this method is that only a single set of images is needed to solve the position information of the structured light source, which greatly simplifies the calibration process. In addition, the feature points arranged on the surface of the plane mirror not only enrich the calibration information, but also provide strong geometric constraints for the solution of the plane mirror's own posture, thereby improving the overall calibration accuracy.
[0100] 3. Construction of structured light stripes with equal resolution of half field of view
[0101] Aiming at the problem of defect detection on the high-transparency surface of cylindrical parts, an in-depth analysis of the defect detection model is conducted. The structured light source and the cylindrical part are arranged coaxially in space, and the industrial camera is installed on the upper end of the part. Considering that the surface of the high-transparency part may have color difference and geometric defects due to the production process, various types of structured light stripes will be used to highlight the defect characteristics; in order to take into account the fast pace of industrial production and the special requirements of the mechanical structure for part loading and unloading, an arched light source is designed to avoid structural interference; in view of the random distribution of defects on the part surface, a solution of combining part rotation with continuous acquisition by an industrial camera is proposed. In view of this, the structured light source is designed to be in an arched state, such as Figure 5 As shown in the figure, the images collected by the industrial camera only use half of the field of view for defect detection and analysis. Through the rotation of the part and continuous capture by the industrial camera, full inspection of part surface defects can be achieved.
[0102] 4 Experiments and Applications
[0103] In order to verify the feasibility of the theoretical method for high-transmittance surface defect detection of cylindrical parts, the most common cylindrical high-transmittance glass cups in life were selected for verification. The principle of structured light stripe transmission was used to build a hardware system to accurately present the defect characteristics of the inner surface of the glass cup and effectively detect defects.
[0104] 4.1 Hardware System Construction
[0105] Based on the above detection principle, the mechanical structure is designed and a system is constructed for high-transmittance inner surface defect detection of cylindrical parts. The structured light source will be customized according to the diameter of the cylindrical part, and ensure that the axes of the structured light source, cylindrical part and industrial camera coincide with each other in spatial posture to form a coaxial layout; the target defect types include bulges, pits, nodules and foreign matter; since the system needs to detect geometric and chromatic aberration defects at the same time, the structured light source is composed of binary and cosine structured light stripes, which requires a relative displacement between the part and the structured light source to ensure that various defects can be effectively imaged in the corresponding structured light stripes. By optimizing the mechanical structure design, the part is moved to the circular surface detection station through the clamping mechanism and the transfer mechanism. After it is in place, the part is adsorbed on the rotating mechanism by the vacuum negative pressure mechanism, and the rotating mechanism is used to realize the self-rotation of the part. The industrial camera is used for continuous capture to realize the full detection of defects on the inner surface of the cylindrical part. The glass surface defect detection system is as follows: Figure 6 As shown in the figure, the improved YOLOv8 detection model is deployed on the client's server based on the Python language. The single-model inference time is optimized to about 15ms. In view of the differentiated characteristics of color difference and geometric defects, the system adopts a dual-model parallel inference architecture to achieve real-time detection of defects.
[0106] 4.2 System Verification Test
[0107] In evaluating the key factors affecting high-transmittance inner surface defect detection of cylindrical parts, we will focus on the imaging stability of chromatic aberration and geometric defects, the model training accuracy of parts, and the detection effects of different types of defects, to evaluate the stability and accuracy of system detection.
[0108] Imaging stability verification is based on the principle of structured light fringe transmission for defect detection. Different types of defects are optically presented using the detection system. The defect types include geometric and chromatic aberration defects. The imaging effect is as follows: Figure 7 shown.
[0109] To simulate defects at different angles, the rotation angle of the part is changed, and the imaging effects of different types of defects at different angles are compared and analyzed. For pits in geometric defects, the part is rotated 2° each time within a fringe cycle to capture the image. The changes in the binary fringe and cosine fringe areas of the image are shown as follows: Figure 8 As shown in the figure, the pit defect size is 0.05mm through three-coordinate detection. When the geometric defect in the binary stripe area is affected by the defect angle and depth, the binary stripe is deformed, and the geometric defect is indirectly presented through the deformation of the binary stripe. However, in the cosine stripe area, as shown by the red arrow in the figure, it only has a slight grayscale change, which is not easy to extract the defect features through deep learning.
[0110] For the discoloration in color difference defects, the glass cup part is rotated 2° each time within a fringe cycle to capture the image. The changes of the defect with a size of 0.1mm in the binary fringe and cosine fringe areas of the image are as follows: Figure 8 As shown in the figure, when the color difference defect is in the binary stripe area, it will be misjudged when using deep learning for detection due to the interference of the binary stripe background. However, if it exists in the cosine stripe area, the background is relatively simple and the grayscale value of the area has been calibrated. The grayscale change is known, which will improve the ability to detect color difference defects using deep learning.
[0111] By imaging different types of defects and verifying their rotational repeatability, geometric defects will be imaged and detected in the binary fringe area, and chromatic aberration defects will be imaged and detected in the cosine fringe area. This result not only provides a basis for defect imaging for the subsequent industrial application of deep learning algorithm detection, but also confirms the feasibility and practicality of the proposed imaging theory.
[0112] Model training and test results: In order to verify the detection effect of the proposed deep learning model, defects are labeled, trained and verified. Since the stripes of structured light stripe transmission present different shapes for geometric and chromatic defects, but for geometric defects such as cracks, wavy lines, bulges, cracks, bubbles, etc., the features of the stripe images captured by the industrial camera are similar, so the defect dataset will be merged. For scratches and impurities, separate datasets will be defined according to their characteristics. Since an image may contain data for multiple defect annotations, the dataset contains a total of 1078 targets after statistics, and the defects are enhanced by small sample data driving, and the defect data is expanded to 2631.
[0113] An optimized version of the YOLOv8s model is used based on the expanded defect data, including improvements to the DET4, SPPELAN, and C2F_DCNv3 modules. The training results are evaluated using the loss function and accuracy. The Adam optimizer is used for model training, and the maximum number of training iterations is 50.
[0114] After testing, the loss function of the training result is as follows Figure 9As shown in the figure, it shows the changes of three types of losses during the model training process: classification loss (cls_loss) and rectangular box regression loss (box_loss, dfl_loss). The proposed model shows good convergence and stability during the training process. The loss function does not show obvious floating oscillation during the convergence process, which fully demonstrates the robustness and efficiency of the model.
[0115] The mentioned model achieved significant training results on the training set of defect datasets, such as Figure 10 As shown in the figure, the validation data set is verified, and the curve shows the process of model accuracy improving with the number of iterations. The recognition ability and recall rate gradually increase, indicating that the accuracy of the model in identifying defects is improved. This proves that the model detection is efficient, the identification is accurate, and the training results are significant.
[0116] When compared with the current mainstream target detection network, the proposed optimization model is relatively superior in comprehensive indicators such as detection accuracy, recall rate, detection capability, model parameter complexity, and memory performance. Specifically, the model achieved an accuracy rate of 98.8%, which strongly demonstrated its outstanding ability in accurately identifying defects. At the same time, the recall rate of 94.8% ensured that the model could efficiently capture the vast majority of defect instances, reducing the risk of missed detection. The detection capability of 97.8% is another strong evidence of the superiority of the overall performance of the model, reflecting its stable performance in complex scenarios. It is particularly worth mentioning that the model only consumed 5.29MB of memory resources during the inference process. This low memory usage feature enables the model to show extremely high efficiency and practicality in engineering application deployment. This lightweight design not only reduces the requirements for hardware resources, but also improves the portability and scalability of the model on different platforms.
[0117] In summary, the proposed optimization model demonstrates remarkable performance in the field of defect detection, combining high detection capability, strong recall, lightweight design, and high efficiency. It provides a defect detection algorithm foundation for subsequent industrial deployment. The model has broad application prospects and important practical value, and is expected to provide strong technical support for intelligent upgrades and quality control in related industries.
[0118] 4.3 Engineering Application Verification
[0119] To verify the stability and inspection efficiency of the system, the system was started up normally for a 5-hour batch test. A total of 1,500 glass cups were inspected. One shift was arranged for manual visual inspection, with an inspection efficiency of 60 parts per person per hour. Each shift consisted of 5 people, and a total of 5 hours were required to complete the inspection. The data of manual visual inspection and system inspection were collected separately, and finally confirmed by third-party visual inspection staff. For the glass cups with objections, the defect location and size value were determined by third-party dimensional inspection as the basis for judgment to ensure data accuracy. The statistical data are shown in Tables 1 and 2.
[0120] Table 1 Statistical data of manual self-inspection and third-party inspection
[0121]
[0122] Table 2 Statistics of system testing and third-party testing
[0123]
[0124] Finally, it should be noted that the above embodiments are merely examples for the purpose of illustrating the present invention and are not intended to limit the embodiments. Those skilled in the art will readily appreciate that other variations or modifications based on the above description are possible. It is not necessary and impossible to provide an exhaustive list of all embodiments. However, obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.
Claims
1. A method for detecting defects in cylindrical transparent parts, characterized in that: The detection method comprises the following steps: During the inspection preparation phase, the cylindrical transparent parts are cleaned and pre-treated. Then, based on the light transmittance of the part material and the minimum defect size expected to be detected, the appropriate industrial camera resolution, structured light source wavelength, and power parameters are selected. During the detection pose configuration phase, the industrial camera and structured light source are spatially arranged so that their axes are precisely coaxial with the axis of the cylindrical part. The distance between the lens focus and the part surface is determined by comprehensively considering the focal length of the industrial camera, the target surface size, and the part radius and height parameters. The spacing between the light source and the part is then set based on the fringe resolution and the established defect detection accuracy requirements. During the structured light fringe excitation phase, a composite structured light source, integrating binary fringes and cosine fringes, is used to project a fringe pattern onto the part surface in a configured coaxial position. Multi-view fringe images are acquired through the relative motion of the part and the light source, and the fringe parameters are adjusted according to the specific characteristics of the part. During the machine vision inspection phase, an industrial camera is used to capture the aforementioned stripe images, which are then fed into the improved YOLOv8 network model for defect recognition. In the model optimization and evaluation phase, the training effect of the network model is evaluated based on the constructed joint loss function and combined with the detection accuracy index, and then the type and location information of the defect is output; In the post-inspection processing stage, the detected defects are graded, and then combined with the actual usage scenarios and quality standard requirements of the parts to generate a corresponding defect handling recommendation report.
2. The method for detecting defects in a cylindrical transparent part according to claim 1, wherein: During the detection posture configuration stage, the distance between the lens focus and the part surface is determined based on the focal length of the industrial camera, the target surface size, and the part radius and height parameters; The distance between the light source and the part is set based on the relationship between fringe resolution and the minimum resolvable fringe width, combined with the distance between the lens focus and the part surface.
3. The method for detecting defects in a cylindrical transparent part according to claim 1, wherein: In the structured light fringe excitation stage, multi-view fringe images are acquired by rotating the part or translating the light source. Binary fringes are used to modulate and generate edge features of geometric defects, and cosine fringes are used to modulate and generate grayscale gradient features of chromatic aberration defects. When inspecting parts with large curvature changes, adjust the binary fringe period and cosine fringe frequency according to the curvature change rate of the part surface; When inspecting slender cylindrical parts, the light source layout and movement mode are adjusted, and an axial scanning process is added.
4. The method for detecting defects in a cylindrical transparent part according to claim 1, wherein: In the machine vision detection stage, the improved YOLOv8 network model includes the following modules: A feature extraction module integrating deformable convolution, which calculates the sampling point offset according to the normal direction of the part surface; Small target detection head, whose receptive field size is related to the distance from the lens focus to the part surface and the distance from the light source to the part; The enhanced spatial pyramid pooling module outputs feature map resolution that matches the number of viewing angles of the stripe image acquisition. At the same time, the model training adopts a transfer learning strategy, first pre-training using a public industrial defect dataset, and then fine-tuning based on actual part images.
5. The method for detecting defects in a cylindrical transparent part according to claim 1, wherein: In the model optimization and evaluation stage, a joint loss function is constructed that includes the edge loss of geometric defects and the grayscale loss of chromatic aberration defects; The geometric defect detection results are associated with the fringe distortion model under the coaxial posture. By adjusting the distance between the lens focus and the part surface, and the distance between the light source and the part, the reflection interference of the part surface is suppressed. The color difference defect detection results are correlated and verified with the grayscale gradient threshold of the cosine fringe, and an ambient light interference compensation model is established.
6. The method for detecting defects in a cylindrical transparent part according to claim 1, wherein: The coaxial pose is solved for extrinsic parameters through the plane mirror-assisted calibration method. During the specific calibration process, at least three calibration plate images at different angles are first collected, and the Zhang Zhengyou calibration method is used to obtain the intrinsic parameter matrix of the industrial camera. Then, combined with the plane mirror reflection principle, the extrinsic parameter conversion matrix between the industrial camera and the structured light source is calculated.
7. A cylindrical transparent parts defect detection system, characterized in that: The system includes: Inspection preparation unit: It consists of a cleaning device and a parameter configuration module. The cleaning device is used to clean parts, and the parameter configuration module is used to select parameters related to industrial cameras and structured light sources based on part characteristics. Coaxial position adjustment subsystem: includes a three-axis translation stage and a rotary indexing stage, used to adjust the coaxial position of industrial cameras, structured light sources, and parts; Composite structured light projection subsystem: an arched array light source integrating a binary fringe generator and a cosine fringe generator, which performs relative motion fringe excitation by cooperating with a translation guide or a part rotation axis; Multimodal visual inspection subsystem: This includes an industrial camera and plane mirror calibration module, and uses an improved YOLOv8 network model to perform fringe image acquisition and defect feature detection. Parameter linkage control subsystem: This subsystem establishes the distance between the lens focus and the part surface, the distance between the light source and the part, and the mapping relationship table between the fringe encoding parameters and the network model detection parameters, and implements closed-loop control of the detection process through the PLC controller. Post-detection processing unit: It consists of a defect grading module and a report generation module. The defect grading module is used for defect grading processing, and the report generation module is used to generate a processing suggestion report based on the defect situation.
8. The columnar transparent part defect detection system according to claim 7, characterized in that: The coaxial posture adjustment subsystem and the composite structured light projection subsystem achieve motion-projection coordination through a synchronous trigger module, controlling each rotation angle of the part to correspond to a specific stripe projection state. An emergency stop device and a safety protection module are also provided.
9. The columnar transparent part defect detection system according to claim 7, characterized in that: The parameter linkage control subsystem has a built-in defect detection accuracy optimization algorithm. When the missed detection rate is detected to be greater than 3%, it automatically adjusts the distance between the lens focus and the part surface, the distance between the light source and the part, or the fringe frequency, and synchronously updates the small target detection head parameters of the network model. At the same time, the system has data storage and traceability functions, which can save original images, test results and related parameters during the detection process.
Citation Information
Cited By
Surface defect detection method and system based on curved surface coding and multi-view fusion
CN121027154A
Cordyceps militaris fermented beverage quality monitoring method and system based on image recognition
CN121298604A
Image recognition-based quality monitoring method and system for cordyceps militaris fermented beverage
CN121298604B
Liquid crystal glass defect detection device and control method
CN121453668A
Liquid crystal glass defect detection device and control method
CN121453668B