WDXI: The Dataset of X-Ray Image For Weld Defects: Wenming Guo, Huifan Qu Lihong Liang
WDXI: The Dataset of X-Ray Image For Weld Defects: Wenming Guo, Huifan Qu Lihong Liang
1052
and then calculate the maximum point from this sequence,
select the closest point to the 375-pixel central axis, and crop
the 200-pixel rectangular areas on the left and right sides. The
mean line chart is shown in Figure 2.
If the point is too far away from the standard center weld
center axis, the rectangular area with the size of
Figure 3. 8 example result, each pair is a sample result, the original image is
on the left and the cropped image is on the right.
c) [175:575, 0: h] is cropped as the final result. 8
example results randomly chosen by us are shown in Figure 3.
slag is recorded as slag. Some weld images do not have the After the image is cut well, we use Gaussian blur to reduce
corresponding test report. And we also collected it back as image noise. Images are saved in 16-bit TIF format, of which
unlabeled data. One image corresponds to a type of defect, 12 valid data range, 4096 gray levels entirely. The normal
except 200 of which have multiple defects. Each image is display can't display all gray levels, only can display 256 gray
marked with a serial number, and each image has a record levels. And often the weld defects are not easy to see directly,
corresponding. their grayscale range and background grayscale range are very
similar. Here we use the window width window level method
C. Image Preprocessing to adjust the image to makes the defects clearer. For example,
Professional film reproducer transforms the file into digital if the selected window width is W and the window level is L,
image. There will be a blank area on each side of the image. The gray scale between W f L will be displayed. All the
During the ray inspection, numbers, letters, and arrows were grayscale values smaller than the W-L range are set to 0, and
manually placed to identify the weld number and useful space. the grayscale values larger than the W + L range is set to 255.
Our primary concern is the weld area. Trimming numbers and The remaining gray value linearly converted to 0 ~ 255 range.
arrows will increase the effective area ratio. Due to a large Window width window effect is shown in Figure 4.
number of images, the artificial cut does not work efficiently.
And we collect the weld images are vertical as shown in Figure III. MODEL
1. Based on this, we designed a set of tailoring methods for Our model will deal with a multi-classification problem,
automatic tailoring. which is divided into eight categories: 7 defect types, and no
defects. The model takes each weld image (gray image) as
1) The steps of our tailoring methods are as follows. input, and the neural network will calculate the probability that
a) We extract left and right arrows as a template. Match the image belongs to which class. The maximum value in the
the two arrows in the original image [12]. When the matching selection probability is used as the final prediction category.
similarity is greater than 0.9, the arrow position is adopted. If
there are two match similarity higher than 0.9, choose a point A. Network Detail
with a column coordinate closer to 375 (average weld center Our model uses a convolutional neural network that
axis). Assuming that the width of the image is w, the height is contains a 4-layer convolutional layer. The pooled layer is
h, and the matching point result is (x, y), the rectangular area connected to each convolution layer. The LRN regularization
with the size of [x: x f 400, 0: h] is cropped. layer [13] is connected after the first three pooling layers. The
last layer is a fully connected layer which connected with eight
b) If there is no matching similarity higher than 0.9, We output nodes. We use 40% dropout to prevent overfitting, the
will find the average pixel value for each column in the image, detail of the network structure is shown Table III. Softmax is
1053
TABLE III. NETWORK STRUCTURE C. Results
Type Patch Output size #Params After 100K steps training, we use the test set to measure the
size/stride training results. We finally achieved the top-1 accuracy of
Convolution 5x5/2 200 x 200 x 32 0.8K
46.6% and top-3 accuracy of 77% in the multiclass
Max pool 2x2/2 100 x 100 x 32
LRN
classification of weld defects. Because of the higher signal-to-
Convolution 3x3/2 50 x 50 x 64 18K noise ratio and fewer feature points, the classification accuracy
Max pool2 2x2/2 25 x 25 x 64 is lower than the manual design feature method. In our
LRN previous experiment, a similar network structure was used, but
Convolution 3x3/1 25 x 25 x 128 73K two fully connected layers (384, 192) were used so that the
Max pool 2x2/2 13 x 13 x 128 number of parameters reached 5,000K. At the same time, the
LRN original images were used directly without image enhancement.
Convolution 3x3/1 13 x 13 x 256 294K
The top-1 accuracy was finally around 28% and top-3 accuracy
Avg pool 2x2/2 7 x 7 x 256
Dropout(40%) 7 x 7 x 256
around 53%.
Fc 8 100K For convolutional neural networks, the quality of the data
Total 485K
has a significant influence on the final result. It can be
used to normalize the output. The goal of the final optimization concluded from the previous results that the use of the window
is the cross-entropy loss function. width window level method to enhance the data has resulted in
a specific increase in the final result. The size of the original
L({x, y}1N ) ¦¦ yi( n ) * log( f ( x ( n ) ) i ) image is large, and the defect area occupies a small proportion.
n i
It is difficult to observe defects in the original image. Image
ǂǂǂwhere x is the image and y is the label of the enhancement makes the defect more accessible to be
image. yi(n) represents whether the n-th sample belongs to the i- recognized from the background. In the previous training, there
th category. Its value is 0 or 1. f(x(n))i represents the prediction would be an overfitting phenomenon. A small amount of data
probability of the classification model for the n-th sample cannot drive an extensive network. So we reduce the numbers
image of the i-th category. The prediction probability is the of fully connected layers to one. The number of parameters
output of softmax layer. The probability of prediction for each also decreased significantly.
class adds up to 1. We use the top-1 and top-3 classification
accuracy to measure the result of classification is good or bad. IV. CONCLUSION
B. Training Detail This paper introduces an utterly new weld defect image
The proportion of samples between classes and classes is an data set WDXI. Based on this data set, a convolutional neural
imbalance. The ratio between round defects and no defects network model was designed for defect classification tasks.
reaches 70:1. This imbalance will lead to a decrease in the final The use of template matching in image preprocessing
accuracy [14]. We extracted 1000 examples from each class as automatically removes the numbers and arrows in the image.
a training set, extracted 200 samples from each type as the Keep the weld area in the original picture. The window width
validation set, and extracted 200 samples of each kind as the window level method was used to enhance the image, making
test set. the defect more visible. Finally, the model achieved a top-1
accuracy of 46.6% on the task of identifying weld defect types.
Use the over-sampling method for categories with WDXI data set will be available for academic and research
insufficient sample sizes and use under-sampling for samples purposes.
that exceed the number of samples. Training sets, validation
sets, and test sets do not overlap each other. Finally, there are In this paper, the prediction accuracy of the model is not
8000 samples for the training set, 1600 samples for validation very high. To improve the accuracy of model prediction and
set, and 1600 samples for the test set. the quality of data sets, future work can be divided into the
following sections. First, because there are too few positive
All images were normalized before training. Linearly scales examples in the data set, it is impossible to build models to
the image to have zero mean and unit norm. Randomly flip left predict whether there are defects or nor. We need to collect
and right for each image. We then scaled the variable-sized more positive examples to enrich the dataset. Second, all the
image to 400 * 400. negatives are not illuminated under the same conditions, and
We use a Gaussian distribution to initialize the weights in the gray-scale distribution is not the same. At present, the
the network. The initial learning rate is 0.005, learning rate parameters of the window width window level method are set
decay factor is 0.1. We use the Adam algorithm to optimize the in batches. It is necessary to build a model of automatic
learning parameters to enhance each image more precisely.
loss function with £1 = 0.9, £2 = 0.999. The batch size is set
Third, the proportion of defective areas after image scaling is
to 8. We validated after each epoch and finally chose the model tiny, and a significant amount of detail lost. If we can directly
with the highest accuracy. extract the defect area, we can reduce the size of the image
We build the model based on the tensorflow platform. Our while retaining more information of the defect. In the future,
experimental platform is equipped with two CPU (Intel Xeon we will make more efforts to improve the quality of data sets
E5-2620 2.10GHz), 64GB of memory and graphics card is and improve classification accuracy.
Quadro M2000.
ACKNOWLEDGMENT
1054
This research was supported by the National key foundation [7] Zapata, Juan, R. Vilar, and R. Ruiz. "Automatic Inspection System of
for exploring scientific instrument of China (Project Welding Radiographic Images Based on ANN Under a Regularisation
Process." Journal of Nondestructive Evaluation 31.1(2012):34-45.
No.2013YQ240803).
[8] Abouelatta, Ossama, et al. "Classification of Welding Defects Using
Gray Level Histogram Techniques via Neural Network." 39(2014):M1-
REFERENCES M13.
[1] GB/T 3323-2005, Radiographic examination of fusion welded joints in [9] Vilar, Rafael, J. Zapata, and R. Ruiz. "An automatic system of
metallic materials. classification of weld defects in radiographic images." Ndt & E
[2] Kasban, H., et al. "Welding defect detection from radiography images International 42.5(2009):467-476.
with a cepstral approach." Ndt & E International 44.2(2011):226-231. [10] Wang, Xin. "Recognition of Welding Defects in Radiographic Images
[3] Mery, D, and M. A. Berti. "Automatic detection of welding defects by Using Support Vector Machine Classifier." Research Journal of
using texture features." Insight - Non-Destructive Testing and Condition Applied Sciences Engineering & Technology 2.3(2010):295-301.
Monitoring 45.10(2003):676-681. [11] Mu, Weilei, et al. "Automatic classification approach to weld defects
[4] Valavanis, Ioannis, and D. Kosmopoulos. "Multiclass defect detection based on PCA and SVM." Insight:Non-Destructive Testing and
and classification in weld radiographic images using geometric and Condition Monitoring 55.10(2013):535-539.
texture features." Expert Systems with Applications 37.12(2010):7606- [12] Hanebeck, Uwe D. "Template matching using fast normalized cross
7614. correlation." Optical Pattern Recognition XII International Society for
[5] Wang, Gang, and T. W. Liao. "Automatic identification of different Optics and Photonics, 2001:95-102.
types of welding defects in radiographic images." Ndt & E International [13] Krizhevsky, Alex, I. Sutskever, and G. E. Hinton. "ImageNet
35.8(2002):519-528. classification with deep convolutional neural networks." International
[6] Kumar, Jayendra, R. S. Anand, and S. P. Srivastava. "Flaws Conference on Neural Information Processing Systems Curran
classification using ANN for radiographic weld images." International Associates Inc. 2012:1097-1105.
Conference on Signal Processing and Integrated Networks IEEE, [14] TMasko, D. & Hensman, P. The impact of imbalanced training data for
2014:145-150. convolutional neural networks. Bachelor thesis, KTH, School of
Computer Science and Communication (2015).
1055