Visible light detection method and system for tubular workpiece inner surface defects

By processing the reflected light from the inner surface of a tubular workpiece using a CCD visible light imaging module, and combining concave surface correction and brightness equalization correction, a defect segmentation and classification network is constructed. This solves the problem that the influence of defect area was not considered in the defect detection of the inner surface of tubular workpieces, and achieves high-precision defect detection.

CN121007901APending Publication Date: 2025-11-25CHN ENERGY SUQIAN POWER GENERATION CO LTD +1
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202511509708.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing technologies fail to effectively consider the impact of defect area on the conformity of tubular workpieces in the detection of defects on the inner surface of tubular workpieces, and the detection accuracy is insufficient, especially for defects on the inner surface of tubular workpieces, the accuracy needs to be improved.

Method used

A CCD visible light imaging module is used to capture reflected light from the inner surface of a tubular workpiece. The visible light image is processed by concave surface correction and brightness equalization correction. A defect segmentation network is constructed to extract the defect region and calculate its area. Combined with a defect classification network, the defect is classified and a non-conforming mark is output.

Benefits of technology

It improves the accuracy and effectiveness of detecting defects on the inner surface of tubular workpieces, and can accurately calculate the area of ​​the defect region and mark the defect as non-conforming according to the defect category, thereby enhancing the effectiveness and precision of the detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121007901A_ABST
    Figure CN121007901A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of optical defect detection, in particular to a visible light detection method and system for defects on the inner surface of a tubular workpiece, and the method comprises the following steps: collecting a visible light image of the inner surface of the tubular workpiece through a CCD visible light imaging module; performing visible light image correction on the visible light image to obtain a calibrated visible light image, wherein the visible light image correction comprises concave surface correction and brightness balance correction; constructing a defect segmentation network to perform defect region extraction on the calibration visible light image and calculating the area of the defect region; constructing a defect classification network to classify the extracted defect areas to obtain defect category information; and performing disqualification marking on the workpiece with the defect area larger than a defect area threshold value according to the defect category information, and outputting a detection result. According to the method, the defect area of the inner surface of the tubular workpiece is segmented and then classified, and the area of the defect area is accurately calculated, so that the unqualified workpiece is marked, and the accuracy of detecting the defects of the inner surface of the tubular workpiece is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of optical defect detection, and in particular to a visible light detection method and system for defects on the inner surface of a tubular workpiece. BACKGROUND

[0002] Surface defect detection is an important guarantee for quality control in the industry and an important task in industrial manufacturing. During the casting process of workpieces on the industrial production line, different types of defects may occur due to production processes and other problems, thereby affecting the performance of the workpieces. Therefore, defect detection of workpieces is an essential part of modern industrial production lines.

[0003] In actual production processes, small defects on the surface of a workpiece do not affect the eligibility of the workpiece. However, existing workpiece surface defect detection only detects the defect location and defect type, without further considering the impact of defect area on the eligibility of the workpiece. Since the inner surface of a tubular workpiece is in a concave arc structure, conventional detection is easily disturbed. However, visible light detection technology can accurately capture the details of the inner surface of the workpiece to quantify the defect area, and can also eliminate the interference of the inner surface of the tubular workpiece by customizing the light source, thereby providing a feasible path for improving the detection accuracy of the inner surface of the tubular workpiece.

[0004] For example, the Chinese patent with the authorization announcement number CN117191816B discloses an electronic component surface defect detection method and device based on multispectral fusion, which includes obtaining a defect detection model and collecting visible light images and infrared images of the component surface. After registration and fusion, the defect detection model is input to realize defect detection. However, this technical solution is similar to most existing workpiece surface defect detection technologies, which only detect the defect location and defect type, without further considering the impact of defect area on the eligibility of the workpiece. Moreover, there are few studies on the detection of defects on the inner surface of a tubular workpiece, and the accuracy of the detection of defects on the inner surface of a tubular workpiece needs to be improved. SUMMARY

