The surfaces of castings often have defects like dark hole,shallow pits,crack,bulge and depression.These defects not only weaken the strength of the casting but also cause structural deformation,which lead to a safety hazard.At present,traditional detection methods have been difficult to meet industrial demands due to high cost,low efficiency,and strong artificial dependence.In this study,we proposes a depth learning based casting defect detection algorithm to achieve better detection results.In order to preserve the defect features as much as possible,we use a 5 megapixel industrial camera to capture images of 2566*1940 pixels.The algorithm is mainly divided into two parts:Firstly,we train a YOLO network to find the area to be detected from the original image,segment the area image and adjust it to 256*256 pixels.We then used an improved ResNet-50 network to identify the resulting image and determine if it was defective.In order to improve the detection accuracy,we made two improvements to the ResNet-50 network: 1.We proposed the ASoftReLU function to replace the traditional ReLU activation function,which avoids neuronal death and further improves the training speed and classification accuracy of the network.2.We designed a multi-channel convolutional neural network to combine data expansion with image feature enhancement to consolidate the essential features of the image during training and enhance the anti-jamming capability of the network.To verify the effectiveness of the algorithm,three sets of experiments were carried out on the TensorFlow platform to build a neural network.The last set of experiments was the final result of the algorithm.The results of the experiment have two judgment indicators: 1.Whether there is a defect;2.The category of the defect.According to the experimental results,the improved algorithm achieves 98.2% training set accuracy and 94.3% test set accuracy in the task of determining whether there is a defect.For the determination of defect categories,the algorithm achieved 88.2% accuracy on the test set.Both tasks achieved good accuracy,indicating that the improved network has good detection ability. |