The control process of welding requires manual operations, and this consumes time. Robot classifier can help by automatic detection of welding defect and by taking rapid actions to correct in situ the defect. This paper presents a convolutional neural network (CNN) model developed to classify the welding defect like splash, twisty, overlap, edge and copper adhesion based on machine vision. Using a resistance spot welding (RSW) dataset the CNN model was trained and evaluated to achieve the best performance. The batch size was varied to quantify its effect on the precision of the model. The model can predict the type of welding surface by confidence of 99.86%.