Summary of the invention
The present invention is directed to the deficiency of existing welding quality inspection technology, proposes a kind of weld seam based on convolutional neural networks
The method of quality testing screening.By acquiring face of weld image, quality analysis is carried out to weld seam, screens matter based on the analysis results
Measure underproof weldment.
In order to achieve the above object, technical solution provided by the invention is a kind of face of weld based on convolutional neural networks
Quality determining method, including following steps: Image Acquisition, weldquality analysis, testing result processing.
One, Image Acquisition: being realized using high-resolution industry camera, has scanning, the typing function of welding point image
Can, it realizes pad Image Acquisition and is transferred to the function of quality analysis module, record acquisition time mark function and weldment
Information record function.
Two, weldqualities analysis: weldquality analysis the following steps are included:
Step 1, welded seam area positioning capturing is carried out to image to be detected: welded seam area is carried out using convolutional neural networks
Positioning is captured, is positioned by rectangle frame and extracts weld inspection region, then the welded seam area image detected is pre-processed,
And the quality testing analysis module that pre-processed results are sent into step 2 tests and analyzes weldquality.
Step 2, quality testing is carried out to the pad region captured, judges whether weld seam to be detected is qualified.To guarantee
The clarity of welded seam area amplifies the pad region captured with cubic spline interpolation.The weldering that will be previously detected
After connecing region amplification, welding quality inspection is carried out by convolutional neural networks to the region.To a large amount of pad samples and non-weldering
Detection model training is carried out after the pretreatment of contact sample data, and (training normal weld sample and abnormal weld seam sample are each in this example
12500 are used for quality testing model).Specifically:
Step 2.1, the training of convolutional neural networks.It, will be by pre- place under the tensorflow frame of Ubuntu system
12500 normal weld images of reason and 12500 abnormal weld image data are divided into training set, training set label, test set,
Test set label.Using back propagation learning algorithm and stochastic gradient descent method.According to the big of the loss value of propagated forward
Small, Lai Jinhang backpropagation iteration updates each layer of convolutional neural networks of weight.Until the loss value of model is intended to restrain
When, indicate that model training is completed.
Step 2.2, the feature extraction of weld image.Every piece image in data set is input to described in back
In convolutional neural networks, according to above-mentioned trained detection model, weld image feature under the model is extracted, model
Layer second from the bottom obtains the feature of the image using full process of convolution.
Step 2.3, the identification of weld image.A weld image to be sorted is given, trained depth is input to
It practises in model, obtains feature of the image under convolutional neural networks, and use classifier pair in the last layer of network model
Image carries out quality testing.
The processing of three, testing results: testing result processing module includes: data memory module, data disaply moudle, weldment report
Alert screening module, abnormal data memory module.
Beneficial effects of the present invention:
The beneficial effects of the present invention are convolutional neural networks to carry out welding quality analysis to weld image, avoids existing
Cumbersome detecting step in method, and positioning capturing can be carried out to welded seam area automatically.Furthermore display module of the invention
Quality testing can be monitored in real time and warning reminding.
Specific implementation:
One, Image Acquisition
Pad image capture module realized using existing high-resolution camera, have welding point image scanning,
Input function realizes pad Image Acquisition and is transferred to the function of quality analysis module, record acquisition time mark function with
And weldment information record function.
Image acquisition device completes the pad information acquired after acquisition to the transmission of quality analysis module, including pad
Image, image acquisition time and weldment labelled notation.
Weld point image point folding: such as the surface pores of pad, undercut, overlap, burn-through and face of weld crackle, weld seam ruler
Very little deviation etc..It, must be clean by the splash and dirt removal of surrounding near weld seam before Image Acquisition.
The analysis of two, weldqualities
Weldquality analysis the following steps are included:
Step 1, detection welded seam area positioning capturing is carried out to image to be detected:
Capture positioning is carried out to welded seam area using convolutional neural networks, is positioned by rectangle frame and extracts weld seam detection area
Then domain pre-processes the welded seam area image detected, and result is sent into quality testing analysis module to weld seam matter
Amount is tested and analyzed.
The step of design of convolutional neural networks shown in Fig. 2:
Convolutional layer: navigating to target area in order to detect, first using the convolutional layer+active coating+pond on one group of basis
Change the characteristic pattern that layer extracts image.This feature figure be shared for subsequent RPN (Region Proposal Networks) layer and
Full articulamentum.All convolutional layers are all: convolution kernel is having a size of 3, framing mask 1.All pond layers are all: convolution kernel ruler
Very little is 2, and convolution kernel moving step length is 2.
Fig. 3 show RPN (Region Proposal Networks) layer, and RPN network is for generating alternative target detection
Region.The layer judges that regional ensemble belongs to target prospect or background by softmax, and frame recurrenceization is recycled to correct area
Domain set obtains accurate alternative target region.
The generation of regional ensemble: being as unit of super-pixel, frame favored area is that super-pixel each of divides super picture
Plain region and super-pixel critical zone obtain regional ensemble by super-pixel region and super-pixel critical zone, can so subtract
Few calculation amount.
Rectangle frame adjustment criteria: it is diffused or shrinks according to the Critical Matrices of super-pixel.The size of rectangle frame to be selected is
Generate maximum rectangle frame shared by super-pixel or super-pixel group.
Frame sliding: the image traversal based on breadth First.According to traverse path, slider box selects frame, slides every time all
Guarantee that rectangle frame region is the maximum rectangular area of current super-pixel covering.
Frame is adjusted: based on adjacent super-pixel maximum comparability max (si) carry out super-pixel merging adjusting
Merge rule: calculating super-pixel similarity: si=d (xi, yi) wherein siSuper-pixel x is covered for rectangleiWith adjacent super
Pixel yiSimilarity, be adopted as rectangle covering super-pixel xiWith adjacent super-pixel yiEuclidean distance indicate.Merge critical super picture
The maximum super-pixel of similarity forms new super-pixel region in element.Rectangular shaped rim is the maximum square of new super-pixel region overlay
Shape region.
Frame quality evaluation IOU (Intersection-over-Union) value calculate: using marking area testing result with
Intersection between standard results label is the same as the value in the union between marking area testing result and standard results as IOU.
Target area judgement: calculate whether the region detected is target area using the characteristic pattern for detecting region, together
Shi Zaici adjusts frame region and obtains the final exact position of detection block.
Be illustrated in figure 4 to capture treat welded seam area carry out quality testing and judge weld seam whether He Ge process.
Input is weld image to be detected, obtains the spy of image by trained depth convolutional neural networks model extraction
Sign, classifies according to weldquality classification, last output category result.
For the clarity for guaranteeing welded seam area, the welded seam area captured is amplified with cubic spline interpolation, previously
After the doubtful welded seam area amplification detected, welding quality inspection is carried out by convolutional neural networks to the region.By to big
(the normal weld sample trained in the present embodiment is trained after amount normal weld sample and the pretreatment of improper weld seam sample data
This is used for quality testing model with each 12500, improper weld seam sample).
(1) the design module of convolutional neural networks
If Fig. 5 is the convolutional neural networks model that the present invention designs, by input layer, hidden layer, output layer is formed:
A. input layer
Input layer is the weld image that data weld seam captures localization region.
B. hidden layer
Convolutional layer: successively choosing convolution kernel is 3*3, and the convolutional layer of 1*1, each layer of port number be identical as input layer.
Activation primitive:Wherein x indicates characteristic pattern to be activated in each layer.
Pond layer: using the convolution kernel of 2*2, maximum Chi Huacao is carried out to the output after convolution operation after convolutional layer
Make.
C. output layer
The full convolutional layer connection of the last one of output layer and hidden layer, the dimension of output is two, and each dimension indicates normal
The probability of weld image and abnormal weld image.
Including 6 groups of convolutional layers, 1 group of full articulamentum;In preceding 4 groups of convolutional layers each group include convolution kernel be 3*3 convolutional layer,
Active coating and pond layer.Two groups are convolutional layer that convolution kernel is 1*1 afterwards.Last full articulamentum is that welding quality inspection result is defeated
Out.
(2) training of convolutional neural networks
Under the tensorflow frame of Ubuntu system, will by pretreated 12500 normal weld images and
The processing image data of 12500 abnormal weld seams is divided into training set, training set label, test set, test set label.Using reversed
Propagate learning algorithm and stochastic gradient descent method.According to the size of the loss value of propagated forward, Lai Jinhang backpropagation iteration
Update each layer of convolutional neural networks of weight.When the loss value of model is intended to convergence, indicate that model training is complete
At.
(3) feature extraction of weld image
Every piece image in data set is input in convolutional neural networks described in back, has been instructed according to above-mentioned
The detection model perfected extracts the feature of weld image under the model, is obtained by the full convolutional layer of layer second from the bottom.
(4) identification of weld image
A weld point image to be sorted is given, is input in the trained convolutional neural networks model of the present invention, obtains
Feature under the convolutional neural networks model of image, and quality testing is carried out to image in the last layer.
Three, result treatments
Data result processing includes: data storage, and data are shown, weldment alarm screening, abnormal data storage.
Data storage: it is used to store image capture module acquired image data by memory module and data are analyzed
The output data of module, each data include: weldquality analysis as a result, image acquisition time, weldment marker number.
Data are shown: the data by reading memory module, display weld seam detection result in image acquisition time axis
Trend.When there are unqualified solder joint data, display detection abnormal alarm.
Abnormal data storage: Abnormal welding point data are stored by abnormal data memory module, each data include: residual
Weldment number, image acquisition time, quality measurements where secondary weld seam.
The screening alarm of four, weldments
When quality measurements are lower than normality threshold, following steps are executed:
1. storing weldment information and testing result to abnormal data memory module
2. sending abnormal signal to alarm system, alarm is triggered, display module shows abnormal data and alarms.
3. according to the abnormal results information flag defect ware weldment detected.
4. being screened according to abnormal data defect ware weldment.
The series of detailed descriptions listed above only for feasible embodiment of the invention specifically
Protection scope bright, that they are not intended to limit the invention, it is all without departing from equivalent implementations made by technical spirit of the present invention
Or change should all be included in the protection scope of the present invention.