Method and system for defect detection of torsion leaf spring based on deep learning

Through image processing and ultrasonic signal analysis based on deep learning, the problem of local missed detection and insufficient accuracy of the torsional willow leaf spring detection method in the existing technology is solved, and efficient and accurate detection of internal defects of the willow leaf spring is achieved.

CN118294540BActive Publication Date: 2024-10-15SHENZHEN OUSHENGKE CONNECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410729944.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-10-15
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

The existing defect detection method of torsional willow leaf springs cannot completely detect all areas inside the willow leaf springs, resulting in local missed detection and reduced accuracy. In particular, the detection sensitivity of subtle defects and surface defects is insufficient.

Method used

Using a method based on deep learning, through image processing and ultrasonic signal analysis, the foreground subject image and representation in the willow leaf spring image are extracted. Combined with the preset defect representation, the defect detection model is used to perform defect location positioning and attribute analysis, and the defect phase velocity is calculated. and group velocity to improve detection accuracy.

Benefits of technology

It improves the accuracy of defect detection of torsible willow leaf springs, enhances the accuracy of defect location and identification of defect characteristics, and ensures effective detection of subtle defects and surface defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118294540B_ABST
    Figure CN118294540B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of defect detection technology, and provides a method and system for detecting defects of a torsion willow leaf spring based on deep learning, including: collecting a willow leaf spring image corresponding to the torsion willow leaf spring, extracting a foreground subject image in the willow leaf spring image, performing subject enhancement processing on the foreground subject image to obtain an enhanced subject image; extracting a subject representation corresponding to the enhanced subject image, sampling the subject representation using a representation sampling layer in a defect detection model to obtain a subject sampling representation, mapping the subject sampling representation using a defect mapping layer in the defect detection model to obtain a subject defect representation; calculating the defect phase velocity and defect group velocity corresponding to the defect position; combining the defect phase velocity and defect group velocity, analyzing the defect attribute corresponding to the defect position, and determining the willow leaf spring defect corresponding to the torsion willow leaf spring. The present invention aims to improve the accuracy of defect detection of torsion willow leaf springs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of defect detection technology, and in particular to a method and system for detecting defects in a torsionally movable leaf spring based on deep learning. Background Art

[0002] A torsional willow leaf spring is a type of spring that is commonly used in various mechanical devices and equipment. It is made of metal strips or coils, has a shape similar to a willow leaf, and can store and release energy by twisting. If there are defects in the torsional willow leaf spring, it is easy to increase the probability of malfunction or failure, which will in turn affect the use of the vehicle, such as vehicle driving stability and safety. Therefore, it is necessary to repair the defects of the torsional willow leaf spring.

[0003] The existing torsional leaf spring defect detection method adopts the X-ray detection method, which is to place the leaf spring to be tested under the X-ray detection equipment, determine the detection position, start the equipment, perform X-ray exposure, generate corresponding image images, observe and analyze the obtained images, and identify possible defects in the leaf spring, such as cracks, pores, etc. However, this detection method cannot completely detect all areas inside the leaf spring, resulting in local missed detection, and the sensitivity to the detection of minor defects or surface defects leads to reduced accuracy of the torsional leaf spring defect detection. Summary of the invention

[0004] The present invention provides a method and system for detecting defects in a torsionally movable willow leaf spring based on deep learning, the main purpose of which is to improve the accuracy of detecting defects in a torsionally movable willow leaf spring.

[0005] To achieve the above object, the present invention provides a method for detecting defects of a torsionally movable leaf spring based on deep learning, comprising:

[0006] Collecting a willow leaf spring image corresponding to a twistable willow leaf spring, extracting a foreground subject image from the willow leaf spring image, and performing subject enhancement processing on the foreground subject image to obtain an enhanced subject image;

[0007] Extracting a subject representation corresponding to the enhanced subject image, inputting the subject representation and a preset defect representation into a pre-trained defect detection model, sampling the subject representation using a representation sampling layer in the defect detection model to obtain a subject sampling representation, combining the preset defect representation, and mapping the subject sampling representation using a defect mapping layer in the defect detection model to obtain a subject defect representation;

[0008] In combination with the main defect characterization, the defect position corresponding to the torsional leaf spring is determined, ultrasonic signal data corresponding to the defect position is collected using a preset ultrasonic device, and the defect phase velocity and defect group velocity corresponding to the defect position are calculated based on the ultrasonic signal data;

[0009] The defect properties corresponding to the defect position are analyzed in combination with the defect phase velocity and the defect group velocity, and the willow leaf spring defect corresponding to the torsional willow leaf spring is determined in combination with the defect properties and the defect position.

[0010] Optionally, extracting the foreground subject image from the willow leaf spring image includes:

[0011] Detecting the pixel color value corresponding to each pixel point in the willow leaf spring image;

[0012] Calculate the pixel grayscale value corresponding to each pixel in the willow leaf spring image according to the pixel color value;

[0013] According to the pixel grayscale value, grayscale processing is performed on the willow leaf spring image to obtain a grayscale willow leaf spring image, and a binarization threshold corresponding to the grayscale willow leaf spring image is set;

[0014] Extracting a grayscale foreground subject image from the grayscale willow leaf spring image according to the binarization threshold;

[0015] The grayscale foreground subject image is subjected to pseudo color mapping processing to obtain a foreground subject image.

[0016] Optionally, performing subject enhancement processing on the foreground subject image to obtain an enhanced subject image includes:

[0017] Performing pixel equalization processing on the foreground subject image to obtain a balanced subject image;

[0018] The smoothed pixel value corresponding to each pixel in the balanced main image is calculated by the following formula:

[0019] ;

