## 3 Method
### Model Architecture
#### 3.1.2 Chicken Classifier  
After identifying the stationary regions, the classifier determines whether these areas represent chickens by leveraging a combination of deep learning models in a knowledge distillation framework. The EfficientNet [19] model is employed as the teacher model. Pre-trained on ImageNet, EfficientNet-B0 is fine-tuned using a custom dataset containing images of chickens and non-chicken objects captured from the farm environment. It is selected due to its high accuracy, efficiency, and ability to extract detailed features from the input images, providing a robust foundation for training the student model. Its strong performance in feature extraction makes it an ideal teacher model for knowledge distillation. The distilled vision transformer model DeiT-Tiny [20] is used as the student model. DeiT (distilled vision transformer) is a lightweight version of the vision transformer (ViT) designed for resource-constrained environments. Unlike traditional convolutional neural networks, ViT models operate on sequences of image patches, leveraging self-attention mechanisms to capture long-range dependencies in the input data. DeiT improves upon ViT by incorporating a knowledge distillation process during training, allowing it to achieve high accuracy with significantly reduced computational complexity. In DeiT, an additional distillation token is used to directly learn from the teacher model during training, enhancing the student model's performance while retaining its efficiency. The use of a lightweight architecture, combined with the distillation process, enables DeiT-Tiny to deliver competitive classification accuracy with minimal resource requirements, making it suitable for real-time applications in broiler farms. Through the knowledge distillation process [18], which employs a distillation loss function, the model learns to replicate the intricate feature extraction capabilities of the more complex teacher model. This process enables the student model to achieve high accuracy while maintaining a lightweight structure, which is essential for real-time inference, particularly in resource-limited environments like farms. Figure 2: Stationary object detection process. By combining these models, the system ensures that the student model retains the classification accuracy and robust feature extraction of the teacher model while also being computationally efficient enough to perform the real-time detection of dead chickens with minimal hardware requirements. The accuracy of the teacher and the lightweight structure of the student make this combination highly effective for practical deployment in broiler farms. Knowledge distillation is a process in which a lightweight student model is trained to mimic the performance of a larger, more complex teacher model. In this approach, the student model is optimized using both soft targets--the probability distribution outputs from the teacher model--and hard targets, which are the true labels from the dataset. The soft targets provide rich information about the relationships between classes, while the hard targets offer direct supervision. To integrate these two types of learning, a distillation loss function is employed, combining the standard classification loss of the student model with the distillation loss from the teacher model [18]. The overall loss function (\(L\)) can be expressed as follows:  
\[L=\alpha\times L_{\text{CE}}+(1-\alpha)\times L_{\text{KD}} \tag{1}\]  
where \(L_{\text{CE}}\) is the cross-entropy loss between the student model's predictions and the true labels (hard targets). \(L_{\text{KD}}\) is the distillation loss, calculated as the Kullback-Leibler divergence between the teacher and student outputs (soft targets), often modulated by a temperature parameter \(T\) to soften the probabilities. \(\alpha\) is a weighting factor balancing the importance of the classification loss and the distillation loss.