Accurate real-time fish fry counting is critical in aquaculture to optimize feeding strategies and enhance farming efficiency. However, traditional counting methods face significant limitations due to overlapping high-density fish schools, complex backgrounds, and real-time requirements. To address this challenge, this study proposes an automated fish fry counting method based on an enhanced YOLOv8s model. The study incorporates a Channel Prior Convolution Attention (CPCA) mechanism into the backbone network, dynamically allocating attention weights across both channel and spatial dimensions to enhance feature extraction and target recognition. Additionally, the lightweight counting detection head (EffiCount Head) is designed by integrating coupling design and partial convolution techniques to reduce model complexity and improve inference speed. The results show that the enhanced model achieves a mAP of 98.2% in fish fry counting, a 4.0% improvement over the original model. The model also reduces the number of parameters by 13.6% and increases inference speed by 15.8%. This method demonstrates high precision and robustness in complex backgrounds and high-density scenarios, enabling efficient real-time fish fry counting and significantly improving aquaculture productivity.