Sunday, October 25, 2026
Science
No Result
View All Result
  • Login
  • HOME
  • SCIENCE NEWS
  • CONTACT US
  • HOME
  • SCIENCE NEWS
  • CONTACT US
No Result
View All Result
Scienmag
No Result
View All Result
Home Science News Agriculture

AI Spots Which Pig Is Coughing in Crowded Pens, Even at Night

October 25, 2026
in Agriculture
Alan Morgan
By Alan Morgan Scienmag Editorial Profile - Precision Agriculture
Reading Time: 6 mins read
0
AI Spots Which Pig Is Coughing in Crowded Pens, Even at Night

AI Spots Which Pig Is Coughing in Crowded Pens, Even at Night

65
SHARES
587
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Respiratory disease remains one of the costliest problems in modern pig production, and one of the hardest to catch early. A new study reports an artificial intelligence system that can do something previous tools could not: watch and listen to a group of pigs and pinpoint exactly which individual is coughing, even in dim nighttime conditions. The method, developed and tested on pigs experimentally infected with the respiratory pathogen Mycoplasma hyopneumoniae (Mhp), combines sound analysis, computer vision and a hierarchical temporal modelling architecture into a single pipeline for identifying coughing animals in group-housed environments.

The economic stakes are considerable. Productivity losses attributable to porcine reproductive and respiratory syndrome virus alone have been estimated to exceed USD 1 billion annually in the United States, with substantial losses also reported on Chinese pig farms. Yet diagnosis of respiratory disease in commercial herds still relies largely on farm inspections, slaughter checks, serology and post-mortem examination of dead animals. These approaches are labour-intensive, expensive, slow, and often applied only after disease has progressed or an animal has died. Contact-based monitoring devices such as ear tags and respiratory belts add cost and stress, limiting large-scale deployment. Coughing, by contrast, is one of the most prevalent and easily observable clinical signs of porcine respiratory disease, making it an attractive target for non-invasive, continuous monitoring.

Earlier cough-sound studies focused mainly on detecting that a cough occurred somewhere in a pig house, without identifying which pen or animal produced it. Sound source localisation techniques mapped coughs to pen-level risk areas but could not distinguish individuals within the same pen. A later audio-visual approach used motion history images to link cough sounds to transient body movements, but relied on handcrafted motion features and threshold-based rules whose robustness in busy group-housed settings remained uncertain. The new work builds on a deep learning multimodal method for coughing pig identification and extends it in three directions: a task-specific architecture for hierarchical audiovisual temporal modelling, a design that decouples the recurrent temporal module from the classification layer, and a dataset featuring low-light nighttime scenes for evaluating performance under both day and night conditions.

The experimental foundation was a 42-day challenge study conducted from August to October 2024 within a Biosafety Level 2 laboratory at the Jiangsu Academy of Agricultural Sciences, approved by the institutional animal care committee. Ten 60-day-old crossbred finishing pigs were split equally between an infected group and a control group, housed in separate but identical pens under controlled conditions of 23 to 28 degrees Celsius and 40 to 70 percent relative humidity, with antibiotic-free feed. Pigs in the experimental group received an intratracheal dose of virulent Mhp suspended in phosphate-buffered saline; controls received saline only. Infection was confirmed serologically: serum Mhp-IgG sample-to-negative ratios in the infected group fell below the 50 percent ELISA threshold on days 28 and 42, and nasal swab Mhp-sIgA sample-to-positive ratios rose above the 0.2 cutoff on day 28, while control animals stayed within negative ranges throughout. Post-mortem examination at day 42 revealed characteristic shrimp-like lung lesions in the infected group and none in controls, and testing ruled out other common swine pathogens.

A high-definition camera mounted roughly two metres above each pen recorded the pigs’ dorsal regions continuously at 25 frames per second. From these recordings, 300 clips showing coughing events were manually segmented, 200 from daytime and 100 from nighttime footage. The pipeline consists of three modules. First, a coughing event detection module based on a sound event detection convolutional recurrent neural network processes log-Mel spectrograms of two-channel audio to locate the onset and offset of coughs and extract acoustic features. Second, a pig object detection module applies YOLO26-OBB, chosen for its oriented bounding boxes that fit pigs’ varied postures and reduce overlap between adjacent animals, to the single frame with the highest cough probability, then crops each pig’s region across the surrounding frames of the event window. Third, a coughing pig identification module fuses the audio features with each candidate pig’s video sequence and decides which animal is actually coughing.

The identification module is where the architectural novelty lies. Cropped pig sequences are converted to grayscale and resized to 112 by 112 pixels before a visual encoder, comprising 3D convolutional layers, a ResNet18 backbone and a video temporal convolutional network, extracts frame-level visual embeddings. Audio and visual features are then combined through channel attention, which concatenates the modalities and generates time-varying channel weights via a one-dimensional convolution, adaptively emphasising informative dimensions while suppressing redundancy. A bidirectional gated recurrent unit (BiGRU) models short-term temporal dynamics in both directions, and an eight-head self-attention mechanism then reweights the temporal features globally to capture dependencies across the whole event. Because the self-attention module receives BiGRU outputs that already encode temporal order, no positional encoding was added. Training used a weighted cross-entropy loss that upweights positive coughing samples, with a positive weight of 2.8 chosen in preliminary experiments, reflecting the fact that in health monitoring a missed diseased pig is costlier than a false alarm that can be checked manually.

