Method for detecting the size and defects of a metal corrugated hose
Patent Information
- Application Number
- CN202410510918.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-04-26
AI Technical Summary
然而,现有的检测方法无法在生产过程中充分考虑焊缝的缺陷以及波纹尺寸的检测问题
Smart Images

Figure CN118608450B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of testing technology, and more specifically, to a method for detecting the dimensions and defects of a metal corrugated hose. Background Technology
[0002] Corrugated hoses, as flexible pressure-resistant pipe fittings, are installed in liquid transportation systems to compensate for the relative displacement of pipe or machine / equipment connection ends, absorb vibration energy, and play a role in vibration reduction and noise reduction. They possess numerous advantages such as high flexibility, light weight, corrosion resistance, fatigue resistance, and resistance to high and low temperatures. Widely used in various industrial piping systems, they are an important component for connecting, transporting, and controlling fluid media. Improper selection of corrugated hose length and diameter, and non-standard manufacturing processes are the main problems leading to frequent hose leakage safety accidents. The production process of metal corrugated hoses involves two key steps: welding steel plates and forming the corrugations. However, existing inspection methods cannot fully consider weld defects and corrugation dimensions during the production process. Summary of the Invention
[0003] The technical problem to be solved by the present invention is how to monitor the weld defects and corrugation dimensions of corrugated hoses during the production process, so as to improve the production quality of corrugated hoses. In order to overcome the defects of the prior art, the present invention provides a method for detecting the dimensions and defects of metal corrugated hoses.
[0004] This invention provides a method for detecting the size and defects of corrugated metal hoses, applied to the weld forming station and the corrugation forming station of a corrugated metal hose production line. The weld forming station is equipped with a first image acquisition unit, and the corrugation forming station is equipped with a second image acquisition unit. The corrugated metal hose production line is equipped with a host computer, and both the first and second image acquisition units are electrically connected to the host computer. The method for detecting the size and defects includes:
[0005] Step 1: Check if the transformation coefficient λ between the world coordinate system and the pixel coordinate system of the current metal corrugated hose production line exists in the database. If it exists, proceed to step 3; otherwise, proceed to step 2.
[0006] Step 2: The second image acquisition unit acquires images of a pre-set length of corrugated metal hose in real time. The conversion coefficient λ between the world coordinate system and the pixel coordinate system of the corrugated metal hose production line is calculated by comparing the width value of the corrugated metal hose in the pixel coordinate system with the actual width value of the corrugated metal hose in the current image.
[0007] Step 3: The first image acquisition unit acquires the current weld image of the metal corrugated hose at the weld forming station, builds an improved MobileNetv2 network model, which includes a parallel residual bottleneck network and an inverse residual bottleneck network. The weld image is superimposed after being processed by the residual network and the inverse residual network, and a coordinate attention mechanism is added to obtain a weld feature map with attention weights in the width and height directions. Then, the weld feature map is superimposed with the original weld image. The improved MobileNetv2 network model is trained and optimized using the weld image dataset. The optimized and trained improved MobileNetv2 network model is used to perform real-time defect detection on the weld image. If a defect is detected in the metal corrugated hose, the host computer issues an early warning. If no defect is detected in the metal corrugated hose, the next weld image is processed.
[0008] Step 4: The second image real-time acquisition unit acquires the corrugated image of the metal corrugated hose at the corrugated imaging station. After preprocessing the current corrugated image, the edge part in the current corrugated image is extracted. The peak point and valley point of the edge part are extracted, and the outer diameter data, wave distance data and valley distance data of the metal corrugated hose are calculated by combining the conversion coefficient obtained in step 2.
[0009] Step 5: Sequentially determine whether the outer diameter data, wave pitch data, and valley distance data of the metal bellows exceed the corresponding preset outer diameter threshold, preset wave pitch threshold, and preset valley distance threshold, respectively. If yes, the host computer issues an early warning; otherwise, return to step 4 to process the next bellows image.
[0010] Compared with existing technologies, this application has the following advantages: It employs an improved MobileNetV2 network model that combines a residual bottleneck network and an inverse residual linear bottleneck network in parallel, with the addition of a coordinate attention mechanism, to perform defect detection on weld images. The parallel operation of the residual bottleneck network and the inverse residual linear bottleneck network allows for consideration of both the weld contour and internal information in the weld image. The addition of the coordinate attention mechanism further enhances the MobileNetV2 network model's focus on important information at different locations in the image, improving its spatial feature perception capabilities and thus improving its performance in image processing tasks. Simultaneously, it calculates the transformation coefficient λ between the world coordinate system and the pixel coordinate system of the corrugated hose production line using the width value of the corrugated hose acquired by the second image acquisition unit in the pixel coordinate system and the true width value of the corrugated hose. Machine vision methods are then used to locate and extract the peak and valley points of the corrugated hose, enabling quality monitoring and improving the production quality of the corrugated hose. Furthermore, this invention deploys defect detection and dimensional quality inspection on the corrugated hose production line, achieving quality management in the production of corrugated hoses.
[0011] In one possible implementation, the actual data information of the metal corrugated hose in step 2 includes:
[0012] The formula for calculating the transformation coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line is as follows:
[0013]
[0014] In the formula, T a X represents the actual width value of the corrugated metal hose. a This represents the width of the corrugated hose in the pixel coordinate system of the current image of the corrugated hose, and λ represents the transformation coefficient.
[0015] Compared with existing technologies, the above technical solution can establish a correspondence between the pixel values of the weld image and the actual size of the corrugated metal hose, and achieve accurate measurement of the size of the corrugated metal hose in the weld image. This method is simple, accurate and efficient.
[0016] In one possible implementation, the specific process of training and optimizing the MobileNetv2 network model using the weld seam image dataset in step 3 includes:
[0017] Step 3.1: Collect and construct a weld defect image dataset; the weld defect image dataset contains weld images with weld grids, weld images with porosity, weld images with slag inclusions, weld images with cracks, and weld images with faults.
[0018] Step 3.2: Enhance the images in the weld defect image dataset, including random rotation, translation, and horizontal flipping operations;
[0019] Step 3.3: Divide the weld defect image dataset into a training set, a test set, and a validation set;
[0020] Step 3.4: Input the training set into the improved MobileNetv2 network model for model training. During the training process, the cross-entropy loss function and the Adam optimizer are used for model training.
[0021] Step 3.5: Evaluate the trained improved MobileNetv2 network model using the test set, and save the improved MobileNetv2 network model for real-time defect detection of weld seam images.
[0022] Compared with existing technologies, optimizing the training of the improved MobileNetv2 network model can improve the accuracy of the improved MobileNetv2 network model in detecting weld defects.
[0023] In one possible implementation, the preprocessing of the current ripple image in step 4 specifically includes:
[0024] Step 4.1a: Perform Gaussian filtering and median filtering on the current ripple image in sequence;
[0025] Step 4.1b: Perform opening and closing operations on the filtered ripple image;
[0026] Step 4.1c: Perform binarization on the ripple image after opening and closing operations to obtain a black and white binarized ripple image;
[0027] Step 4, which involves extracting the edge portion of the current ripple image and extracting the peak and valley points of the edge portion, specifically includes:
[0028] Step 4.2a: Calculate the variance of the edge contours of the binarized ripple image; the specific calculation formula is as follows:
[0029]
[0030]
[0031] In the formula, x i This represents the coordinate values of a pixel in a binary ripple image. V represents the average value of the edge coordinates of the binarized wavy image, V represents the variance value of the edge of the binarized wavy image, and V0 is the variance threshold.
[0032] Step 4.2b: Determine if the variance is less than the preset threshold V0:
[0033]
[0034] If yes, then Y = 1, the metal corrugated hose in the current corrugated image does not have a bare rod phenomenon, proceed to 4.2c; if no, then Y = 0, the metal corrugated hose in the current corrugated image has a bare rod phenomenon, return to step 4.
[0035] 4.2c. Traverse the left and right boundary contours of the binary ripple image to obtain the peak points F. right F left Valley value point G right G left .
[0036] Compared with existing technologies, the above technical solution can accurately obtain the peak points F of the edge contours of the left and right boundaries of the binarized ripple image. right F left Valley value point G right G left .
[0037] In one possible implementation, step 4.2c involves iterating through the peak points F of the edge contours of the left and right boundaries of the binarized ripple image. right F left Valley value point G right G left Specifically, it includes:
[0038] 4.2c1. Traverse the pixels of the left boundary contour of the binary ripple image. If the x-axis coordinate of the current pixel (x, m) is greater than the x-axis coordinates of the adjacent pixels m-1, m-2...mk and greater than the x-axis coordinates of the adjacent pixels m+1, m+2...m+k, then save the coordinates of the current pixel m to array F. left If m = m + k, proceed to 4.2c2; otherwise, m = m + 1, and proceed to 4.2c2.
[0039] 4.2c2. Determine if m is greater than the length of the image. If yes, proceed to 4.2c3; otherwise, return to 4.2c1.
[0040] 4.2c3. Traverse the pixels of the left boundary contour of the binary ripple image. If the x-axis coordinate of the current pixel m is less than the x-axis coordinates of the adjacent pixels m-1, m-2...mk and less than the x-axis coordinates of the adjacent pixels m+1, m+2...m+k, then save the x-axis coordinate of the current pixel m to array G. left If m = m + k, proceed to 4.2c4; otherwise, m = m + 1, and proceed to 4.2c4.
[0041] 4.2c4. Determine if m is greater than the length of the image. If yes, proceed to 4.2c5; otherwise, return to 4.2c3.
[0042] 4.2c5. Perform steps 4.2c1 to 4.2c4 on the right boundary, and save the peak point in F. right Valley points are stored in G right .
[0043] In one possible implementation, step 4, which involves calculating the outer diameter, wave pitch, and valley distance of the metal bellows using the conversion coefficient λ obtained in step 2, specifically includes using the wave pitch data of the left edge as the wave pitch data of the bellows:
[0044] Let F left =[(a x1 ,a y1 ), (a x2 ,a y2 )…(a xn ,a yn )], F right =[b x1 ,b y1), (n x2 ,b y2 )…(b xn ,b yn )],
[0045] G left =[(c x1 ,c y1 ), (c x2 ,c y2 )…(c xn ,c yn )], G right =[(d x1 ,d y1 ), (d x2 ,d y2 )…(d xn ,d yn )]
[0046] The formula for calculating the outer diameter is:
[0047]
[0048] TW i =λ*W i
[0049] The formula for calculating the wave distance data is as follows:
[0050]
[0051] TB i =λ*B i
[0052] The formula for calculating valley diameter data is:
[0053]
[0054] TN i =λ*N i
[0055] In the formula, a xi ,a yi These represent the coordinates of the peak point on the left edge, b xi ,b yi c represents the coordinates of the peak point on the right edge. xi ,c yi The coordinates d of the valley point on the left edge xi ,d yi The coordinates of the valley point on the right edge are represented; TN represents the actual valley diameter data, TB represents the actual wave distance data, and TW represents the actual outer diameter data. Attached Figure Description
[0056] Figure 1 This is a flowchart of the method of the present invention;
[0057] Figure 2 This is a schematic diagram of the structure of the parallel and structured attention mechanism of the residual bottleneck network and the inverse residual linear bottleneck network in the improved MobileNetV2 of this invention. Detailed Implementation
[0058] First, those skilled in the art should understand that these embodiments are merely used to explain the technical principles of the embodiments of this application and are not intended to limit the scope of protection of the embodiments of this application. Those skilled in the art can make adjustments as needed to adapt to specific application scenarios.
[0059] In the description of the embodiments of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application based on the specific circumstances.
[0060] In the embodiments of this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0061] The present application will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0062] like Figure 1 The method for detecting the size and defects of a metal corrugated hose is shown and applied to the weld forming station and the corrugation forming station of a metal corrugated hose production line. The weld forming station is equipped with a first image acquisition unit, and the corrugation forming station is equipped with a second image acquisition unit. The metal corrugated hose production line is equipped with a host computer, and both the first and second image acquisition units are electrically connected to the host computer. When the metal corrugated hose production line starts, the first and second image acquisition units are activated and acquire weld and corrugation images at the weld forming station and the corrugation forming station according to a preset acquisition frequency. The size and defect detection method includes:
[0063] Step 1: Check if the transformation coefficient λ between the world coordinate system and the pixel coordinate system of the current metal corrugated hose production line exists in the database. If it exists, proceed to step 3; otherwise, proceed to step 2.
[0064] Step 2: The second image acquisition unit acquires images of a pre-set length of corrugated metal hose in real time. The transformation coefficient λ between the world coordinate system and the pixel coordinate system of the corrugated metal hose production line is calculated by comparing the width value of the corrugated metal hose in the current image (in the pixel coordinate system) with the actual width value of the hose. The calculation formula is as follows:
[0065]
[0066] In the formula, T a X represents the actual width value of the corrugated metal hose. a This represents the width of the corrugated hose in the pixel coordinate system in the current image of the corrugated hose, and λ represents the transformation coefficient. By establishing the correspondence between the pixel values of the weld image and the actual size of the corrugated hose, the size of the corrugated hose in the weld image can be accurately measured. This method is simple, accurate and efficient.
[0067] Step 3: The first image acquisition unit acquires the current weld image of the metal corrugated hose at the weld forming station, builds an improved MobileNetv2 network model, which includes a parallel residual bottleneck network and an inverse residual bottleneck network. The weld image is superimposed after being processed by the residual network and the inverse residual network, and a coordinate attention mechanism is added to obtain a weld feature map with attention weights in the width and height directions. Then, the weld feature map is superimposed with the original weld image. The improved MobileNetv2 network model is trained and optimized using the weld image dataset. The optimized and trained improved MobileNetv2 network model is used to perform real-time defect detection on the weld image. If a defect is detected in the metal corrugated hose, the host computer issues an early warning. If no defect is detected in the metal corrugated hose, the next weld image is processed.
[0068] Specifically, the content regarding the parallel processing of residual bottleneck networks and inverse residual bottleneck networks includes:
[0069] Operation of weld seam images in the bottleneck of residual network: After reducing the number of channels by 1X1 convolution, ReLU activation function is applied, followed by 3X3 convolution and ReLU activation function is applied again, and finally the number of channels is restored by 1X1 convolution and ReLU activation function is applied.
[0070] Operation of weld seam images in inverse residual bottleneck network: 1X1 convolution increases the number of channels and then ReLU activation function is applied, followed by 3X3 convolution and ReLU activation function is applied, and finally 1X1 convolution reduces the number of channels.
[0071] After adding the output of the residual bottleneck network to the output of the inverse residual linear bottleneck network, a coordinate attention mechanism is added to obtain a weld feature map with attention weights in the width and height directions; the coordinate attention mechanism is existing technology and will not be elaborated on here.
[0072] The weld feature map with attention weights in the width and height directions is added to the original input weld image and then output.
[0073] Next, the improved MobileNetv2 network model performs a two-dimensional convolution operation on the obtained feature map, followed by a global average pooling operation. The pooled feature map is then input into a fully connected layer for feature fusion and classification. Finally, the probability distribution of each category is obtained through the softmax function, and the category with the highest probability is selected as the final detection result.
[0074] This specific embodiment outlines the detailed process for training, optimizing, and improving the MobileNetv2 network model using a weld seam image dataset:
[0075] Step 3.1: Collect and construct a weld defect image dataset; the weld defect image dataset contains weld images with weld grids, weld images with porosity, weld images with slag inclusions, weld images with cracks, and weld images with faults.
[0076] Step 3.2: Enhance the images in the weld defect image dataset, including random rotation, translation, and horizontal flipping operations;
[0077] Step 3.3: Divide the weld defect image dataset into a training set, a test set, and a validation set;
[0078] Step 3.4: Input the training set into the improved MobileNetv2 network model for model training. During training, the cross-entropy loss function and Adam optimizer are used. Specific training content includes using the image annotation tool LabelImg to label the category and location bounding boxes of corrugated pipes and weld defects, generating XML format label files; then, writing the width and height data of the corrugated hose and weld defects into two separate txt files, with each line storing information for one target; sequentially traversing the txt files storing the width and height information of the fault target label boxes, statistically analyzing the distribution of label box sizes, using the capping method to remove outliers, and finally modifying the size of the generated anchor boxes based on the size of the label boxes; based on the insulator image features, setting confidence loss and regression loss to evaluate and analyze the predicted box classification and regression effects until the model converges. The evaluation dataset is the collected weld defect test dataset.
[0079] Step 3.5: Evaluate the trained improved MobileNetv2 network model using the test set, and save the improved MobileNetv2 network model for real-time defect detection of weld images;
[0080] Step 4: The second real-time image acquisition unit acquires the corrugated image of the metal corrugated hose at the corrugated imaging station. After preprocessing the current corrugated image, the edge portion of the current corrugated image is extracted, and the peak and valley points of the edge portion are extracted. Combined with the conversion coefficient obtained in Step 2, the outer diameter data, wave pitch data, and valley distance data of the metal corrugated hose are calculated. Specifically, the preprocessing of the current corrugated image includes:
[0081] Step 4.1a: Perform Gaussian filtering and median filtering on the current ripple image in sequence;
[0082] Step 4.1b: Perform opening and closing operations on the filtered ripple image;
[0083] Step 4.1c: Perform binarization on the ripple image after opening and closing operations to obtain a black and white binarized ripple image;
[0084] Step 4, which involves extracting the edge portion of the current ripple image and extracting the peak and valley points of the edge portion, specifically includes:
[0085] Step 4.2a: Calculate the variance of the edge contour of the binarized corrugated image. Since the metal corrugated hose may have a smooth rod phenomenon during the production and cutting process, the corrugated image of the smooth rod is not measured. This specific implementation determines the presence of a smooth rod phenomenon by calculating the variance of the edge contour of the binarized corrugated image. Variance actually reflects the degree of data dispersion. For changes in image edges, if the edge changes are small, the values of the edge pixels fluctuate within a certain range, resulting in a small calculated variance; however, if there are corrugations or irregular edges, the values of the edge pixels will fluctuate significantly, resulting in a larger variance. Since the left and right edges of the corrugated pipe are relatively symmetrical, only the variance of one side is considered. The specific calculation formula is expressed as follows:
[0086]
[0087]
[0088] In the formula, x i This represents the coordinate values of a pixel in a binary ripple image. V represents the average value of the edge coordinates of the binarized wavy image, V represents the variance value of the edge of the binarized wavy image, and V0 is the variance threshold.
[0089] Step 4.2b: Determine if the variance is less than the preset threshold V0:
[0090]
[0091] If yes, then Y = 1, the metal corrugated hose in the current corrugated image does not have a bare rod phenomenon, proceed to 4.2c; if no, then Y = 0, the metal corrugated hose in the current corrugated image has a bare rod phenomenon, return to step 4.
[0092] 4.2c. Traverse the left and right boundary contours of the binary ripple image to obtain the peak points F. right F left Valley value point G right G left Specific traversal methods include:
[0093] 4.2c1. Traverse the pixels of the left boundary contour of the binary ripple image. If the x-axis coordinate of the current pixel (x, m) is greater than the x-axis coordinates of the adjacent pixels m-1, m-2...mk and greater than the x-axis coordinates of the adjacent pixels m+1, m+2...m+k, then save the coordinates of the current pixel m to array F. left If m = m + k, proceed to 4.2c2; otherwise, m = m + 1, and proceed to 4.2c2.
[0094] 4.2c2. Determine if m is greater than the length of the image. If yes, proceed to 4.2c3; otherwise, return to 4.2c1.
[0095] 4.2c3. Traverse the pixels of the left boundary contour of the binary ripple image. If the x-axis coordinate of the current pixel m is less than the x-axis coordinates of the adjacent pixels m-1, m-2...mk and less than the x-axis coordinates of the adjacent pixels m+1, m+2...m+k, then save the x-axis coordinate of the current pixel m to array G. left If m = m + k, proceed to 4.2c4; otherwise, m = m + 1, and proceed to 4.2c4.
[0096] 4.2c4. Determine if m is greater than the length of the image. If yes, proceed to 4.2c5; otherwise, return to 4.2c3.
[0097] 4.2c5. Perform steps 4.2c1 to 4.2c4 on the right boundary, and save the peak point in F. right Valley points are stored in G right ;
[0098] Step 5: Sequentially determine whether the outer diameter, wave pitch, and valley distance data of the metal bellows exceed the corresponding preset outer diameter threshold, preset wave pitch threshold, and preset valley distance threshold, respectively. If yes, the host computer issues a warning; otherwise, return to step 4 to process the next bellows image. The calculation of the outer diameter, wave pitch, and valley distance data of the metal bellows uses the wave pitch data of the left edge as the wave pitch data of the bellows. Specifically, this includes:
[0099] Let F left =[(a x1 ,a y1 ), (a x2 ,a y2 )…(a xn ,a yn )], F right =[b x1 ,b y1 (b) x2 ,b y2 )…(b xn ,b yn )],
[0100] G left =[(c x1 ,c y1 ), (c x2 ,c y2 )…(c xn ,c yn )], G right =[(d x1 ,d y1 ), (dx2 ,d y2 )…(d xn ,d yn )]
[0101] The formula for calculating the outer diameter is:
[0102]
[0103] TW i =λ*W i
[0104] The formula for calculating the wave distance data is as follows:
[0105]
[0106] TB i =λ*B i
[0107] The formula for calculating valley diameter data is:
[0108]
[0109] TN i =λ*N i
[0110] In the formula, a xi ,a yi These represent the coordinates of the peak point on the left edge, b xi ,b yi c represents the coordinates of the peak point on the right edge. xi ,c yi The coordinates d of the valley point on the left edge xi ,d yi The coordinates of the valley point on the right edge are represented; TN represents the actual valley diameter data, TB represents the actual wave distance data, and TW represents the actual outer diameter data.
[0111] Furthermore, in this specific embodiment, the first image acquisition unit and the second image acquisition unit specifically use industrial cameras to acquire images, thereby improving the accuracy of the images.
[0112] In the description of the embodiments of this application, it should be noted that the terms "inner" and "outer" and other terms indicating direction or positional relationship are based on the direction or positional relationship shown in the drawings. This is only for the convenience of description and does not indicate or imply that the device or component must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this application.
[0113] In the description of this application, the references to terms such as "an embodiment," "some embodiments," "in this embodiment," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0114] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting the dimensions and defects of a metal corrugated hose, applied at the weld forming station and the corrugation forming station of a metal corrugated hose production line, characterized in that... The weld forming station is equipped with a first image acquisition unit, and the corrugated forming station is equipped with a second image acquisition unit. The metal corrugated hose production line is equipped with a host computer. Both the first and second image acquisition units are electrically connected to the host computer. The size and defect detection method includes: Step 1: Check if the transformation coefficient λ between the world coordinate system and the pixel coordinate system of the current metal corrugated hose production line exists in the database. If it exists, proceed to step 3; otherwise, proceed to step 2. Step 2: The second image acquisition unit acquires images of a pre-set length of corrugated metal hose in real time. The conversion coefficient λ between the world coordinate system and the pixel coordinate system of the corrugated metal hose production line is calculated by comparing the width value of the corrugated metal hose in the pixel coordinate system with the actual width value of the corrugated metal hose in the current image. Step 3: The first image acquisition unit acquires the current weld image of the metal corrugated hose at the weld forming station, and builds an improved MobileNetv2 network model. The improved MobileNetv2 network model includes a parallel residual bottleneck network and an inverse residual bottleneck network. The weld image is superimposed after being processed by the residual network and the inverse residual network, and a coordinate attention mechanism is added to obtain a weld feature map with attention weights in the width and height directions. Then, the weld feature map is superimposed with the original weld image. The improved MobileNetv2 network model is trained and optimized using the weld image dataset. The optimized and trained improved MobileNetv2 network model is used to perform real-time defect detection on the weld image. If a defect is detected in the metal corrugated hose, the host computer issues an early warning. If no defect is detected in the metal corrugated hose, the next weld image is processed. Step 4: The second image real-time acquisition unit acquires the corrugated image of the metal corrugated hose at the corrugated imaging station. After preprocessing the current corrugated image, the edge part in the current corrugated image is extracted. The peak point and valley point of the edge part are extracted, and the outer diameter data, wave pitch data and valley distance data of the metal corrugated hose are calculated by combining the conversion coefficient obtained in step 2. Step 5: Sequentially determine whether the outer diameter data, wave pitch data, and valley distance data of the metal bellows exceed the corresponding preset outer diameter threshold, preset wave pitch threshold, and preset valley distance threshold, respectively. If yes, the host computer issues an early warning; otherwise, return to step 4 to process the next bellows image.
2. The method for detecting the dimensions and defects of a metal corrugated hose according to claim 1, characterized in that, The actual data information of the metal corrugated hose in step 2 includes: The formula for calculating the transformation coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line is as follows: In the formula, T a X represents the actual width value of the corrugated metal hose. a This represents the width of the corrugated hose in the pixel coordinate system of the current image of the corrugated hose, and λ represents the transformation coefficient.
3. The method for detecting the dimensions and defects of a metal corrugated hose according to claim 1, characterized in that, The specific process of training, optimizing, and improving the MobileNetv2 network model using the weld seam image dataset in step 3 includes: Step 3.1: Collect and construct a weld defect image dataset; the weld defect image dataset contains weld images with weld grids, weld images with porosity, weld images with slag inclusions, weld images with cracks, and weld images with faults. Step 3.2: Enhance the images in the weld defect image dataset, including random rotation, translation, and horizontal flipping operations; Step 3.3: Divide the weld defect image dataset into a training set, a test set, and a validation set; Step 3.4: Input the training set into the improved MobileNetv2 network model for model training. During the training process, the cross-entropy loss function and the Adam optimizer are used for model training. Step 3.5: Evaluate the trained improved MobileNetv2 network model using the test set, and save the improved MobileNetv2 network model for real-time defect detection of weld images.
4. The method for detecting the dimensions and defects of a metal corrugated hose according to claim 1, characterized in that, Step 4, the preprocessing of the current ripple image, specifically includes: Step 4.1a: Perform Gaussian filtering and median filtering on the current ripple image in sequence; Step 4.1b: Perform opening and closing operations on the filtered ripple image; Step 4.1c: Perform binarization on the ripple image after opening and closing operations to obtain a black and white binarized ripple image; Step 4, which involves extracting the edge portion of the current ripple image and extracting the peak and valley points of the edge portion, specifically includes: Step 4.2a: Calculate the variance of the edge contours of the binarized ripple image; the specific calculation formula is as follows: In the formula, x i This represents the coordinate values of a pixel in a binary ripple image. V represents the average value of the edge coordinates of the binarized wavy image, V represents the variance value of the edge of the binarized wavy image, and V0 is the variance threshold. Step 4.2b: Determine if the variance is less than the preset threshold V0: If so, then Y = 1, and the metal corrugated hose in the current corrugated image does not exhibit a smooth rod phenomenon. Proceed to 4.2c. If not, then Y = 0, the metal corrugated hose in the current corrugated image has a bare rod phenomenon, return to step 4; 4.2c. Traverse the left and right boundary contours of the binary ripple image to obtain the peak points F. right F left Valley value point G right G left .
5. The method for detecting the dimensions and defects of a metal corrugated hose according to claim 4, characterized in that, In step 4.2c, the peak points F of the edge contours of the left and right boundaries of the binarized ripple image are obtained by traversing the data. right F left Valley value point G right G left Specifically, it includes: 4.2c1. Traverse the pixels of the left boundary contour of the binary ripple image. If the x-axis coordinate of the current pixel (x, m) is greater than the x-axis coordinates of the adjacent pixels m-1, m-2...mk and greater than the x-axis coordinates of the adjacent pixels m+1, m+2...m+k, then save the coordinates of the current pixel m to array F. left If m = m + k, proceed to 4.2c2; otherwise, m = m + 1, and proceed to 4.2c2. 4.2c2. Determine if m is greater than the length of the image. If yes, proceed to 4.2c3; otherwise, return to 4.2c1. 4.2c3. Traverse the pixels of the left boundary contour of the binary ripple image. If the x-axis coordinate of the current pixel m is less than the x-axis coordinates of the adjacent pixels m-1, m-2...mk and less than the x-axis coordinates of the adjacent pixels m+1, m+2...m+k, then save the x-axis coordinate of the current pixel m to array G. left If m = m + k, proceed to 4.2c4; otherwise, m = m + 1, and proceed to 4.2c4. 4.2c4. Determine if m is greater than the length of the image. If yes, proceed to 4.2c5; otherwise, return to 4.2c3. 4.2c5. Perform steps 4.2c1 to 4.2c4 on the right boundary, and save the peak point in F. right Valley points are stored in G right .
6. The method for detecting the dimensions and defects of a metal corrugated hose according to claim 4, characterized in that, In step 4, the outer diameter and wave pitch of the metal bellows are calculated using the conversion coefficient λ obtained in step 2. Based on the valley distance data values, the wavelength data of the left edge is used as the wavelength data of the bellows, specifically including: Let F left = [(a x1 , a y1 ), (a x2 , a y2 )…(a xn , a yn )], F right = [(b x1 , b y1 ), (b x2 , b y2 )…(b xn , b yn )], G left =[(c x1 ,c y1 )、(c x2 ,c y2 )…(c xn ,c yn )],G right =[(d x1 ,d y1 )、(d x2 ,d y2 )…(d xn ,d yn )] The formula for calculating the outer diameter is: The formula for calculating the wave distance data is as follows: The formula for calculating valley diameter data is: The formula for calculating the outer diameter is: TW i =λ*W i The formula for calculating the wave distance data is as follows: TB i =λ*B i The formula for calculating valley diameter data is: TN i =λ*N i In the formula, a xi ,a yi These represent the coordinates of the peak point on the left edge, b xi ,b yi c represents the coordinates of the peak point on the right edge. xi ,c yi The coordinates d of the valley point on the left edge xi ,d yi The coordinates of the valley point on the right edge are represented; TN represents the actual valley diameter data, TB represents the actual wave distance data, and TW represents the actual outer diameter data.
Citation Information
Patent Citations
Bathroom ceramic defect detection method based on two-stage MobileNet
CN113850791A
Steel surface defect detection lightweight algorithm integrating classification and detection
CN117576441A