The invention relates to the technical field of industrial automation, in particular to an abnormal image detection method based on a self-attention generative adversarial network, and the method comprises the following specific steps: S1, obtaining a to-be-detected image; S2, inputting an image to be detected into the TransGANormaly, and obtaining an abnormal score; and S3, judging whether the abnormal score is greater than a certain specific threshold value or not. According to the method, a self-attention mechanism is designed and used for replacing convolution operation, so that the defect that the convolution operation can only extract local features can be effectively overcome, feature extraction on a larger scale level is realized, the anomaly detection performance of the model is effectively improved, the problems that normal and abnormal samples need to be used at the same time at present, the application range is limited, a convolutional neural network is used for carrying out feature extraction and coding on an image at present, convolution operation focuses on extraction of local information, grasp of global information is greatly limited, the scale of an abnormal area in an industrial image may be large, and a method based on convolution operation cannot be well applied.