[0020] Among them, A represents the smooth pixel value corresponding to each pixel in the foreground main image, Represents a rectangular window, and E represent the number of rows and columns of all pixels in the foreground subject image, and represents the Dth to last row and the Eth to last column in the foreground subject image, Represents the pixel value of the pixel point with coordinates (a, b) in the foreground subject image,

[0021] According to the smoothed pixel values, performing image smoothing processing on the foreground subject image to obtain a smoothed subject image;

[0022] The smoothed main image is subjected to sharpening and enhancement processing to obtain an enhanced main image.

[0023] Optionally, extracting the subject representation corresponding to the enhanced subject image includes:

[0024] Extracting color information from the enhanced subject image, and quantizing the color information to obtain a color palette;

[0025] Constructing a color histogram corresponding to the enhanced subject image according to the color palette;

[0026] Calculating the color feature value of the enhanced subject image according to the color histogram;

[0027] Normalizing the color feature value to obtain a target color feature value, and constructing a color feature vector corresponding to the target color feature value;

[0028] Generating a subject color representation of the enhanced subject image according to the color feature vector, and extracting a subject texture feature of the enhanced subject image;

[0029] The subject color representation and the subject texture feature are combined to obtain the subject representation of the enhanced subject image.

[0030] Optionally, the sampling process of the main representation by using the representation sampling layer in the defect detection model to obtain the main sampling representation includes:

[0031] Performing standard processing on the subject representation using the standardization layer in the representation sampling layer to obtain a standard subject representation;

[0032] Using the pooling sampling layer in the representation sampling layer to perform representation sampling processing on the standard subject representation to obtain the target subject representation;

[0033] Calculating the representation coefficient corresponding to the target subject representation using the decision tree layer in the representation sampling layer;

[0034] According to the representation coefficients, an output layer in the representation sampling layer is used to output a corresponding subject sampling representation from the target subject representation.

[0035] Optionally, the calculating the representation coefficient corresponding to the target subject representation by using the decision tree layer in the representation sampling layer includes:

[0036] Extracting a representation label in the target subject representation using a label extractor in the decision tree layer;

[0037] Calculate the label probability corresponding to the representation label, and calculate the subject representation entropy and the representation condition entropy corresponding to the target subject representation respectively by using the entropy function in the decision tree layer in combination with the label probability;

[0038] Combining the subject representation entropy and the representation condition entropy, calculating the representation gain ratio corresponding to the target subject representation;

[0039] According to the representation gain ratio, a representation coefficient corresponding to the target subject representation is obtained.

[0040] Optionally, combining the preset defect representation and using the defect mapping layer in the defect detection model to map the main sampling representation to obtain the main defect representation includes:

[0041] Vectorizing the subject sampling representation and the preset defect representation to obtain a first representation vector and a second representation vector;

[0042] Calculating a vector mapping value between the first characterization vector and the second characterization vector using a mapping function in the defect mapping layer;

[0043] The correlation function in the defect mapping layer is used to calculate the representation correlation between the preset defect representation and the subject sampling representation:

[0044] The correlation function includes:

[0045] ;

[0046] Wherein, F represents the correlation between the preset defect representation and the main sampling representation, e and e+1 represent the serial numbers corresponding to the preset defect representation and the main sampling representation, respectively. represents the number of representations of the subject sampled representation, represents the value corresponding to the e-th representation in the subject sampling representation, represents the average value of the representation corresponding to the subject sampling representation, Indicates the value corresponding to the e+1th representation in the preset defect representation, Indicates the average value of the representation corresponding to the preset defect representation, and They represent the standard deviations of the subject sampling representation and the preset defect representation, respectively.

[0047] The representation correlation and the vector mapping value are combined to extract features associated with the preset defect representation from the main sample representation to obtain the main defect representation.

[0048] Optionally, calculating the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data includes:

[0049] Performing filtering processing on the ultrasonic signal data to obtain filtered signal data;

[0050] Analyze the signal frequency corresponding to the ultrasonic wave in the filtered signal data, and measure the sound wave propagation period and sound wave speed corresponding to the ultrasonic wave;

[0051] Combining the acoustic wave propagation period and the acoustic wave velocity, calculating the defect phase velocity corresponding to the defect position;

[0052] The defect group velocity corresponding to the defect position is calculated according to the defect phase velocity and the signal frequency.

[0053] Optionally, the combining the acoustic wave propagation period and the acoustic wave velocity to calculate the defect phase velocity corresponding to the defect position includes:

[0054] Calculate the sound wave propagation distance corresponding to the ultrasonic wave by combining the sound wave propagation period and the sound wave velocity;

[0055] Measuring the distance between the ultrasonic device and the defect position to obtain the flaw detection distance;

[0056] Determining a defect propagation distance corresponding to the defect position according to the flaw detection distance and the sound wave propagation distance;

[0057] Calculating the sound path period corresponding to the ultrasonic wave according to the flaw detection distance and the sound wave velocity;

[0058] Determine the defect propagation period corresponding to the defect position by combining the sound wave propagation period and the sound path period;

[0059] The defect phase velocity corresponding to the defect position is calculated by combining the defect propagation distance and the defect propagation period.

[0060] A system for detecting defects in a torsionally movable leaf spring based on deep learning, characterized in that the system comprises:

[0061] An image enhancement module is used to collect a willow leaf spring image corresponding to the twistable willow leaf spring, extract a foreground subject image from the willow leaf spring image, and perform subject enhancement processing on the foreground subject image to obtain an enhanced subject image;