[0005] In order to overcome the defects and deficiencies of the prior art, the present application provides a visible light detection method and system for defects on the inner surface of a tubular workpiece, which realizes the marking of unqualified workpieces by segmenting and classifying the defect area on the inner surface of the tubular workpiece and accurately calculating the defect area, thereby improving the effectiveness and accuracy of the detection of defects on the inner surface of a tubular workpiece on an industrial production line.

[0006] In order to achieve the above-mentioned purpose, the present application adopts the following technical solutions:

[0007] The present application provides a visible light detection method for defects on the inner surface of a tubular workpiece, which includes the following steps:

[0008] The CCD visible light imaging module emits visible light to the inner surface of the tubular workpiece, captures reflected light according to the difference in visible light absorption rate between the normal area and the defect area of the inner surface of the tubular workpiece, and obtains a visible light image;

[0009] The visible light image is sequentially subjected to inner concave surface correction and brightness equalization correction to offset the perspective distortion caused by the concave surface of the inner surface of the tubular workpiece and the interference of the ambient light source, and obtain a calibrated visible light image reflecting the distribution of visible light absorption rate, and the calibrated visible light image is preprocessed, the preprocessing including defect labeling and data enhancement;

[0010] A defect segmentation network is constructed to extract a defect area from the calibrated visible light image according to the uneven brightness distribution caused by different visible light absorption rates and calculate the area of the defect area, a defect classification network is constructed to classify the defect area according to the brightness and area shape of the defect area, obtain defect category information, mark the workpiece with an area of the defect area greater than a defect area threshold as unqualified, and output a detection result.

[0011] As a preferred technical solution, the inner concave surface correction is used to correct the concave surface of the inner surface of the tubular workpiece to a plane, and the correction process is represented by the following formula:

[0012] ;

[0013] In the formula, represents a corrected straight line, represents the radius of the cross section of the tubular workpiece, represents the height of the vertical emission angle of the CCD visible light imaging module, represents the angle of the horizontal emission angle of the CCD visible light imaging module.

[0014] As a preferred technical solution, the brightness equalization correction is used to eliminate interference such as reflection and shadow and correct the brightness of the visible light image to be uniform, and the specific steps include:

[0015] The visible light RGB image of the inner surface of the tubular workpiece collected is converted to an HSV color space, and a brightness component reflecting the brightness characteristics of the visible light is separated out;

[0016] The brightness component is subjected to multi-scale Gaussian smoothing, and the illumination component in the visible light signal is estimated by guided filtering;

[0017] According to the distribution of the illumination component, the brightness equalization degree of the visible light image is adaptively adjusted to obtain a calibrated visible light image.

[0018] As a preferred technical solution, the data enhancement is used to expand the visible light image, and the specific steps include:

[0019] An image transformation is performed on a visible light image of the inner surface of a tubular workpiece, the image transformation including at least one of horizontal flipping, vertical flipping, and random angle rotation.

[0020] As a preferred technical solution, the calculation process for the area of ​​the defect region is expressed by the following formula:

[0021] ;

[0022] In the formula This represents the actual area of ​​the defective region. Indicates the first in the defect area The actual area corresponding to each pixel This indicates the distance from the CCD visible light imaging module to the inner surface of the tubular workpiece being photographed. This indicates the focal length of the CCD visible light imaging module. This represents the width of a single pixel in a CCD visible light imaging module sensor. It represents the height of a single pixel in a CCD visible light imaging module sensor.

[0023] As a preferred technical solution, the defect segmentation network includes 9 residual layers, 4 downsampling layers, 4 upsampling layers and 1 feature map fusion layer, wherein the input of the feature map fusion layer is the output of the residual layers and the upsampling layers, and the output of the feature map fusion layer is the defect region of the visible light image of the inner surface of the tubular workpiece.

[0024] As a preferred technical solution, the defect segmentation network includes 9 residual layers, 4 downsampling layers, 4 upsampling layers and 1 feature map fusion layer, wherein the input of the feature map fusion layer is the output of the residual layers and the upsampling layers, and the output of the feature map fusion layer is the defect region of the visible light image of the inner surface of the tubular workpiece.

