Method for detecting size and defect of metal corrugated hose
Through the improved MobileNetv2 network model and image acquisition technology, the problem of weld defect and corrugation size detection in the production of metal corrugated hoses is solved, accurate detection of welds and corrugations is achieved, and production quality and safety are improved.
Patent Information
- Application Number
- CN202410510918.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-04-26
AI Technical Summary
Existing detection methods cannot fully consider weld defects and corrugation size issues during the production process of metal corrugated hoses, resulting in low production quality and increased safety risks.
The improved MobileNetv2 network model is used, combined with the residual bottleneck network and the inverse residual bottleneck network, and a coordinate attention mechanism is added for real-time defect detection of weld images, and the ripple image is obtained through the image acquisition unit to extract edge feature points. Calculate the outer diameter, wave pitch and valley distance data of corrugations to realize quality monitoring of metal corrugated hoses.
It achieves accurate detection of weld defects and corrugation size, improves the production quality of metal corrugated hoses, and ensures product safety and consistency.
Smart Images

Figure CN118608450A
Abstract
Description
Technical Field
[0001] The invention relates to the field of detection technology, and in particular to a method for detecting the size and defects of a metal corrugated hose. Background Art
[0002] As a flexible pressure-resistant pipe fitting, the corrugated hose is installed in the liquid transportation system to compensate for the mutual displacement of the connection ends of the pipeline or machine and equipment, absorb vibration energy, and play a role in vibration reduction and noise reduction. It has many characteristics such as good flexibility, light weight, corrosion resistance, fatigue resistance, high and low temperature resistance, etc. It is widely used in various industrial pipeline systems and is an important component for connecting, conveying and controlling fluid media. Improper selection of the length and diameter of the corrugated hose and non-standard manufacturing process are the main problems leading to frequent hose leakage safety accidents. There are two key steps in the production process of metal corrugated hoses: one is the welding of steel plates, and the other is the forming of corrugations. However, the existing detection methods cannot fully consider the defects of welds and the detection of corrugation size 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 size of the corrugated hose during the production process of the corrugated hose and improve the production quality of the corrugated hose. In order to overcome the defects of the above-mentioned prior art, the present invention provides a size and defect detection method for a metal corrugated hose.
[0004] The present invention provides a size and defect detection method for a metal corrugated hose, which is applied to a weld forming station and a corrugation forming station of a metal corrugated hose production line. The weld forming station is provided with a first image acquisition unit, the corrugation forming station is provided with a second image acquisition unit, and the metal corrugated hose production line is provided with a host computer. The first image acquisition unit and the second image acquisition unit are both electrically connected to the host computer. The size and defect detection method comprises:
[0005] Step 1, read whether there is a conversion coefficient λ between the world coordinate system and the pixel coordinate system of the current metal corrugated hose production line in the database, if it exists, go to step 3, if not, go to step 2;
[0006] Step 2, the second image acquisition unit acquires a metal corrugated hose image of a preset length in real time, and calculates the conversion coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line through the width value of the metal corrugated hose in the pixel coordinate system in the current metal corrugated hose image and the true width value of the metal corrugated hose;
[0007] Step 3, the first image acquisition unit acquires the current weld image of the metal corrugated hose on the weld forming station, and builds an improved MobileNetv2 network model, wherein the improved MobileNetv2 network model includes a parallel residual bottleneck network and an inverse residual bottleneck network, and 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 direction and the height direction, and then the weld feature map is superimposed with the original weld image, and the improved MobileNetv2 network model is optimized through training of the weld image data set, and the improved MobileNetv2 network model after optimization training is used to perform real-time defect detection on the weld image, and if a defect is detected in the metal bellows, the host computer issues an early warning, and if the metal bellows is detected to have no defect, the next weld image is processed;
[0008] Step 4, the second real-time image acquisition unit acquires the corrugation image of the metal corrugated hose on the corrugation imaging station, extracts the edge portion of the current corrugation image after preprocessing the current corrugation image, extracts the peak points and valley points of the edge portion, and calculates the outer diameter data, wave distance data and valley distance data value of the metal corrugated hose in combination with the conversion coefficient obtained in step 2;
[0009] Step 5: determine in turn whether the outer diameter data, wave pitch data and valley distance data values of the metal bellows exceed the corresponding preset outer diameter threshold, preset wave pitch threshold and preset valley distance threshold respectively. If so, the host computer issues an early warning. If not, return to step 4 to enter the next corrugated image processing.
[0010] Compared with the prior art, the present application has the following advantages: a residual bottleneck network and an inverse residual linear bottleneck network are used in parallel, and an improved MobileNetV2 network model with a coordinate attention mechanism is added to realize defect detection of weld images, and the network model with the residual bottleneck network and the inverse residual linear bottleneck network in parallel can take into account the contour and internal information of the weld in the weld image, and the addition of the coordinate attention mechanism can improve the MobileNetV2 network model to pay more attention to important information at different positions in the image, and enhance the perception ability of the improved MobileNetV2 network model to spatial features, thereby improving the performance of the model in image processing tasks; at the same time, the width value of the metal corrugated hose in the pixel coordinate system collected by the second image acquisition unit and the true width value of the metal corrugated hose are used to calculate the conversion coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line, and a machine vision method is used to locate the extraction of the peak points and valley points of the metal corrugated hose, so as to realize quality monitoring of the metal corrugated hose and improve the production quality of the metal corrugated hose; in addition, the present invention deploys defect detection and size quality detection on the metal corrugated hose production line to realize quality management of metal corrugated hose production.
[0011] In a possible implementation manner, the actual data information of the metal corrugated hose in step 2 includes:
[0012] The calculation formula of the conversion coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line is:
[0013]
[0014] Where, T a Indicates the actual width of the metal corrugated hose, X a It represents the width of the metal corrugated hose in the pixel coordinate system in the current metal corrugated hose image, and λ is represented as the conversion coefficient.
[0015] Compared with the prior art, the above technical solution can establish a corresponding relationship between the pixel value of the weld image and the actual size of the metal corrugated hose, thereby realizing accurate measurement of the size of the metal corrugated hose in the weld image. This method is simple, accurate and efficient.
[0016] In a possible implementation manner, the specific process of optimizing and improving the MobileNetv2 network model through training of the weld image dataset in step 3 includes:
[0017] Step 3.1, collecting and constructing a weld defect image data set; the weld defect image data set contains weld images with qualified welds, weld images with pores, weld images with slag inclusions, weld images with cracks, and weld images with faults;
[0018] Step 3.2, enhancing the image of the weld defect image dataset, including random rotation, translation, and horizontal flipping operations;
[0019] Step 3.3, the weld defect image dataset is divided 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 Adam optimizer are used for model training.
[0021] Step 3.5: Use the test set to evaluate the trained improved MobileNetv2 network model, and save the improved MobileNetv2 network model for real-time defect detection of weld images.
[0022] Compared with the existing technology, optimizing and training the improved MobileNetv2 network model can improve the accuracy of the improved MobileNetv2 network model in weld defect detection.
[0023] In a possible implementation manner, 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, performing opening and closing operations on the filtered ripple image;
[0026] Step 4.1c, performing a binary conversion on the ripple image after the opening and closing operation to obtain a black and white binary ripple image;
[0027] In step 4, the extraction of the edge portion in the current ripple image and the extraction of the peak points and the valley points of the edge portion specifically include:
[0028] Step 4.2a, calculate the variance of the edge contour of the binary ripple image; the specific calculation formula is expressed as:
[0029]
[0030]
[0031] In the formula, x i Represents the coordinate value of the pixel point in the binary ripple image, is the average value of the edge coordinates of the binary ripple image, V represents the variance value of the edge of the binary ripple image, and V0 is the variance threshold;
[0032] Step 4.2b: Determine whether 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, and the process goes to step 4.2c; if no, then Y=0, the metal corrugated hose in the current corrugated image does have a bare rod phenomenon, and the process goes back to step 4;
[0035] 4.2c. Traverse to obtain the peak point F of the edge contour of the left and right boundaries of the binary ripple image right 、F left and valley point G right , G left .
[0036] Compared with the prior art, the above technical solution can accurately obtain the peak points F of the edge contours of the left and right boundaries of the binary ripple image. right 、F left and valley point G right , G left .
[0037] In a possible implementation, the peak points F of the edge contours of the left and right boundaries of the binary ripple image are obtained by traversing in step 4.2c. right 、F left and valley point G right , G left Specifically include:
[0038] 4.2c1. Traverse the pixel points of the left edge contour of the binary ripple image. If the x-axis coordinate value of the current pixel point (x, m) m is greater than the x-axis coordinate value of the adjacent pixel points m-1, m-2…mk and greater than the x-axis coordinate value of the adjacent pixel points m+1, m+2…m+k, then save the coordinate value of the current pixel point m to the array F. left , m=m+k, go to 4.2c2, if not, m=m+1, and go to 4.2c2;
[0039] 4.2c2. Determine whether m is greater than the length of the image. If so, proceed to 4.2c3. If not, return to 4.2c1.
[0040] 4.2c3. Traverse the pixel points of the left edge contour of the binary ripple image. If the x-axis coordinate value of the current pixel point m is smaller than the x-axis coordinates of the adjacent pixel points m-1, m-2…mk and smaller than the x-axis coordinates of the adjacent pixel points m+1, m+2…m+k, then save the x-axis coordinate of the current pixel point m to the array G. left , m=m+k, go to 4.2c4, if not, m=m+1, and go to 4.2c4;
[0041] 4.2c4. Determine whether m is greater than the length of the image. If so, proceed to 4.2c5. If not, return to 4.2c3.
[0042] 4.2c5. Perform steps 4.2c1 to 4.2c4 for the right boundary and save the peak point in F right , the valley points are stored in G right .
[0043] In a possible implementation manner, in step 4, the outer diameter data, wave pitch data, and valley pitch data values of the metal bellows are calculated based on the conversion coefficient λ obtained in step 2, and using the wave pitch data of the left edge as the wave pitch data of the bellows specifically includes:
[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 calculation formula for the outer diameter data is:
[0047]
[0048] TW i =λ*W i
[0049] The calculation formula for the wave distance data is:
[0050]
[0051] TB i =λ*B i
[0052] The calculation formula for valley diameter data is:
[0053]
[0054] TN i =λ*N i
[0055] In the formula, a xi ,a yi Respectively represent the coordinates of the peak point on the left edge, b xi ,b yi Respectively represent the coordinates of the peak point on the right edge, c xi ,c yi Coordinates d of the valley point on the left edge xi ,d yi Represents the coordinates of the valley point on the right edge; TN represents the actual valley diameter data, TB represents the actual wave distance data, and TW represents the actual outer diameter data. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a flow chart of the method of the present invention;
[0057] Figure 2 This is a schematic diagram of the structure of the improved residual bottleneck network and the inverse residual linear bottleneck network in MobileNetV2 in parallel and the structural attention mechanism. DETAILED DESCRIPTION
[0058] First, those skilled in the art should understand that these implementations are only used to explain the technical principles of the embodiments of the present application, and are not intended to limit the protection scope of the embodiments of the present application. Those skilled in the art can make adjustments to them as needed to adapt to specific application scenarios.
[0059] In the description of the embodiments of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.
[0060] In the embodiments of the present application, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0061] The present application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0062] like Figure 1 A size and defect detection method for a metal corrugated hose is shown, which is applied to a weld forming station and a corrugation forming station of a metal corrugated hose production line. The weld forming station is provided with a first image acquisition unit, and the corrugation forming station is provided with a second image acquisition unit. The metal corrugated hose production line is provided with a host computer, and the first image acquisition unit and the second image acquisition unit are both electrically connected to the host computer. When the metal corrugated hose production line is started, the first image acquisition unit and the second image acquisition unit are started, and weld images and corrugation images on the weld forming station and the corrugation forming station are collected at a preset collection frequency. The size and defect detection method includes:
[0063] Step 1, read whether there is a conversion coefficient λ between the world coordinate system and the pixel coordinate system of the current metal corrugated hose production line in the database, if it exists, go to step 3, if not, go to step 2;
[0064] Step 2, the second image acquisition unit acquires a metal corrugated hose image of a preset length in real time, and calculates the conversion coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line through the width value of the metal corrugated hose in the pixel coordinate system in the current metal corrugated hose image and the true width value of the metal corrugated hose; the calculation formula is:
[0065]
[0066] Where, T a Indicates the actual width of the metal corrugated hose, X a represents the width value of the metal corrugated hose in the pixel coordinate system in the current metal corrugated hose image, and λ represents the conversion coefficient; by establishing the corresponding relationship between the pixel value of the weld image and the real size of the metal corrugated hose, the accurate measurement of the size of the metal corrugated hose in the weld image is achieved. 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 on the weld forming station, and builds an improved MobileNetv2 network model, wherein the improved MobileNetv2 network model includes a parallel residual bottleneck network and an inverse residual bottleneck network, and 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 direction and the height direction, and then the weld feature map is superimposed with the original weld image, and the improved MobileNetv2 network model is optimized through training of the weld image data set, and the improved MobileNetv2 network model after optimization training is used to perform real-time defect detection on the weld image, and if a defect is detected in the metal bellows, the host computer issues an early warning, and if the metal bellows is detected to have no defect, the next weld image is processed;
[0068] The details of parallel processing of residual bottleneck network and inverse residual bottleneck network include:
[0069] The operation of the weld image in the residual network bottleneck: 1X1 convolution reduces the number of channels and then applies the ReLU activation function, followed by 3X3 convolution and the ReLU activation function again, and finally restores the number of channels through 1X1 convolution and applies the ReLU activation function;
[0070] The operation of the weld image in the inverse residual bottleneck network: 1X1 convolution increases the number of channels and then applies the ReLU activation function, followed by 3X3 convolution and ReLU activation function, and finally 1X1 convolution reduces the number of channels;
[0071] After adding the output of the residual bottleneck network and 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 direction and the height direction; the coordinate attention mechanism is a prior art and will not be described in detail here;
[0072] The weld feature map with attention weights in 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, and then performs a global average pooling operation. The pooled feature map is input into the 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 largest probability is selected as the final detection result.
[0074] The specific process of this specific embodiment for optimizing and improving the MobileNetv2 network model through training of weld image datasets includes:
[0075] Step 3.1, collecting and constructing a weld defect image data set; the weld defect image data set contains weld images with qualified welds, weld images with pores, weld images with slag inclusions, weld images with cracks, and weld images with faults;
[0076] Step 3.2, enhancing the image of the weld defect image dataset, including random rotation, translation, and horizontal flipping operations;
[0077] Step 3.3, the weld defect image dataset is divided 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, and use the cross entropy loss function and Adam optimizer for model training during the training process; the specific training content includes using the image annotation tool LabelImg to mark the category and position boundary box of the corrugated pipe and weld defect targets, and generate a labeling file in xml format; then write the width and height data of the metal corrugated hose and weld defect targets into two txt files respectively, and each line stores the information of one target; traverse the txt files storing the width and height information of the fault target marking box in turn, count the distribution of the marking box size, use the cap method to remove outliers, and finally modify the size of the generated anchor box according to the size of the marking box; according to the insulator image features, set confidence loss and regression loss to evaluate and analyze the classification and regression effects of the prediction box until the model converges, wherein the evaluation data set is the collected weld defect test data set;
[0079] Step 3.5, use the test set to evaluate the trained improved MobileNetv2 network model, 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 on the corrugated imaging station, and after preprocessing the current corrugated image, extracts the edge part of the current corrugated image, extracts the peak point and the valley point of the edge part, and calculates the outer diameter data, wave distance data and valley distance data value of the metal corrugated hose in combination with the conversion coefficient obtained in step 2; wherein: preprocessing the current corrugated image specifically includes:
[0081] Step 4.1a, perform Gaussian filtering and median filtering on the current ripple image in sequence;
[0082] Step 4.1b, performing opening and closing operations on the filtered ripple image;
[0083] Step 4.1c, performing a binary conversion on the ripple image after the opening and closing operation to obtain a black and white binary ripple image;
[0084] In step 4, the extraction of the edge portion in the current ripple image and the extraction of the peak points and the valley points of the edge portion specifically include:
[0085] Step 4.2a, calculate the variance of the edge contour of the binary corrugated image. Since the metal corrugated hose may have a bare rod phenomenon during the production and cutting process, the corrugated image of the bare rod is not measured and processed. This specific implementation method determines whether there is a bare rod phenomenon by calculating the variance of the edge contour of the binary corrugated image. The variance actually reflects the discrete degree of the data. For the change of the edge of the image, if the edge change is very small, the value of the edge pixel fluctuates within a certain range, resulting in a smaller calculated variance; if there are corrugated or irregular edges, the value of the edge pixel will fluctuate greatly, resulting in a larger variance; since the left and right edges of the corrugated tube are relatively symmetrical, only the edge on one side is considered for the variance operation; the specific calculation formula is expressed as:
[0086]
[0087]
[0088] In the formula, x i Represents the coordinate value of the pixel point in the binary ripple image, is the average value of the edge coordinates of the binary ripple image, V represents the variance value of the edge of the binary ripple image, and V0 is the variance threshold;
[0089] Step 4.2b: Determine whether 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, and the process goes to step 4.2c; if no, then Y=0, the metal corrugated hose in the current corrugated image does have a bare rod phenomenon, and the process goes back to step 4;
[0092] 4.2c. Traverse to obtain the peak point F of the edge contour of the left and right boundaries of the binary ripple image right 、F left and valley point G right , G left ; Specific traversal methods include:
[0093] 4.2c1. Traverse the pixel points of the left edge contour of the binary ripple image. If the x-axis coordinate value of the current pixel point (x, m) m is greater than the x-axis coordinate value of the adjacent pixel points m-1, m-2…mk and greater than the x-axis coordinate value of the adjacent pixel points m+1, m+2…m+k, then save the coordinate value of the current pixel point m to the array F. left , m=m+k, go to 4.2c2, if not, m=m+1, and go to 4.2c2;
[0094] 4.2c2. Determine whether m is greater than the length of the image. If so, proceed to 4.2c3. If not, return to 4.2c1.
[0095] 4.2c3. Traverse the pixel points of the left edge contour of the binary ripple image. If the x-axis coordinate value of the current pixel point m is smaller than the x-axis coordinates of the adjacent pixel points m-1, m-2…mk and smaller than the x-axis coordinates of the adjacent pixel points m+1, m+2…m+k, then save the x-axis coordinate of the current pixel point m to the array G. left , m=m+k, go to 4.2c4, if not, m=m+1, and go to 4.2c4;
[0096] 4.2c4. Determine whether m is greater than the length of the image. If so, proceed to 4.2c5. If not, return to 4.2c3.
[0097] 4.2c5. Perform steps 4.2c1 to 4.2c4 for the right boundary and save the peak point in F right , the valley points are stored in G right ;
[0098] Step 5: determine in turn whether the outer diameter data, wave pitch data and valley distance data values of the metal bellows exceed the corresponding preset outer diameter threshold, preset wave pitch threshold and preset valley distance threshold respectively. If so, the host computer issues an early warning. If not, return to step 4 to enter the next corrugated image processing; the calculation of the outer diameter data, wave pitch data and valley distance data values of the metal bellows uses the wave pitch data of the left edge as the wave pitch data of the bellows; specifically including:
[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 calculation formula for the outer diameter data is:
[0102]
[0103] TW i =λ*W i
[0104] The calculation formula for the wave distance data is:
[0105]
[0106] TB i =λ*B i
[0107] The calculation formula for valley diameter data is:
[0108]
[0109] TN i =λ*N i
[0110] In the formula, a xi ,a yi Respectively represent the coordinates of the peak point on the left edge, b xi ,b yi Respectively represent the coordinates of the peak point on the right edge, c xi ,c yi Coordinates d of the valley point on the left edge xi ,d yi Represents the coordinates of the valley point on the right edge; TN represents the actual valley diameter data, TB represents the actual wave distance data, and TW represents the actual outer diameter data.
[0111] In addition, the first image acquisition unit and the second image acquisition unit in this specific embodiment specifically use industrial cameras to acquire images to improve the accuracy of the images.
[0112] In the description of the embodiments of the present application, it should be noted that in the description of the present application, terms such as "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships 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, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present application.
[0113] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "in the present embodiment", "specific example", or "some examples" etc. means that the specific features, mechanisms, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, mechanisms, materials or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0114] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for detecting the size and defects of a metal corrugated hose, which is applied to the weld forming station and the corrugation forming station of a metal corrugated hose production line, characterized in that: The weld forming station is provided with a first image acquisition unit, the corrugation forming station is provided with a second image acquisition unit, the metal corrugated hose production line is provided with a host computer, the first image acquisition unit and the second image acquisition unit are both electrically connected to the host computer, and the size and defect detection method includes: Step 1, read whether there is a conversion coefficient λ between the world coordinate system and the pixel coordinate system of the current metal corrugated hose production line in the database, if it exists, go to step 3, if not, go to step 2; Step 2, the second image acquisition unit acquires a metal corrugated hose image of a preset length in real time, and calculates the conversion coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line through the width value of the metal corrugated hose in the pixel coordinate system in the current metal corrugated hose image and the true width value of the metal corrugated hose; Step 3, the first image acquisition unit acquires the current weld image of the metal corrugated hose on the weld forming station, and builds an improved MobileNetv2 network model, wherein the improved MobileNetv2 network model includes a parallel residual bottleneck network and an inverse residual bottleneck network, and 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 direction and the height direction, and then the weld feature map is superimposed with the original weld image; the improved MobileNetv2 network model is optimized through training of the weld image data set, and the improved MobileNetv2 network model after optimization training is used to perform real-time defect detection on the weld image, and if a defect is detected in the metal bellows, the host computer issues an early warning, and if the metal bellows is detected to have no defect, the next weld image is processed; Step 4, the second real-time image acquisition unit acquires the corrugation image of the metal corrugated hose on the corrugation imaging station, extracts the edge portion of the current corrugation image after preprocessing the current corrugation image, extracts the peak points and valley points of the edge portion, and calculates the outer diameter data, wave distance data and valley distance data value of the metal corrugated hose in combination with the conversion coefficient obtained in step 2; Step 5: determine in turn whether the outer diameter data, wave pitch data and valley distance data values of the metal bellows exceed the corresponding preset outer diameter threshold, preset wave pitch threshold and preset valley distance threshold respectively. If so, the host computer issues an early warning. If not, return to step 4 to enter the next corrugated image processing.
2. The method for detecting the size 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 calculation formula of the conversion coefficient λ between the world coordinate system and the pixel coordinate system of the metal corrugated hose production line is: Where, T a Indicates the actual width of the metal corrugated hose, X a It represents the width of the metal corrugated hose in the pixel coordinate system in the current metal corrugated hose image, and λ is represented as the conversion coefficient.
3. The method for detecting the size and defects of a metal corrugated hose according to claim 1, characterized in that: The specific process of improving the MobileNetv2 network model by training and optimizing the weld image dataset in step 3 includes: Step 3.1, collecting and constructing a weld defect image data set; the weld defect image data set contains weld images with qualified welds, weld images with pores, weld images with slag inclusions, weld images with cracks, and weld images with faults; Step 3.2, enhancing the image of the weld defect image dataset, including random rotation, translation, and horizontal flipping operations; Step 3.3, the weld defect image dataset is divided 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 Adam optimizer are used for model training. Step 3.5: Use the test set to evaluate the trained improved MobileNetv2 network model, and save the improved MobileNetv2 network model for real-time defect detection of weld images.
4. The method for detecting the size and defects of a metal corrugated hose according to claim 1, characterized in that: The preprocessing of the current ripple image in step 4 specifically includes: Step 4.1a, perform Gaussian filtering and median filtering on the current ripple image in sequence; Step 4.1b, performing opening and closing operations on the filtered ripple image; Step 4.1c, performing a binary conversion on the ripple image after the opening and closing operation to obtain a black and white binary ripple image; In step 4, the extraction of the edge portion in the current ripple image and the extraction of the peak points and the valley points of the edge portion specifically include: Step 4.2a, calculate the variance of the edge contour of the binary ripple image; the specific calculation formula is expressed as: In the formula, x i Represents the coordinate value of the pixel point in the binary ripple image, is the average value of the edge coordinates of the binary ripple image, V represents the variance value of the edge of the binary ripple image, and V0 is the variance threshold; Step 4.2b: Determine whether the variance is less than the preset threshold V0: If so, Y=1, and there is no bare rod phenomenon in the metal corrugated hose in the current corrugated image, and proceed to 4.2c. If not, then Y=0, and the metal corrugated hose in the current corrugated image has a bare rod phenomenon, and return to step 4; 4.2c. Traverse to obtain the peak point F of the edge contour of the left and right boundaries of the binary ripple image right 、F left and valley point G right , G left .
5. The method for detecting the size and defects of a metal corrugated hose according to claim 4, characterized in that: The peak points F of the edge contours of the left and right boundaries of the binary ripple image are obtained by traversing in step 4.2c. right 、F left and valley point G right , G left Specifically include: 4.2c1. Traverse the pixel points of the left edge contour of the binary ripple image. If the x-axis coordinate value of the current pixel point (x, m) m is greater than the x-axis coordinate value of the adjacent pixel points m-1, m-2…mk and greater than the x-axis coordinate value of the adjacent pixel points m+1, m+2…m+k, then save the coordinate value of the current pixel point m to the array F. left , m=m+k, go to 4.2c2, if not, m=m+1, and go to 4.2c2; 4.2c2. Determine whether m is greater than the length of the image. If so, proceed to 4.2c3. If not, return to 4.2c1. 4.2c3. Traverse the pixel points of the left edge contour of the binary ripple image. If the x-axis coordinate value of the current pixel point m is smaller than the x-axis coordinates of the adjacent pixel points m-1, m-2…mk and smaller than the x-axis coordinates of the adjacent pixel points m+1, m+2…m+k, then save the x-axis coordinate of the current pixel point m to the array G. left , m=m+k, go to 4.2c4, if not, m=m+1, and go to 4.2c4; 4.2c4. Determine whether m is greater than the length of the image. If so, proceed to 4.2c5. If not, return to 4.2c3. 4.2c5. Perform steps 4.2c1 to 4.2c4 for the right boundary and save the peak point in F right , the valley points are stored in G right .
6. The method for detecting the size and defects of a metal corrugated hose according to claim 4, characterized in that: In step 4, the outer diameter data and wave pitch number of the metal bellows are calculated by combining the conversion coefficient λ obtained in step 2. According to the data value of the valley distance, the wave distance data of the left edge is used as the wave distance data of the bellows, which specifically includes: 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 )].[[]]END]] 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 calculation formula for the outer diameter data is: The calculation formula for the wave distance data is: The calculation formula for valley diameter data is: The calculation formula for the outer diameter data is: TW i =λ*W i The calculation formula for the wave distance data is: TB i =λ*B i The calculation formula for valley diameter data is: TN i =λ*N i In the formula, a xi ,a yi Respectively represent the coordinates of the peak point on the left edge, b xi ,b yi Respectively represent the coordinates of the peak point on the right edge, c xi ,c yi Coordinates d of the valley point on the left edge xi ,d yi Represents the coordinates of the valley point on the right edge; 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
Metal plate cutting processing method and system based on image segmentation
CN116630255A
PCB defect detection and identification method based on YOLO-SEE
CN117372339A
Steel surface defect detection lightweight algorithm integrating classification and detection
CN117576441A
