An edge-computing-device-based abnormal sound monitoring and early warning system, method and device for laying hens
By using edge computing devices and the DASP-CAM model, the problem of lagging abnormal sound recognition in traditional chicken flock health monitoring has been solved, realizing automated, real-time monitoring and early warning of abnormal sounds from laying hens in the chicken house, thus improving the accuracy of recognition and the reliability of early warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING AGRICULTURAL UNIVERSITY
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-12
AI Technical Summary
Traditional chicken health monitoring relies on manual inspections, which makes it difficult to identify abnormal sounds in real time and continuously in complex noise environments, resulting in delayed disease detection and affecting egg production and mortality rates.
An edge computing-based system for monitoring and warning of abnormal sounds in laying hens is adopted. This system identifies abnormal sounds by acquiring audio data, processing it through edge computing, and using the DASP-CAM model. It also incorporates an improved CAM++ model with dual-branch input adaptation and convolutional time-frequency enhancement to achieve accurate identification and warning of abnormal sounds in laying hens.
It enables continuous, automated monitoring and rapid response to abnormal sounds from laying hens in the chicken house, reduces reliance on the cloud, improves identification accuracy and early warning reliability, and reduces hardware costs and energy consumption.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent farming technology, specifically to a system, method, and device for monitoring and warning of abnormal sounds in laying hens based on edge computing devices. Background Technology
[0002] With the rapid development of the egg-laying hen farming industry, large-scale and intensive management of chicken houses has gradually become the mainstream. However, traditional methods of monitoring flock health mainly rely on manual inspections and experience-based judgment, which suffers from problems such as discontinuous monitoring, delayed response, and strong subjectivity. Especially in the early stages of abnormalities such as respiratory diseases and environmental stress, it is often difficult to detect them in time, which can easily lead to a decline in egg production, an increase in mortality, and significant economic losses. In addition, the vocal behavior of laying hens varies significantly depending on their age, stocking density, and environmental conditions. Chicken houses are also constantly accompanied by mechanical noise from fans, manure cleaners, feeding equipment, and wind noise, making it difficult to achieve stable and standardized identification of abnormal sounds through manual listening or simple rules.
[0003] Therefore, how to use intelligent methods to monitor and provide timely warnings of abnormal sounds from laying hens in complex noise environments in real time has become a key issue that urgently needs to be addressed in the laying hen farming industry. Achieving accurate monitoring and early warning of abnormal sounds can not only assist farmers in early intervention and reduce the risk of disease transmission, but also improve farming management efficiency and economic benefits.
[0004] In existing technologies, abnormal monitoring of chicken flocks mainly relies on computer vision and environmental sensor data. Chinese invention patent application CN120032393B discloses a "method, system, medium, and terminal for abnormal monitoring of broilers based on data analysis." This technical solution collects broiler image data by deploying cameras at different monitoring angles and uses image pixel segmentation and feature extraction models (such as convolutional neural networks) to identify the static contours and distribution density of broilers. Chinese invention patent application CN120298143A discloses a "system and method for detecting and warning of abnormal behavior in caged chickens based on image analysis." This technical solution targets high-density caged environments and uses deep learning models to analyze video monitoring data to identify abnormal behaviors such as feather pecking, climbing, and vent pecking. Both of these patented technologies rely on high-quality image acquisition, which typically requires the deployment of high-resolution cameras. To achieve comprehensive coverage, a large investment in equipment is often necessary. Furthermore, to meet the needs of nighttime shooting, additional supplementary lighting systems are required, which not only increases hardware costs but also raises the complexity of the circuitry and energy consumption within the chicken house.
[0005] Therefore, there is an urgent need for a monitoring and early warning system that does not rely on light conditions and can accurately identify abnormal conditions in laying hens through sound characteristics. Summary of the Invention
[0006] Objectives of the Invention: The first objective of this invention is to provide an automated monitoring and rapid response system for monitoring and early warning of abnormal sounds in laying hens based on edge computing devices; the second objective of this invention is to provide a method for monitoring and early warning of abnormal sounds in laying hens based on edge computing devices; and the third objective of this invention is to provide a device for monitoring abnormal sounds in laying hens based on edge computing devices.
[0007] To achieve the aforementioned primary objective, the technical solution of the abnormal sound monitoring and early warning system for laying hens provided by this invention is as follows: This invention provides an abnormal sound monitoring and early warning system for laying hens, comprising an audio acquisition module, an edge computing processing module, a power supply and communication module, a cloud server, and a data display module, wherein: The audio acquisition module is used to collect continuous sound signals from laying hens in the chicken house environment to obtain raw audio data; An edge computing processing module, connected to the audio acquisition module, is used to slice the raw audio data into segments of fixed duration to obtain segmented audio. The segmented audio is preprocessed, Fbank acoustic features are extracted, and input into a hen abnormal sound recognition model for identification and analysis, outputting the audio category and corresponding confidence level. The audio categories include normal audio, abnormal audio, and other audio. The hen abnormal sound recognition model is constructed based on the DASP-CAM model. The DASP-CAM model includes a dual-branch input adaptation module, a convolutional time-frequency feature enhancement front-end, an initial temporal modeling layer, a CAM++ network, a time-frequency joint attention module, a multi-scale convolution module, a channel recalibration module, an anomaly-sensitive pooling module, and a multi-window fusion classification output module. Among them, normal audio refers to the routine vocalizations produced by laying hens when they are in a normal state of feeding, drinking, resting, communicating, or light activity without obvious disease symptoms or strong stress response. This includes steady short calls, low-intensity group communication calls, sounds accompanying feeding, and natural vocalizations in the context of daily activities. Abnormal audio refers to abnormal vocalizations related to respiratory abnormalities, stress responses, or abnormal behaviors, including coughing sounds, purring sounds, cat-like sounds, frog-like sounds, etc. Other audio refers to environmental disturbances that are not the target chicken's vocalizations or do not reflect the chicken's health status, including fan noises, mechanical operating sounds, collision sounds, and wind sounds, etc. A power supply and communication module is used to supply power to the edge computing processing module and provide network communication. The cloud server is used to receive and store the identification results, confidence scores and statistical information uploaded by the edge computing processing module, and to summarize, analyze and manage the historical records of the data. The data display module, connected to the cloud server, is used to display to users the real-time identification results of the chicken coop, the distribution of abnormal categories, confidence information, and early warning records.
[0008] This invention is based on the monitoring of abnormal sounds in laying hens, and constructs an intelligent sound monitoring and early warning device. By collecting sound information from the laying hen population in the chicken house, the continuous audio is segmented into fixed-duration segments and pre-processed with noise reduction. Acoustic features are extracted and input into an abnormal sound recognition model for laying hens, constructed based on the DASP-CAM model, for identification and analysis. The model outputs the abnormality category and confidence level. Within a set statistical time window, the proportion of abnormal audio is calculated. When the proportion of abnormal audio reaches a preset threshold, an early warning is triggered, thereby achieving timely monitoring and early warning of abnormal health and stress risks in laying hens.
[0009] Furthermore, the method for preprocessing segmented audio is as follows: each segmented audio is subjected to DC removal and normalization, bandpass filtering, and spectral threshold noise reduction to obtain the preprocessed segmented audio.
[0010] Furthermore, the DASP-CAM model (Dual-branch Adaptation and Anomaly-Sensitive Pooling enhanced Context-Aware Masking Network) is an improved CAM++ hen abnormal sound recognition model based on dual-branch input adaptation and convolutional time-frequency enhancement. It represents a context-aware masking dense time-delay neural network that integrates dual-branch input adaptation and anomaly-sensitive pooling enhancement. It includes a dual-branch input adaptation module, a convolutional time-frequency feature enhancement front-end, an initial temporal modeling layer, a context-aware masking dense time-delay convolutional CAM++ network, a time-frequency joint attention module, a multi-scale convolution module, a channel recalibration module, an anomaly-sensitive pooling module, and a multi-window fusion classification output module. The dual-branch input adaptation module takes the Fbank feature matrix as input and outputs an enhanced input representation that fuses short-term and long-term branch features. The dual-branch input adaptation module is used to perform temporal multi-scale input enhancement on the Fbank features, constructing short-term and long-term branches. The short-term branch is used to highlight the local rapid change features corresponding to transient abnormal vocalizations, and the long-term branch is used to highlight the long-term context features corresponding to persistent abnormal state changes, so as to enhance the model's ability to represent short, sudden abnormal vocalizations and persistent abnormal sounds of laying hens. The input to the convolutional time-frequency feature enhancement front-end is the enhanced input representation output by the dual-branch input adaptation module, and the output is the convolutional time-frequency enhancement feature; the convolutional time-frequency feature enhancement front-end is used to extract local time-frequency texture features of the audio signal and enhance the discriminative acoustic representation; The input to the initial temporal modeling layer is the convolutional time-frequency enhanced feature output by the convolutional time-frequency feature enhancement front-end, and the output is the initial temporal modeling feature; the initial temporal modeling layer is used to perform preliminary temporal relationship modeling on the features enhanced by the front-end, so as to form an intermediate temporal representation containing adjacent context information; The CAM++ network takes as input the initial temporal modeling features output by the initial temporal modeling layer and outputs as high-level contextual temporal features. The CAM++ network is used to perform deep temporal modeling and contextual information extraction on the enhanced input features to obtain high-level feature representations suitable for recognizing abnormal sounds in laying hens. The input to the time-frequency joint attention module is the high-level contextual temporal features output by the CAM++ network, and the output is the time-frequency enhanced features after joint weighting of the time and frequency dimensions. The time-frequency joint attention module is used to perform saliency weighting on the features in the time and frequency dimensions respectively, highlighting key time frames and key frequency bands related to anomaly identification, so as to enhance the model's ability to focus on local anomalous acoustic segments and discriminative frequency bands. The input of the multi-scale convolution module is the time-frequency enhancement feature output by the time-frequency joint attention module, and the output is the multi-scale convolution fusion feature; the multi-scale convolution module is used to extract abnormal patterns under different temporal receptive fields in the high-level semantic space, and enhance the modeling ability of abnormal sounds with different durations. The input to the channel recalibration module is the multi-scale convolutional fusion feature output by the multi-scale convolution module, and the output is the recalibrated feature after channel weighting. The channel recalibration module is used to perform channel-level importance filtering on the multi-scale features, strengthen effective semantic channels and suppress noisy redundant channels. The input to the anomaly-sensitive pooling module is the recalibration features output by the channel recalibration module, and the output is a statistical pooling vector representing the entire audio segment. The anomaly-sensitive pooling module is used to perform weighted aggregation of frame-level features, strengthen the response of abnormal features and suppress the interference of background noise in the breeding environment, so as to improve the model's ability to distinguish between abnormal sounds, normal sounds and environmental noise. The input of the multi-window fusion classification output module is the statistical pooling vector output by the anomaly-sensitive pooling module, and the output is the category results and corresponding confidence scores of normal audio, abnormal audio and other audio. The multi-window fusion classification output module is used to combine the main classification results, multi-window statistical results and auxiliary anomaly and background scoring results to output the category results and corresponding confidence scores of normal audio, abnormal audio and other audio, thereby improving the stability and robustness of the three types of sound recognition in complex aquaculture environments.
[0011] Through the synergistic effect of the above modules, the improved CAM++ abnormal sound recognition model for laying hens is better adapted to the complex acoustic conditions present in the laying hen farming environment, such as mechanical noise, wind noise, and mixed group calls, thereby improving the accuracy, robustness, and reliability of abnormal sound recognition and early warning.
[0012] Furthermore, the dual-branch input adaptation module is used to model the input Fbank acoustic features using short-time and long-time branches to enhance the representation of anomalous sound patterns at different time scales. The input Fbank feature matrix is subjected to short-time and long-time branch transformations respectively to obtain short-time and long-time branch outputs. After the two branches are fused and transposed to recover the enhanced input representation, the enhanced input representation is obtained. in: This represents the fusion enhancement feature in the transpose domain; Represents the fusion mapping function; Indicates short-term branch output; Indicates long-term branch output; This indicates splicing by channel dimension; Indicates residual connection; This indicates that the audio signal is input after taking the transposed Fbank acoustic features; Indicates the frequency band dimension; Indicates the first Total number of frames for each sample; This represents the enhanced input representation restored to a time-frequency arrangement.
[0013] Furthermore, the convolutional time-frequency feature enhancement front-end is used to extract local time-frequency texture features and complete the previous-stage feature enhancement; the initial temporal modeling layer is used to perform preliminary temporal modeling on the previous-stage enhanced features, and its output is: in: This represents the output features of the convolutional front end; This represents a convolutional time-frequency feature enhancement front end, used to extract local time-frequency textures and perform dimensionality expansion; This represents the enhanced input representation restored to its time-frequency arrangement. Indicates the sample index.
[0014] Furthermore, the initial temporal modeling layer is used to perform preliminary temporal modeling on the output features of the convolutional time-frequency feature enhancement front-end, and its output is: in: This represents the output of the initial temporal modeling layer; This represents the TDNN time series modeling operator; This represents the output features of the convolutional front end; Indicates the sample index.
[0015] Furthermore, the context-aware masked dense delay convolutional CAM++ network outputs features from the initial temporal modeling layer. As input, after passing through multiple CAMDenseTDNNBlocks and transition layers, high-level contextual temporal features are obtained, and the output is... .
[0016] Within each CAMDenseTDNNBlock, a dense connection method is used. Let the first... Within the block, the first Layer output features are Then we have:
[0017] in, Indicates the first Within the block, the first Layer nonlinear transformation; This indicates splicing by channel dimension; Indicates the first Each block of input features; This represents the layer index within a certain CAMDenseTDNNBlock.
[0018] Furthermore, a context-aware masking mechanism is introduced during the extraction of local temporal features at each layer. Let the... Within the block, the first Layer input features are The results of local feature extraction are as follows:
[0019] in: Represented as the first Within the block, the first Local temporal features extracted from the layer; Represented as the first Within the block, the first Local feature extraction function of the layer.
[0020] Furthermore, the time-frequency joint attention module applies time-dimensional weighting and frequency-dimensional weighting to the backbone network output features, respectively; let the backbone network output be... The attention weights in the time dimension are:
[0021] in: Represents the real number field; This represents the number of high-level feature channels after passing through the backbone network; Indicates the number of time frames; Indicates the attention weights in the time dimension; This represents the Sigmoid activation function; Represents the time attention mapping function; This indicates the operation of averaging along the channel dimension.
[0022] The features after time-attention weighting are: in: Indicates the time-enhanced features; This indicates element-wise multiplication.
[0023] The frequency dimension attention weights are: in: Represents the frequency-dimensional attention weights; This represents the Sigmoid activation function; Represents the frequency attention mapping function; This indicates average pooling along the time dimension; This indicates splicing by channel dimension; This indicates max pooling along the time dimension.
[0024] The time-frequency joint enhancement output is: in: Indicates time-frequency joint enhancement features; This indicates element-wise multiplication.
[0025] Furthermore, after the high-level contextual temporal features are extracted by the context-aware masked dense delay convolutional CAM++ network, they are sequentially input into the time-frequency joint attention module, the multi-scale convolution module, the channel recalibration module, and the anomaly-sensitive pooling module. The time-frequency joint attention module is used to highlight key time frames and key frequency bands, the multi-scale convolution module is used to extract abnormal patterns under different temporal receptive fields, the channel recalibration module is used to filter important feature channels, and the anomaly-sensitive pooling module is used to perform weighted statistical pooling on frame-level features to generate a global representation vector representing the entire audio segment.
[0026] Furthermore, the multi-scale convolution module performs parallel convolution modeling on the output features of the time-frequency joint attention module under different temporal receptive fields. The channel recalibration module performs channel-level importance filtering on the output features of the multi-scale convolution module. The anomaly-sensitive pooling module performs weighted statistical pooling on the channel-recalibrated output features. The multi-window fusion classification output module performs classification output on the statistical pooling vector output by the anomaly-sensitive pooling module.
[0027] Furthermore, the method for constructing an abnormal sound recognition model for laying hens based on the improved CAM++ laying hen abnormal sound recognition model using dual-branch input adaptation and convolutional time-frequency enhancement includes the following steps: Continuous sound signals from the laying hens in the chicken coop environment were collected as raw audio data. The raw audio data in the training and validation sets are sliced and preprocessed to extract Fbank acoustic features; The original audio data were labeled according to audio category and divided into training set, validation set and test set; The Fbank acoustic features in the training set are input into the abnormal sound recognition model of laying hens for supervised training to obtain a trained model. The model outputs the probability distribution of each audio category, takes the category corresponding to the maximum softmax probability as the recognition category, and uses the maximum probability as the confidence score output. The Fbank acoustic features in the validation set are input into the trained model for evaluation. The model is evaluated based on classification accuracy, recall, and F1 score, and the model with the best evaluation result is selected as the final abnormal hen sound recognition model. The Fbank acoustic features are extracted and input into the final abnormal hen sound recognition model for inference. The final abnormal hen sound recognition model outputs the probability distribution of each audio category. The category with the highest probability is taken as the recognition category, and the highest probability is taken as the corresponding recognition confidence.
[0028] To achieve the second objective mentioned above, the technical solution of the abnormal sound monitoring and early warning method for laying hens provided by the present invention is as follows: This invention provides a method for monitoring abnormal sounds in laying hens using the above-described system, comprising the following steps: In a chicken coop environment, a continuous audio stream is acquired using an audio acquisition module and sampled at a preset sampling rate. Audio segments are extracted periodically or continuously, and segments with obvious distortion, low signal-to-noise ratio, or severe clipping are removed to obtain the original audio data. The original audio data is sliced into segments of uniform length. Timestamps, collection points, and chicken coop numbers are added to the segments as metadata to construct a standardized sample format. DC component removal is performed on each segment, and amplitude normalization is applied. Bandpass filtering is then applied to each segment. Spectral threshold denoising is performed on the filtered audio, and Fbank acoustic features are extracted from the denoised audio as input features for the model. The aforementioned Fbank acoustic features are input into the abnormal sound recognition model for laying hens. The model outputs the audio category and corresponding confidence level, calculates the percentage of abnormal audio within the statistical time window, and generates early warning event information if the percentage of abnormal audio exceeds the threshold. The early warning event information includes the chicken house number, collection point, early warning trigger time, distribution of abnormal audio categories, percentage of abnormal audio, and confidence level statistics.
[0029] To achieve the third objective mentioned above, the technical solution of the abnormal sound monitoring and early warning method for laying hens provided by this invention is as follows: This invention provides a device for monitoring and warning of abnormal sounds in laying hens, including the aforementioned system for monitoring and warning of abnormal sounds in laying hens.
[0030] Furthermore, the abnormal sound monitoring and early warning device for laying hens includes a main body, which contains a microphone, a Raspberry Pi connected to the microphone, a PoE power supply expansion board connected to the Raspberry Pi, and a heat sink. The microphone has a built-in audio acquisition module, the Raspberry Pi has a built-in edge computing processing module, and the PoE power supply expansion board has a built-in power supply and communication module. The heat sink is located near the Raspberry Pi to dissipate the heat generated by the Raspberry Pi and reduce the internal temperature of the device. The main body has a first waterproof connector and a second waterproof connector. The first waterproof connector is connected to the PoE power supply expansion board for connection to an external network cable. The second waterproof connector is also connected to the PoE power supply expansion board for connection to an external power source. The bottom of the main body has a bottom cover with several audio acquisition ports inside. The microphone is located near one of the audio acquisition ports on the bottom cover.
[0031] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: (1) It realizes continuous, automated monitoring and rapid response to abnormal sounds in chicken houses. The present invention collects continuous sounds from the laying hen population in the chicken house, and performs audio slicing, feature extraction and intelligent recognition. It can continuously output abnormal categories and confidence levels, and trigger early warnings based on the proportion of abnormal audio within the statistical time window, which is conducive to early detection and intervention of abnormalities.
[0032] (2) Inference is performed at the edge, reducing latency and dependence on the cloud and network. This invention deploys slicing, preprocessing, feature extraction and model inference on edge computing devices, avoiding the bandwidth occupation and network instability caused by uploading large amounts of raw audio to the cloud, reducing end-to-end system latency and improving the reliability and real-time performance of the chicken coop operation.
[0033] (3) The identification results are interpretable, statistical, and traceable, which facilitates aquaculture management decisions. This invention outputs "category + confidence level" and calculates the proportion of abnormal audio within a set statistical window, and generates early warning events using a threshold triggering strategy; at the same time, the identification results, confidence level and statistical information can be uploaded to the cloud for storage and display, realizing historical record management and visual analysis, which facilitates the tracking and review of abnormal trends.
[0034] (4) The model is more focused on the abnormal sound of the target and more suppresses noise, balancing accuracy and efficiency. This invention uses an improved CAM++ model for recognizing abnormal sounds of laying hens based on dual-branch input adaptation and convolutional time-frequency enhancement. The dual-branch input adaptation module simultaneously models short-term sudden abnormalities and long-term continuous abnormality patterns. The convolutional time-frequency feature enhancement front end strengthens the local time-frequency texture representation. The high-level contextual temporal features are extracted by combining a context-aware masking dense time-delay convolutional backbone network, thereby improving the ability to express the key features of abnormal sounds of laying hens. Furthermore, the time-frequency joint attention module, multi-scale convolution module, channel recalibration module, and abnormality-sensitive pooling module are used to enhance and aggregate key time frames, key frequency bands, multi-time receptive field abnormal patterns, and important semantic channels step by step, thereby highlighting the abnormal acoustic features and effectively suppressing interference features such as fan noise, mechanical noise, and mixed group calls in the breeding environment. At the same time, the improved CAM++ model maintains high recognition performance while having low computational complexity and fast inference speed, making it suitable for near real-time operation on edge devices with limited computing power.
[0035] (5) More convenient on-site deployment and lower wiring and maintenance costs. This invention preferably adopts the PoE power supply and communication integrated method, which realizes power supply and data transmission simultaneously through Ethernet cable, which can reduce the complexity of on-site wiring and maintenance costs in chicken houses and improve the convenience of system installation and expansion. Attached Figure Description
[0036] Figure 1 This is a system block diagram of the present invention.
[0037] Figure 2 This is a system workflow diagram of the present invention.
[0038] Figure 3This is a schematic diagram of the overall device of the present invention; 1-first waterproof connector, 2-second waterproof connector, 3-waterproof and breathable membrane, 4-device cover, 5-heat dissipation port, 6-device body, 7-device bottom cover, 8-audio acquisition port.
[0039] Figure 4 This is a schematic diagram of the device module structure of the present invention; 9-Raspberry Pi 5, 10-Heat sink, 11-PoE power supply expansion board, 12-Pickup unit.
[0040] Figure 5 This is a block diagram of an algorithm system for monitoring abnormal sounds in laying hens. Detailed Implementation
[0041] This invention constructs an improved CAM++ model for recognizing abnormal sounds in laying hens, referred to as the DASP-CAM model (Dual-branch Adaptation and Anomaly-Sensitive Pooling enhanced Context-AwareMasking Network). It is an improved CAM++ model for recognizing abnormal sounds in laying hens based on dual-branch input adaptation and convolutional time-frequency enhancement.
[0042] The present invention will be further described below with reference to embodiments, but the scope of protection of the present invention is not limited thereto.
[0043] Combination Figure 1 , Figure 2 This invention provides an edge computing-based system for monitoring and warning of abnormal sounds in laying hens. The system collects continuous sound information from a flock of laying hens in a chicken house, segments the continuous audio into fixed-duration segments, performs noise reduction preprocessing, extracts acoustic features, and inputs them into an abnormal sound recognition model. It then outputs the abnormality category and confidence level. Within a set statistical time window, the system calculates the proportion of abnormal audio. When the proportion reaches a preset threshold, an early warning is triggered, thereby enabling timely monitoring and warning of abnormal health and stress risks in laying hens.
[0044] Combination Figure 1 The edge computing-based hen abnormal sound monitoring and early warning system provided in this embodiment of the invention includes an audio acquisition module, an edge computing processing module, a power supply and communication module, a cloud server, and a data display module, wherein: (1) Audio acquisition module, used to acquire continuous sound signals of laying hens in the chicken house environment and obtain raw audio data; (2) Edge computing processing module, connected to the audio acquisition module, is used to perform fixed-duration slicing processing on continuous audio, with a slice length of 5s and a sampling frequency of 16kHz; it performs preprocessing such as DC removal and normalization, bandpass filtering to reduce low-frequency noise of the fan, and spectral threshold noise reduction on each audio segment; it extracts Fbank acoustic features and inputs them into the improved CAM++ egg-laying hen abnormal sound recognition model based on dual-branch input adaptation and convolution time-frequency enhancement for inference, and outputs the audio category and corresponding confidence score; the audio category includes normal audio, abnormal audio and other audio, wherein abnormal audio includes coughing sound, purring sound, cat meow sound, frog croaking sound, etc., and other audio includes mechanical noise and wind sound, etc.; the confidence score uses the softmax maximum probability as the output; (3) Power supply and communication module, used to power the edge computing processing module and provide network communication. It adopts PoE power supply and communication integration, and the Ethernet cable realizes power supply and data transmission at the same time, reducing the difficulty of wiring on the chicken house site; (4) Cloud server, used to receive and store the identification results, confidence level and statistical information uploaded by the edge computing processing module, and to summarize and analyze the data and manage historical records; (5) Data display module, connected to the cloud server, used to display to users the real-time identification results of chicken coops, distribution of abnormal categories, confidence information and early warning records.
[0045] Combination Figure 2 In some embodiments, specifically, an abnormal sound monitoring and early warning system for laying hens is constructed through the following steps: S1-1 In a chicken coop environment, a continuous audio stream is collected using a microphone. The sample is taken at a preset sampling rate, and segments with obvious distortion, low signal-to-noise ratio, or severe clipping are removed to obtain a set of original audio samples of acceptable quality.
[0046] S1-2 Slices the continuous audio into fixed lengths, preferably 5s, to form audio samples of uniform length; add timestamps, collection points, chicken coop numbers and other metadata to each audio segment to construct a standardized sample format for easy subsequent training and traceability.
[0047] S1-3 DC removal and amplitude normalization: DC removal is performed on each audio segment, and amplitude normalization is performed to reduce the impact of amplitude differences caused by different acquisition devices and distances on model training.
[0048] S1-4 performs bandpass filtering on the audio, reducing low-frequency steady-state noise components such as those from fans, and improving the distinguishability of abnormal sounds from the target.
[0049] S1-5 performs spectral threshold noise reduction on the filtered audio to suppress steady-state or quasi-steady-state background noise, improve the signal-to-noise ratio, and reduce the interference of mechanical noise and wind noise on the recognition model.
[0050] S1-6 Extract Fbank acoustic features from the denoised audio as model input features. Preferably, the Fbank dimension is 80-dimensional, the frame length is 25ms, and the frame shift is 10ms.
[0051] S1-7 Manually label the audio samples to form three categories: normal audio, abnormal audio, and other audio. Abnormal audio is further labeled into abnormal subcategories such as coughing sounds, purring sounds, cat-like sounds, and frog-like sounds. Other audio includes mechanical noise, wind sounds, etc., and forms a dataset partition for training / validation / testing.
[0052] S1-8 The model is trained on the classified dataset, and the model with the best comprehensive index is selected as the abnormal sound recognition model for laying hens.
[0053] S1-9 deploys the trained model to an edge computing device. The device is installed in the chicken coop and powered on to start collecting continuous audio streams from the chicken coop.
[0054] S1-10 Slices the continuous audio stream into segments of fixed 5-second durations to obtain a segment sequence; extract Fbank features from each audio segment according to S1-6 and input them into the trained improved CAM++ egg-laying hen abnormal sound recognition model based on dual-branch input adaptation and convolutional time-frequency enhancement to obtain a segment-level recognition result sequence.
[0055] S1-11 Set a statistical time window and confidence threshold according to the actual production conditions of different chicken houses. Take the slices that meet the threshold conditions in the window as valid slices and calculate the proportion of abnormal audio. The proportion of abnormal audio is the ratio of the number of slices in the window that are judged as abnormal audio to the total number of valid slices in the window.
[0056] S1-12 When the proportion of abnormal audio reaches a preset threshold, an early warning event is generated and output to the platform for display; the threshold and statistics window can be configured to adapt to different chicken house noise environments and management strategies.
[0057] S1-13 Early warning event information includes: chicken house number, collection point, early warning trigger time, distribution of abnormal categories, percentage of abnormalities, and confidence level statistics; and slice-level details and statistical reports can be saved locally or uploaded to a cloud server for traceability.
[0058] Specifically, in S1-2, the specific method for constructing the standardized sample format is as follows: In a chicken coop environment, a continuous audio stream is acquired using a microphone. Sampling is performed at a preset sampling rate, and segments with significant distortion, low signal-to-noise ratio, or severe clipping are removed to obtain a set of high-quality original audio samples. Subsequently, the continuous audio is sliced into fixed lengths, preferably 5 seconds, with a sampling frequency of 16 kHz, thus forming audio samples of uniform length. Each audio segment is then appended with metadata such as a timestamp, acquisition location, and chicken coop number to construct a standardized sample format.
[0059] Let the first The discrete-time signal of each audio sample is: in: Indicates the first The audio sample at the ... The amplitude at each sampling point; Indicates the sample index; Indicates the index of discrete sampling points; Indicates the first The total number of sampling points for each audio sample.
[0060] All samples constitute the supervised learning dataset: in: This represents a supervised learning dataset; Indicates the first One audio sample; Indicates the first The category label corresponding to each audio sample; This represents the total number of samples.
[0061] Furthermore, the dataset is divided into a training set, a validation set, and a test set: in: Represents the training set; Represents the validation set; Represents the test set; This represents the empty set.
[0062] Specifically, in steps S1-3- and S1-5-, DC removal, amplitude normalization, bandpass filtering, and spectral threshold noise reduction are performed sequentially on each audio segment. The specific methods are as follows: Let the original discrete signal be The result of removing DC is: in: This represents the audio signal after DC removal; Indicates the first The audio sample at the ... The amplitude at each sampling point; Indicates the first The mean of the samples satisfies: in: Indicates the first The total number of sampling points for each audio sample.
[0063] Amplitude normalization is performed on the signal after DC removal: in: This indicates a normalized signal; This represents the stability constant to prevent the denominator from being zero.
[0064] The normalized signal is then subjected to bandpass filtering and spectral threshold noise reduction to obtain the final preprocessed signal: in: This represents the preprocessed audio signal; Indicates the bandpass filter operator; This represents the spectral threshold noise reduction operator.
[0065] Specifically, in steps S1-6, audio Fbank acoustic features are extracted as model feature input. The feature extraction steps are as follows:
[0066] S1-6-1 Let the preprocessed discrete audio signal be... Sampling rate Frame length is Frame shift is The corresponding sampling point lengths are as follows: in: This indicates the number of sampling points in each frame; This indicates the frame length, preferably 25 ms; This indicates the sampling rate, preferably 16000 Hz; This indicates the number of sampling points between two adjacent frames; This indicates a frame shift, preferably 10 ms.
[0067] No. The frame signal is represented as: in: Indicates the first The first sample Frame signal; Indicates the time frame index.
[0068] For the Frame windowing yields: in: This represents the windowed frame signal; The window function is represented, preferably a Hamming window.
[0069] S1-6-2 Regarding the windowed section Performing a short-time Fourier transform on the frame signal yields the complex spectrum: in: Indicates the first The first sample Frame in Complex spectrum values at each frequency point; Indicates frequency index; This indicates the number of sampling points in each frame; Represents the natural constant; Represents the imaginary unit; It represents pi (π).
[0070] The corresponding power spectrum is expressed as: in: Represents the power spectrum; This represents the magnitude of the complex spectrum.
[0071] The power spectrum is passed through by Integrating the Mel filter bank consisting of the nth bandpass filter, we obtain the nth... Energy of each filter: in: Indicates the first The first sample Frame in Energy on each Mel filter; Indicates the total number of frequency domain sampling points; Indicates the first The Mel filter in the th... Response values at each frequency point; Indicates the Mel filter index; This indicates the number of Mel filters, preferably 80.
[0072] S1-6-3 Taking the logarithm of the filter bank energy yields the log-Fbank characteristic: in: Indicates the first The first sample Frame number F-bank characteristics; To represent logarithmic operations, the natural logarithm is preferred; Indicates the first The first sample Frame in Energy on each Mel filter; This represents the stability constant that prevents the logarithm from reaching zero.
[0073] S1-6-4 To improve stability across devices and operating conditions, mean-free normalization is performed on the Fbank features along the time dimension: in: This represents the Fbank feature after mean normalization. Indicates the first The first sample Frame number F-bank characteristics; Indicates the first Total number of frames for each sample; Indicates the summation index; Indicates the first The first sample Frame number F-bank characteristics.
[0074] By concatenating all time frames, the feature matrix is obtained: in: Indicates the first The Fbank feature matrix of each sample; Represents the real number field; Indicates the first Total number of frames for each sample; Indicates the number of Mel filters.
[0075] Combination Figure 3 The abnormal sound monitoring device for laying hens provided in this embodiment is an integrated protective structure used to complete audio acquisition, edge inference, and result uploading on-site in the chicken house. The device preferably adopts an integrated PoE power supply and communication method, achieving both power supply and data transmission simultaneously via Ethernet cable, thereby reducing the difficulty of on-site wiring in the chicken house and improving deployment convenience.
[0076] In some embodiments, the hen abnormal sound monitoring device includes a device body 6, within which are a microphone 12, a Raspberry Pi 9 connected to the microphone 12, a PoE power supply expansion board 11 connected to the Raspberry Pi 9, and a heat sink 10. The microphone 12 has a built-in audio acquisition module, the Raspberry Pi 9 has a built-in edge computing processing module, and the PoE power supply expansion board 11 has a built-in power supply and communication module. The heat sink 10 is located near the Raspberry Pi 9 to dissipate the heat generated by the Raspberry Pi 9 and reduce the internal temperature of the device. The device body is provided with a first waterproof connector 1 and a second waterproof connector 2. The first waterproof connector 1 is connected to the PoE power supply expansion board 11 for connection to an external network cable. The second waterproof connector 2 is connected to the PoE power supply expansion board 11 for connection to an external power source. The bottom of the device body is provided with a device bottom cover, within which are opened a plurality of audio acquisition ports 8, and the microphone 12 is located near the audio acquisition port of the device bottom cover.
[0077] In specific implementation, the first waterproof connector 1 is an RJ45 waterproof connector used to connect to the external network cable and achieve waterproof sealing; the second waterproof connector 2 is a PG type waterproof connector used for cable introduction and fixation and to improve the waterproof performance of the connection point; the waterproof and breathable membrane 3 is used for heat dissipation of the equipment inside the shell and to inhibit the entry of water vapor, thereby improving the long-term stability of the internal circuit; 4 is the equipment cover, used to cooperate with the equipment body to form a closed protective space; the heat dissipation port 5 is used to cooperate with the heat dissipation structure to achieve heat exchange and improve heat dissipation efficiency; the equipment body 6 is used to support the internal circuit board, heat dissipation components and microphone components and form an overall structural support; the equipment bottom cover 7 is used to cooperate with the equipment cover and equipment body to complete the assembly and protect the internal components; the audio acquisition port 8 is used to provide an acoustic channel for the microphone, allowing external sound to enter the equipment and be collected by the microphone; the Raspberry Pi 5 9 serves as the edge computing main control board, used to perform computational tasks such as audio slicing, preprocessing, feature extraction, model inference and result statistics; the heat sink 10 is used to conduct heat generated by the main control board and reduce the internal temperature rise of the equipment. The PoE power supply expansion board 11 is used to convert Ethernet PoE power supply into a power supply usable by the device and provide a network communication interface; the microphone 12 is used to collect the sound signals of laying hens in the chicken house environment and output audio electrical signals.
[0078] In some embodiments, the microphone 12 is arranged opposite to the audio acquisition port 8 to form a stable acoustic acquisition channel; the heat sink 10 is configured in conjunction with the heat dissipation port 5 to enhance the heat dissipation capacity of the edge computing main control board 9 and related circuits; the RJ45 waterproof connector, PG type waterproof connector, waterproof and breathable membrane 3, together with the equipment cover 4 and the equipment bottom cover 7, constitute a protective structure to improve the reliability and service life of the equipment in the humid and dusty environment of the chicken house.
[0079] Combination Figure 4 Specifically, the abnormal sound recognition model for laying hens is constructed through the following steps: S2-1 Dataset Construction: The audio samples obtained in S1 are labeled according to categories to construct a supervised learning dataset, which is then divided into a training set, a validation set, and a test set.
[0080] S2-2 Feature Extraction: Extract Fbank features from audio samples in the training and validation sets using the method in S1-6 to obtain the input feature matrix.
[0081] S2-3 Model Structure: An improved CAM++ hen abnormal sound recognition model based on dual-branch input adaptation and convolutional time-frequency enhancement is used as the abnormal sound recognition network. The model includes a dual-branch input adaptation module, a convolutional time-frequency feature enhancement front-end, an initial temporal modeling layer, a context-aware masked dense time-delay convolutional (CAM++) network, a time-frequency joint attention module, a multi-scale convolutional module, a channel recalibration module, an anomaly-sensitive pooling module, and a multi-window fusion classification output module. Specifically, the dual-branch input adaptation module performs short-term and long-term branch modeling on the input Fbank features; the convolutional time-frequency feature enhancement front-end strengthens local time-frequency texture representation; the initial temporal modeling layer completes the preceding temporal modeling; the CAM++ network extracts high-level contextual temporal features; the time-frequency joint attention module highlights key time frames and key frequency bands; the multi-scale convolutional module extracts anomaly patterns under different temporal receptive fields; the channel recalibration module filters important semantic channels; the anomaly-sensitive pooling module aggregates frame-level features into a global representation vector; and the multi-window fusion classification output module outputs the final classification result and corresponding confidence level.
[0082] S2-4 Training Objective: Supervised training is performed on the classification results output by the model. The total training loss is constructed based on the final fused classification output, the main classification output, the multi-window classification output, and the auxiliary anomaly score and background score. The loss is gradually converged through iterative optimization to obtain the optimal model parameters.
[0083] In the S2-5 model inference stage, the probability distribution of each category is output. The category with the highest softmax probability is taken as the recognition category, and the confidence level is output as the highest probability.
[0084] S2-6 Model Evaluation and Selection: The model is evaluated using indicators such as classification accuracy, recall, and F1 score. The model with the best comprehensive indicators is selected as the abnormal sound recognition model for laying hens.
[0085] Specifically, in some embodiments, an abnormal sound recognition model for laying hens is constructed through the following steps: S2-1-1 Dataset Construction: The audio samples obtained in S1 are labeled according to category and divided into training set, validation set and test set to form a supervised learning dataset: in: This represents a supervised learning dataset; Indicates the first One audio sample; Indicates the corresponding category label; This represents the total number of samples.
[0086] S2-2 Feature Extraction: Extract Fbank features from audio samples in the training and validation sets using the method in S1-6 to obtain the input feature matrix. .
[0087] S2-3 Model Structure: The model includes a dual-branch input adaptation module, a convolutional time-frequency feature enhancement front-end, an initial temporal modeling layer, a context-aware masked dense time-delay neural network (CAM++), a time-frequency joint attention module, a multi-scale convolution module, a channel recalibration module, an anomaly-sensitive pooling module, and a multi-window fusion classification output module.
[0088] S2-3-1 Dual-branch input adapter module Transpose the Fbank feature matrix as follows: in: This represents the input features after transposition; Indicates the first The Fbank feature matrix of each sample; Indicates the transpose operation; Represents the real number field; Indicates the frequency band dimension; Indicates the first Total number of frames for each sample; Indicates the sample index.
[0089] The short-time branch output is: in: Indicates short-term branch output; This represents a short-time local modeling operator, used to highlight rapidly changing local features, and is suitable for capturing sudden bursts of short, unusual cries.
[0090] The long-term branch output is: in: Indicates long-term branch output; This represents a long-term context modeling operator, used to highlight the long-term context patterns corresponding to persistent state-change sounds.
[0091] After merging the two branches and transposing them to restore the original representation, we obtain the enhanced input representation: in: This represents the fusion enhancement feature in the transpose domain; Represents the fusion mapping function; This indicates splicing by channel dimension; Indicates residual connection; This represents the enhanced input representation restored to a time-frequency arrangement.
[0092] S2-3-2 Convolutional Time-Frequency Feature Enhancement Front-End Will Inputting the convolutional time-frequency feature enhancement front-end, we obtain: in: This represents the output features of the convolutional front end; This represents a convolutional time-frequency feature enhancement front end, used to extract local time-frequency textures and perform dimensionality expansion; Indicates the sample index.
[0093] S2-3-3 Initial Temporal Modeling Layer The output from the convolutional front end continues into the initial temporal modeling layer: in: This represents the output of the initial temporal modeling layer; This represents the TDNN time series modeling operator; This represents the output features of the convolutional front end; Indicates the sample index.
[0094] The initial temporal modeling layer outputs features Furthermore, it is used as input to a context-aware masked dense delay convolutional backbone network to extract higher-level contextual temporal features.
[0095] S2-3-4 Context-Aware Masked Dense Delay Neural Network (CAM++) The network outputs features from the initial temporal modeling layer. Using this as input, we obtain high-level contextual temporal features: in: Indicates the first Each sample is mapped into high-level contextual temporal features after passing through multiple CAMDenseTDNNBlocks and transition layers; This represents the entire CAM++ network mapping function; Indicates the sample index.
[0096] The CAM++ network consists of multiple CAMDenseTDNNBlocks cascaded with transition layers. Let the first... The input features of each stage are And satisfy:
[0097] Then the first The output of each stage is: in, Indicates the first The sample was processed by the first... The stage output features after each CAMDenseTDNNBlock; Indicates the first One CAMDenseTDNNBlock; Indicates the first The sample in the network Input features at each stage.
[0098] If the first If a transition layer is set after each stage, the input for the next stage will be: in, Indicates the first The sample in the network Input features at each stage; Indicates the first A transition layer.
[0099] The final backbone network output is: in, This indicates the total number of stages in the backbone network.
[0100] Within each CAMDenseTDNNBlock, a dense connection method is used. Let the first... Within the block, the first Layer output features are Then we have:
[0101] in, Indicates the first Within the block, the first Layer nonlinear transformation; This indicates splicing by channel dimension; Indicates the first Each block of input features; This represents the layer index within a certain CAMDenseTDNNBlock.
[0102] Furthermore, a context-aware masking mechanism is introduced during the extraction of local temporal features at each layer. Let the... Within the block, the first Layer input features are The results of local feature extraction are as follows:
[0103] in: Represented as the first Within the block, the first Local temporal features extracted from the layer; Represented as the first Within the block, the first Local feature extraction function of the layer.
[0104] Let the context embedding vector generated from the input features be: in: Represented as input features The generated context embedding vector; This is represented as a context-embedded generator function.
[0105] The masking weight is then: The local features after weighted calibration are: And It participates in subsequent dense connections as part of the nonlinear transformation output of this layer.
[0106] in: Represented as the first Within the block, the first Context-aware masking weights generated by the layer; Represented as the sigmoid activation function; , It is represented as a learnable weight matrix; Represents a linear mapping; Represented as the ReLU activation function; , This is represented as the bias term of the corresponding mapping network; Represented as local temporal features after context-aware masking calibration; This represents element-wise multiplication; This indicates that the output of this layer is sorted and mapped.
[0107] S2-3-5 Time-Frequency Joint Attention Module Assume the backbone network output is The attention weights in the time dimension are:
[0108] in: Represents the real number field; This represents the number of high-level feature channels after passing through the backbone network; Indicates the number of time frames; Indicates the attention weights in the time dimension; This represents the Sigmoid activation function; Represents the time attention mapping function; This indicates the operation of averaging along the channel dimension.
[0109] The features after time-attention weighting are: in: Indicates the time-enhanced features; This indicates element-wise multiplication.
[0110] The frequency dimension attention weights are: in: Represents the frequency-dimensional attention weights; This represents the Sigmoid activation function; Represents the frequency attention mapping function; This indicates average pooling along the time dimension; This indicates splicing by channel dimension; This indicates max pooling along the time dimension.
[0111] The time-frequency joint enhancement output is: in: Indicates time-frequency joint enhancement features; This indicates element-wise multiplication.
[0112] This module is used to highlight key time frames and key frequency bands respectively, and is more suitable for scenarios in rooster call anomaly detection where "local time slice anomalies and local frequency bands are more discriminative".
[0113] S2-3-6 Multi-scale Convolution Module Let the output of the time-frequency joint attention module be Multi-scale modeling of time series is performed using 1D convolutional kernels with multiple receptive fields.
[0114] in: Represents the real number field; This represents the number of high-level feature channels after passing through the backbone network: Indicates the number of time frames; , , These represent one-dimensional convolutions with kernel sizes of 3, 5, and 7, respectively. This represents a nonlinear mapping. , , Representing the input features respectively The output features are obtained after passing through one-dimensional convolutional branches with kernel sizes of 3, 5, and 7.
[0115] Then the results from the three branches are merged, which can generally be written as: in: This represents the output features after multi-scale convolution fusion; This indicates a merge mapping, restoring the original number of channels; This indicates splicing by channel dimension.
[0116] This module is used to enable the model to simultaneously see anomalous patterns in three time receptive fields: short-term, medium-term, and long-term.
[0117] S2-3-7 Channel Recalibration Module Let the output of the multi-scale convolution module be... The overall response strength of each channel is obtained by globally converging the responses of each channel over time. Then, a small mapping network is used to generate channel weights, and finally, these weights are used to rescale each channel. Channel context convergence can be written as:
[0118] Where: R represents the real number field; C represents the number of feature channels as input to the multi-scale convolution module; T represents the number of time frames; This represents global average pooling along the time dimension; Indicates all All channels The average of the values over 1 time frame is calculated, where T is 1.
[0119] Channel weight generation: in: Indicates channel weight; This represents the Sigmoid activation function; This represents the channel mapping function composed of convolutional or fully connected layers.
[0120] Channel reweighting: in: This indicates the output characteristics after channel recalibration; This represents element-wise multiplication; This indicates the channel weight.
[0121] This module performs channel-level importance filtering on multi-scale features, enhances effective semantic channels, and suppresses redundant or noisy channels.
[0122] S2-3-8 Anomaly-Sensitive Pooling Module Assume the output characteristics after channel recalibration The first one taken from Frame feature vector is Attention score: in: Indicates the first Attention score for each frame; This represents the transpose of the weight vector; Represented as the ReLU activation function; Represents a linear mapping matrix; Represents the bias vector; Indicates scalar bias; This represents the temperature coefficient.
[0123] Normalize it to obtain the abnormally sensitive weight: in: Indicates the first Frame normalization weights; Indicates the first Attention score for each frame; This represents the time frame index used for summation.
[0124] The weighted mean vector is: The weighted standard deviation vector is: in: Represents the weighted mean vector; Represents the weighted standard deviation vector; The element-wise square operation represents the difference between vectors; This represents a stability constant used to prevent numerical instability.
[0125] The statistical pooling vector is: in: This represents the global representation vector after pooling.
[0126] S2-3-9 Multi-window fusion classification output module The statistical pooling vector obtained from anomaly-sensitive pooling Input the main category header, and the output of the main category header is: in: Represents the main category logits; This represents the weight matrix of the main classification layer; This represents the bias vector of the main classification layer.
[0127] The multi-window fusion classification header output is: in: This indicates multi-window categorized output; The weight matrix representing the multi-window classification heads; This represents a global representation of multi-window fusion. This represents the bias vector of the multi-window classification head.
[0128] The final fusion classification output is: in: This represents the final fused classification logits; , Represents the fusion weight coefficient, satisfying .
[0129] In addition, the auxiliary anomaly score and the background score are represented as follows: in: Indicates abnormal auxiliary scoring; , Indicates the weights of the auxiliary scoring layer; , This indicates the bias of the auxiliary scoring layer; This represents the global representation vector after pooling; This indicates background information for auxiliary scoring.
[0130] S2-4 Training Objectives For the final logits Perform softmax to obtain the first... Class probability: in: Indicates the first The sample belongs to the first The predicted probability of a class; Indicates the first The sample belongs to the first The logits value of the class; Indicates the total number of categories; This represents the category index when performing a summation.
[0131] We employ label-smoothed cross-entropy loss, assuming the label smoothing coefficient is... The smoothed label distribution is then: in: This represents the smoothed target distribution; Indicates the first The true label of each sample.
[0132] The label smooth cross-entropy loss for a single classification output is: in: This represents the cross-entropy loss of the final fused output; This represents the number of samples in a training batch; Represents logarithmic operations, preferably natural logarithms.
[0133] The total classification loss is expressed as: in: Represents the total loss by category; Indicates the final fused output; Indicates the main category output; This indicates multi-window categorized output; Represents the set of real labels; , This represents the auxiliary classification loss weight.
[0134] Define anomaly binary objectives: Define the context and the binary objective: in: Indicates the first Anomaly monitoring targets for each sample; Indicates the first Background supervision targets for each sample; Represents a set of exception categories; This represents the set of background categories.
[0135] The abnormal auxiliary loss is: The background auxiliary loss is: in: Indicates abnormal auxiliary loss; Indicates background auxiliary loss; Indicates the first Abnormal scores for each sample; Indicates the first Background scores for each sample; This represents the Sigmoid function.
[0136] The final total loss function is: in: Indicates the total training loss; Indicates the weight of the anomalous auxiliary loss; Indicates the background auxiliary loss weights; S2-5 Parameter Optimization Let the model parameters be , No. The total loss at the next iteration is The learning rate is The weight decay coefficient is Then the parameter update can be expressed as: in: This represents the updated model parameters; This refers to the AdamW optimizer; Indicates the first Model parameters before the next iteration; This represents the gradient of the loss with respect to the parameters; Indicates the first Learning rate at the next iteration; This represents the weight decay coefficient.
[0137] The learning rate employs a warm-up cosine annealing strategy. Let the current training step number be... The number of preheating steps is The learning rate scheduling ends after the number of steps is The minimum learning rate is The maximum learning rate is When the first The number of training steps corresponding to the next iteration is Sometimes, = ,but:
[0138] in: Indicates the first The learning rate corresponding to each training step; This represents the minimum learning rate; Indicates the maximum learning rate; This indicates the total number of steps in the preheating stage; This indicates the number of steps until the learning rate scheduling ends.
[0139] S2-6 Model Evaluation and Optimal Model Selection The model was evaluated using precision, recall, and F1 score. Precision was:
[0140] in: Indicates accuracy; Indicates the number of samples in the validation set; This represents an indicator function, which takes the value 1 if the condition within the parentheses is true, and 0 otherwise. Indicates the first Predicted class labels for each validation sample; Indicates. The first. The true category label of the validation sample.
[0141] No. The precision, recall, and F1 score for each class are as follows: in: Indicates the first Class precision; Indicates the first Class recall rate; Indicates the first Class F1 value; Indicates the first Number of true positives; Indicates the first Number of false positives; Indicates the first Number of false negatives.
[0142] The model with the best overall performance on the validation set was selected as the final model for recognizing abnormal sounds in laying hens.
[0143] Specifically, in S2-5, the specific method for outputting the probability distributions of each category during the model inference stage is as follows: The model inference phase outputs the probability distribution of each category, and the identified categories are: in: Indicates the first The predicted class of each sample; arg max represents the index operation corresponding to the maximum value; Indicates the first The sample belongs to the first The predicted probability of a class.
[0144] The corresponding confidence level is: in: Show the first The confidence level of identification for each sample; Indicates the first The sample belongs to the first The predicted probability of a class.
[0145] Specifically, the early warning statistics and triggering strategies are as follows: S3-1 Slices the continuous audio stream into segments of fixed 5-second durations to obtain a segment sequence. For each audio segment, extract F-bank features according to S1-6, and input them into the trained recognition model to obtain a segment-level recognition result sequence:
[0146] in: This represents the set of slice recognition results within a statistical window; Indicates the first Predicted category for each slice; Indicates the first The confidence level of each slice identification; This indicates the total number of slices within the statistics window.
[0147] S3-2 Set the statistical time window as The confidence threshold is , will satisfy The slices that are not valid are recorded as valid slices.
[0148] S3-3 Let the number of valid audio slices identified as abnormal within the window be... The total number of valid slices within the window is The percentage of abnormal audio is: in: Indicates the percentage of abnormal audio; This indicates the number of valid audio slices identified as abnormal within the window. This indicates the total number of valid slices within the window.
[0149] S3-4 Let the warning threshold be... When satisfied At that time, an early warning event is generated.
[0150] The early warning event information includes at least the chicken house number, collection point, early warning trigger time, distribution of abnormal categories, proportion of abnormal audio, and confidence level statistics. The slice-level details and statistical reports can be saved locally or uploaded to the cloud server for traceability.
Claims
1. An abnormal sound monitoring and early warning system for laying hens, characterized in that, It includes an audio acquisition module, an edge computing processing module, a power supply and communication module, a cloud server, and a data display module, among which: The audio acquisition module is used to collect continuous sound signals from laying hens in the chicken house environment to obtain raw audio data; An edge computing processing module, connected to the audio acquisition module, is used to slice the raw audio data into segments of fixed duration to obtain segmented audio. The segmented audio is preprocessed, Fbank acoustic features are extracted, and input into a hen abnormal sound recognition model for identification and analysis, outputting the audio category and corresponding confidence level. The audio categories include normal audio, abnormal audio, and other audio. The hen abnormal sound recognition model is constructed based on the DASP-CAM model. The DASP-CAM model includes a dual-branch input adaptation module, a convolutional time-frequency feature enhancement front-end, an initial temporal modeling layer, a CAM++ network, a time-frequency joint attention module, a multi-scale convolution module, a channel recalibration module, an anomaly-sensitive pooling module, and a multi-window fusion classification output module. A power supply and communication module is used to supply power to the edge computing processing module and provide network communication. The cloud server is used to receive and store the identification results, confidence scores and statistical information uploaded by the edge computing processing module, and to summarize, analyze and manage the historical records of the data. The data display module, connected to the cloud server, is used to display to users the real-time identification results of the chicken coop, the distribution of abnormal categories, confidence information, and early warning records.
2. The abnormal sound monitoring and early warning system for laying hens according to claim 1, characterized in that, The method for preprocessing segmented audio is as follows: each segment of audio is subjected to DC removal and normalization, bandpass filtering, and spectral threshold noise reduction to obtain the preprocessed segmented audio.
3. The abnormal sound monitoring and early warning system for laying hens according to claim 1, characterized in that, In the DASP-CAM model, the dual-branch input adaptation module is used to perform temporal multi-scale input enhancement on Fbank features, constructing short-time branches and long-time branches. The short-time branches are used to highlight the local rapid change features corresponding to transient abnormal vocalizations, and the long-time branches are used to highlight the long-term context features corresponding to persistent abnormal state changes. The convolutional time-frequency feature enhancement front-end receives the enhanced input representation output by the dual-branch input adaptation module, which is used to extract local time-frequency texture features of the audio signal and enhance the discriminative acoustic representation; The initial temporal modeling layer receives the convolutional time-frequency enhancement features output by the convolutional time-frequency feature enhancement front-end, and uses them to perform preliminary temporal relationship modeling on the features enhanced by the front-end, so as to form an intermediate temporal representation containing adjacent context information; Used to perform preliminary temporal relationship modeling on the enhanced features of the front end, so as to form an intermediate temporal representation containing adjacent context information; The CAM++ network receives the initial temporal modeling features output by the initial temporal modeling layer, which are used to perform deep temporal modeling and context information extraction on the enhanced input features to obtain a high-level feature representation suitable for recognizing abnormal sounds in laying hens. The time-frequency joint attention module receives the high-level contextual temporal features output by the CAM++ network, and uses them to perform saliency weighting on the features in the time dimension and frequency dimension respectively, highlighting key time frames and key frequency bands related to anomaly identification; The multi-scale convolution module receives the time-frequency enhancement features output by the time-frequency joint attention module, which are used to extract abnormal patterns under different temporal receptive fields in the high-level semantic space, so as to output multi-scale convolution fusion features. The channel recalibration module receives the multi-scale convolutional fusion features output by the multi-scale convolution module, and uses them to perform channel-level importance filtering on the multi-scale features to output recalibrated features. The anomaly-sensitive pooling module receives the recalibration features output by the channel recalibration module, and uses them to perform weighted aggregation of frame-level features, enhance the response of anomaly features, and suppress background noise interference from the aquaculture environment. The multi-window fusion classification output module receives the statistical pooling vector output by the anomaly-sensitive pooling module, and is used to output the category results and corresponding confidence scores of normal audio, abnormal audio and other audio.
4. The abnormal sound monitoring and early warning system for laying hens according to claim 3, characterized in that, The input representation of the dual-branch input adapter module: in: This represents the fusion enhancement feature in the transpose domain; Represents the fusion mapping function; Indicates short-term branch output; Indicates long-term branch output; This indicates splicing by channel dimension; Indicates residual connection; This indicates that the audio signal is input after taking the transposed Fbank acoustic features; Indicates the frequency band dimension; Indicates the first Total number of frames for each sample; This represents the enhanced input representation restored to its time-frequency arrangement. The output of the convolutional time-frequency feature enhancement front-end is: in: This represents the output features of the convolutional front end; This represents a convolutional time-frequency feature enhancement front end, used to extract local time-frequency textures and perform dimensionality expansion; This represents the enhanced input representation restored to its time-frequency arrangement. Indicates the sample index; The output of the initial temporal modeling layer is: in: This represents the output of the initial temporal modeling layer; This represents the TDNN time series modeling operator; This represents the output features of the convolutional front end; This indicates the sample index.
5. The abnormal sound monitoring and early warning system for laying hens according to claim 3, characterized in that, The CAM++ network outputs features from the initial temporal modeling layer. As input, after passing through multiple CAMDenseTDNNBlocks and transition layers, high-level contextual temporal features are obtained, and the output is... Within each CAMDenseTDNNBlock, a dense connection method is used; let the first... Within the block, the first Layer output features are Then we have: in, Indicates the first Within the block, the first Layer nonlinear transformation; This indicates splicing by channel dimension; Indicates the first Each block of input features; This represents the layer index within a specific CAMDenseTDNNBlock; Furthermore, a context-aware masking mechanism is introduced during the extraction of local temporal features at each layer; let the first layer be... Within the block, the first Layer input features are The results of local feature extraction are as follows: in: Represented as the first Within the block, the first Local temporal features extracted from the layer; Represented as the first Within the block, the first Local feature extraction function of the layer.
6. The abnormal sound monitoring and early warning system for laying hens according to claim 3, characterized in that, The time-frequency joint attention module performs time-dimensional weighting and frequency-dimensional weighting on the backbone network output features, respectively; let the backbone network output be... The attention weights in the time dimension are: in: Represents the real number field; This represents the number of high-level feature channels after passing through the backbone network; Indicates the number of time frames; Indicates the attention weights in the time dimension; This represents the Sigmoid activation function; Represents the time attention mapping function; This indicates the operation of averaging along the channel dimension; The features after time-attention weighting are: in: Indicates the time-enhanced features; This represents element-wise multiplication; The frequency dimension attention weights are: in: Represents the frequency-dimensional attention weights; This represents the Sigmoid activation function; Represents the frequency attention mapping function; This indicates average pooling along the time dimension; This indicates splicing by channel dimension; This indicates max pooling along the time dimension; The time-frequency joint enhancement output is: in: Indicates time-frequency joint enhancement features; This indicates element-wise multiplication.
7. The abnormal sound monitoring and early warning system for laying hens according to claim 1, characterized in that, A method for constructing an abnormal sound recognition model for laying hens based on the DASP-CAM model includes the following steps: Continuous sound signals from laying hens in the chicken house environment were collected as raw audio data. The raw audio data was then sliced into fixed-duration segments and preprocessed to obtain standardized audio samples. Standardized audio samples are labeled according to audio categories to construct a supervised learning dataset, which is then divided into a training set, a validation set, and a test set. Fbank acoustic features were extracted from audio samples in the training and validation sets and used as input features for the abnormal sound recognition model of laying hens. The Fbank acoustic features corresponding to the training set are input into the abnormal sound recognition model of laying hens for supervised training, so that the model outputs the probability distribution of normal audio, abnormal audio and other audio categories, and the model parameters are optimized based on the loss function to obtain the candidate abnormal sound recognition model of laying hens. The Fbank acoustic features corresponding to the validation set are input into the candidate laying hen abnormal sound recognition model for evaluation. The model with the best evaluation result is determined based on the classification accuracy, recall and F1 score, and is used as the final laying hen abnormal sound recognition model. The acoustic features of Fbank are extracted and input into the final abnormal sound recognition model for laying hens for inference. The final abnormal sound recognition model for laying hens outputs the probability distribution of each audio category. The category with the highest probability is taken as the recognition category, and the highest probability is taken as the corresponding recognition confidence.
8. A method for monitoring abnormal sounds in laying hens using the system described in any one of claims 1-7, characterized in that, Includes the following steps: In a chicken coop environment, a continuous audio stream is acquired using an audio acquisition module and sampled at a preset sampling rate. Audio segments are extracted periodically or continuously, and segments with obvious distortion, low signal-to-noise ratio, or severe editing are removed to obtain the original audio data; The original audio data is sliced into segments of uniform length. Timestamps, collection points, and chicken coop numbers are added to each segment as metadata to construct a standardized sample format. DC component removal and amplitude normalization are performed on each segment. Then, bandpass filtering is applied to each segment. Spectral threshold denoising is performed on the filtered audio, and Fbank acoustic features are extracted from the denoised audio as model input features. The aforementioned Fbank acoustic features are input into the abnormal sound recognition model for laying hens. The model outputs the audio category and corresponding confidence level, calculates the percentage of abnormal audio within the statistical time window, and generates early warning event information if the percentage of abnormal audio exceeds the threshold. The early warning event information includes the chicken house number, collection point, early warning trigger time, distribution of abnormal audio categories, percentage of abnormal audio, and confidence level statistics.
9. A device for monitoring and warning of abnormal sounds in laying hens, characterized in that, The system includes the abnormal sound monitoring and early warning system for laying hens as described in any one of claims 1-7.
10. The egg-laying hen abnormal sound monitoring and early warning device according to claim 9, characterized in that, The device includes a main body containing a microphone, a Raspberry Pi connected to the microphone, a PoE power supply expansion board connected to the Raspberry Pi, and a heatsink. The microphone has a built-in audio acquisition module, the Raspberry Pi has a built-in edge computing processing module, and the PoE power supply expansion board has a built-in power supply and communication module. The heatsink is located near the Raspberry Pi to dissipate heat generated by the Raspberry Pi and reduce the internal temperature of the device. The main body has a first waterproof connector and a second waterproof connector. The first waterproof connector is connected to the PoE power supply expansion board for connection to an external network cable. The second waterproof connector is also connected to the PoE power supply expansion board for connection to an external power source. The bottom of the main body has a bottom cover with several audio acquisition ports. The microphone is located near one of the audio acquisition ports on the bottom cover.