The results were strong across the board. In four-fold cross-validation, the coughing event detection module achieved an average frame-level F1 score of 0.88 with an error rate of 0.28, and event-level averages of 0.68 F1, 0.62 precision and 0.75 recall; the best fold, retained for building the audiovisual dataset, reached a frame-level F1 of 0.95. The object detection module attained a mean average precision (mAP) of 0.94 at IoU thresholds of 0.50 to 0.95, detecting all pigs reliably in both daytime and nighttime scenes. Across five independent training runs, the full identification system achieved an average mAP of 0.96, precision of 0.86, recall of 0.92, F1 of 0.89, error rate of 0.23 and video-level accuracy of 0.80, meaning that in most videos the coughing or non-coughing status of every pig was correctly determined.

Notably, performance held up in the dark. Under nighttime low-light conditions the model recorded an mAP of 0.96, precision of 0.92, F1 of 0.90, error rate of 0.19 and video-level accuracy of 0.82, with recall of 0.89. In other words, the model produced fewer false detections at night while slightly missing more coughing instances, with overall performance essentially unchanged. The authors note that the nighttime evaluation involved fewer videos, 24 versus 56 during daytime, which made the metrics somewhat more variable, though the fluctuations remained small. This matters practically because environmental noise and animal activity are typically lower at night and in the early morning, potentially offering a more stable window for health assessment.

Ablation experiments confirmed that each component contributes. Removing the self-attention mechanism caused the error rate to balloon from 0.23 to 0.71, with precision collapsing to 0.64 while recall stayed high, showing that self-attention mainly suppresses false positives arising from non-cough movements and slight audio-visual misalignment. Removing the BiGRU degraded mAP, recall, F1 and video-level accuracy while increasing metric variability, underscoring the value of bidirectional local temporal modelling for coughs of variable duration and ambiguous boundaries. Comparisons against existing methods were also favourable: the proposed model outperformed the earlier coughing pig detection model, LR-ASD and TalkNet-ASD on mAP, recall, F1, error rate and video-level accuracy, while a rule-based motion-history method performed poorly, with precision of 0.17 and F1 of 0.22. Paired t-tests across five runs showed statistically significant advantages in several metrics, including F1, error rate and video-level accuracy against the earlier coughing pig detection model, and recall, F1, error rate and video-level accuracy against LR-ASD, though LR-ASD retained significantly higher precision. Inference takes about 0.0121 seconds per pig sequence on an RTX A6000 GPU, comparable to competing audiovisual models, though the full three-module pipeline needed roughly 14.85 seconds for an 8.68-second video of five pigs.

The authors are candid about the limitations. All data came from two controlled pens in a single BSL-2 laboratory with only ten pigs, so generalisation to commercial farms, different stocking densities and pen configurations remains untested. The random event-level data split, stratified only by day and night, means segments from the same pig or recording day could appear in both training and validation sets, potentially inflating estimates of generalisation; future work will adopt animal-level or temporally blocked splits. Cough labels were annotated by a single researcher without inter-annotator reliability checks, and the identification experiments ran on manually confirmed cough-event segments rather than unfiltered continuous recordings, so the reported metrics do not represent end-to-end performance. Overlapping coughs from multiple pigs, fixed bounding boxes without tracking, and latency dominated by the event detection module all remain open challenges. Even so, the study demonstrates that learned audiovisual temporal modelling can attribute a cough to a specific animal within a crowded pen, day or night, laying groundwork for continuous, non-invasive respiratory disease surveillance in intensive pig production.

Subject of Research: Audiovisual multimodal deep learning for identifying coughing pigs in group-housed environments

Article Title: Coughing pig identification method based on multimodal fusion and hierarchical temporal modelling in group-housed environments

Article References: He, J., Zhuang, Y., Gan, Y., Qiu, F., yang, G., Liu, K., Wu, Y., Zhao, Y., Li, H., Li, J., Li, Q., & Yu, L. (2026). Coughing pig identification method based on multimodal fusion and hierarchical temporal modelling in group-housed environments. Smart Agricultural Technology, 15, Article 102658. https://doi.org/10.1016/j.atech.2026.102658

Image Credits: AI Generated

DOI: 10.1016/j.atech.2026.102658

Keywords: precision livestock farming, swine respiratory disease, Mycoplasma hyopneumoniae, audiovisual fusion, deep learning, cough detection, active speaker detection, animal welfare, nighttime monitoring, BiGRU, self-attention, object detection

Cite Scienmag News

