Intensively farmed animals such as pigs inevitably experience a certain degree of psychological stress, which leads to a reduction in production performance. Mental health traits are currently difficult to measure, resulting in a gap in understanding their genetic basis. To address this challenge, we propose a computational framework called mental health of animals (MeHA), capable of revealing genes related to animal mental health traits. Using MeHA, we identified 109 candidate genes associated with pig mental health and discovered their intricate connections with critical functions, such as memory, cognition, and neural development, which are essential components of mental health and cognitive performance. Importantly, our findings provide evidence of the potential impact of these genes on economically important traits, including meat quality and piglet survival. This research underscores the importance of genetic studies in enhancing our understanding of animal behavior and cognition, as well as promoting agricultural practices. By applying our approach to study the genetic basis of mental health in pigs as a case, we confirmed that our framework is an effective way to reveal genetic factors affecting animal mental health traits, which contributes to animal welfare and has potential implications for understanding human mental disorders.
Complex farming environments, breed variation, and the high cost of manual annotation remain major obstacles to robust pig detection, while cross-breed detection under few-shot conditions has been insufficiently explored in previous studies. To address this gap, we propose a few-shot pig detection framework that combines an improved YOLOv7 detector with CycleGAN-based pseudo-sample generation. The detector was enhanced through anchor optimization, Efficient Channel Attention (ECA), and Log-Sum-Exp (LSE) pooling to improve localization and feature discrimination in dense pigsty scenes. In addition, an optimized CycleGAN with perceptual loss was used to generate synthetic Duroc-like pig images to enrich the limited target-domain training set. The framework was evaluated using a two-dataset design: a White Pig Base Dataset was used to establish the source-domain detector and validate the architectural improvements, whereas a Duroc Pig Few-Shot Dataset was used to assess cross-breed adaptation under a 10-shot setting. The experimental results show that the proposed method achieved 98.16% mAP on the White pig dataset and 85.52% mAP on the Duroc Few-Shot Dataset. On the Duroc Few-Shot Dataset, the final framework outperformed Faster R-CNN, CenterNet, and YOLOv8, and also surpassed DCGAN- and SRGAN-based augmentation strategies. These results indicate that the proposed method provides an effective and practical solution for cross-breed few-shot pig detection, with potential value for intelligent livestock monitoring under annotation-limited conditions.