[0025] The downsampling layer consists of a double convolutional layer and a max pooling layer, wherein the double convolutional layer includes 3×3 convolutional units, batch normalization units, group normalization units, and the PReLu activation function.

[0026] As a preferred technical solution, the defect classification network includes a self-calibrating convolutional unit for extracting defect feature information of different sizes from the visible light image of the inner surface of the tubular workpiece. Specific steps include:

[0027] Original defect feature map of the inner surface of the tubular workpiece Based on the original defect feature map Number of channels It is split into two defect feature maps, namely the first defect feature map. Second defect feature map All sizes , Indicates the height of the defect feature map. Indicates the width of the defect feature map;

[0028] For the first defect feature map Perform defect feature self-calibration to obtain defect output feature map. It can be expressed by the following formula:

[0029] ;

[0030] In the formula This indicates a downsampling operation. This represents a 3×3 convolution operation. Indicates an upsampling operation. This indicates the Sigmoid activation operation. This indicates the addition of defect feature maps. This represents the multiplication of defect feature maps;

[0031] Second defect feature map An attention mechanism is introduced during the convolution operation to obtain a defect attention feature map. It can be expressed by the following formula:

[0032] ;

[0033] In the formula This represents a 1×1 convolution operation. Indicates coordinate attention, This represents a 3×3 convolution operation. This represents the addition of defect feature maps;

[0034] Output feature map of defects and defect attention feature map The images are stitched together to obtain a self-calibrated output visible light feature map.

[0035] As a preferred technical solution, the defect area threshold is determined by defect category information, with the first defect category information corresponding to the first defect area threshold, the second defect category information corresponding to the second defect area threshold, and the third defect category information corresponding to the third defect area threshold.

[0036] As a preferred technical solution, the loss function of the defect segmentation network is expressed by the following formula:

[0037] ;

[0038] In the formula The predicted probability value represents the true category of the defect. This represents the modulation factor used to increase the weight of difficult examples. This represents the modulation factor used to reduce sample weights. Indicates the cutoff threshold. This represents the loss function of the defect segmentation network. Difficult samples refer to samples that are difficult for the network to predict and are prone to errors.

[0039] The present invention also provides a visible light detection system for defects on the inner surface of tubular workpieces, comprising:

[0040] The visible light image acquisition module emits visible light onto the inner surface of the tubular workpiece through the CCD visible light imaging module. It captures the reflected light based on the difference in visible light absorption rates between the normal area and the defect area of ​​the inner surface of the tubular workpiece, and obtains a visible light image.

[0041] The visible light image preprocessing module preprocesses the acquired visible light image to obtain a calibrated visible light image. The preprocessing includes visible light image correction, defect annotation, and data augmentation. The visible light image correction includes concave surface correction and brightness equalization correction.

[0042] The defect segmentation network construction module constructs a defect segmentation network to extract defect regions from the calibrated visible light image and calculate the area of ​​the defect regions.

[0043] The defect classification network construction module builds a defect classification network to classify the extracted defect regions and obtain defect category information.

[0044] The detection result output module, based on the comprehensive defect category information, marks workpieces with defect areas exceeding the defect area threshold as unqualified and outputs the detection results.

[0045] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0046] (1) This invention captures the reflected light from the inner surface of a tubular workpiece using a CCD visible light imaging module, and then performs concave surface correction and brightness equalization correction on the visible light image to offset the perspective distortion caused by the concavity of the inner surface of the tubular workpiece and the interference of the ambient light source, thereby obtaining a calibrated visible light image that reflects the distribution of visible light absorption rate; at the same time, by first segmenting and then classifying the defect area on the inner surface of the tubular workpiece, the accuracy of detecting defects on the inner surface of the tubular workpiece is improved.

[0047] (2) This invention extracts the defect region from the inner surface image of the tubular workpiece by constructing a defect segmentation network and accurately calculates the defect region area. The defect category information output by the defect classification network is used to mark the workpiece with the defect region area greater than the defect area threshold as unqualified, thereby improving the effectiveness of defect detection on the inner surface of the tubular workpiece. Attached Figure Description

