A fabric material recognition method based on spatially partitioned attention
To achieve high-precision identification of fabric materials,reduce identification time,and improve production efficiency,it is of great significance to develop a system capable of accurately distinguishing between various fabric types.In this paper,we proposed a fabric material recognition network that incorporates spatial segmentation attention.We utilized the pre-trained DenseNet121 network for experimental dataset selection and combined depthwise separable convolution(DSC)with the spatial partitioned attention module(SPAM)to create a network structure that fulfills the demands of swift recognition and high precision.To obtain the best performance of the network,the dataset was preprocessed by color weakening,data augmentation and region division.We collected a series of fabric images with temporal sequence information from videos showing fabrics being blown by the wind.The RGB values of critical regions were weighted and recalibrated,and random perturbations,flips,and translations were applied to the images,enhancing clarity in critical regions while suppressing irrelevant ones.The Euclidean distance was used to calculate the displacement amount around the same pixel time of the fabric image,and the image region was divided into wrinkled area and flat areas.We obtained 6,000 grayscale images of 224x224 pixels,with 1,000 fabric images per class across six categories.We constructed the proposed mixed depthwise separable convolutional neural network(MDW-CNN)using Python.Firstly,the fabric video was segmented to obtain the fabric image for data preprocessing.Then,the improved convolutional neural network was used for feature extraction,and the ordinary convolution was replaced by the DSC,which enhanced the ability of the network to extract features and reduced the network parameters and calculation.Secondly,SPAM was introduced after each convolutional layer to enhance the saliency features,prevent the loss of too much information of the feature map,and improve the accuracy of the network.Finally,fabric material recognition was achieved through the global average pooling layer and the softmax layer.The 224 px×224 px fabric image was used to complete the experiment on the Intel processor,and the CNN+LSTM,Timesformer,two-stream network,ViViT,YOLOv5,YOLOv8 and the network proposed in this paper were compared.The results show that the proposed MDW-CNN can maintain good recognition accuracy while ensuring a low number of parameters.The network proposed in this study shows strong performance in fabric material recognition,achieving a recognition accuracy of 93.9%.Regarding network parameters,the proposed method reduced them by 3.3%,48.5%,56.7%,29.3%,26.1%,and 12.7%when compared with CNN+LSTM,Timesformer,the two-stream network,ViViT,YOLOv5,and YOLOv8,respectively.In this study,the improved convolutional network method has been applied to the task of fabric recognition.Experimental results indicate that the improved network offers faster detection speeds,significantly reduces the number of network parameters,achieves a recognition accuracy of 93.9%,and has a detection time of 83.14 ms for a single image.Thus,it achieves real-time performance while maintaining high recognition accuracy.