[0062] a representation mapping module, used to extract a subject representation corresponding to the enhanced subject image, input the subject representation and a preset defect representation into a pre-trained defect detection model, sample the subject representation using a representation sampling layer in the defect detection model to obtain a subject sampled representation, and map the subject sampled representation using a defect mapping layer in the defect detection model in combination with the preset defect representation to obtain a subject defect representation;

[0063] A velocity calculation module, for determining the defect position corresponding to the torsional leaf spring in combination with the main body defect characterization, collecting ultrasonic signal data corresponding to the defect position using a preset ultrasonic device, and calculating the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data;

[0064] The defect analysis module is used to analyze the defect attribute corresponding to the defect position by combining the defect phase velocity and the defect group velocity, and determine the willow leaf spring defect corresponding to the torsional willow leaf spring by combining the defect attribute and the defect position.

[0065] The present invention can remove the image irrelevant to the willow leaf spring in the willow leaf spring image by extracting the foreground main image in the willow leaf spring image, isolate the main subject in the image, and thus improve the efficiency of subsequent image processing. The present invention can obtain the key image information in the enhanced main image by extracting the main representation corresponding to the enhanced main image, so that the subsequent defect detection model can perform relevant processing on the main representation. The present invention locates the defect position corresponding to the torsional willow leaf spring by combining the main defect representation, thereby improving the accuracy of defect position positioning, and calculates the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data, and can obtain the ultrasonic propagation velocity corresponding to the defect position and the energy propagation velocity of the ultrasonic signal, so as to facilitate the subsequent analysis of the defect attribute corresponding to the defect position. The present invention analyzes the defect attribute corresponding to the defect position by combining the defect phase velocity and the defect group velocity, and then understands the defect characteristics corresponding to the defect position, so as to improve the accuracy of the torsional willow leaf spring defect detection. Therefore, the method and system for torsional willow leaf spring defect detection based on deep learning provided by the embodiment of the present invention can improve the accuracy of torsional willow leaf spring defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 A flowchart of a method for detecting defects of a torsionally movable leaf spring based on deep learning provided by one embodiment of the present invention;

[0067] Figure 2 A functional module diagram of a system for detecting defects in torsional leaf springs based on deep learning provided in one embodiment of the present invention.

[0068] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0069] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0070] The embodiment of the present application provides a method for detecting defects in a torsion willow leaf spring based on deep learning. In the embodiment of the present application, the execution subject of the method for detecting defects in a torsion willow leaf spring based on deep learning includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided in the embodiment of the present application. In other words, the method for detecting defects in a torsion willow leaf spring based on deep learning can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0071] Reference Figure 1 FIG. 1 is a flow chart of a method for detecting defects of a torsionally movable willow leaf spring based on deep learning according to an embodiment of the present invention. In this embodiment, the method for detecting defects of a torsionally movable willow leaf spring based on deep learning includes steps S1 to S4.

[0072] S1. Collect a willow leaf spring image corresponding to a twistable willow leaf spring, extract a foreground subject image from the willow leaf spring image, and perform subject enhancement processing on the foreground subject image to obtain an enhanced subject image.

[0073] The present invention can remove images irrelevant to the willow leaf spring in the willow leaf spring image by extracting the foreground main image in the willow leaf spring image, isolate the main subject in the image, and thus improve the efficiency of subsequent image processing, wherein the foreground main image is an image in the willow leaf spring image that only contains the twistable willow leaf spring.

[0074] As an embodiment of the present invention, the method of extracting the foreground main image from the willow leaf spring image includes: detecting the pixel color value corresponding to each pixel point in the willow leaf spring image, calculating the pixel grayscale value corresponding to each pixel point in the willow leaf spring image according to the pixel color value, performing grayscale processing on the willow leaf spring image according to the pixel grayscale value to obtain a grayscale willow leaf spring image, and setting a binarization threshold corresponding to the grayscale willow leaf spring image, extracting the grayscale foreground main image from the grayscale willow leaf spring image according to the binarization threshold, and performing pseudo-color mapping processing on the grayscale foreground main image to obtain a foreground main image.

[0075] Among them, the pixel color value is the pixel value corresponding to each pixel point in the willow leaf spring image, including the RGB value of each pixel, that is, the values ​​of the three channels of red, green and blue. The grayscale willow leaf spring image is an image in the willow leaf spring image that is expressed only by grayscale values. The binarization threshold is the threshold used when converting the grayscale willow leaf spring image into a binary image.

[0076] Optionally, the pixel color value corresponding to each pixel in the willow leaf spring image can be detected by GIMP tool; the calculation method of the pixel grayscale value corresponding to each pixel in the willow leaf spring image is: the pixel values ​​of the three channels of red, green and blue in the pixel color value are weighted averaged to calculate the grayscale value of each pixel, pixel grayscale value = 0.299 * R + 0.587 * G + 0.114 * B. The setting of the binarization threshold corresponding to the grayscale willow leaf spring image can be achieved by an adaptive threshold method. By using the cv2.adaptiveThreshold() function in OpenCV, the parameters of the grayscale willow leaf spring image, such as block size, constant, etc., are extracted and input into the corresponding function to calculate the corresponding threshold, such as the cv2.adaptiveThreshold() function in OpenCV. The foreground main image can be extracted according to the comparison result between the binarization threshold and the grayscale value of the pixel in the grayscale willow leaf spring image. When the grayscale value of the pixel is greater than the binarization threshold, the pixel is set to 1, otherwise, it is set to 0. The pixels are traversed in sequence to obtain a binarized image. The binarized image is segmented and the pixels with a pixel value of 0 are removed to obtain the foreground main image of the grayscale willow leaf spring image. The pseudo-color mapping processing of the grayscale foreground main image can be achieved by a rainbow color mapping method. The grayscale value is mapped to a colorful rainbow color spectrum to obtain a corresponding colorful image.