Alan Morgan. (October 25, 2026). AI Spots Which Pig Is Coughing in Crowded Pens, Even at Night. Scienmag. https://scienmag.com/ai-spots-which-pig-is-coughing-in-crowded-pens-even-at-night/

Alan Morgan. "AI Spots Which Pig Is Coughing in Crowded Pens, Even at Night." Scienmag, 25 October 2026, https://scienmag.com/ai-spots-which-pig-is-coughing-in-crowded-pens-even-at-night/. Accessed 25 October 2026.

Alan Morgan. "AI Spots Which Pig Is Coughing in Crowded Pens, Even at Night." Scienmag. October 25, 2026. https://scienmag.com/ai-spots-which-pig-is-coughing-in-crowded-pens-even-at-night/

Tags: active speaker detectionAI system for identifying coughing pigsAI-based pig coughing detectionAI-driven solutions for large-scale pig farm healthanimal welfareaudiovisual fusionBiGRUcomputer vision for livestock healthcost-effective livestock disease management toolscough detectiondeep learningearly detection of porcine respiratory diseaseshierarchical temporal modeling in animal disease detectionimpact of Mycoplasma hyopneumoniae on pig productionMycoplasma hyopneumoniaenighttime monitoringnighttime pig health monitoring technologynon-invasive monitoring of pig respiratory healthobject detectionPrecision Livestock Farmingrespiratory disease monitoring in pig farmsself-attentionsound analysis for pig health assessmentswine respiratory disease
Share26Tweet16
Previous Post

Extreme rainfall remobilizes mining tailings metals and stresses coastal Restinga plants

Next Post

Baker’s yeast turns benzaldehyde into a chiral building block in student lab

Related Posts

Extreme rainfall remobilizes mining tailings metals and stresses coastal Restinga plants
Agriculture

Extreme rainfall remobilizes mining tailings metals and stresses coastal Restinga plants

October 25, 2026
Mixing Selection Tools Beats Standard Breeding in Simulated Oat and Wheat Programs
Agriculture

Mixing Selection Tools Beats Standard Breeding in Simulated Oat and Wheat Programs

October 25, 2026
Knockout study links PP2 to phloem defense against viroid and virus
Agriculture

Knockout study links PP2 to phloem defense against viroid and virus

October 25, 2026
Precision priming, not spraying, may unlock salicylic acid for crops
Agriculture

Precision priming, not spraying, may unlock salicylic acid for crops

October 25, 2026
Machine learning predicts genome designs for multi-trait cotton and crop breeding
Agriculture

Machine learning predicts genome designs for multi-trait cotton and crop breeding

October 25, 2026
Research report: Genetic diversity analysis and core collection construction of 259 garlic germplasm resources based on SSR molecular markers
Agriculture

Research report: Genetic diversity analysis and core collection construction of 259 garlic germplasm resources based on SSR molecular markers

October 25, 2026
Next Post
Baker’s yeast turns benzaldehyde into a chiral building block in student lab

Baker's yeast turns benzaldehyde into a chiral building block in student lab

  • Mothers who receive childcare support from maternal grandparents show more optimized

    Mothers who receive childcare support from maternal grandparents show more parental warmth, finds NTU Singapore study

    27656 shares
    Share 11059 Tweet 6912
  • University of Seville Breaks 120-Year-Old Mystery, Revises a Key Einstein Concept

    1061 shares
    Share 424 Tweet 265
  • Bee body mass, pathogens and local climate influence heat tolerance

    682 shares
    Share 273 Tweet 171
  • Researchers record first-ever images and data of a shark experiencing a boat strike

    546 shares
    Share 218 Tweet 137
  • Groundbreaking Clinical Trial Reveals Lubiprostone Enhances Kidney Function

    531 shares
    Share 212 Tweet 133
Science

Embark on a thrilling journey of discovery with Scienmag.com—your ultimate source for cutting-edge breakthroughs. Immerse yourself in a world where curiosity knows no limits and tomorrow’s possibilities become today’s reality!

RECENT NEWS

  • Baker’s yeast turns benzaldehyde into a chiral building block in student lab
  • AI Spots Which Pig Is Coughing in Crowded Pens, Even at Night
  • Extreme rainfall remobilizes mining tailings metals and stresses coastal Restinga plants
  • Explainable AI framework blends calibrated models to predict heart disease risk

Categories

  • Agriculture
  • Anthropology
  • Archaeology
  • Athmospheric
  • Biology
  • Biotechnology
  • Blog
  • Bussines
  • Cancer
  • Chemistry
  • Climate
  • Earth Science
  • Editorial Policy
  • Marine
  • Mathematics
  • Medicine
  • Pediatry
  • Policy
  • Psychology & Psychiatry
  • Science Education
  • Science News
  • Social Science
  • Space
  • Technology and Engineering

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 5,151 other subscribers

© 2025 Scienmag - Science Magazine

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • HOME
  • SCIENCE NEWS
  • CONTACT US

© 2025 Scienmag - Science Magazine

Discover more from Science

Subscribe now to keep reading and get access to the full archive.

Continue reading