Acoustic online nondestructive testing method based on convolutional neural network
Technical Field
The invention relates to the technical field of online nondestructive testing, in particular to an acoustic online nondestructive testing method based on a convolutional neural network.
Background
The metal parts are important components of mechanical systems, and the quality condition of the metal parts is related to whether the mechanical systems can normally operate or not. Therefore, it is necessary to perform quality inspection of metal parts and to reject defective products. The nondestructive detection can realize the detection of the product quality by utilizing the changes of the reaction of heat, sound, light, electricity, magnetism and the like caused by the abnormal structure or the defects of the material on the premise of not damaging or not influencing the service performance of the detected object and not damaging the internal tissue of the detected object.
The conditions that the quality of the metal parts is not qualified mainly comprise: cracks, breakage, hardness/density inconsistency, dimensional variations, raw material residue, and the like. At present, the methods for detecting the quality of metal parts mainly include: magnetic particle inspection, eddy current inspection, ultrasonic inspection, ray inspection, acoustic emission inspection and the like. The magnetic particle detection is mainly used for detecting cracks, folds, interlayers, slag inclusions and the like, has high detection sensitivity and low detection speed, is difficult to be used for online detection, and is only suitable for magnetic materials. The eddy current detection is mainly used for detecting surface/near surface defects, conductivity, magnetic conductivity, geometric dimensions and the like, and has the advantages of high detection speed, low detection precision and difficulty in detecting internal defects. The ultrasonic detection is mainly used for detecting thickness, hardness, residual stress, adhesive strength and the like, and the coupling agent is needed during detection, so that the ultrasonic detection is difficult to be used for online nondestructive detection. The ray detection technology is generally suitable for detecting defects of air holes, slag-inclusion dense air holes, cold shut, incomplete penetration of welding, incomplete fusion and the like in welding seams and castings, the rays are difficult to transmit metals, the detection cost is high, and the human body can be damaged.
The basic principle of the acoustic emission detection technology is as follows: when an object to be measured is subjected to an external force, energy can be rapidly released in a local area of the object to be measured and transient elastic waves are generated, the elastic waves are sensed and converted into electric signals by using sensors such as a microphone, a piezoelectric plate and an ultrasonic probe, and the electric signals are subjected to a series of processing, so that relevant characteristic parameters of the object to be measured are obtained, and the condition of the object to be measured is judged. Acoustic emission inspection is a non-destructive inspection method that can be used to inspect the quality of rigid objects, such as structural defects, cracks, dimensional deviations, and the like. The related patents are briefly described as follows:
in the invention patent of china with the application number of 201710053519.X, "an acoustic glass defect detection method based on a neural network", glass is knocked, time domain features (namely, a mean value, a root mean square value and a peak value), frequency domain features (namely, the area of a signal spectrum and the frequency corresponding to the maximum value of the spectrum) and wavelet domain features (namely, signal energy after wavelet decomposition and reconstruction) are extracted from a sound signal generated by knocking, and a BP neural network is adopted to detect glass defects according to the features. The sound signal characteristics described in this patent are susceptible to sound level and co-frequency noise. If the picked-up knocking sound becomes larger or smaller due to the change of sensitivity or the change of the picking-up distance of the pickup in the using process, the average value and the peak value (namely, time domain characteristics) of the signal, the signal energy (namely, wavelet domain characteristics) after wavelet decomposition reconstruction and the area (namely, frequency domain characteristics) of the signal spectrum all change; if the tapping sound is contaminated by noise, the frequency (i.e. peak value) corresponding to the maximum value of the frequency spectrum may be affected in addition to the mean value, peak value, signal energy after wavelet decomposition and reconstruction, and area of the signal frequency spectrum.
In summary, an effective online nondestructive testing method for the quality of metal parts and related equipment are still lacking.
Disclosure of Invention
In view of the above, it is necessary to provide an acoustic online nondestructive testing method based on a convolutional neural network to solve the above-mentioned shortcomings in the background art that the characteristics of the sound signal are unstable and easily interfered when the product quality is detected based on acoustics.
In order to achieve the purpose, the invention adopts the following technical scheme:
an acoustic online nondestructive testing method based on a convolutional neural network comprises the following steps:
s1, training a product quality calculation network W according to a plurality of metal products with determined product quality, thereby obtaining a product quality calculation model M;
and S2, detecting the quality of the detected metal product with undetermined quality according to the product quality calculation model M obtained in the step S1, and judging whether the detected metal product is qualified.
Further, the S1 includes the following steps:
s101, selecting a plurality of metal products with qualified quality and a plurality of metal products with unqualified quality as trained metal products;
s102, selecting one metal product from the trained metal products in the S101 to knock;
s103, picking up sound signals generated by the knocked metal product in the S102 due to knocking vibration, and sampling the sound signals to obtain sound data Si;
S104, for the sound data SiFourier transform is carried out, and then the absolute value of the Fourier transform result generated in S104 is taken to obtain the frequency spectrum energy data Xi;
S105, the sound data SiSum spectral energy data XiAs quality information data Q of the metal product tapped in S102i;
S106, performing the operations from S101 to S105 on each trained metal product to obtain a quality information data set { Q) of the trained metal producti};
S107, using the quality information data set { QiEach set of quality information data Q iniAs input data for the product quality calculation network W, a quality criterion value delta is usediAs output data of the product quality calculation network W, training the product quality calculation network W to obtain a product quality calculation model M; specifically, the mass standard value δiThe specific values are as follows:
if the ith metal product is a qualified product, the quality standard value deltai1 is ═ 1; if the ith metal product is an unqualified product, the quality standard value deltai=-1。
Further, the S2 includes the following steps:
s201, knocking a metal product to be detected; the knocked metal product to be detected is a detected metal product;
s202, picking up a sound signal generated by the detected metal product due to knocking vibration, and sampling the sound signal to obtain sound data S;
s203, carrying out Fourier transformation on the sound data S, and then taking an absolute value of a Fourier transformation result generated in the S203 to obtain frequency spectrum energy data X;
s204, using the sound data S and the spectral energy data X as quality information data Q of the detected metal product;
s205, taking the quality information data Q as input data of the product quality calculation model M obtained in S107, and obtaining a product quality parameter R of the detected metal product through calculation of the product quality calculation model M;
s206, comparing the product quality parameter R with a product quality threshold T, and if the product quality parameter R is greater than the product quality threshold T, judging that the detected metal product is qualified; and if the product quality parameter R is less than or equal to the product quality threshold value T, judging that the detected metal product is unqualified.
Further, the specific structure and application steps of the product quality computing network W are as follows:
s301, input layer: inputting quality information data Q; the quality information data Q includes sound data S and spectral energy data X;
s302, a convolution layer: performing feature extraction on the sound data S by using a one-dimensional convolution unit C1 to obtain time domain feature data F1, and performing feature extraction on the spectral energy data X by using a one-dimensional convolution unit C2 to obtain frequency domain feature data F2;
s303, a fusion layer: fusing the time domain characteristic data F1 and the frequency domain characteristic data F2 to obtain product characteristic data F;
s304, full connection layer: receiving product characteristic data F obtained by the fusion layer;
s305, output layer: namely the output of the full connection layer; and the data of the output layer is the product quality parameter R of the detected metal product.
Further, the product quality calculation model M has the same network structure as the product quality calculation network W.
Further, the specific structure of the one-dimensional convolution unit C1 is as follows:
first layer convolution of C1: the convolution kernel size of the first layer convolution of C1 is m11×1×n11The non-linear excitation function of the first layer convolution of C1 is ReLu, and the pooling method of the first layer convolution of C1 is average pooling;
second layer convolution of C1: the convolution kernel size of the second layer convolution of C1 is m12×1×n12The nonlinear excitation function of the second layer convolution of C1 is ReLu, and the pooling method of the second layer convolution of C1 is average pooling;
the specific structure of the one-dimensional convolution unit C2 is as follows:
first layer convolution of C2: the convolution kernel size of the first layer convolution of C2 is m21×1×n21The nonlinear excitation function of the first layer convolution of C2 is ReLu, and the pooling method of the first layer convolution of C2 is maximum pooling;
second layer convolution of C2: the convolution kernel size of the second layer convolution of C2 is m22×1×n22The non-linear excitation function of the second layer convolution of C2 is ReLu, and the pooling method of the second layer convolution of C2 is maximum pooling.
Further, the computational expression of the nonlinear excitation function ReLu is x' ═ max (0, x) (1)
X in formula (1) represents the convolution result; and the nonlinear excitation function ReLu reserves the value which is greater than or equal to zero in the convolution result, and sets the value which is less than zero in the convolution result to zero.
Further, said m11、m12、m21、m22The relationship of (1) is: m is11>m12,m21>m22。
Further, in S303, the fusion method of the time domain feature data F1 and the frequency domain feature data F2 is: performing data fusion in a cascade mode; the cascade axis is 1, i.e. the cascade is performed in a signal lengthening manner.
Further, the S303 includes the steps of:
s3031, m contained in the time domain feature data F112A one-dimensional matrix F11Cascading to obtain the length m12×n12One-dimensional matrix F of111(ii) a The one-dimensional matrix F11Is of length n12A one-dimensional matrix of (a);
m contained in the frequency domain feature data F222A one-dimensional matrix F22Cascading to obtain the length m22×n22One-dimensional matrix F of222(ii) a Said oneDimension matrix F22Is of length n22A one-dimensional matrix of (a);
s3032, converting the matrix F111And matrix F222Cascading to obtain the length m12×n12+m22×n22One-dimensional matrix F of333(ii) a The one-dimensional matrix F333I.e. the product characteristic data F as described in S303.
The invention has the beneficial effects that:
according to the invention, the time-frequency domain sound features are not calculated by adopting a traditional sound feature extraction method, but the time-domain acoustic features and the frequency-domain acoustic features are directly extracted from the time-domain sound data and the frequency-domain sound data by using a convolutional neural network structure, and the convolutional neural network is trained by a large number of samples (metal products with known quality), so that the most effective acoustic features can be extracted from the parameters of the final convolutional neural network, the influence of sound size change and noise on the detection result is effectively avoided, and the detection robustness and the detection accuracy can be improved.
Drawings
FIG. 1 is a flow chart of the operation of an acoustic online nondestructive testing method based on a convolutional neural network of the present invention;
FIG. 2 is a flowchart of the operation of S1 according to the present invention;
FIG. 3 is a flowchart of the operation of S2 according to the present invention;
FIG. 4 is a schematic diagram illustrating the structure and flow of a product quality calculation network W according to the present invention;
FIG. 5 is a schematic structural diagram of a one-dimensional convolution unit C1 according to the present invention;
FIG. 6 is a schematic structural diagram of a one-dimensional convolution unit C2 according to the present invention;
FIG. 7 is a schematic structural diagram of an acoustic online nondestructive testing device based on a convolutional neural network according to the present invention;
FIG. 8 is a schematic diagram of the operation process of an acoustic online nondestructive testing device based on a convolutional neural network according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be further clearly and completely described below with reference to the embodiments of the present invention. It should be noted that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is to be understood that the terms "upper", "lower", "front", "rear", "left", "right", and the like, are used in the orientations and positional relationships indicated in the drawings for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus are not to be construed as limiting the present invention.
The terms "first," "second," "third," "fourth," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicit to the number of technical features indicated. Thus, the definitions of "first", "second", "third", "fourth" features may explicitly or implicitly include one or more of such features.
Example 1
As shown in fig. 1, an acoustic online nondestructive testing method based on a convolutional neural network includes the following steps:
s1, training a product quality calculation network W according to a plurality of metal products with determined product quality, thereby obtaining a product quality calculation model M;
and S2, detecting the quality of the detected metal product with undetermined quality according to the product quality calculation model M obtained in the step S1, and judging whether the detected metal product is qualified.
Further, as shown in fig. 1 and fig. 2, the S1 includes the following steps:
s101, selecting a plurality of metal products with qualified quality and a plurality of metal products with unqualified quality as trained metal products; specifically, N1 qualified products and N2 unqualified products are selected from the metal products with determined product quality;
s102, selecting one metal product from the trained metal products in the S101 to knock; specifically, the ith product (i is more than or equal to 1 and less than or equal to N1 and N2) is knocked to generate vibration;
s103, picking up sound signals generated by the knocked metal product in the S102 due to knocking vibration, and sampling the sound signals to obtain sound data Si(ii) a Specifically, a sound signal generated by vibration of the ith product is picked up and is subjected to sampling processing to obtain digitized sound data Si;
S104, for the sound data SiFourier transform is carried out, and then the absolute value of the Fourier transform result generated in S104 is taken to obtain the frequency spectrum energy data Xi;
S105, sound data SiSum spectral energy data XiQuality information data Q as the metal product tapped in S102i(ii) a Specifically, the sound data SiSum spectral energy data XiQuality information data Q as ith producti;
S106, performing the operations from S101 to S105 on each trained metal product to obtain a quality information data set { Q) of the trained metal producti}; specifically, the selected N1+ N2 products are operated according to the steps S101 to S105 to obtain quality information data sets { Q of N1+ N2 productsi};
S107, using the quality information data set { QiEach set of quality information data Q iniAs input data for the product quality calculation network W, a quality criterion value delta is usediAnd the data are used as output data of the product quality calculation network W, and the product quality calculation network W is trained, so that a product quality calculation model M is obtained.
Further, as shown in fig. 1, 2, and 3, the S2 includes the following steps:
s201, knocking a metal product to be detected; the knocked metal product to be detected is a detected metal product;
s202, picking up a sound signal generated by the detected metal product due to knocking vibration, and sampling the sound signal to obtain sound data S; the sound data S is a digitized sound signal;
s203, carrying out Fourier transformation on the sound data S, and then taking an absolute value of a Fourier transformation result generated in the S203 to obtain frequency spectrum energy data X;
s204, using the sound data S and the spectral energy data X as quality information data Q of the detected metal product;
s205, taking the quality information data Q as input data of the product quality calculation model M obtained in S107, and obtaining a product quality parameter R of the detected metal product through calculation of the product quality calculation model M;
s206, comparing the product quality parameter R with a product quality threshold T, and if the product quality parameter R is greater than the product quality threshold T, judging that the detected metal product is qualified; and if the product quality parameter R is less than or equal to the product quality threshold value T, judging that the detected metal product is unqualified.
Further, as shown in fig. 1, fig. 2, fig. 3, and fig. 4, the specific structure and application steps of the product quality calculation network W are as follows:
s301, input layer: inputting quality information data Q; the quality information data Q includes sound data S and spectral energy data X;
s302, a convolution layer: performing feature extraction on the sound data S by using a one-dimensional convolution unit C1 to obtain time domain feature data F1, and performing feature extraction on the spectral energy data X by using a one-dimensional convolution unit C2 to obtain frequency domain feature data F2;
s303, a fusion layer: fusing the time domain characteristic data F1 and the frequency domain characteristic data F2 to obtain product characteristic data F;
s304, full connection layer: receiving product characteristic data F obtained by the fusion layer;
s305, output layer: namely the output of the full connection layer; and the data of the output layer is the product quality parameter R of the detected metal product.
Further, the product quality calculation model M and the product quality calculation network W have the same network structure; specifically, the product quality calculation model M is obtained by training the product quality calculation network W.
Further, as shown in fig. 5, the specific structure of the one-dimensional convolution unit C1 is as follows:
c1 first layer convolution: the convolution kernel size of the first layer convolution of C1 is m11×1×n11The non-linear excitation function of the first layer convolution of C1 is ReLu, and the pooling method of the first layer convolution of C1 is average pooling; specifically, the pooled window size is 3, and the step size is 2;
second layer convolution of C1: the convolution kernel size of the second layer convolution of C1 is m12×1×n12The nonlinear excitation function of the second layer convolution of C1 is ReLu, and the pooling method of the second layer convolution of C1 is average pooling; specifically, the pooled window size is 3, and the step size is 2;
as shown in fig. 6, the specific structure of the one-dimensional convolution unit C2 is as follows:
first layer convolution of C2: the convolution kernel size of the first layer convolution of C2 is m21×1×n21The nonlinear excitation function of the first layer convolution of C2 is ReLu, and the pooling method of the first layer convolution of C2 is maximum pooling; specifically, the pooled window size is 2, and the step size is 2;
second layer convolution of C2: the convolution kernel size of the second layer convolution of C2 is m22×1×n22The nonlinear excitation function of the second layer convolution of C2 is ReLu, and the pooling method of the second layer convolution of C2 is maximum pooling; specifically, the pooled window size is 2, with a step size of 2.
Further, the computational expression of the nonlinear excitation function ReLu is x' ═ max (0, x) (1)
X in formula (1) represents the convolution result; and the nonlinear excitation function ReLu reserves the value which is greater than or equal to zero in the convolution result, and sets the value which is less than zero in the convolution result to zero.
Further, said m11、m12、m21、m22The relationship of (1) is:m11>m12,m21>m22。
further, in S303, the fusion method of the time domain feature data F1 and the frequency domain feature data F2 is: performing data fusion in a cascade mode; the cascade axis is 1, i.e. the cascade is performed in a signal lengthening manner.
Further, the S303 includes the steps of:
s3031, m included in time domain feature data F112A one-dimensional matrix F11Cascading to obtain the length m12×n12One-dimensional matrix F of111(ii) a The one-dimensional matrix F11Is of length n12A one-dimensional matrix of (a);
m contained in the frequency domain feature data F222A one-dimensional matrix F22Cascading to obtain the length m22×n22One-dimensional matrix F of222(ii) a The one-dimensional matrix F22Is of length n22A one-dimensional matrix of (a);
s3032, converting the matrix F111And matrix F222Cascading to obtain the length m12×n12+m22×n22One-dimensional matrix F of333(ii) a The one-dimensional matrix F333I.e. the product characteristic data F as described in S303.
Example 2
Example 2 is a further optimization of example 1;
as shown in fig. 1, 7 and 8, the convolutional neural network based acoustic online nondestructive testing method is applied to a convolutional neural network based acoustic online nondestructive testing device, and the online nondestructive testing device includes: the device comprises a conveying device 1, an orientation adjusting module 3, a detecting module 4, a control processing module 5, a rejecting device 6 and a state indicating module 7; the illustrated conveyor 1 is used for conveying workpieces 2 to be inspected;
the orientation adjusting module 3 comprises a first electric eye module, an orientation detecting module and a rotating module; the first electric eye module is used for detecting whether a workpiece 2 to be detected on the conveying device 1 is about to pass through the direction adjusting module 3, and if the workpiece 2 to be detected is detected, a trigger signal is output to the direction detecting module; the orientation detection module is used for detecting the current orientation of the workpiece 2 to be detected and transmitting the current orientation information of the workpiece 2 to be detected to the rotation module; the rotating module adjusts the current orientation information of the workpiece 2 to be detected to a set orientation;
the detection module 4 comprises a second electric eye module, an electromagnetic control module, an electromagnetic knocking module and a sound pickup module; the second electric eye module is used for detecting whether the workpiece 2 to be detected after the direction adjustment is about to pass through the detection module 4 or not on the conveying device 1, and if the workpiece 2 to be detected is detected, a trigger signal is output to the electromagnetic control module; after receiving the trigger signal, the electromagnetic control module sends a driving signal to the electromagnetic knocking module according to parameters such as set voltage, pulse width ratio of PWM (pulse width modulation) and the like (the parameters determine the size of knocking force and knocking stroke), so that the electromagnetic knocking module is driven to knock a workpiece to be detected; the workpiece to be detected vibrates after being knocked and generates sound; the sound pickup module is used for picking up sound generated by vibration of a workpiece to be detected;
the control processing module 5 comprises a sound signal processing module, a digital signal processing module and a quality judging module; the sound signal processing module is used for carrying out noise reduction, signal conditioning and digital processing on the sound signals picked up by the sound pickup module and transmitting digital sound data to the digital signal processing module; the digital signal processing module is used for processing the digitized sound data to obtain quality data of the workpiece to be detected; the quality judging module is used for comparing the quality data of the workpiece to be detected with qualified standard data so as to judge whether the quality of the workpiece is qualified or not;
the removing device 6 is used for removing unqualified workpieces 8;
the state indicating module 7 is configured to indicate three states: the current workpiece is qualified, the current workpiece is unqualified, and a plurality of continuous workpieces are unqualified.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.