Abstract A method for lightweight grain detection under transmission electron microscopy is proposed to address the issues of inadequate detection accuracy, slow speed, and high resource consumption, utilizing an improved YOLOv8. The approach involves substituting YOLOv8’s backbone structure with Mobilenetv3small, reducing model complexity while maintaining accuracy. Additionally, GsConv modules are applied to the feature enhancement network to optimize grain recognition and positioning. Experimental results show that the accuracy of the enhanced YOLOv8 reaches 97.4%, with a 66% reduction in parameters and a 70.7% decrease in computational demand, fulfilling the requirements for a lightweight experimental deployment.