Welding quality real-time detection method and system based on LSTM and residual distribution

文档序号:477993 发布日期:2022-01-04 浏览:14次 中文

阅读说明:本技术 基于lstm与残差分布的焊接质量实时检测方法及系统 (Welding quality real-time detection method and system based on LSTM and residual distribution ) 是由 姚志豪 钱鹏 李波 于 2021-12-08 设计创作,主要内容包括:本发明公开了一种基于LSTM与残差分布的焊接质量实时检测方法及系统,包括:基于预训练的LSTM模型,对极短的时间序列窗口构建残差矩阵,衡量单个时间窗口内的残差矩阵与整体残差矩阵的分布相似度,根据分布相似度是否超过阈值的判断,实现短时间内的焊接质量缺陷检测。本发明基于非侵入性设备所采集的高频时序信号数据,利用LSTM构建真实数据与预测数据的残差矩阵,衡量残差矩阵分布相似度,确定异常时序阈值来识别焊接质量缺陷,从而解决了焊接图像、光谱、声音等数据难以采集、缺陷数据难以标注、模型鲁棒性不足等技术问题,可做到焊接质量缺陷的实时检测。(The invention discloses a welding quality real-time detection method and a system based on LSTM and residual distribution, comprising the following steps: based on a pre-trained LSTM model, a residual matrix is constructed for an extremely short time sequence window, the distribution similarity of the residual matrix in a single time window and the whole residual matrix is measured, and welding quality defect detection in a short time is realized according to the judgment whether the distribution similarity exceeds a threshold value. The method is based on high-frequency time sequence signal data acquired by non-invasive equipment, utilizes LSTM to construct a residual matrix of real data and predicted data, measures the distribution similarity of the residual matrix, and determines an abnormal time sequence threshold to identify the welding quality defect, thereby solving the technical problems that data such as welding images, spectrums, sounds and the like are difficult to acquire, defect data are difficult to label, model robustness is insufficient and the like, and realizing real-time detection of the welding quality defect.)

1. A welding quality real-time detection method based on LSTM and residual error distribution is characterized by comprising the following steps:

step 1: splitting high-frequency time sequence data acquired in a normal welding process into three data sets, respectively carrying out window sliding cutting on the three data sets by taking Train _ Windows as a training time window, Label _ Windows as a prediction time window and Rolling _ Step as a Step length, and constructing three moldable data sets [ Seq1, Seq2 and Seq3 ];

step 2: training an LSTM model by using Seq1 to determine an LSTM structure and related parameters;

and step 3: loading a pre-trained LSTM model to reason for Seq2, and calculating residual errors by using predicted values and real values of all Label _ Windows of Seq2 to further construct a residual error matrix M;

and 4, step 4: reasoning each Label _ Windows of Seq3 by utilizing a pre-trained LSTM model, and calculating residual errors of the Label _ Windows predicted values and the true values of each reasoning to obtain N residual error matrixes with the size of Label _ Windows;

and 5: respectively calculating the distribution similarity of the residual matrixes with the sizes of N Label _ Windows and the residual matrix M, and further determining an abnormal threshold according to the data distribution of the distribution similarity;

step 6: and for new high-frequency welding time sequence data, performing sliding window according to Train _ Windows, importing the sliding window into a trained LSTM model for reasoning, calculating the distribution similarity of each Label _ Windows residual matrix and the residual matrix M, and judging whether the Label _ Windows is abnormal or not according to whether the distribution similarity exceeds a threshold value or not.

2. The method for detecting the welding quality based on the LSTM and the residual error distribution in real time as claimed in claim 1, wherein the high frequency time sequence data collected in step 1 comprises one or more of current, voltage, wire feeding speed and air flow speed, and the frequency is not lower than 10 KHz.

3. The method for detecting welding quality in real time based on LSTM and residual distribution according to claim 1, wherein the step 1 further comprises: the data set [ Seq1, Seq2, Seq3] was further normalized.