[0077] The present invention can highlight the main target in the image by performing subject enhancement processing on the foreground subject image, making it visually clearer, more obvious and easier to identify, which is convenient for feature extraction of subsequent images, wherein the enhanced subject image is an image obtained by enhancing the subject in the foreground subject image.

[0078] As an embodiment of the present invention, the subject enhancement processing of the foreground subject image to obtain the enhanced subject image includes: performing pixel equalization processing on the foreground subject image to obtain a balanced subject image, and calculating the smoothed pixel value corresponding to each pixel point in the balanced subject image by the following formula:

[0079] ;

[0080] Among them, A represents the smooth pixel value corresponding to each pixel in the foreground main image, Represents a rectangular window, and E represent the number of rows and columns of all pixels in the foreground subject image, and represents the Dth to last row and the Eth to last column in the foreground subject image, Represents the pixel value of the pixel point with coordinates (a, b) in the foreground subject image,

[0081] According to the smoothed pixel values, the foreground subject image is subjected to image smoothing processing to obtain a smoothed subject image, and the smoothed subject image is subjected to sharpening and enhancement processing to obtain an enhanced subject image.

[0082] Among them, the balanced main image is an image in which the pixels in the foreground main image are more evenly distributed after the pixel values ​​in the foreground main image are equalized, the smoothed pixel value is the pixel value obtained by calculation for each pixel point in the balanced main image, and the sharpening enhancement processing is to enhance the details and clarity in the image. Furthermore, the pixel equalization processing of the foreground main image can be achieved by a histogram equalization method; the sharpening enhancement processing of the smoothed main image can be achieved by a high-pass filter.

[0083] S2. Extract the subject representation corresponding to the enhanced subject image, input the subject representation and the preset defect representation into a pre-trained defect detection model, use the representation sampling layer in the defect detection model to sample the subject representation and the preset defect representation respectively to obtain a subject sampling representation and a defect sampling representation, combine the defect sampling representation, and use the defect mapping layer in the defect detection model to map the subject sampling representation to obtain a subject defect representation.

[0084] The present invention can obtain key image information in the enhanced subject image by extracting the subject representation corresponding to the enhanced subject image, so as to facilitate the subsequent defect detection model to perform relevant processing on the subject representation, wherein the subject representation is key information in the enhanced subject image, such as texture features or color features.

[0085] As an embodiment of the present invention, the extracting of the subject representation corresponding to the enhanced subject image includes: extracting color information from the enhanced subject image, quantizing the color information to obtain a color palette, constructing a color histogram corresponding to the enhanced subject image based on the color palette, calculating color feature values ​​of the enhanced subject image based on the color histogram, normalizing the color feature values ​​to obtain target color feature values, constructing a color feature vector corresponding to the target color feature values, generating a subject color representation of the enhanced subject image based on the color feature vector, and extracting subject texture features of the enhanced subject image, and combining the subject color representation and the subject texture features to obtain the subject representation of the enhanced subject image.

[0086] Among them, the color information is information that expresses the color attributes of the enhanced main image, the color palette is a table or set of a finite number of color values, the color histogram is a statistical graph of the color distribution in the enhanced main image, the color feature value is a numerical value that describes the color attributes of the enhanced main image, such as the average color, color distribution range and color saturation, the target color feature value is a feature value obtained by mapping the color feature value to between 0 and 1, and the main texture feature is a texture representation in the enhanced main image.

[0087] Optionally, the color information in the enhanced subject image can be extracted through the HSV model; the quantization processing of the color information can be implemented through a color quantization algorithm, such as the K-means quantization algorithm; the construction of the color histogram corresponding to the enhanced subject image can be implemented through a mapping tool, such as the Visio mapping tool; the calculation of the color eigenvalue of the enhanced subject image can be implemented through the accumulation method, gradually accumulating the number of color occurrences in the color palette, and using the corresponding calculation formula to calculate the corresponding color frequency or color average value, and the normalization processing of the color eigenvalue can be performed through Z-Score standardization; the construction of the color feature vector corresponding to the target color eigenvalue can be implemented through the word2vec algorithm; the main texture features of the enhanced subject image can be extracted through a Gabor filter.

[0088] The present invention utilizes the representation sampling layer in the defect detection model to perform sampling processing on the subject representation, so as to selectively extract and retain the most important features in the subject representation, which helps to enhance the quality of the subject representation and enable it to more accurately express the key information of the enhanced subject image.

[0089] As an embodiment of the present invention, the subject representation is sampled and processed by the representation sampling layer in the defect detection model to obtain the subject sampling representation, including: performing standard processing on the subject representation by the standardization layer in the representation sampling layer to obtain a standard subject representation, performing representation sampling processing on the standard subject representation by the pooling sampling layer in the representation sampling layer to obtain a target subject representation, calculating the representation coefficient corresponding to the target subject representation by the decision tree layer in the representation sampling layer, and outputting the corresponding subject sampling representation from the target subject representation by the output layer in the representation sampling layer according to the representation coefficient.

[0090] Among them, the standardization layer converts the form of the subject representation into a form that can be processed by the defect detection model, and is composed of the Min-Max standardization function. The pooling sampling layer is a neural layer that performs dimensionality reduction processing on the standard subject representation, and is constructed by a pooling function, such as the maximum pooling function. The decision tree layer is an algorithm for calculating the importance corresponding to the target subject representation. The output layer is composed of an output function, such as the Softmax function.

