Abstract:To address the issues of low efficiency and high labor costs associated with nighttime inspections in crayfish farming, a lightweight method for identifying crayfish on the bank, termed FAS-YOLOv8n, was proposed based on an improved YOLO v8n architecture. Firstly, to tackle the problem of poor image quality of crayfish captured at night, both RGB and infrared images were collected to integrate multi-source information. Secondly, Ghost convolutions and C2f_Repghost modules were employed in the backbone network of YOLO v8n to reduce the model’s parameter count. Additionally, a deformable attention (DA) mechanism was introduced between the backbone and neck networks to enhance the model’s focus on crayfish and improve feature extraction efficiency. Finally, the VoVGSCSP module replaced the C2f module to accelerate feature fusion in the neck network, further reducing computational load. Experimental results indicated that the improved FAS-YOLOv8n model achieved a recognition accuracy of 90.62% on the integrated image dataset, with mean average precision (mAP) of 92.9% and recall rate of 85%. Compared with the RGB and infrared image datasets, the recognition accuracy, mAP, and recall rate was improved by 6.05 and 8.46, 4.78 and 7.14, and 3.84 and 3.87 percentage points, respectively. When tested on the integrated dataset, the improved FAS-YOLOv8n model demonstrated a 5.1 percentage points increase in mAP over the original model, while reducing parameter count and computational load by 13.29% and 23.17%, respectively. The model size was only 6.2MB, with detection speed of 86 frames per second. Its recognition performance surpassed that of other mainstream object detection models, enabling lightweight deployment and providing technical support for the application of drones in pond inspections.