[0048] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0049] Figure 1 This is a schematic diagram of the overall process of a visible light detection method for defects on the inner surface of a tubular workpiece according to the present invention.

[0050] Figure 2 This is a schematic diagram of the defect segmentation network in a visible light detection method for inner surface defects of tubular workpieces according to the present invention;

[0051] Figure 3 This is a schematic diagram of a visible light detection system for inner surface defects of tubular workpieces according to the present invention. Detailed Implementation

[0052] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0053] Example 1

[0054] like Figure 1 As shown, this embodiment provides a visible light detection method for defects on the inner surface of tubular workpieces, specifically including the following steps:

[0055] S1: Acquire visible light images of the inner surface of the tubular workpiece using a CCD visible light imaging module.

[0056] Furthermore, in industrial settings, the quality of the inner surface of tubular workpieces directly affects their performance, and defect identification relies heavily on the differences in the optical response of materials to visible light. When a CCD visible light imaging module acquires visible light images, the module's built-in light source first emits uniform visible light onto the inner surface of the tubular workpiece. For normal areas of the workpiece, the lattice or molecular structure of the material is regular, the electronic transition energy levels or molecular vibration modes are fixed, the absorption rate of visible light at a specific wavelength is stable, the reflected light intensity fluctuates little, and a uniform grayscale distribution is observed. When there are crack defects on the inner surface, the visible light absorption rate decreases, the reflected light intensity increases, and this appears as bright lines in the image. If there are corrosion defects on the inner surface, the visible light absorption rate increases, the reflected light intensity decreases, and dark spots appear in the image. The CCD visible light imaging module converts the differences in reflected light intensity in different areas into electrical signals through the photoelectric effect, which are then converted into digital images via analog-to-digital conversion, ultimately yielding a visible light image containing defect features.

[0057] S2: The acquired visible light image is preprocessed to obtain a calibrated visible light image. The preprocessing includes visible light image correction, defect annotation, and data augmentation. Visible light image correction includes concave surface correction and brightness equalization correction.

[0058] Because the inner surface of the tubular workpiece has a concave arc-shaped structure, the acquired visible light image will be distorted due to perspective. It is necessary to correct the concave surface to a flat surface. Inner concave surface correction is used to correct the concave surface of the tubular workpiece's inner surface to a flat surface, setting the height of the vertical emission angle of the CCD visible light imaging module to be... The horizontal emission angle of the CCD visible light imaging module is: The radius of the cross-section of the tubular workpiece is ,curve The corresponding central angle is Formulas are constructed based on geometric relationships:

[0059] ;

[0060] ;

[0061] In the formula If the straight line is obtained after correction of the concave surface, it can be obtained from the above formula:

[0062] ;

[0063] ;

[0064] Therefore, the curve A straight line is obtained after correction. :

[0065] ;

[0066] Since fluctuations in ambient light or uneven illumination can cause localized brightness anomalies in images, brightness equalization correction is used to eliminate lighting interference such as reflections and shadows in visible light images and to unify the brightness distribution of the image. Specific steps include:

[0067] The acquired visible light RGB image of the inner surface of the tubular workpiece is converted into the HSV color space, and the luminance component reflecting the luminance characteristics of visible light is separated.

[0068] Multi-scale Gaussian smoothing of the luminance component is performed, and guided filtering is used to estimate the illumination component in the visible light signal.

[0069] Based on the distribution of the illumination components, the brightness uniformity of the visible light image is adaptively adjusted to obtain a calibrated visible light image;

[0070] Defect annotation is used to mark defect areas and defect categories on the calibration visible light image, and to clearly distinguish different defect types such as cracks, corrosion, and impurities.

[0071] Data augmentation is used to expand the calibrated visible light map by simulating the imaging effects of visible light at different angles, thereby enriching the dataset and improving the network's generalization performance. The specific implementation process is as follows:

[0072] To enhance the generalization performance of the network, when the calibrated visible light image is input into the network for training, image transformations such as horizontal flipping, vertical flipping, and random angle rotation are applied to the image with a certain probability. By simulating the visible light imaging effect under different emission angles, the visible light image dataset is expanded.