[0091] Further, as an optional embodiment of the present invention, the use of the decision tree layer in the representation sampling layer to calculate the representation coefficient corresponding to the target subject representation includes: using the label extractor in the decision tree layer to extract the representation label in the target subject representation, calculating the label probability corresponding to the representation label, combining the label probability, using the entropy function in the decision tree layer to respectively calculate the subject representation entropy and the representation conditional entropy corresponding to the target subject representation, combining the subject representation entropy and the representation conditional entropy, calculating the representation gain ratio corresponding to the target subject representation, and obtaining the representation coefficient corresponding to the target subject representation according to the representation gain ratio.

[0092] Among them, the representation label is the representation category corresponding to the sampling subject representation, the subject representation entropy and the representation condition entropy respectively represent the degree of confusion corresponding to the sampling subject representation and the degree of contribution under a specific representation, and the representation gain ratio is an indicator measurement value used for representation selection.

[0093] Furthermore, as an optional embodiment of the present invention, the label extractor is compiled by a scripting language, such as JS language; the label probability corresponding to the representation label can be obtained by the ratio of the frequency of label occurrence to the total frequency; the entropy function is composed of an information entropy function; the calculation process of the representation gain ratio corresponding to the target subject representation is: use the subject representation entropy to subtract the corresponding representation condition entropy to obtain the representation gain value corresponding to each feature, calculate the ratio of the representation gain value to the total gain value, and obtain the representation gain ratio corresponding to each representation.

[0094] The present invention combines the preset defect representation and utilizes the defect mapping layer in the defect detection model to map the main sampling representation, thereby improving the defect recognition accuracy of the main sampling representation, wherein the preset defect representation is the existing defect feature corresponding to the torsional willow leaf spring, and the main defect representation is the feature related to the defect in the main sampling representation.

[0095] As an embodiment of the present invention, the method of combining the preset defect representation and mapping the main sampling representation using the defect mapping layer in the defect detection model to obtain the main defect representation includes: vectorizing the main sampling representation and the preset defect representation to obtain a first representation vector and a second representation vector, calculating the vector mapping value between the first representation vector and the second representation vector using the mapping function in the defect mapping layer, and calculating the representation correlation between the preset defect representation and the main sampling representation using the correlation function in the defect mapping layer:

[0096] The correlation function includes:

[0097] ;

[0098] Wherein, F represents the correlation between the preset defect representation and the main sampling representation, e and e+1 represent the serial numbers corresponding to the preset defect representation and the main sampling representation, respectively. represents the number of representations of the subject sampled representation, represents the value corresponding to the e-th representation in the subject sampling representation, represents the average value of the representation corresponding to the subject sampling representation, Indicates the value corresponding to the e+1th representation in the preset defect representation, Indicates the average value of the representation corresponding to the preset defect representation, and They represent the standard deviations of the subject sampling representation and the preset defect representation, respectively.

[0099] The representation correlation and the vector mapping value are combined to extract features associated with the preset defect representation from the main sample representation to obtain the main defect representation.

[0100] Among them, the mapping function is a function that calculates the quantitative value of the relationship between the first characterization vector and the second characterization vector, the vector mapping value represents the value obtained after mapping the first characterization vector to the space corresponding to the second characterization vector, and the vector mapping value can be used to understand the vector similarity between the first characterization vector and the second characterization vector, and the characterization correlation represents the feature correlation between the preset defect characterization and the subject sampling characterization.

[0101] Furthermore, the vectorization processing of the main sampling representation and the preset defect representation can be achieved through the word2vec algorithm; the mapping function includes a linear function and a nonlinear function; the features associated with the preset defect representation can be extracted from the main sampling representation by combining the representation correlation and the vector mapping value and the corresponding preset threshold value. When the representation correlation and the vector mapping value are respectively greater than the corresponding preset threshold values, the corresponding representation is extracted to obtain the main defect representation, wherein the preset threshold is the comparison standard value corresponding to the representation correlation and the vector mapping value, which can be set to 0.8, or can be set according to the specific application scenario.

[0102] S3. In combination with the main defect characterization, the main defect area in the enhanced main image is detected, and according to the main defect area, the defect position corresponding to the torsional leaf spring is determined, and ultrasonic signal data corresponding to the defect position is collected using a preset ultrasonic device, and according to the ultrasonic signal data, the defect phase velocity and defect group velocity corresponding to the defect position are calculated.

[0103] The present invention locates the defect position corresponding to the torsional willow leaf spring by combining the main defect characterization, thereby improving the accuracy of defect position positioning, and calculates the defect phase velocity and defect group velocity corresponding to the defect position based on the ultrasonic signal data, so as to obtain the ultrasonic propagation velocity and the energy propagation velocity of the ultrasonic signal corresponding to the defect position, which is convenient for subsequent analysis of the defect attributes corresponding to the defect position. Optionally, the step of determining the defect position corresponding to the torsional willow leaf spring is: combining the main defect characterization, detecting the main defect area in the enhanced main image, determining the defect position corresponding to the torsional willow leaf spring based on the main defect area, and mining the signal parameters from the ultrasonic signal data.

[0104] As an embodiment of the present invention, the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data are calculated, including: filtering the ultrasonic signal data to obtain filtered signal data, analyzing the signal frequency corresponding to the ultrasonic wave in the filtered signal data, measuring the sound wave propagation period and sound wave velocity corresponding to the ultrasonic wave, combining the sound wave propagation period and the sound wave velocity to calculate the defect phase velocity corresponding to the defect position, and calculating the defect group velocity corresponding to the defect position according to the defect phase velocity and the signal frequency.