4. The method for detecting the welding quality based on the LSTM and the residual distribution in real time according to claim 1, wherein the distribution similarity in the steps 5 and 6 comprises KL divergence, JS divergence or W distance.

5. The method for detecting welding quality in real time based on LSTM and residual distribution according to claim 1, wherein in step 5, after normal fitting is performed on the distribution similarity obtained by calculation, the data with set confidence is taken as an abnormal threshold.

6. A welding quality real-time detection system based on LSTM and residual distribution is characterized by comprising a data acquisition module and a data processing module, wherein the data processing module adopts the detection method of any one of claims 1-5 to perform real-time detection on the welding quality according to high-frequency welding time sequence data acquired by the data acquisition module.

Technical Field

The invention relates to a welding quality real-time detection method and system based on LSTM (long-short term memory artificial neural network) and residual distribution, belonging to the technical field of automatic welding.

Background

With the rapid development of industries such as automobiles, aerospace, construction and transportation in recent years, the process and quality requirements for industrial equipment are higher and higher, and the welding quality detection technology is widely applied in a plurality of fields in recent years. The welding quality can be divided into direct welding quality and indirect welding quality, and the main contents of the welding joint of a common welding product comprise mechanical property, internal and external defects, the geometric dimension of a welded product and the like. Indirect weld quality is a factor that can be detected by a sensor of the sense or nature of the welder during the welding process and that indirectly determines the quality of the direct weld. Although such indirect weld quality does not directly indicate the performance of the weld joint, it is largely reflected in the presence of weld quality problems during the welding process.

At present, the deep learning is combined with data such as visual images, arc spectrums, arc sounds and the like to carry out welding quality diagnosis, which is a main technical means for carrying out welding quality diagnosis, but in an actual use scene, the data such as the welding images, the spectrums, the sounds and the like are difficult to collect, are greatly influenced by the environment, the defect types are difficult to define, a large amount of data marking is needed, the time and the economic cost are high, and the effect is poor. And time series data such as electric signals in the welding process not only contain power performance information but also contain a large amount of welding quality information, and meanwhile, the time series data is low in acquisition cost and not easy to be influenced by external environment factors, and the welding quality detection cost and effectiveness can be greatly reduced by analyzing and mining the corresponding relation between the time series data and welding quality defects.

Disclosure of Invention

The purpose of the invention is as follows: aiming at the problems in the prior art, the invention provides a welding quality real-time detection method and system based on LSTM and residual distribution.

The technical scheme is as follows: aiming at the defects of the prior art, the invention aims at reducing the data acquisition cost and the abnormal labeling cost, does not need to perform abnormal labeling on abnormal time sequence data, simultaneously converts the welding quality detection problem into the detection of time sequence abnormal signals in the welding process, selects LSTM for model training by considering the time dependence relationship and the nonlinear property of the welding quality defect, has zero value for residual errors in the normal welding process, but has deviation from the zero value due to the unstable system and the influence of the external environment, but has stable overall residual error distribution, constructs a residual error matrix for an extremely short time sequence window by combining the high-frequency data characteristic (more sampling points in unit time) and the welding real-time detection requirement, measures the distribution similarity of the residual error matrix in a single time window and the overall residual error matrix, and determines the threshold value according to the distribution similarity, and welding quality defect detection in a short time is realized. The method specifically comprises the following steps:

step 1: splitting high-frequency time sequence data acquired in a normal welding process into three data sets, respectively carrying out window sliding cutting on the three data sets by taking Train _ Windows as a training time window, Label _ Windows as a prediction time window and Rolling _ Step as a Step length, and constructing three moldable data sets [ Seq1, Seq2 and Seq3 ];

step 2: training an LSTM model by using Seq1 to determine an LSTM structure and related parameters;