[0073] Horizontal and vertical flipping are highly symmetrical, thus preserving the complete features of the original visible light image of the inner surface of the tubular workpiece. The horizontal flipping process is represented by the following formula:

[0074] ;

[0075] In the formula Represents the pixels in the visible light image of the inner surface of the original tubular workpiece. pixel grayscale values, This indicates the height of the visible light image of the inner surface of the original tubular workpiece. Represents the pixels in the visible light image of the inner surface of a tubular workpiece after horizontal flipping. The pixel grayscale value; where the pixel grayscale value reflects the visible light reflectance at that pixel location;

[0076] The vertical flipping process is represented by the following formula:

[0077] ;

[0078] In the formula This represents the width of the visible light image of the original tubular workpiece's inner surface. Represents the pixels in the visible light image of the inner surface of a tubular workpiece after vertical flipping. The pixel grayscale value;

[0079] Random angle rotation involves randomly rotating the visible light image around its center point at any angle within the range of 0-360°. This random angle rotation preserves all feature information of the visible light image of the inner surface of the tubular workpiece and enables the acquisition of visible light image data at various angles.

[0080] S3: Construct a defect segmentation network to extract defect regions from the calibrated visible light image and calculate the area of ​​the defect regions;

[0081] like Figure 2 As shown, the defect segmentation network includes 9 residual layers, 4 downsampling layers, 4 upsampling layers and 1 feature map fusion layer. The input of the feature map fusion layer is the output of the residual layers and the upsampling layers, and the output of the feature map fusion layer is the defect region of the visible light image of the inner surface of the tubular workpiece.

[0082] The residual layer includes two batch normalization units, two PReLu activation functions, and two 3×3 convolutional units to mitigate the gradient vanishing problem caused by the increase in the depth of the defect segmentation network;

[0083] The downsampling layer consists of a double convolutional layer and a max pooling layer. The double convolutional layer includes two 3×3 convolutional units, a batch normalization unit, a group normalization unit, and a PReLu activation function. The combination of batch normalization units and group normalization units accelerates the convergence speed of the defect segmentation network, while stabilizing the global brightness distribution of different visible light samples and optimizing the brightness consistency of local regions.

[0084] The upsampling layer performs upsampling on the feature map through transposed convolution. The size change of the visible light feature map after transposed convolution is expressed by the following formula:

[0085] ;

[0086] In the formula This represents the side length of the input feature map. This indicates the side length of the output feature map. This indicates the padding length of the input feature map. Indicates the kernel size. Indicates the sliding step size. This indicates the fill length of the output feature map, which can adapt to the perspective distortion of visible light imaging under different pipe diameters, ensuring that the spatial position of the defect after upsampling is consistent with the original visible light image.

[0087] The feature map fusion layer fuses the outputs of the residual layer and the upsampling layer, outputting the defect region of the visible light image of the inner surface of the tubular workpiece. Specific steps include:

[0088] Let the outputs of the four upsampling layers be the upsampling output features from bottom to top. Figure 1 Upsampling output features Figure 2 Upsampling output features Figure 3 And upsampling output feature map 4;

[0089] The residual layer output feature map is up-dimensionalized using a 1×1 convolution operation;

[0090] The upsampled residual layer output feature map is concatenated with the upsampled output feature map 4, and the channel ratio of the concatenation is 1:1.

[0091] The loss function of the defect segmentation network is expressed by the following formula:

[0092] ;

[0093] In the formula The predicted probability value represents the true category of the defect. This represents the modulation factor used to increase the weight of difficult examples. This represents the modulation factor used to reduce sample weights. Indicates the cutoff threshold. The loss function of the defect segmentation network is represented by the loss function of the network. Difficult samples refer to samples that are difficult for the network to predict and are prone to errors. In this embodiment, defects with irregular shapes, low distinction from the background, or small proportions in visible light images are considered difficult samples. The defect classification network has difficulty predicting their defect categories. By increasing the weight of difficult samples through relevant modulation factors, the defect classification network can pay more attention to these types of samples during training.

[0094] The calculation process for the defect area is expressed by the following formula:

[0095] ;

[0096] In the formula This represents the actual area of ​​the defective region. Indicates the first in the defect area The actual area corresponding to each pixel This indicates the distance from the CCD visible light imaging module to the inner surface of the tubular workpiece being photographed. This indicates the focal length of the CCD visible light imaging module. This represents the width of a single pixel in a CCD visible light imaging module sensor. It represents the height of a single pixel in a CCD visible light imaging module sensor.

[0097] S4: Construct a defect classification network to classify the extracted defect regions and obtain defect category information;

[0098] The defect classification network consists of dense blocks and transition layers, wherein the dense blocks include batch normalization units, self-calibrating convolutional units and ReLU activation functions, and the transition layers include 1×1 convolutional units and 2×2 average pooling layers.

[0099] The self-calibrating convolutional unit is used to extract defect feature information of different sizes from the visible light image of the inner surface of a tubular workpiece. Combined with an attention mechanism, it can automatically identify the brightness difference region between the defect and the background in the visible light image, enhance the visible light feature response of the defect region through weight allocation, and suppress brightness interference from irrelevant background. Specific steps include:

[0100] Original defect feature map of the inner surface of the tubular workpiece Based on the original defect feature map Number of channels It is split into two defect feature maps, namely the first defect feature map. Second defect feature map All sizes , Indicates the height of the defect feature map. Indicates the width of the defect feature map;

[0101] For the first defect feature map Perform defect feature self-calibration to obtain defect output feature map. It can be expressed by the following formula:

[0102] ;

[0103] In the formula This indicates a downsampling operation. This represents a 3×3 convolution operation. Indicates an upsampling operation. This indicates the Sigmoid activation operation. This indicates the addition of defect feature maps. This represents the multiplication of defect feature maps;

[0104] Second defect feature map An attention mechanism is introduced during the convolution operation to obtain a defect attention feature map. It can be expressed by the following formula:

[0105] ;

[0106] In the formula This represents a 1×1 convolution operation. Indicates coordinate attention, This represents a 3×3 convolution operation. This represents the addition of defect feature maps;

[0107] Output feature map of defects and defect attention feature map The data are stitched together to obtain a self-calibrated output feature map. The defect classification network achieves accurate classification based on the differences in the material optical characteristics of the defects. For example, crack defects are represented by high-brightness continuous features in the feature map because the material absorption rate is lower than that of normal areas. Corrosion defects are represented by low-brightness blocky features because the absorption rate is higher than that of normal areas. Impurity defects are represented by irregular spot features because of the difference in absorption rate between impurities and matrix materials. The self-calibrated convolutional unit can capture these subtle feature differences and strengthen the feature of the defect area by combining the attention mechanism, and finally output accurate defect category information.

[0108] S5: Based on the comprehensive defect category information, mark the workpieces with defect areas larger than the defect area threshold as unqualified and output the inspection results;

[0109] The defect area threshold is determined by the defect category information. The first defect category information corresponds to the first defect area threshold, the second defect category information corresponds to the second defect area threshold, and the third defect category information corresponds to the third defect area threshold. In this embodiment, the difference in area thresholds corresponding to different defect categories is determined by the actual degree of harm that each type of defect poses to the performance, safety, or functionality of the workpiece. After the defect segmentation network extracts the defect region and calculates the area, the defect classification network determines the category to which the defect belongs. The system automatically calls the area threshold corresponding to that category for comparison. If the defect area exceeds the corresponding threshold, the workpiece is marked as unqualified, thus avoiding misjudgment caused by using a single threshold.

[0110] Example 2

[0111] like Figure 3 As shown, this embodiment provides a visible light inspection system 20 for defects on the inner surface of tubular workpieces, comprising:

[0112] The visible light image acquisition module 21 emits visible light onto the inner surface of the tubular workpiece through the CCD visible light imaging module, and captures the reflected light based on the difference in the absorption rate of visible light between the normal area and the defect area of ​​the inner surface of the tubular workpiece to obtain a visible light image.

