To address the problem that existing deep learning methods are not sufficiently accurate to detect rice pests with changeable shapes or similar appearances, a self-attention feature fusion model for rice pest detection (SAFFPest) was proposed. The model was based on VarifocalNet. First, a deformable convolution module was added to the feature extraction network, to improve the feature extraction ability of pests with changeable shapes. Second, by obtaining the balance features of multiple feature maps, the self-attention mechanism was introduce...