## 3 Experimental Results and Analysis
### Ablation Experiment  
We performed eight sets of ablation tests to determine the improvement due to each module for the YOLOv8n model's livestock target detection capability. The purpose of these studies was to assess how various module integrations, either separate or in combination, affect the model's overall performance. These tests aimed to ascertain the optimization contributions of each module and their efficacy in enhancing the YOLOv8n model's livestock target identification capabilities. Figure 8: Exemplary detection results comparing YOLOv8n and CCS-YOLOv8 on the common livestock detection dataset from Qinghai. (**A**) The YOLOv8n model misdetects two of the sheep, counting them as four in the densely distributed group, whereas the CCS-YOLOv8 model correctly identifies these sheep targets. (**B**) The YOLOv8n model struggles with missed detections of lambs and repeated detections of sheep, while the CCS-YOLOv8 model effectively avoids these errors. (**C**) The CCS-YOLOv8 model accurately detects a small yak in the distance, a target missed by the YOLOv8n model. Table 2 displays the ablation experiment results. After integrating the small object detection layer, the YOLOv8 model demonstrated improvements in precision, recall, [EMAIL_ADDRESS], [EMAIL_ADDRESS], [EMAIL_ADDRESS]:0.95, and F1-score, achieving 84.9%, 77.9%, 82.7%, 59%, 52.7%, and 80.4%, respectively: marking an enhancement of 1.9%, 3.6%, 4.1%, 5.3%, 3.9%, and 2%, respectively, over the baseline YOLOv8n. This discovery implies that the YOLOv8 network's capacity to acquire livestock's finer details is improved by lowering the receptive field and adding the tiny target detection layer. As a result, the model becomes more effective at reducing missed detections and false detections of small target livestock. The addition of the small object detection layer allows the network to focus on and accurately identify fine details, enabling improved performance for detecting and localizing small livestock instances. Relative to the baseline YOLOv8n, the model's performance is enhanced after incorporating the C2 fCBAM module, with metrics reaching 85.2%, 74.8%, 79.7%, 55.2%, 49.8%, and 79.4% for precision, recall, [EMAIL_ADDRESS], [EMAIL_ADDRESS], [EMAIL_ADDRESS]:0.95, and F1-score, respectively. In particular, the precision was enhanced by 2.2% relative to the baseline. The C2 fCBAM module allows for more precise focusing on the important features within the image. This module enhances the quality and diversity of feature extraction, leading to improved precision in the model's predictions. By selectively attending to relevant image regions, the C2 fCBAM module helps the model capture and emphasize crucial features, resulting in more accurate and precise detection of livestock instances. After integrating the CARAFE operator, the YOLOv8 model exhibits metrics of 82.6%, 76.9%, 79.7%, 55.2%, 50%, and 79.2% in terms of precision, recall, [EMAIL_ADDRESS], [EMAIL_ADDRESS], [EMAIL_ADDRESS]:0.95, and F1-score, respectively. The CARAFE operator demonstrates a notable enhancement in mAP, and recall improved by 2.6%. This signifies that the model can leverage contextual information surrounding the target, which is crucial for understanding the target's background environment. By incorporating contextual information, the model can better analyze the relationships and dependencies between the target and its surroundings. This contextual understanding aids with improving the accuracy of livestock detection by reducing false detections and enhancing the model's ability to discriminate between livestock and other objects or backgrounds. By considering the broader context, the model can make more informed decisions about the presence of livestock based on the surrounding visual cues. This helps to reduce false positives and improve the overall reliability of the model's predictions. The CCS-YOLOv8 model demonstrates the best detection performance.