First, the welding defects are a consequence of the interactions between the welding variables and the welding trajectory. For your Machine Learning system, you need to train the model with the relation between the values of the variables and the defects. Some defects appear as a consequence of the welding trajectory; you must analyze your process and the influence of the trajectory over the defect's apparition. To train your systems, you could implement an artificial vision system (very complicated) or a system that monitors the welding variables affected by the welding path (like current) in real time. The system will make sense if a robot performs the weldings; otherwise, you will only have a "defect predictor."
I hope this simple idea helps you to start your project.