[0113] The visible light image preprocessing module 22 preprocesses the acquired visible light image. The preprocessing includes visible light image correction, defect annotation, and data augmentation. The visible light image correction includes concave surface correction and brightness equalization correction to obtain a calibrated visible light image.

[0114] Defect segmentation network construction module 23 constructs a defect segmentation network to extract defect regions from the obtained calibrated visible light image and calculate the defect region area;

[0115] Defect classification network construction module 24 constructs a defect classification network to classify the extracted defect regions and obtain defect category information;

[0116] The detection result output module 25, based on the comprehensive defect category information, marks workpieces with defect areas larger than the defect area threshold as unqualified and outputs the detection results.

[0117] The parameters and steps for implementing the corresponding functions of each unit module in the visible light detection system for inner surface defects of tubular workpieces described above can be referred to the parameters and steps in the embodiments of the visible light detection method for inner surface defects of tubular workpieces described above, and will not be repeated here.

[0118] Those skilled in the art will know that this invention can be implemented as a system, method, or computer program product.

[0119] Therefore, this disclosure can be implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the invention can also be implemented as a computer program product in one or more computer-readable media containing computer-readable program code.

[0120] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0121] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A visible light detection method for defects on the inner surface of tubular workpieces, characterized in that, Includes the following steps: Visible light is emitted onto the inner surface of a tubular workpiece using a CCD visible light imaging module. The reflected light is captured based on the difference in visible light absorption rates between the normal and defective areas of the inner surface of the tubular workpiece, thus obtaining a visible light image. The visible light image is sequentially subjected to concave surface correction and brightness equalization correction to counteract the perspective distortion caused by the concavity of the inner surface of the tubular workpiece and the interference of ambient light source, so as to obtain a calibrated visible light image that reflects the distribution of visible light absorption rate. Preprocessing is then performed, including defect annotation and data augmentation. A defect segmentation network is constructed. Based on the uneven brightness distribution caused by different visible light absorption rates, defect regions are extracted from the calibrated visible light image and the defect area is calculated. A defect classification network is constructed to classify the defect regions based on their brightness and shape, thereby obtaining defect category information. Based on the comprehensive defect category information, workpieces with defect areas larger than the defect area threshold are marked as unqualified, and the detection results are output.

2. The visible light detection method for inner surface defects of tubular workpieces according to claim 1, characterized in that, The concave surface correction is used to correct the concave surface of the inner surface of the tubular workpiece to a flat surface. The correction process is expressed by the following formula: ; In the formula This represents the corrected straight line. This represents the radius of the cross-section of the tubular workpiece. This indicates the height of the vertical emission angle of the CCD visible light imaging module. This refers to the horizontal emission angle of the CCD visible light imaging module.

3. The visible light detection method for inner surface defects of tubular workpieces according to claim 1, characterized in that, The brightness equalization correction is used to uniformize the brightness of a visible light image, and the specific steps include: The acquired visible light RGB image of the inner surface of the tubular workpiece is converted into the HSV color space, and the luminance component reflecting the luminance characteristics of visible light is separated. Multi-scale Gaussian smoothing of the luminance component is performed, and guided filtering is used to estimate the illumination component in the visible light signal. Based on the distribution of the illumination components, the brightness uniformity of the visible light image is adaptively adjusted to obtain a calibrated visible light image.

4. The visible light detection method for inner surface defects of tubular workpieces according to claim 1, characterized in that, The data augmentation is used to enhance visible light images, and the specific steps include: An image transformation is performed on a visible light image of the inner surface of a tubular workpiece, the image transformation including at least one of horizontal flipping, vertical flipping, and random angle rotation.

5. The visible light detection method for inner surface defects of tubular workpieces according to claim 1, characterized in that, The calculation process for the area of ​​the defect region is expressed by the following formula: ; In the formula This represents the actual area of ​​the defective region. Indicates the first in the defect area The actual area corresponding to each pixel This indicates the distance from the CCD visible light imaging module to the inner surface of the tubular workpiece being photographed. This indicates the focal length of the CCD visible light imaging module. This represents the width of a single pixel in a CCD visible light imaging module sensor. It represents the height of a single pixel in a CCD visible light imaging module sensor.