[0105] Among them, the filtered signal data is high-quality signal data obtained after removing the noise interference in the ultrasonic signal data, the signal frequency is the speed of periodic change of the signal oscillation corresponding to the ultrasonic wave, the sound wave propagation period is the total time from the emission to the return of the ultrasonic wave, and the sound wave velocity is the propagation velocity corresponding to the ultrasonic wave. Optionally, the filtering processing of the ultrasonic signal data can be achieved by a digital filter; the signal frequency corresponding to the ultrasonic wave in the filtered signal data can be achieved by a frequency analysis tool, and the frequency analysis tool is compiled by JAVA language; the measurement of the sound wave propagation period and sound wave velocity corresponding to the ultrasonic wave can be achieved by an ultrasonic sensor and a sound velocity meter; the defect group velocity corresponding to the defect position can be obtained by calculating the product of the defect phase velocity and the signal frequency.

[0106] Optionally, as an optional embodiment of the present invention, the combining of the sound wave propagation period and the sound wave velocity to calculate the defect phase velocity corresponding to the defect position includes: combining the sound wave propagation period and the sound wave velocity to calculate the sound wave propagation distance corresponding to the ultrasonic wave, measuring the distance between the ultrasonic device and the defect position to obtain the flaw detection distance, determining the defect propagation distance corresponding to the defect position according to the flaw detection distance and the sound wave propagation distance, calculating the sound path period corresponding to the ultrasonic wave according to the flaw detection distance and the sound wave velocity, determining the defect propagation period corresponding to the defect position in combination with the sound wave propagation period and the sound path period, and calculating the defect phase velocity corresponding to the defect position in combination with the defect propagation distance and the defect propagation period.

[0107] Among them, the sound wave propagation distance is the one-way transmission distance of the ultrasonic wave, the flaw detection distance describes the distance between the signal emission position of the ultrasonic device and the defect position, the defect propagation distance is the distance the ultrasonic wave propagates in the defect position, the sound path period is the time before the ultrasonic wave is emitted to the defect position, and the defect propagation period is the propagation time of the ultrasonic wave in the defect position. Optionally, the sound wave propagation distance can be obtained by multiplying the sound wave propagation period by the sound wave velocity and then multiplying by 1 / 2; the defect propagation distance can be obtained by subtracting the flaw detection distance from the sound wave propagation distance; the defect propagation period can be obtained by subtracting the sound path period from half of the sound wave propagation period; the defect phase velocity corresponding to the defect position can be obtained by dividing the defect propagation distance by the defect propagation period.

[0108] S4. Analyze the defect attributes corresponding to the defect position by combining the defect phase velocity and the defect group velocity, and determine the willow leaf spring defect corresponding to the torsional willow leaf spring by combining the defect attributes and the defect position.

[0109] The present invention analyzes the defect attributes corresponding to the defect position by combining the defect phase velocity and the defect group velocity, and then understands the defect characteristics corresponding to the defect position to improve the accuracy of the torsion willow leaf spring defect detection, wherein the defect attributes are the defect characteristics corresponding to the defect position, such as the physical properties of the defect area or the structural changes of the defect area, such as cracks or holes. Optionally, the analysis of the defect attributes corresponding to the defect position can be obtained by combining the changes of the defect phase velocity and the defect group velocity or deriving a formula for analysis. For example, the elastic modulus of the defect position can be obtained by measuring the changes of these two velocities and drawing a change map of the defect phase velocity and the defect group velocity. According to the map characteristics, the specific structure of the defect position can be queried from the existing database, and finally, the defect attribute and the defect position are combined to determine the willow leaf spring defect corresponding to the torsion willow leaf spring.

[0110] The present invention can remove the image irrelevant to the willow leaf spring in the willow leaf spring image by extracting the foreground main image in the willow leaf spring image, isolate the main subject in the image, and thus improve the efficiency of subsequent image processing. The present invention can obtain the key image information in the enhanced main image by extracting the main representation corresponding to the enhanced main image, so that the subsequent defect detection model can perform relevant processing on the main representation. The present invention locates the defect position corresponding to the torsional willow leaf spring by combining the main defect representation, thereby improving the accuracy of defect position positioning, and calculates the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data, and can obtain the ultrasonic propagation velocity corresponding to the defect position and the energy propagation velocity of the ultrasonic signal, so as to facilitate the subsequent analysis of the defect attribute corresponding to the defect position. The present invention analyzes the defect attribute corresponding to the defect position by combining the defect phase velocity and the defect group velocity, and then understands the defect characteristics corresponding to the defect position, so as to improve the accuracy of the torsional willow leaf spring defect detection. Therefore, the method for torsional willow leaf spring defect detection based on deep learning provided in the embodiment of the present invention can improve the accuracy of torsional willow leaf spring defect detection.

[0111] like Figure 2 As shown, it is a functional module diagram of a system for detecting defects of torsional leaf springs based on deep learning provided by one embodiment of the present invention.

[0112] The system 100 for detecting defects of a torsion leaf spring based on deep learning according to the present invention can be installed in an electronic device. According to the functions implemented, the system 100 for detecting defects of a torsion leaf spring based on deep learning can include an image enhancement module 101, a characterization mapping module 102, a speed calculation module 103 and a defect analysis module 104. The module according to the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, which are stored in the memory of the electronic device.

[0113] In this embodiment, the functions of each module / unit are as follows:

[0114] The image enhancement module 101 is used to collect a willow leaf spring image corresponding to a twistable willow leaf spring, extract a foreground subject image from the willow leaf spring image, and perform subject enhancement processing on the foreground subject image to obtain an enhanced subject image;

[0115] The representation mapping module 102 is used to extract the subject representation corresponding to the enhanced subject image, input the subject representation and the preset defect representation into a pre-trained defect detection model, sample the subject representation using the representation sampling layer in the defect detection model to obtain a subject sampled representation, and map the subject sampled representation using the defect mapping layer in the defect detection model in combination with the preset defect representation to obtain a subject defect representation;

