| In manufacturing process,machine vision detection methods are used to address low detection efficiency,improve detection accuracy and save labor resource.In this thesis,a surface roughness detection method bassed on convolutional neural networks(CNNs)is proposed to detect milled surface roughness.The reaserch details are as follow:1.Collecting workpiece surface roughness images and constructing experimental data sets.The standard roughness sample of milling workpiece was selected as the object of image acquisition,and the four roughness surface images of milling workpiece were obtained by the CCD camera in laboratory.In order to solve the problem of too small number of images and too large size,the original roughness images collected in the experiment are clipped.Then the roughness image after cutting is transformed into grayscale roughness image,so that the image occupation is smaller,which is beneficial to realize efficient training of network model.The preprocessed workpiece surface roughness image was divided into 70% training set and 30% test set as the experimental data set of Dense Net network model roughness image.2.DenseNet model was used to detect workpiece surface roughness DenseNet121 network model is used as the basic model to detect workpiece surface roughness.When constructing the DenseNet121 network model,the linear rectification function is selected as the activation function of the model,and the batch normalization method is selected as the optimization function of the model.In the training stage of DenseNet121 network model,the roughness image training set is used to train the model.After the model was trained,the roughness image test set was input into the Dense Net121 network model to test the detection performance of the model on the roughness image data set.3.The improved DenseNet model was used to detect the workpiece surface roughness.Aiming at the problem of redundant parameters and long training time of the original DenseNet network model,the network model was pruned by combining the attention mechanism of convolution layer filter and the scaling coefficient of batch normalized layer.According to the proposed joint pruning method,the characteristic channels corresponding to the redundant parameters in the network can reduce the training time of the Dense Net network model,which is conducive to the fast training of the model.The attention mechanism of the convolutional layer filter and the scale coefficient of the batch normalized layer were introduced into the dense connection module of the original Dense Net network model.The importance of the feature channel of the network model was determined according to the value of the attention mechanism of the convolutional layer and the scale coefficient,and the network model was pruned.The network model after pruning is trained by the training set of roughness image experimental data set,and the surface roughness of workpiece is detected by the trained Dense Net network model.According to the theoretical analysis and experimental results,the improved Dense Net detection model proposed in this thesis has achieved great performance gain,reduced detection time cost and increased detection accuracy to some extent. |