In modern intensive pig farming, precise recognition of piglet behavior is essential for assessing growth and enhancing animal welfare; however, existing research largely focuses on adult pigs, lacking detailed classification for piglets, while traditional detection models face challenges in real-world farming environments due to large model parameters and high computational complexity. To overcome these limitations, this paper proposes a lightweight multi-behavior detection model for piglets based on YOLOv8, designed to recognize eight behaviors (Lying, Kneeling, Standing, Drinking, Suckling, Trampling, Hitting and Biting ear). Firstly, GhostNet is employed to replace the original backbone of YOLOv8, simplifying the architecture while improving detection speed, and the FasterNet Block, integrated with an efficient multi-scale attention (EMA) mechanism, is embedded into the C2f module to effectively facilitate the feature fusion process through enhanced feature extraction. Additionally, an efficient lightweight multi-path detection head (ELMD) is utilized to reduce computational complexity through parallel structures and shared convolutional parameters. Experimental results indicate that the improved model significantly outperforms the original YOLOv8n model, achieving a 2.5 % increase in precision, a 1.5 % improvement in mean average precision(mAP), a 9.1 ms reduction in inference latency, and a 59.1 % decrease in parameter count, resulting in a final model size of 3.6 MB. Compared to mainstream detection models like SSD, RT-DETR, Faster R-CNN, YOLOv5n, YOLOv7-tiny, and YOLOv10n, our improved model exhibits superior performance with a precision of 82.7 %, mAP of 78.5 % with 1.23M Parameters and 3.9G FLOPs, demonstrating its efficiency, accuracy, and lightweight design. To validate the improved YOLOv8 model's effectiveness on edge devices, the proposed model was deployed on the NVIDIA Jetson Orin NX platform, and its performance metrics were analyzed to assess its efficiency in recognizing multiple piglet behaviors. Finally, with TensorRT acceleration on the Jetson Orin NX platform, the average inference time per image reached 15.8 ms. This study offers a feasible solution for intelligent monitoring in intensive pig farming.