Research on the fabric defect detection algorithm based on semantic segmentation
Defect detection is an important link for textile enterprises to improve product quality.The fabric with defects cannot be used in production,which greatly reduces the production efficiency of the factory.At present,the detection of fabric defects in most enterprises in China is still mainly based on manual visual inspection.With the extension of working hours,human function is limited,human eyes are tired,defects will be missed and misjudged,and the objectivity is poor and the detection efficiency is low.Affected by physiology,psychology and external environment,it will have an important impact on the health of testers.As there are many kinds of fabrics and the types,sizes and shapes of defects are different,it is impossible to meet the requirements of factory production efficiency and detection accuracy only by manual visual inspection.Therefore,intelligent inspection is introduced into the factory and gradually replaces manual visual inspection.Fabric defect detection has become a research hotspot.Convolutional neural network and algorithm research have a significant effect on defect detection,while the reasonable collection of data sets is a big problem.There are many kinds of fabric textures and fibers,and fabric defects account for a small proportion relative to the pixels of the whole image,usually between 0.5%and 15%,so it is impossible to achieve a balanced proportion of pixels.Due to the uneven data classification in the data set,the detection accuracy cannot be further improved.Many scholars have designed different neural networks to detect defects,such as U-net and ResNet50.The accuracy rate can reach 95%for fabric defects with large pixels,such as broken warp and weft,but only 80%for defects with small pixels,such as holes and stains,and the effect is not good.The imbalance of data types in data sets is very common,including defects with large pixel ratio and defects with small pixel ratio.The network needs to be adjusted to improve the detection accuracy of small-category defects.To solve the problem of imbalanced data classification and improve the accuracy of small-category defect detection,we put forward a CS model network designed on the basis of Resnet and U-net network structure,and adds MSCA attention mechanism suitable for small-category defect and strip defect feature detection,which makes the network pay more attention to this kind of defects.The multi-class Focal Loss function is introduced into it,which makes the segmentation result more accurate by increasing the weight of small-class defects.The small-scale defects are given a large initial weight and dynamically adjusted to keep it balanced.By adjusting the parameters of Focal loss function,mIoU,Acc and Loss values are used as experimental evaluation indicators to compare the experimental results,and CS model is compared with the semantic segmentation models of U-net,ResNet50,DeepLabV3 and VGG16 networks,respectively.The experimental results show that the detection accuracy ofthe CS model network model proposed in this study is improved by 2.97%compared with U-net,7.89%compared with mIoU,3.86%compared with ResNet50,and 6.98%compared with mIoU,all of which have been significantly improved,and the problems of uneven classification of data categories and detection accuracy of small-category defects in data sets have been solved.The research results can provide reference suggestions for fabric defect detection research.
MSCA attention mechanismimage semantic segmentationmulticlass loss functiondefects detectionneural network