and step 3: loading a pre-trained LSTM model to reason the Seq2, calculating residual errors by using predicted values (selecting predicted data closer to Train _ Windows for a plurality of predicted values at the same time point) and true values of all Label _ Windows of Seq2, and further constructing a residual error matrix M (constructing a multi-dimensional residual error matrix M by using difference values for a multi-dimensional high-frequency time sequence);

and 4, step 4: reasoning each Label _ Windows of Seq3 by utilizing a pre-trained LSTM model, and calculating residual errors of the Label _ Windows predicted values and the true values of each reasoning to obtain N residual error matrixes with the size of Label _ Windows;

and 5: respectively calculating the distribution similarity of the residual matrixes with the sizes of N Label _ Windows and the residual matrix M, and further determining an abnormal threshold according to the data distribution of the distribution similarity;

step 6: and for new high-frequency welding time sequence data, performing sliding window according to Train _ Windows, importing the sliding window into a trained LSTM model for reasoning, calculating the distribution similarity of each Label _ Windows residual matrix and the residual matrix M, and judging whether the Label _ Windows is abnormal or not according to whether the distribution similarity exceeds a threshold value or not.

Further, the high-frequency time sequence data collected in step 1 is high-frequency signal data collected for a longer time period in a normal welding process by using a non-invasive data collecting device, wherein the high-frequency signal data comprises but is not limited to one or more of current, voltage, wire feeding speed and gas flow speed, and the frequency of the high-frequency signal data is not lower than 10 KHz.

Further, the step 1 further includes: and (4) carrying out normalization processing on the data sets [ Seq1, Seq2 and Seq3] so as to accelerate the model training speed.

Further, the calculation of the distribution similarity in the steps 5 and 6 includes, but is not limited to, KL divergence, JS divergence, or w (wasserstein) distance, etc.

Further, in the step 5, after the distribution similarity obtained by calculation is subjected to normal fitting, data with set confidence is taken as an abnormal threshold.

In addition, the invention also provides a welding quality real-time detection system based on LSTM and residual distribution, which comprises a data acquisition module and a data processing module, wherein the data processing module adopts the welding quality real-time detection method to perform real-time detection on welding defects according to the high-frequency welding signal data acquired by the data acquisition module, including but not limited to current, voltage, wire feeding speed and air flow speed.

Has the advantages that: compared with the prior art, the welding quality real-time detection method and system based on LSTM and residual distribution provided by the invention have the following advantages:

1. compared with the method for constructing a classification model by using data such as sound, spectrum, images and the like to perform welding quality on-line diagnosis, the method only needs to use non-invasive data acquisition equipment to acquire high-frequency time sequence data in the welding process, so that the data is easy to acquire, and the detection cost is low.

2. The time series model is pre-trained, LSTM model parameters are determined, welding quality defects can be identified only by using the trained model to perform reasoning sliding window data and threshold value judgment in the actual use process, a large amount of abnormal labels are not needed, and the defect that the welding quality defects are difficult to label is overcome.

3. In the actual production process, the time sequence data is relatively standardized and is not easily influenced by environmental factors, and the model is built by utilizing the high-frequency time sequence, so that the model is more robust and has good robustness.

Drawings

FIG. 1 is a schematic overall flow chart of an embodiment of the present invention;

FIGS. 2a and 2b are a model training and prediction graph and a residual matrix calculation graph, respectively, according to an embodiment of the present invention;

FIG. 3 is a diagram of the detection result of a segment of high frequency current and voltage timing data according to an embodiment of the present invention.

Detailed Description

The following description of the preferred embodiments of the present invention with reference to the accompanying drawings will more clearly and completely illustrate the technical solutions of the present invention.

Fig. 1 shows a real-time welding quality detection method based on LSTM and residual distribution, which includes the following steps:

step 1: acquiring high-frequency current and voltage time sequence data in a normal welding process;

the data is high-frequency current and voltage data of a long time period in the normal welding process acquired by non-invasive data acquisition equipment;