6. The visible light detection method for inner surface defects of tubular workpieces according to claim 1, characterized in that, The defect segmentation network includes 9 residual layers, 4 downsampling layers, 4 upsampling layers and 1 feature map fusion layer. The input of the feature map fusion layer is the output of the residual layers and the upsampling layers, and the output of the feature map fusion layer is the defect region of the visible light image of the inner surface of the tubular workpiece. The downsampling layer consists of a double convolutional layer and a max pooling layer, wherein the double convolutional layer includes 3×3 convolutional units, batch normalization units, group normalization units, and the PReLu activation function.

7. The visible light detection method for inner surface defects of tubular workpieces according to claim 1, characterized in that, The defect classification network includes self-calibrating convolutional units for extracting defect feature information of different sizes from visible light images of the inner surface of tubular workpieces. Specific steps include: Original defect feature map of the inner surface of the tubular workpiece Based on the original defect feature map Number of channels It is split into two defect feature maps, namely the first defect feature map. Second defect feature map All sizes , Indicates the height of the defect feature map. Indicates the width of the defect feature map; For the first defect feature map Perform defect feature self-calibration to obtain defect output feature map. It can be expressed by the following formula: ; In the formula This indicates a downsampling operation. This represents a 3×3 convolution operation. Indicates an upsampling operation. This indicates the Sigmoid activation operation. This indicates the addition of defect feature maps. This represents the multiplication of defect feature maps; Second defect feature map An attention mechanism is introduced during the convolution operation to obtain a defect attention feature map. It can be expressed by the following formula: ; In the formula This represents a 1×1 convolution operation. Indicates coordinate attention, This represents a 3×3 convolution operation. This represents the addition of defect feature maps; Output feature map of defects and defect attention feature map The images are stitched together to obtain a self-calibrated output visible light feature map.

8. The visible light detection method for inner surface defects of tubular workpieces according to claim 1, characterized in that, The defect area threshold is determined by defect category information. The first defect category information corresponds to the first defect area threshold, the second defect category information corresponds to the second defect area threshold, and the third defect category information corresponds to the third defect area threshold.

9. A visible light detection method for inner surface defects of tubular workpieces according to claim 6, characterized in that, The loss function of the defect segmentation network is expressed by the following formula: ; In the formula The predicted probability value represents the true category of the defect. This represents the modulation factor used to increase the weight of difficult examples. This represents the modulation factor used to reduce sample weights. Indicates the cutoff threshold. This represents the loss function of the defect segmentation network.

10. A visible light detection system for defects on the inner surface of a tubular workpiece, used to implement the visible light detection method for defects on the inner surface of a tubular workpiece according to any one of claims 1-9, characterized in that, The system includes: The visible light image acquisition module emits visible light onto the inner surface of the tubular workpiece through the CCD visible light imaging module. It captures the reflected light based on the difference in visible light absorption rates between the normal area and the defect area of ​​the inner surface of the tubular workpiece, and obtains a visible light image. The visible light image preprocessing module preprocesses the acquired visible light image to obtain a calibrated visible light image. The preprocessing includes visible light image correction, defect annotation, and data augmentation. The visible light image correction includes concave surface correction and brightness equalization correction. The defect segmentation network construction module constructs a defect segmentation network to extract defect regions from the calibrated visible light image and calculate the area of ​​the defect regions. The defect classification network construction module builds a defect classification network to classify the extracted defect regions and obtain defect category information. The detection result output module, based on the comprehensive defect category information, marks workpieces with defect areas exceeding the defect area threshold as unqualified and outputs the detection results.

Citation Information

Patent Citations

  • Electronic component surface defect detection method and device based on multi-spectral fusion

    CN117191816B

  • Deep neural network surface defect detection method based on feature fusion

    CN111627012A

  • Photovoltaic cell defect detection bionic model based on mimicry vision

    CN117115538A

  • Method and device for detecting defects on inner wall of cylinder of long barrel and storage medium

    CN117214172A

  • Cross-granularity small sample segmentation method for pipeline inner surface defect image

    CN117541792A