Image recognition of fabric patterns is an important technology in the textile industry.In order to improve the accurate recognition of ethnic fabric pattern images and preserve the digitized pattern information,a fabric pattern image recognition algorithm based on the combination of ResNet50 model and multihead attention mechanism was proposed in this study through the example of Yi fabrics.Firstly,a fabric pattern database was constructed using the images that have been expanded to meet the training requirements,and then the ResNet model was built with the multihead attention mechanism module.The global information of the image obtained by the attention mechanism was used for training.Finally,the GN(Group Normalization)layer was used to calculate the average value of the sample channels,and the model accuracy was acquired as 90.8%,which was 14.8%higher than the ResNet model without the attention mechanism.The method can quickly and accurately identify ethnic fabric pattern images captured or scanned in complex scenes,improving the efficiency of fabric pattern recognition.