step 2: dividing the acquired high-frequency current and voltage time sequence data into three data sets with the same data quantity, and respectively using the three data sets as model training, residual matrix construction and welding quality defect threshold determination;

and step 3: respectively carrying out window sliding cutting on the three data sets by taking Train _ Windows as the training time window size, Label _ Windows as the prediction time window size and Rolling _ Step as the Step length, carrying out normalization processing on the data, and accelerating the training speed of the model, thereby constructing three modeling-capable data sets [ Seq1, Seq2 and Seq3 ];

as shown in fig. 2a, Train _ Windows and Label _ Windows represent that the model predicts data of a Label _ Windows (i.e., Predict = 1) time window by using data of a Train _ Windows (i.e., Train = 3) time window, because a large amount of sample data is generated in 1s in high frequency data, prediction of a unit time point cannot be performed, and prediction should be performed by converting into a time window;

and 4, step 4: training an LSTM model by using Seq1 to determine an LSTM structure and related parameters;

and 5: loading the pre-trained LSTM to carry out reasoning on Seq2 to obtain predicted values of all Label _ Windows of Seq 2;

step 6: as shown in fig. 2b, the true value corresponding to the predicted time point is taken to calculate the difference value between the predicted value and the true value, and for the multi-dimensional high-frequency time sequence, the difference value is used to construct a multi-dimensional residual matrix M;

in other embodiments, if Label _ Windows > 1, there are multiple predictions for the same time point, and since the closer to Train _ Windows, the higher the data reliability, the more recent predicted data to Train _ Windows is preferred as the predicted value for the predicted time point;

and 7: loading the trained LSTM to reason about each Label _ Windows of the Seq3, and calculating a residual error for a Label _ Windows predicted value and a true value of each reason to obtain N Label _ Windows-sized residual error matrixes;

and 8: respectively calculating the data distribution similarity of the residual matrixes with the sizes of N Label _ Windows and the residual matrix M, wherein in order to adapt to the conditions that the residual matrixes have higher overlapping performance and the similarity is not easy to measure, the W distance is used for measuring the similarity of two high-dimensional data distributions to obtain a distance matrix S;

and step 9: fitting normal distribution to the distance matrix S, and taking data with 95% confidence as an abnormal threshold;

step 10: for new high-frequency welding time sequence data, sliding Windows are conducted according to Train _ Windows, the sliding Windows are guided into a trained LSTM model for reasoning, each Label _ Windows residual matrix and the W distance between each Label _ Windows residual matrix and the residual matrix M are calculated, and whether the Label _ Windows is abnormal or not is judged according to the fact that whether the W distance exceeds a threshold value or not (fig. 3 shows the detection result of the welding quality real-time detection method for a section of welding high-frequency current and voltage time sequence data).

In addition, the embodiment also provides a welding quality real-time detection system based on LSTM and residual error distribution, which includes a data acquisition module and a data processing module, wherein the data acquisition module employs a non-invasive data acquisition device, the data processing module is a processor, and the processor performs real-time detection of welding defects according to the high-frequency welding signal data acquired by the non-invasive device, including but not limited to current, voltage, wire feeding speed, and air flow speed, by the welding quality real-time detection method.

The welding quality detection model is constructed by using the high-frequency time sequence data of the single normal label, the difficulty that a large amount of abnormal label data are needed in the traditional welding quality defect detection model and the abnormal label data are difficult to collect is overcome, meanwhile, the new time sequence is cut, inference is carried out based on the pre-trained LSTM, the welding defect detection is carried out by combining the determined threshold, the judgment can be carried out only by obtaining a smaller time window (for example, 50 ms) in actual use, and the requirement of real-time detection is met.

The above detailed description merely describes preferred embodiments of the present invention and does not limit the scope of the invention. Without departing from the spirit and scope of the present invention, it should be understood that various changes, substitutions and alterations can be made herein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims and their equivalents.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种电子束熔炼钽锭切片装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!