[0116] The velocity calculation module 103 is used to determine the defect position corresponding to the torsional leaf spring in combination with the main body defect characterization, collect ultrasonic signal data corresponding to the defect position using a preset ultrasonic device, and calculate the defect phase velocity and defect group velocity corresponding to the defect position based on the ultrasonic signal data;

[0117] The defect analysis module 104 is used to analyze the defect attribute corresponding to the defect position by combining the defect phase velocity and the defect group velocity, and determine the willow leaf spring defect corresponding to the torsional willow leaf spring by combining the defect attribute and the defect position.

[0118] In detail, each module described in the system 100 for detecting defects of a torsionally twisted leaf spring based on deep learning described in the embodiment of the present application is used in the same manner as described above. Figure 1 The same technical means as the method for detecting defects of torsional leaf springs based on deep learning described in the text can produce the same technical effects, which will not be repeated here.

[0119] In the several embodiments provided by the present invention, it should be understood that the provided methods and systems can be implemented in other ways. For example, the method embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for detecting defects in torsion springs based on deep learning. It is characterized in that The method comprises: Collecting a willow leaf spring image corresponding to a twistable willow leaf spring, extracting a foreground subject image from the willow leaf spring image, and performing subject enhancement processing on the foreground subject image to obtain an enhanced subject image; Extracting a subject representation corresponding to the enhanced subject image, inputting the subject representation and a preset defect representation into a pre-trained defect detection model, sampling the subject representation using a representation sampling layer in the defect detection model to obtain a subject sampling representation, combining the preset defect representation, and mapping the subject sampling representation using a defect mapping layer in the defect detection model to obtain a subject defect representation, wherein combining the preset defect representation, and mapping the subject sampling representation using a defect mapping layer in the defect detection model to obtain a subject defect representation, includes: Vectorizing the subject sampling representation and the preset defect representation to obtain a first representation vector and a second representation vector; Calculating a vector mapping value between the first characterization vector and the second characterization vector using a mapping function in the defect mapping layer; The correlation function in the defect mapping layer is used to calculate the representation correlation between the preset defect representation and the subject sampling representation: The correlation function includes: ; Wherein, F represents the correlation between the preset defect representation and the main sampling representation, e and e+1 represent the serial numbers corresponding to the preset defect representation and the main sampling representation, respectively. represents the number of representations of the subject sampled representation, represents the value corresponding to the e-th representation in the subject sampling representation, represents the average value of the representation corresponding to the subject sampling representation, Indicates the value corresponding to the e+1th representation in the preset defect representation, Indicates the average value of the representation corresponding to the preset defect representation, and They represent the standard deviations of the subject sampling representation and the preset defect representation, respectively. Combining the representation correlation and the vector mapping value, extracting features associated with the preset defect representation from the subject sample representation to obtain a subject defect representation; In combination with the main defect characterization, the defect position corresponding to the torsional leaf spring is determined, and ultrasonic signal data corresponding to the defect position is collected using a preset ultrasonic device. According to the ultrasonic signal data, the defect phase velocity and defect group velocity corresponding to the defect position are calculated, wherein the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data are calculated, including: Performing filtering on the ultrasonic signal data to obtain filtered signal data; Analyze the signal frequency corresponding to the ultrasonic wave in the filtered signal data, and measure the sound wave propagation period and sound wave speed corresponding to the ultrasonic wave; Calculate the defect phase velocity corresponding to the defect position by combining the sound wave propagation period and the sound wave velocity; Calculating a defect group velocity corresponding to the defect position according to the defect phase velocity and the signal frequency; The defect properties corresponding to the defect position are analyzed in combination with the defect phase velocity and the defect group velocity, and the willow leaf spring defect corresponding to the torsional willow leaf spring is determined in combination with the defect properties and the defect position.

2. A method for detecting defects in a torsionally movable leaf spring based on deep learning as claimed in claim 1, It is characterized in that The step of extracting the foreground subject image from the willow leaf spring image comprises: Detecting the pixel color value corresponding to each pixel point in the willow leaf spring image; Calculate the pixel grayscale value corresponding to each pixel in the willow leaf spring image according to the pixel color value; According to the pixel grayscale value, grayscale processing is performed on the willow leaf spring image to obtain a grayscale willow leaf spring image, and a binarization threshold corresponding to the grayscale willow leaf spring image is set; Extracting a grayscale foreground subject image from the grayscale willow leaf spring image according to the binarization threshold; The grayscale foreground subject image is subjected to pseudo color mapping processing to obtain a foreground subject image.

3. A method for detecting defects in a torsionally movable leaf spring based on deep learning as claimed in claim 1, It is characterized in that The performing subject enhancement processing on the foreground subject image to obtain an enhanced subject image includes: Performing pixel equalization processing on the foreground subject image to obtain a balanced subject image; The smoothed pixel value corresponding to each pixel in the balanced main image is calculated by the following formula: ; Among them, A represents the smooth pixel value corresponding to each pixel in the foreground main image, represents a rectangular window, D and E represent the number of rows and columns of all pixels in the foreground subject image, and represents the Dth to last row and the Eth to last column in the foreground subject image, Represents the pixel value of the pixel point with coordinates (a, b) in the foreground subject image, According to the smoothed pixel values, performing image smoothing processing on the foreground subject image to obtain a smoothed subject image; The smoothed main image is subjected to sharpening and enhancement processing to obtain an enhanced main image.

