In order to effectively achieve the quality classification of sunflower seeds based on appearance identification in production scenarios, a multi-objective sunflower seed classification method based on a self-attention mechanism was proposed in this paper, which achieves the classification of sunflower seed object images with an accuracy of 94.71% by using a Multi-Head Self-attention mechanism to focus on the classification objects on the basis of effectively extracting context-dependent information from sunflower seed images. However, visualization experiments found that the model's attention could not effectively focus on the class activated regions of the image, resulting in a model that was heavily influenced by background noise and suffered from such defects as high computational cost and large model size. To address the above problems, a self-attention Focusing algorithm was proposed in this paper by evaluating and reconstructing the connections in the attention weight matrix, pruning the less influential connections, and realizing the update of the attention score, which gradually focuses attention on the class activated regions in continuous iterations, effectively shielding the background noise. Experiments have shown that applying the Focusing algorithm improves the accuracy rate to 96.6% based on a 34.3% reduction in the number of model parameters. Model accuracy was successfully improved while achieving model lightweighting, and the model was made more resistant to background noise due to the focused attention region. The self-attention Focusing algorithm's effectiveness in improving accuracy, focusing attention, and compressing model size is demonstrated. In practical production scenarios, it can be used as a popular application of key techniques for sunflower seed classification.