AUTHOR=Cheng Kai TITLE=Prediction of emotion distribution of images based on weighted K-nearest neighbor-attention mechanism JOURNAL=Frontiers in Computational Neuroscience VOLUME=Volume 18 - 2024 YEAR=2024 URL=https://www.frontiersin.org/journals/computational-neuroscience/articles/10.3389/fncom.2024.1350916 DOI=10.3389/fncom.2024.1350916 ISSN=1662-5188 ABSTRACT=The objective feelings of observers on image emotions are mostly ignored by the existing methods for classifying image emotions. Instead, they concentrate primarily on predicting the categories of image emotions. Therefore, it is impossible to satisfy practical needs by solely categorising an image's emotion. In this study, we provide a novel approach that uses the weighted closest neighbour algorithm to predict the discrete emotion distribution of each image in an abstract painting. Firstly, the emotional features of the images are extracted and different K values are tried. Secondly, an encoder-decoder architecture is used to extract the sentiment features of abstract paintings and a pretrained model is introduced to improve the generalization performance of the classification model so as to speed up the convergence of sentiment classification of abstract paintings with small samples.Finally, a blank attention mechanism is added to the decoder, and the encoder's output sequence is combined with it. The semantics of the abstract painting image may be learned by the decoding learning mechanism of the decoder, which helps to increase the learning ability of the abstract painting's emotion more precisely and sensibly. The experiment demonstrates that the classification algorithm based on the attention mechanism has a higher classification accuracy compared to the current methods, reaching 80.7% classification accuracy, and successfully solves the problem of the rich and challenging to distinguish the emotions of abstract paintings.