4. A method for detecting defects in a torsionally movable leaf spring based on deep learning as claimed in claim 1, It is characterized in that The extracting the subject representation corresponding to the enhanced subject image includes: Extracting color information from the enhanced subject image, and quantizing the color information to obtain a color palette; Constructing a color histogram corresponding to the enhanced subject image according to the color palette; Calculating the color feature value of the enhanced subject image according to the color histogram; Normalizing the color feature value to obtain a target color feature value, and constructing a color feature vector corresponding to the target color feature value; Generating a subject color representation of the enhanced subject image according to the color feature vector, and extracting a subject texture feature of the enhanced subject image; The subject color representation and the subject texture feature are combined to obtain the subject representation of the enhanced subject image.

5. A method for detecting defects in a torsionally movable leaf spring based on deep learning as claimed in claim 1, It is characterized in that The method of sampling the subject representation using the representation sampling layer in the defect detection model to obtain the subject sampling representation includes: Performing standard processing on the subject representation using the standardization layer in the representation sampling layer to obtain a standard subject representation; Using the pooling sampling layer in the representation sampling layer to perform representation sampling processing on the standard subject representation to obtain the target subject representation; Calculating the representation coefficient corresponding to the target subject representation using the decision tree layer in the representation sampling layer; According to the representation coefficients, an output layer in the representation sampling layer is used to output a corresponding subject sampling representation from the target subject representation.

6. A method for detecting defects in a torsionally movable leaf spring based on deep learning as claimed in claim 5, It is characterized in that The calculating the representation coefficient corresponding to the target subject representation by using the decision tree layer in the representation sampling layer includes: Extracting a representation label in the target subject representation using a label extractor in the decision tree layer; Calculate the label probability corresponding to the representation label, and calculate the subject representation entropy and the representation condition entropy corresponding to the target subject representation respectively by using the entropy function in the decision tree layer in combination with the label probability; Combining the subject representation entropy and the representation condition entropy, calculating the representation gain ratio corresponding to the target subject representation; According to the representation gain ratio, a representation coefficient corresponding to the target subject representation is obtained.

7. A method for detecting defects in a torsionally movable leaf spring based on deep learning as claimed in claim 1, It is characterized in that The step of calculating the defect phase velocity corresponding to the defect position by combining the sound wave propagation period and the sound wave velocity includes: Calculate the sound wave propagation distance corresponding to the ultrasonic wave by combining the sound wave propagation period and the sound wave velocity; Measuring the distance between the ultrasonic device and the defect position to obtain the flaw detection distance; Determining a defect propagation distance corresponding to the defect position according to the flaw detection distance and the sound wave propagation distance; Calculating the sound path period corresponding to the ultrasonic wave according to the flaw detection distance and the sound wave velocity; Determine the defect propagation period corresponding to the defect position by combining the sound wave propagation period and the sound path period; The defect phase velocity corresponding to the defect position is calculated by combining the defect propagation distance and the defect propagation period.

8. A system for detecting defects in torsion leaf springs based on deep learning. It is characterized in that The system comprises: An image enhancement module is used to collect a willow leaf spring image corresponding to the twistable willow leaf spring, extract a foreground subject image from the willow leaf spring image, and perform subject enhancement processing on the foreground subject image to obtain an enhanced subject image; A representation mapping module is used to extract a subject representation corresponding to the enhanced subject image, input the subject representation and a preset defect representation into a pre-trained defect detection model, sample the subject representation using a representation sampling layer in the defect detection model to obtain a subject sampling representation, and map the subject sampling representation using a defect mapping layer in the defect detection model in combination with the preset defect representation to obtain a subject defect representation, wherein the mapping of the subject sampling representation using a defect mapping layer in the defect detection model in combination with the preset defect representation to obtain a subject defect representation includes: Vectorizing the subject sampling representation and the preset defect representation to obtain a first representation vector and a second representation vector; Calculating a vector mapping value between the first characterization vector and the second characterization vector using a mapping function in the defect mapping layer; The correlation function in the defect mapping layer is used to calculate the representation correlation between the preset defect representation and the subject sampling representation: The correlation function includes: ; Wherein, F represents the correlation between the preset defect representation and the main sampling representation, e and e+1 represent the serial numbers corresponding to the preset defect representation and the main sampling representation, respectively. represents the number of representations of the subject sampled representation, represents the value corresponding to the e-th representation in the subject sampling representation, represents the average value of the representation corresponding to the subject sampling representation, Indicates the value corresponding to the e+1th representation in the preset defect representation, Indicates the average value of the representation corresponding to the preset defect representation, and They represent the standard deviations of the subject sampling representation and the preset defect representation, respectively. Combining the representation correlation and the vector mapping value, extracting features associated with the preset defect representation from the subject sample representation to obtain a subject defect representation; A velocity calculation module is used to determine the defect position corresponding to the torsional leaf spring in combination with the main defect characterization, collect ultrasonic signal data corresponding to the defect position using a preset ultrasonic device, and calculate the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data, wherein the defect phase velocity and defect group velocity corresponding to the defect position according to the ultrasonic signal data are calculated, including: Performing filtering on the ultrasonic signal data to obtain filtered signal data; Analyze the signal frequency corresponding to the ultrasonic wave in the filtered signal data, and measure the sound wave propagation period and sound wave speed corresponding to the ultrasonic wave; Calculate the defect phase velocity corresponding to the defect position by combining the sound wave propagation period and the sound wave velocity; Calculating a defect group velocity corresponding to the defect position according to the defect phase velocity and the signal frequency; The defect analysis module is used to analyze the defect attribute corresponding to the defect position by combining the defect phase velocity and the defect group velocity, and determine the willow leaf spring defect corresponding to the torsional willow leaf spring by combining the defect attribute and the defect position.