The proposal and development of Generative Adversarial Networks have provided significant impetus for image generation research.Generating high-quality images and solving model collapse problems have always been important research objectives in the field of image generation.In order to improve the self-attention mechanism,enhance the ability to process image features,make the details of the generated image clearer and more realistic,and at the same time,study and solve the problem of model collapse in the generative model.This article focuses on the mechanism of selfattention and the Generative Adversarial Networks,and applies methods such as relative position encoding,variational gradient method,and mini batch normalization to study the algorithm image generation of Self-attention Generative Adversarial Network(SAGAN).The specific research is as follows:1)The generation effect on some shapes of SAGAN images is not very significant.A twodimensional relative position based self-attention generation adversarial network(2DRP-SAGAN)is proposed,which allows the self-attention mechanism to achieve displacement uniformity by introducing relative position encoding in SAGAN,enhances the representation of image generation details,and improves the generation ability of SAGAN.2)As a response to the problem of model collapse in generative adversarial networks,this article investigates the process of optimizing generative antagonistic networks through optimal transmission theory,and investigates the reasons for the occurrence of model collapse.It proposes a variable gradient descent algorithm to eliminate the problem of model collapse.3)In order to verify the effectiveness of the improved algorithm,this article trained different networks on the public dataset Celeb A and compared the results generated by using evaluation indicators IS and FID.The final experimental results show that the quality of self attention generation and network generated images based on two-dimensional relative positions is the best,and the improved model can generate high-quality images while avoiding model collapse issues.In summary,this article enhances the image generation ability of the network by adding twodimensional relative position encoding,investigates the reasons for model collapse during GAN generation adversarial processes.By generating adversarial processes from GAN,the cause of model collapse is studied,and a gradient descent algorithm based on variational methods is introduced to solve the problem of model collapse. |