A pig cough recognition and positioning method and system based on acoustic imaging

CN122991560APending Publication Date: 2026-10-27WENS FOODSTUFF GROUP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611467691.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,猪舍环境声学条件复杂,混响严重,多声源叠加导致信噪比低,传统方法难以有效抑制背景噪声,识别准确率低

Benefits of technology

[0013]本发明公开了一种基于声学成像的猪只咳嗽识别与定位方法及系统。获取麦克风阵列各阵元原始信号,评估幅相响应一致性并对异常阵元校准补偿;基于校准阵列构建互功率谱矩阵,通过波束形成进行空间谱估计,提取候选声源的声压级强度与空间几何特征;据此对初始声学成像数据去模糊,得到清晰的目标声学成像数据;利用深度学习提取频谱纹理与时频能量特征,识别咳嗽声;结合去模糊声像图确定咳嗽声源空间坐标,通过多点定位算法联合解算,构建咳嗽热点空间分布图。本发明克服了猪舍复杂噪声与阵列误差干扰,实现了猪只咳嗽的高精度自动识别与空间定位,为生猪健康预警与精准养殖提供了技术支撑。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122991560A_ABST
    Figure CN122991560A_ABST
Patent Text Reader

Abstract

The application discloses a pig cough recognition and positioning method and system based on acoustic imaging. The original signals of each array element of a microphone array are acquired, the amplitude and phase response consistency is evaluated, and abnormal array elements are calibrated and compensated; a cross-power spectrum matrix is constructed based on the calibrated array, spatial spectrum estimation is carried out through beam forming, and the sound pressure level intensity and spatial geometric features of candidate sound sources are extracted; the initial acoustic imaging data is deblurred based on the features, and clear target acoustic imaging data is obtained; frequency spectrum texture and time-frequency energy features are extracted by using deep learning to recognize cough sounds; the spatial coordinates of the cough sound sources are determined in combination with the deblurred echogram, and are jointly solved through a multi-point positioning algorithm to construct a cough hot spot spatial distribution map. The application overcomes the interference of complex noise in a pig house and array errors, realizes high-precision automatic recognition and spatial positioning of pig cough, and provides technical support for pig health early warning and precision breeding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent monitoring technology for livestock and poultry farming environments, and in particular to a method and system for identifying and locating pig coughs based on acoustic imaging. Background Technology

[0002] The pig farming industry is developing towards large-scale and intensive operations. Respiratory diseases in pigs are one of the main bottlenecks restricting farming efficiency, and coughing is an important early symptom of respiratory infections in pigs. Traditional pig health monitoring mainly relies on manual inspections, which has problems such as strong subjectivity, poor real-time accuracy, and difficulty in detecting diseases at night. In addition, there are multiple noise sources in the pigsty, such as feeding, chewing, drinking, fighting, and equipment operation, making it difficult for manual auscultation to accurately distinguish coughing sounds.

[0003] Current acoustic monitoring technologies mostly employ single microphones or simple arrays to collect sound signals from pigsties, using traditional thresholding methods or shallow machine learning models for cough identification. However, the acoustic conditions in pigsties are complex, with severe reverberation and multiple sound sources resulting in low signal-to-noise ratios. Traditional methods struggle to effectively suppress background noise, leading to low identification accuracy. Furthermore, conventional microphone arrays do not consider the inconsistencies in the amplitude and phase response of array elements, resulting in decreased accuracy in beamforming spatial spectrum estimation, blurred acoustic imaging, and an inability to accurately locate the cough source. In addition, existing technologies lack quantitative analysis of the spatial distribution density of cough sources, making it difficult to intuitively reflect the spatial aggregation of cough hotspots within the pigsty, which is detrimental to early disease warning and precise intervention.

[0004] Therefore, there is an urgent need for a method and system that can achieve high-precision identification and spatial positioning of pig coughs in the complex acoustic environment of pig houses, and construct a cough hotspot distribution map, so as to provide technical support for intelligent monitoring of pig health. Summary of the Invention

[0005] To address at least one of the aforementioned technical problems, this invention proposes a method and system for identifying and locating pig coughs based on acoustic imaging.

[0006] The first aspect of this invention provides a method for identifying and locating coughs in pigs based on acoustic imaging, comprising: Acquire the original acoustic signal data of each element in the microphone array in the target pig house, evaluate the amplitude and phase response consistency of each element based on the original acoustic signal data, and if there are abnormal elements in the amplitude and phase response error data of the evaluated elements that exceed the preset error threshold, perform acoustic signal acquisition calibration compensation on the abnormal elements to obtain the microphone array after acquisition parameter calibration. Acoustic signal data of array elements are obtained from the microphone array calibrated according to the acquisition parameters. The cross power spectrum matrix between array elements is constructed. The cross power spectrum matrix is ​​spatially estimated based on the beamforming algorithm. The sound pressure level intensity features and spatial geometric features of candidate sound sources are extracted from the obtained initial acoustic imaging data to obtain the distribution features of candidate sound sources. Based on the distribution characteristics of the candidate sound sources, the initial acoustic imaging data is subjected to acoustic deblurring to obtain the deblurred target acoustic imaging data. Based on deep learning algorithms, spectral texture features and time-frequency energy features are extracted from the deblurred target acoustic imaging data, and cough recognition and classification are performed to obtain the recognition result data of coughing pigs in the target pigsty. Based on the identification result data and the deblurred target sonographic image data, the spatial coordinates of the cough sound source are determined. The spatial coordinates are then jointly calculated based on a multi-point localization algorithm to construct a spatial distribution map of the cough hotspots in the target pigsty.

[0007] In this solution, the process involves acquiring the raw acoustic signal data of each element in the microphone array within the target pigsty, evaluating the amplitude and phase response consistency of each element based on the raw acoustic signal data, and if any abnormal element is found in the evaluated amplitude and phase response error data exceeding a preset error threshold, then the abnormal element undergoes acoustic signal acquisition calibration compensation to obtain a microphone array with calibrated acquisition parameters. Specifically: The original acoustic signal data of each element in the microphone array in the target pig house is acquired. The original acoustic signal data is synchronously extracted according to the same time window. Fourier transform is performed on the acoustic signal in the corresponding time window of each element to obtain the complex spectrum data of each element in the corresponding frequency component. Using any one array element as the response reference element, the amplitude ratio and phase difference of the complex spectrum data of the remaining array elements are calculated by comparing them with the complex spectrum data of the response reference element, thus obtaining the amplitude response difference of each array element relative to the response reference element. and phase response difference ,satisfy: , In the formula, The frequency component number. In response to the reference element number, The array element number and , This represents the total number of elements in the microphone array. This represents the modulo operation on complex numbers. To represent the argument of a complex number, the superscript is used. Indicates complex conjugation. Perform Fourier transform on the acoustic signal of each array element within the corresponding time window to obtain the complex spectrum data of the corresponding frequency components. For the first Each element within its time window Acoustic signal sample values ​​at each sampling point; The amplitude response error data of the array elements is constructed based on the amplitude response difference, and the equivalent time delay of each array element is fitted based on the phase response difference and the frequency change relationship to obtain the phase response error data of the array elements. The array element amplitude response error data and array element phase response error data are compared with the preset error threshold respectively to determine the presence of abnormal array elements whose amplitude response error or phase response error exceeds the preset error threshold. For the abnormal array element, an amplitude-phase calibration transfer function is constructed based on its complex spectrum ratio relative to the response reference array element. The amplitude-phase calibration transfer function is fitted by the least squares method to determine the amplitude compensation coefficient and phase compensation amount of the abnormal array element. The amplitude compensation coefficient is applied to the amplitude of the acquired signal of the abnormal array element, and the phase compensation amount is converted into the corresponding time delay compensation parameter. Amplitude gain correction and time alignment compensation are performed on the acoustic signal acquired by the abnormal array element. The frequency domain response of each array element's acoustic signal after compensation is compared to obtain the compensated amplitude response error and phase response error. The compensated array element response parameters are then used as the acoustic signal acquisition parameters of each array element to obtain the microphone array with the acquisition parameters calibrated.

[0008] In this scheme, the microphone array calibrated according to the acquisition parameters acquires the acoustic signal data of the array elements, constructs the cross-power spectrum matrix between the array elements, performs spatial spectrum estimation on the cross-power spectrum matrix based on the beamforming algorithm, and extracts the sound pressure level intensity features and spatial geometric features of the candidate sound sources from the obtained initial acoustic image data to obtain the distribution features of the candidate sound sources. Specifically: The synchronous acoustic signal data of each element of the microphone array is acquired according to the calibrated acquisition parameters. The synchronous acoustic signal data is then processed by frame segmentation and windowing. The time-domain acoustic signal of each element after frame segmentation is converted to the frequency domain by short-time Fourier transform to obtain the complex spectrum data of each element at multiple frequency points. For each frequency point, the first The complex spectrum data of the first array element and the first array element The conjugate multiplication of the complex spectrum data of each array element yields the result at each frequency point. Each element and the first The cross-power spectral density values ​​between array elements, and for continuous The frames are accumulated and averaged to form the cross-power spectrum matrix between the array elements. ,satisfy: , In the formula, Let H be the column vector formed by the complex spectra of each array element, where the superscript H denotes the conjugate transpose. The frame number, For frequency; Based on beamforming algorithms, a three-dimensional scanning grid is divided within the target pigsty space. According to the spatial coordinates of each array element in the microphone array and the sound velocity parameter, the array steering vector corresponding to each scanning grid point is constructed using the propagation delay. , For each scan grid point Reaching the The propagation delay of each array element, where the superscript T denotes the transpose matrix. The imaginary unit; Substitute the array steering vector corresponding to each scanning grid point into the cross power spectrum matrix for weighted summation to obtain the spatial spectrum energy value of each scanning grid point, and construct the initial acoustic imaging data based on the spatial spectrum energy value. Local maxima search is performed on the initial acoustic imaging data. Grid points with spatial spectral energy values ​​greater than the average energy of adjacent grid points are marked as candidate sound source points. The sound pressure level intensity value at each candidate sound source point is extracted, and a local spatial neighborhood is determined with the candidate sound source point as the center. The spatial coordinate centroid of all grid points in the neighborhood is calculated as the spatial geometric center of the candidate sound source point. The distribution characteristics of the candidate sound source are constituted based on the sound pressure level intensity value and the spatial geometric center.

[0009] In this scheme, the step of performing acoustic deblurring on the initial acoustic imaging data based on the distribution characteristics of the candidate sound sources to obtain the deblurred target acoustic imaging data specifically involves: The initial acoustic imaging data is transformed into spatial domain to obtain spatial energy distribution data. The focal point of the sound source is determined based on the spatial geometric center in the distribution characteristics of the candidate sound source. With each focal point of the sound source as the center, the spatial spectral energy gradient value between adjacent grid points is calculated along the spatial coordinate direction of the three-dimensional scanning grid points. The spatial spectrum energy gradient values ​​of adjacent grid points are compared with a preset gradient threshold. When the spatial spectrum energy gradient value changes from a positive value to a negative value, the grid point corresponding to the negative value is marked as an acoustic energy fuzzy boundary point. Traverse all acoustic energy fuzzy boundary points corresponding to the focal points of all sound sources, fit their spatial coordinates with a convex hull, and use the spatial region enclosed by the closed surface obtained by the convex hull fitting as the fuzzy boundary region. Extract the spatial spectrum energy values ​​of all grid points within the fuzzy boundary region, calculate the arithmetic mean of these energy values ​​as the background energy value of the fuzzy region, and construct an adaptive energy attenuation function based on the background energy value of the fuzzy region. The attenuation coefficient of the adaptive energy attenuation function is proportional to the absolute value of the spatial spectrum energy gradient value, and the attenuation coefficient increases monotonically as the distance between the grid point and the focal point of the sound source increases. The spatial spectrum energy value within the fuzzy boundary region is weighted point by point using the adaptive energy decay function. When the spatial spectrum energy value of a grid point is lower than the background energy value of the fuzzy region, the energy value of the grid point is set to the background energy value of the fuzzy region. Three-dimensional Gaussian smoothing filtering is applied to the energy values ​​of grid points in the weighted fuzzy boundary region. The filtered grid point energy values ​​and the sound pressure level intensity values ​​at the sound source focal point are then normalized to obtain the defuzzified energy value corresponding to each sound source focal point. The deblurred energy value is used to determine the deblurred spatial energy distribution data, and the deblurred target acoustic imaging data is constructed based on the deblurred spatial energy distribution data.

[0010] In this scheme, the extraction of spectral texture features and time-frequency energy features from the deblurred target acoustic imaging data based on deep learning algorithms, as well as cough recognition and classification, yields the recognition result data of pigs coughing in the target pigsty. Specifically: The candidate sound source signals in the deblurred target acoustic imaging data are separated and extracted to obtain the time-domain acoustic signals of each candidate sound source. The time-domain acoustic signals are then processed by frame-segmentation and windowing. The framed time-domain acoustic signals are then transformed to the frequency domain by Fourier transform to obtain the time-spectrum data of each candidate sound source. Mel frequency scaling filter is applied to the time-spectrum data to extract Mel frequency cepstral coefficients. The Mel frequency cepstral coefficients are used to construct spectral texture features. At the same time, the energy amplitude of each time-frequency point is calculated based on the time-spectrum data to construct a time-frequency energy distribution matrix. The time-frequency energy distribution matrix is ​​used to construct time-frequency energy features. Collect audio samples of pig coughing and non-coughing. Plot the time-domain waveform of the pig coughing audio samples to obtain a coughing audio waveform map. Use the coughing audio waveform map as a reference to extract the corresponding spectral texture features and time-frequency energy features as positive sample labels. Use the spectral texture features and time-frequency energy features corresponding to the non-coughing audio samples as negative sample labels to construct a training dataset. A convolutional neural network model is constructed, and the training dataset is input into the convolutional neural network model for iterative training to obtain a cough recognition and classification model. The spectral texture features and time-frequency energy features corresponding to the candidate sound sources are input into the cough recognition and classification model for forward inference, and the recognition result data of the cough of pigs in the target pigsty is output.

[0011] In this scheme, the spatial coordinates of the cough sound source are determined based on the recognition result data and the deblurred target sonographic image data. A multi-point localization algorithm is then used to jointly calculate the spatial coordinates to construct a spatial distribution map of cough hotspots in the target pigsty. Specifically: Based on the recognition result data, candidate sound source markers that are determined to be coughs are extracted. The candidate sound source markers that are determined to be coughs are spatially mapped to the deblurred target acoustic imaging data. The spatial grid point coordinates corresponding to the candidate sound source markers that are determined to be coughs in the deblurred target acoustic imaging data are obtained, and the spatial coordinates of the cough sound source are obtained. Using the spatial coordinates of the cough sound source as a positioning reference point, the spatial coordinate positions of each element in the microphone array after the acquisition parameters have been calibrated are obtained in the target pigsty. And randomly select one array element as the reference array element. A distance difference matrix is ​​constructed from the spatial distance differences between each array element and the cough sound source. This distance difference matrix and the spatial coordinates of each array element are then substituted into the positioning equations of a multi-point positioning algorithm. Using the spatial coordinates of the cough sound source as the initial values ​​for iteration, a weighted least squares joint solution is performed, i.e., the solution is obtained. , In the formula, For the first The weighted coefficients corresponding to each array element are greater than 0. For the speed of sound, To calculate the spatial distance difference between each array element and the reference array element based on the spatial coordinates of the cough sound source and the spatial coordinates of each array element, For the first The estimated arrival time difference of each array element relative to the reference array element is used to obtain the three-dimensional spatial coordinate solution value of the cough sound source in the target pig house through joint calculation. The spatial distribution density of cough sound sources in the target pigsty space is determined based on the calculated three-dimensional spatial coordinates. The density is then analyzed within a statistical window using a kernel density estimation method. Density estimation is performed on the three-dimensional spatial coordinates of each cough sound source to calculate the probability density value at each cough sound source location: , In the formula, It is a three-dimensional Gaussian kernel function. The bandwidth parameter is used; the probability density value is mapped to the three-dimensional spatial coordinate system of the target pig house, and a spatial distribution map of cough hotspots is generated from the probability density value to obtain the spatial distribution map of cough hotspots of the target pig house.

[0012] A second aspect of the present invention also provides a pig cough recognition and localization system based on acoustic imaging. The system includes: a memory and a processor. The memory includes a program for a pig cough recognition and localization method based on acoustic imaging. When the program for a pig cough recognition and localization method based on acoustic imaging is executed by the processor, it implements the steps of the pig cough recognition and localization method based on acoustic imaging as described in any of the above claims.

[0013] This invention discloses a method and system for identifying and locating pig coughs based on acoustic imaging. The method involves acquiring the original signals from each element of a microphone array, evaluating the consistency of amplitude and phase response, and calibrating and compensating for abnormal elements. A cross-power spectrum matrix is ​​constructed based on the calibrated array, and spatial spectrum estimation is performed using beamforming to extract the sound pressure level intensity and spatial geometric features of candidate sound sources. Based on this, the initial acoustic imaging data is deblurred to obtain clear target acoustic imaging data. Deep learning is used to extract spectral texture and time-frequency energy features to identify cough sounds. The spatial coordinates of the cough sound source are determined by combining the deblurred acoustic image, and a spatial distribution map of cough hotspots is constructed through joint calculation using a multi-point localization algorithm. This invention overcomes the interference of complex noise in pig houses and array errors, achieving high-precision automatic identification and spatial localization of pig coughs, providing technical support for pig health early warning and precision farming. Attached Figure Description

[0014] Figure 1 A flowchart of a method for identifying and locating coughs in pigs based on acoustic imaging according to the present invention is shown; Figure 2 The flowchart illustrating the extraction of candidate sound source distribution features according to the present invention is shown. Figure 3 The flowchart illustrating the deblurred target acoustic imaging data obtained by the present invention is shown. Figure 4 A block diagram of a pig cough recognition and localization system based on acoustic imaging according to the present invention is shown. Detailed Implementation

[0015] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0016] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0017] Figure 1 A flowchart of a method for identifying and locating coughs in pigs based on acoustic imaging according to the present invention is shown.

[0018] like Figure 1 As shown, the first aspect of the present invention provides a method for identifying and locating coughs in pigs based on acoustic imaging, comprising: Acquire the original acoustic signal data of each element in the microphone array in the target pig house, evaluate the amplitude and phase response consistency of each element based on the original acoustic signal data, and if there are abnormal elements in the amplitude and phase response error data of the evaluated elements that exceed the preset error threshold, perform acoustic signal acquisition calibration compensation on the abnormal elements to obtain the microphone array after acquisition parameter calibration. Acoustic signal data of array elements are obtained from the microphone array calibrated according to the acquisition parameters. The cross power spectrum matrix between array elements is constructed. The cross power spectrum matrix is ​​spatially estimated based on the beamforming algorithm. The sound pressure level intensity features and spatial geometric features of candidate sound sources are extracted from the obtained initial acoustic imaging data to obtain the distribution features of candidate sound sources. Based on the distribution characteristics of the candidate sound sources, the initial acoustic imaging data is subjected to acoustic deblurring to obtain the deblurred target acoustic imaging data. Based on deep learning algorithms, spectral texture features and time-frequency energy features are extracted from the deblurred target acoustic imaging data, and cough recognition and classification are performed to obtain the recognition result data of coughing pigs in the target pigsty. Based on the identification result data and the deblurred target acoustic image data, the spatial coordinates of the cough sound source are determined. The spatial coordinates are then jointly calculated based on a multi-point localization algorithm to construct a spatial distribution map of the cough hotspots in the target pigsty.

[0019] It should be noted that by acquiring the raw acoustic signal data of each element of the microphone array within the target pigsty and evaluating the consistency of amplitude and phase response, and by performing acoustic signal acquisition calibration compensation for abnormal elements, the amplitude and phase errors between elements can be effectively eliminated, improving the acquisition consistency and signal fidelity of the microphone array. Based on the calibrated microphone array, a cross-power spectrum matrix is ​​constructed, and a beamforming algorithm is used for spatial spectrum estimation. Simultaneously, the sound pressure level intensity features and spatial geometric features of candidate sound sources are extracted, enhancing spatial resolution in complex pigsty environments and accurately acquiring the distribution characteristics of candidate sound sources. Acoustic deblurring of the initial acoustic imaging data based on the distribution characteristics of candidate sound sources suppresses blurring and reverberation interference in acoustic imaging, obtaining clear and accurate target acoustic imaging data. Using deep learning algorithms to extract spectral texture features and time-frequency energy features from the deblurred target acoustic imaging data, as well as for cough recognition and classification, fully explores subtle acoustic differences in cough sounds, achieving high-precision automatic recognition of pig coughs. By combining the recognition results with the deblurred target sonographic data, the spatial coordinates of the cough sound source are determined. A spatial distribution map of cough hotspots is constructed through joint calculation using a multi-point localization algorithm. This can accurately locate the spatial position of coughing pigs and intuitively display the clustering of cough hotspots, providing a reliable basis for early warning and precise prevention and control of respiratory diseases in pigs.

[0020] According to an embodiment of the present invention, the step of acquiring the original acoustic signal data of each element in the microphone array in the target pigsty, evaluating the amplitude and phase response consistency of each element based on the original acoustic signal data, and if there are abnormal elements in the obtained amplitude and phase response error data exceeding a preset error threshold, performing acoustic signal acquisition calibration compensation on the abnormal elements to obtain a microphone array with calibrated acquisition parameters, specifically involves: The original acoustic signal data of each element in the microphone array in the target pig house is acquired. The original acoustic signal data is synchronously extracted according to the same time window. Fourier transform is performed on the acoustic signal in the corresponding time window of each element to obtain the complex spectrum data of each element in the corresponding frequency component. Using any one array element as the response reference element, the amplitude ratio and phase difference of the complex spectrum data of the remaining array elements are calculated by comparing them with the complex spectrum data of the response reference element, thus obtaining the amplitude response difference of each array element relative to the response reference element. and phase response difference ,satisfy: , In the formula, The frequency component number. In response to the reference element number, The array element number and , This represents the total number of elements in the microphone array. This represents the modulo operation on complex numbers. To represent the argument of a complex number, the superscript is used. Indicates complex conjugation. Perform Fourier transform on the acoustic signal of each array element within the corresponding time window to obtain the complex spectrum data of the corresponding frequency components. For the first Each element within its time window Acoustic signal sample values ​​at each sampling point; Based on the amplitude response difference, array element amplitude response error data is constructed, and based on the relationship between the phase response difference and frequency, the equivalent time delay of each array element is fitted in the characteristic frequency band of cough sound according to the linear phase model to obtain array element phase response error data. The array element amplitude response error data and array element phase response error data are compared with the preset error threshold, that is, the maximum deviation of the amplitude ratio of each frequency component relative to 1 is compared with the preset amplitude error threshold, and the absolute value of the equivalent time delay is compared with the preset time delay error threshold to determine that there are abnormal array elements with amplitude response error or phase response error exceeding the preset error threshold. For the anomalous array element, an amplitude-phase calibration transfer function is constructed based on its complex spectrum ratio relative to the response reference array element. This function is then fitted using the least squares method according to a gain-delay model, i.e., the solution is obtained. , In the formula, , These represent the amplitude gain coefficient to be fitted and the equivalent time delay, respectively. To calibrate the upper frequency limit of the frequency band; Determine the amplitude compensation coefficients of the abnormal array elements. The phase compensation amount is then applied to the amplitude of the acquired signal of the abnormal array element, and the phase compensation amount is converted into the corresponding time delay compensation parameter. The amplitude gain correction and time alignment compensation for acoustic signals acquired by abnormal array elements should conform to the following formula: , In the formula, The compensated acoustic signal, This is the amplitude gain coefficient; The frequency domain response of each array element's acoustic signal after compensation is compared to obtain the compensated amplitude response error and phase response error. The compensated array element response parameters are then used as the acoustic signal acquisition parameters of each array element to obtain the microphone array with the acquisition parameters calibrated.

[0021] It should be noted that during actual acoustic monitoring in pigsties, microphone arrays are subject to long-term effects such as high humidity, dust, temperature changes, and element aging. This can easily lead to inconsistent amplitude gain, inconsistent frequency response, and asynchronous signal arrival times in the responses of different microphone elements to the same pig's cough. Since pig coughs are characterized by short duration, strong transients, and complex frequency components, these differences between array elements can cause shifts in the sound pressure amplitude and phase relationship of the same cough on different array elements. This, in turn, affects the subsequent cross-power spectrum matrix construction, spatial spectrum estimation, and sound source localization results. Therefore, it is necessary to uniformly calibrate the acquisition parameters of the microphone array before formally conducting pig cough monitoring.

[0022] First, the microphone array is put into normal working condition in the target pig house, and a sound source with a stable acoustic response is selected in the pig house as the array calibration sound source. The original acoustic signal generated by the calibration sound source is collected simultaneously by each array element. The signals collected by each array element are synchronously intercepted according to the same time window and Fourier transform is performed to obtain the complex spectrum data of each array element on the same frequency component. The array element with stable response is used as the reference array element. The amplitude ratio and phase difference of the complex spectrum data of the remaining array elements are calculated with the reference array element. The amplitude ratio determines the amplitude response difference of each array element, and the equivalent time delay of each array element relative to the reference array element is determined according to the relationship between the phase difference and the frequency. When the amplitude response error or phase response error of a certain array element exceeds the preset error threshold, the array element is determined as an abnormal array element. For abnormal array elements, an amplitude-phase calibration transfer function is established based on the complex spectrum ratio between the abnormal array element and the reference array element. The amplitude compensation coefficient and time delay compensation parameter corresponding to the abnormal array element are obtained by least squares fitting. The amplitude compensation coefficient is written into the signal gain calibration configuration of the abnormal array element, and the time delay compensation parameter is written into the time synchronization calibration configuration of the abnormal array element. This allows the acoustic signals subsequently acquired by the abnormal array element to be gain corrected according to the amplitude compensation coefficient and the time base to be adjusted according to the time delay compensation parameter. After the parameters are written, the calibrated microphone array is put back into the actual acoustic monitoring state of the target pig house. Each array element synchronously acquires the environmental acoustic signals in the pig house according to a unified sampling frequency, sampling clock, and acquisition time window. When sound is heard in the pig house, each array element synchronously acquires the acoustic signal. During the acquisition process, the amplitude gain compensation and time delay compensation are performed on the signals of each array element respectively, so that the same coughing event output by different array elements remains consistent in amplitude scale and time base. Subsequently, the acoustic signals of the same acoustic event are acquired again from the calibrated microphone array. The frequency domain responses of the array elements before and after calibration are compared. If the amplitude response error and phase response error after calibration are both within the preset error threshold, the amplitude gain calibration parameters, frequency response calibration parameters, and time delay calibration parameters currently written to each array element are determined as the final acquisition parameters of the microphone array. The microphone array configured with the final acquisition parameters is used to continuously acquire the synchronous acoustic signals of multiple array elements in the target pig house. This ensures that the subsequently acquired pig cough sounds have a unified amplitude response, frequency response, and time reference among different array elements, avoiding interference from the acquisition differences of the array elements themselves on acoustic imaging and cough sound source localization.

[0023] Figure 2 The flowchart illustrating the present invention for extracting the distribution features of candidate sound sources is shown.

[0024] According to an embodiment of the present invention, the step of acquiring acoustic signal data of array elements of a microphone array calibrated according to the acquisition parameters, constructing a cross-power spectrum matrix between array elements, performing spatial spectrum estimation on the cross-power spectrum matrix based on a beamforming algorithm, and extracting sound pressure level intensity features and spatial geometric features of candidate sound sources from the obtained initial acoustic image data to obtain the distribution features of candidate sound sources, specifically: The synchronous acoustic signal data of each element of the microphone array is acquired according to the calibrated acquisition parameters. The synchronous acoustic signal data is then processed by frame segmentation and windowing. The time-domain acoustic signal of each element after frame segmentation is converted to the frequency domain by short-time Fourier transform to obtain the complex spectrum data of each element at multiple frequency points. For each frequency point, the first The complex spectrum data of the first array element and the first array element The conjugate multiplication of the complex spectrum data of each array element yields the result at each frequency point. Each element and the first The cross-power spectral density values ​​between array elements, and for continuous The frames are accumulated and averaged to form the cross-power spectrum matrix between the array elements. ,satisfy: , In the formula, Let H be the column vector formed by the complex spectra of each array element, where the superscript H denotes the conjugate transpose. For frame number, For frequency; Based on beamforming algorithms, a three-dimensional scanning grid is divided within the target pigsty space. According to the spatial coordinates of each array element in the microphone array and the sound velocity parameter, the array steering vector corresponding to each scanning grid point is constructed using the propagation delay. , For each scan grid point Reaching the The propagation delay of each array element, where the superscript T denotes the transpose matrix. The imaginary unit; Substitute the array steering vector corresponding to each scan grid point into the cross power spectrum matrix for weighted summation, and calculate the spatial spectral energy value of each scan grid point as shown in the following formula: , In the formula, For scanning grid points The corresponding array steering vector, For scanning grid points In frequency Spatial spectral energy value at; Initial acoustic imaging data are constructed based on the spatial spectrum energy values; Local maxima search is performed on the initial acoustic imaging data. Grid points with spatial spectral energy values ​​greater than the average energy of their neighboring grid points are marked as candidate sound source points. The sound pressure level intensity value at each candidate sound source point is extracted, and a local spatial neighborhood is determined with the candidate sound source point as the center. Using the spatial spectral energy values ​​of each grid point within the local spatial neighborhood as weights, the weighted energy center of the coordinates of all grid points within the local spatial neighborhood is calculated: , In the formula, The weighting center of energy is the spatial geometric center of the candidate sound source point. For grid points in the local spatial neighborhood Spatial spectral energy value at; The distribution characteristics of candidate sound sources are determined based on the sound pressure level intensity value and the spatial geometric center.

[0025] It should be noted that, since the target pigsty contains a variety of sounds simultaneously, including pig activity sounds, coughing sounds, feeding equipment operation sounds, fan sounds, and personnel activity sounds, the sound collected by a single array element can only reflect local acoustic information and cannot directly determine the location of different sounds within the pigsty. Therefore, it is necessary to utilize the multi-channel spatial information of the microphone array to first perform spatial analysis on all sounds within the pigsty. Specifically, when the same sound propagates to different array elements, due to the different distances from the sound source to each array element, regular arrival time differences and phase differences will occur. Since the time delay relationships between array elements corresponding to sounds at different locations are different, a cross-power spectrum matrix between array elements is constructed to preserve the correlation between each array element. Then, based on the propagation time delay from each location to each array element in the preset spatial grid, a corresponding spatial response relationship is established. This allows the sound from a certain actual location to be coherently enhanced at the grid point corresponding to that location, while sound components with propagation patterns inconsistent with that location cannot be enhanced simultaneously. In this way, acoustic energy is mapped from the time-domain signal to the three-dimensional space of the pigsty. Further searching for local energy peaks in the spatial energy distribution aims to identify sound sources with independent energy concentration characteristics from a continuous spatial sound field. The energy strength of each candidate sound source is described by its sound pressure level, and its geometric center is determined using the surrounding spatial energy distribution to reduce the positioning error of a single grid point. Therefore, the final candidate sound source distribution characteristics are not the already identified cough sounds, but rather all sound sources with distinguishable spatial concentration characteristics in the current acoustic environment of the target pigsty, along with their sound pressure levels and spatial location characteristics. This provides spatial objects for subsequent sound separation and cough identification for each candidate sound source. The sound velocity parameters are calculated based on real-time environmental parameters such as temperature, humidity, and air pressure within the target pigsty, combined with an air velocity calculation model, to obtain the real-time sound velocity parameters corresponding to the current acoustic propagation environment of the pigsty.

[0026] Figure 3 A flowchart illustrating the deblurred target acoustic imaging data obtained by the present invention is shown.

[0027] According to an embodiment of the present invention, the step of performing acoustic deblurring processing on the initial acoustic imaging data based on the candidate sound source distribution characteristics to obtain deblurred target acoustic imaging data specifically involves: The initial acoustic imaging data is spatially transformed to obtain spatial energy distribution data. Based on the spatial geometric center of the candidate sound source distribution characteristics, the sound source focal point is determined. Using each sound source focal point as the center, the spatial spectral energy gradient value between adjacent grid points is calculated along the spatial coordinate direction of the three-dimensional scanning grid points, as shown in the following equation: , In the formula, For two adjacent grid points along the search direction, For grid points Spatial spectral energy value at; The spatial spectral energy gradient values ​​of adjacent grid points are compared with a preset gradient threshold. The comparison is performed when the spatial spectrum energy gradient value changes from positive to negative and the absolute value of the negative value is greater than the gradient threshold. When, the grid point corresponding to the negative value is... Marked as acoustic energy fuzzy boundary points; Traverse all acoustic energy fuzzy boundary points corresponding to the focal points of all sound sources, fit their spatial coordinates with a convex hull, and use the spatial region enclosed by the closed surface obtained by the convex hull fitting as the fuzzy boundary region. Extract the fuzzy boundary region The spatial spectral energy values ​​of all grid points within the region are used to calculate the arithmetic mean of these energy values ​​as the background energy value of the fuzzy region. An adaptive energy decay function is then constructed based on this background energy value of the fuzzy region. The attenuation coefficient of the adaptive energy attenuation function is: , That is, the attenuation coefficient is proportional to the absolute value of the spatial spectrum energy gradient, and varies with the grid point and the focal point of the sound source. The distance increases monotonically as the distance increases, where, It is the attenuation adjustment coefficient and is greater than 0; The spatial spectral energy values ​​within the fuzzy boundary region are weighted point-by-point using the adaptive energy decay function, and the weighted spatial spectral energy values ​​are calculated as follows: , When the weighted spatial spectrum energy value of the grid points is lower than the background energy value of the blurred region When this occurs, the energy value of the grid point is set as the background energy value of the blurred region; The energy values ​​of grid points within the weighted fuzzy boundary region are then subjected to 3D Gaussian smoothing filtering using a 3D Gaussian kernel function to obtain the smoothed energy. , In the formula, The energy value of the spatial spectrum after weighting. Represents a three-dimensional convolution operation; The filtered grid point energy values ​​and the spatial spectrum energy values ​​at the sound source focal points are subjected to energy normalization processing to calculate the deblurred energy value corresponding to each sound source focal point: , In the formula, The normalized deblurred energy value. The spatial spectral energy value at the focal point of the sound source; Deblurred spatial energy distribution data is determined based on the deblurred energy value, and deblurred target acoustic imaging data is constructed based on the deblurred spatial energy distribution data.

[0028] It should be noted that due to the limited aperture of the microphone array, sound wave diffraction, and the reverberation caused by reflections from the pigsty walls, fences, and equipment, the actual sound source usually appears as a high-energy area spreading outwards in the initial sound image. The energy of adjacent sound sources may also overlap, resulting in unclear sound source boundaries and multiple sound sources sticking together. If the cough sound source is extracted directly from this, it is easy to mix in other environmental sounds.

[0029] By reorganizing the 3D scanning grid points and their spatial spectral energy values ​​in the initial acoustic imaging data into spatial energy distribution data according to spatial coordinates, each grid point corresponds to the actual spatial location in the target pigsty, facilitating subsequent calculations of energy gradient, spatial distance, and boundaries. Subsequently, using the spatial geometric center of the candidate sound source as the sound source focal point, a search is performed outwards from the focal point to the surrounding grid. By calculating the spatial spectral energy gradient of adjacent grid points, the location where the sound source energy transitions from enhancement to attenuation is determined, and the corresponding grid points are marked as acoustic energy fuzzy boundary points. Then, convex hull fitting is used to form a closed surface from the discrete boundary points, obtaining the fuzzy boundary region corresponding to each candidate sound source. Based on this, the average spatial spectral energy of the grid points within the fuzzy boundary region is calculated as the background energy to adapt to the actual background noise levels of different pigsty locations. Furthermore, an adaptive energy attenuation relationship is constructed based on the absolute value of the spatial spectral energy gradient and the distance between the grid point and the sound source focal point. This preserves the effective energy near the sound source, suppresses the diffused energy far from the sound source, and adjusts grid points with energy below the background energy level to the background energy level, avoiding energy voids in the sound source region. Subsequently, a three-dimensional Gaussian smoothing filter was used to eliminate abrupt changes in grid energy, and energy normalization was performed by combining the sound pressure level at the focal point of the sound source. This ensured that different candidate sound sources maintained a reasonable relative energy relationship, and finally, the spatial energy distribution was reconstructed, resulting in target acoustic imaging data with more concentrated sound source locations, clearer boundaries, and higher separation between adjacent sound sources. The spatial domain transformation refers to reorganizing each scanning grid point and its spatial spectrum energy value, represented by the acoustic imaging results in the initial acoustic imaging data, into three-dimensional spatial energy distribution data according to the three-dimensional spatial coordinates of the grid points. This ensures that each grid point corresponds to an actual spatial location in the target pigsty, and the spatial spectrum energy value corresponding to that location is used as the acoustic energy intensity at that location.

[0030] According to an embodiment of the present invention, the step of extracting spectral texture features and time-frequency energy features from the deblurred target acoustic imaging data based on a deep learning algorithm and classifying coughs to obtain the identification result data of coughs in pigsties within the target pigsty is as follows: The candidate sound source signals in the deblurred target acoustic imaging data are separated and extracted to obtain the time-domain acoustic signals of each candidate sound source. The time-domain acoustic signals are then processed by frame-segmentation and windowing. The framed time-domain acoustic signals are then converted to the frequency domain by short-time Fourier transform to obtain the time-spectrum data of each candidate sound source. Mel frequency scaling filtering is applied to the time-spectrum data to extract Mel frequency cepstral coefficients, which are used to construct spectral texture features. Simultaneously, the energy amplitude of each time-frequency point is calculated based on the time-spectrum data to construct a time-frequency energy distribution matrix, which is used to construct time-frequency energy features. Collect audio samples of pig coughing and non-coughing. Plot the time-domain waveform of the pig coughing audio samples to obtain a coughing audio waveform map. Use the coughing audio waveform map as a reference to extract the corresponding spectral texture features and time-frequency energy features as positive sample labels. Use the spectral texture features and time-frequency energy features corresponding to the non-coughing audio samples as negative sample labels to construct a training dataset. A convolutional neural network model is constructed, and the training dataset is input into the convolutional neural network model for iterative training to obtain a cough recognition and classification model. The spectral texture features and time-frequency energy features corresponding to the candidate sound sources are input into the cough recognition and classification model for forward inference. The output cough category probability... Greater than the preset probability threshold When the candidate sound source is determined to be the sound of a pig coughing, the recognition result data of the pig coughing in the target pig house is output.

[0031] It should be noted that by separating and extracting candidate sound sources from the deblurred target acoustic imaging data, different sound sources in the complex environment of a pigsty can be transformed into relatively independent time-domain acoustic signals of candidate sound sources, reducing mutual interference between equipment operation noise, ventilation noise, and pig activity noise. Based on this, the time-spectrum maps of candidate sound sources are obtained through frame-by-frame windowing and Fourier transform, and the Mel-frequency cepstral coefficients and time-frequency energy distribution matrix are extracted respectively. This gives the candidate sound sources multi-dimensional features that simultaneously reflect the spectral structure and energy change patterns of the sound, thus fully characterizing the acoustic features of pig coughing sounds, such as short-duration bursts, spectral concentration, and energy changes. Furthermore, a training dataset is constructed using cough samples and non-cough samples, and a convolutional neural network is used to jointly learn spectral texture features and time-frequency energy features. This reduces misidentification caused by relying on a single acoustic feature and improves the ability to distinguish between coughing sounds and non-coughing sounds in complex pigsty environments. Finally, the trained cough recognition and classification model automatically classifies the candidate sound sources, accurately filtering out pig coughing sounds from all candidate sound sources in the pigsty and outputting the corresponding cough recognition results.

[0032] According to an embodiment of the present invention, the step of determining the spatial coordinates of the cough sound source based on the recognition result data and the deblurred target sonographic image data, and jointly calculating the spatial coordinates based on a multi-point localization algorithm to construct a spatial distribution map of cough hotspots in the target pigsty, specifically involves: Based on the recognition results, candidate sound source markers identified as coughs are extracted. These candidate sound source markers are then spatially mapped to the deblurred target acoustic imaging data. The spatial grid point coordinates corresponding to the candidate sound source markers in the deblurred target acoustic imaging data are obtained, and the coordinates of the grid point with the highest deblurring energy value within its blurred boundary region are also determined. , As the spatial coordinates of the cough sound source, in the formula... The fuzzy boundary region corresponding to the candidate sound source identified as cough; Using the spatial coordinates of the cough sound source as a positioning reference point, the spatial coordinate positions of each element in the microphone array after the acquisition parameters have been calibrated are obtained in the target pigsty. And randomly select one array element as the reference array element. A distance difference matrix is ​​constructed from the spatial distance differences between each array element and the cough sound source. This distance difference matrix and the spatial coordinates of each array element are then substituted into the positioning equations of a multi-point positioning algorithm. Using the spatial coordinates of the cough sound source as the initial values ​​for iteration, a weighted least squares joint solution is performed, i.e., the solution is obtained. , In the formula, For the first The weighted coefficients corresponding to each array element are greater than 0. For the speed of sound, To calculate the spatial distance difference between each array element and the reference array element based on the spatial coordinates of the cough sound source and the spatial coordinates of each array element, For the first The estimated arrival time difference of each array element relative to the reference array element is used to obtain the three-dimensional spatial coordinate solution value of the cough sound source in the target pig house through joint calculation. The spatial distribution density of cough sound sources in the target pigsty space is determined based on the calculated three-dimensional spatial coordinates. The density is then analyzed within a statistical window using a kernel density estimation method. Density estimation is performed on the three-dimensional spatial coordinates of each cough sound source to calculate the probability density value at each cough sound source location: , In the formula, It is a three-dimensional Gaussian kernel function. The bandwidth parameter is used; the probability density value is mapped to the three-dimensional spatial coordinate system of the target pig house, and a spatial distribution map of cough hotspots is generated from the probability density value to obtain the spatial distribution map of cough hotspots of the target pig house.

[0033] It should be noted that by mapping the cough recognition results to the deblurred target acoustic imaging data, a correlation can be established between the identified cough events and their corresponding pigsty locations, avoiding the problem of being unable to determine the location of coughing pigs based solely on sound category. Furthermore, by constructing a distance difference matrix using the spatial distance differences between the cough source and each microphone array element, and combining this with the calibrated spatial coordinates of the array elements for multi-point joint calculation, the spatial observation information of multiple array elements can be used to cross-constrain the location of the cough source, reducing the positioning error of a single array element and the positional shift caused by acoustic reflection and reverberation, thus improving the positioning accuracy of the three-dimensional spatial coordinates of the cough source. Based on the three-dimensional coordinates of multiple cough sources, kernel density estimation is performed, transforming discrete cough events into a spatially continuous probability density distribution. This can intuitively reflect the degree of aggregation of cough sources in different areas, forming a three-dimensional spatial distribution map of cough hotspots in the target pigsty. This expands the analysis from single cough recognition to the analysis of cough spatial aggregation areas, providing spatial basis for quickly identifying cough concentration areas, assessing potential respiratory disease transmission risks, and conducting targeted inspections and prevention and control.

[0034] Figure 4 A block diagram of a pig cough recognition and localization system based on acoustic imaging according to the present invention is shown.

[0035] A second aspect of the present invention also provides a pig cough recognition and localization system based on acoustic imaging. The system includes: a memory 401, a processor 402, and a communication interface 403. The memory includes a program for a pig cough recognition and localization method based on acoustic imaging. The communication interface is used for data connection and communication between the memory and the processor. When the program for a pig cough recognition and localization method based on acoustic imaging is executed by the processor, it implements the steps of the pig cough recognition and localization method based on acoustic imaging as described in any of the above claims.

[0036] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0037] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0038] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for identifying and locating coughs in pigs based on acoustic imaging, characterized in that, Includes the following steps: Acquire the original acoustic signal data of each element in the microphone array in the target pig house, evaluate the amplitude and phase response consistency of each element based on the original acoustic signal data, and if there are abnormal elements in the amplitude and phase response error data of the evaluated elements that exceed the preset error threshold, perform acoustic signal acquisition calibration compensation on the abnormal elements to obtain the microphone array after acquisition parameter calibration. Acoustic signal data of array elements are obtained from the microphone array calibrated according to the acquisition parameters. The cross power spectrum matrix between array elements is constructed. The cross power spectrum matrix is ​​spatially estimated based on the beamforming algorithm. The sound pressure level intensity features and spatial geometric features of candidate sound sources are extracted from the obtained initial acoustic imaging data to obtain the distribution features of candidate sound sources. Based on the distribution characteristics of the candidate sound sources, the initial acoustic imaging data is subjected to acoustic deblurring to obtain the deblurred target acoustic imaging data. Based on deep learning algorithms, spectral texture features and time-frequency energy features are extracted from the deblurred target acoustic imaging data, and cough recognition and classification are performed to obtain the recognition result data of coughing pigs in the target pigsty. Based on the identification result data and the deblurred target sonographic image data, the spatial coordinates of the cough sound source are determined. The spatial coordinates are then jointly calculated based on a multi-point localization algorithm to construct a spatial distribution map of the cough hotspots in the target pigsty.

2. The method for identifying and locating pig coughs based on acoustic imaging according to claim 1, characterized in that, The process involves acquiring the raw acoustic signal data of each element in the microphone array within the target pigsty, evaluating the amplitude and phase response consistency of each element based on the raw acoustic signal data, and if any abnormal element is found in the evaluated amplitude and phase response error data exceeding a preset error threshold, then the abnormal element undergoes acoustic signal acquisition calibration compensation to obtain a microphone array with calibrated acquisition parameters. Specifically: The original acoustic signal data of each element in the microphone array in the target pig house is acquired. The original acoustic signal data is synchronously extracted according to the same time window. Fourier transform is performed on the acoustic signal in the corresponding time window of each element to obtain the complex spectrum data of each element in the corresponding frequency component. Using any one array element as the response reference element, the amplitude ratio and phase difference of the complex spectrum data of the remaining array elements are calculated by comparing them with the complex spectrum data of the response reference element, thus obtaining the amplitude response difference of each array element relative to the response reference element. and phase response difference ,satisfy: , In the formula, The frequency component number. In response to the reference element number, The array element number and , This represents the total number of elements in the microphone array. This represents the modulo operation on complex numbers. To represent the argument of a complex number, the superscript is used. Indicates complex conjugation. Perform Fourier transform on the acoustic signal of each array element within the corresponding time window to obtain the complex spectrum data of the corresponding frequency components. For the first Each element within its time window Acoustic signal sample values ​​at each sampling point; The amplitude response error data of the array elements is constructed based on the amplitude response difference, and the equivalent time delay of each array element is fitted based on the phase response difference and the frequency change relationship to obtain the phase response error data of the array elements. The array element amplitude response error data and array element phase response error data are compared with the preset error threshold respectively to determine the presence of abnormal array elements whose amplitude response error or phase response error exceeds the preset error threshold. For the abnormal array element, an amplitude-phase calibration transfer function is constructed based on its complex spectrum ratio relative to the response reference array element. The amplitude-phase calibration transfer function is fitted by the least squares method to determine the amplitude compensation coefficient and phase compensation amount of the abnormal array element. The amplitude compensation coefficient is applied to the amplitude of the acquired signal of the abnormal array element, and the phase compensation amount is converted into the corresponding time delay compensation parameter. Amplitude gain correction and time alignment compensation are performed on the acoustic signal acquired by the abnormal array element. The frequency domain response of each array element's acoustic signal after compensation is compared to obtain the compensated amplitude response error and phase response error. The compensated array element response parameters are then used as the acoustic signal acquisition parameters of each array element to obtain the microphone array with the acquisition parameters calibrated.

3. The method for identifying and locating pig coughs based on acoustic imaging according to claim 1, characterized in that, The microphone array, calibrated according to the acquisition parameters, acquires acoustic signal data of its elements, constructs a cross-power spectrum matrix between the elements, performs spatial spectrum estimation on the cross-power spectrum matrix based on a beamforming algorithm, and extracts sound pressure level intensity features and spatial geometric features of candidate sound sources from the obtained initial acoustic image data to obtain the distribution features of candidate sound sources. Specifically: The synchronous acoustic signal data of each element of the microphone array is acquired according to the calibrated acquisition parameters. The synchronous acoustic signal data is then processed by frame segmentation and windowing. The time-domain acoustic signal of each element after frame segmentation is converted to the frequency domain by short-time Fourier transform to obtain the complex spectrum data of each element at multiple frequency points. For each frequency point, the first The complex spectrum data of the first array element and the first array element The conjugate multiplication of the complex spectrum data of each array element yields the result at each frequency point. Each element and the first The cross-power spectral density values ​​between array elements, and for continuous The frames are accumulated and averaged to form the cross-power spectrum matrix between the array elements. ,satisfy: , In the formula, Let H be the column vector formed by the complex spectra of each array element, where the superscript H denotes the conjugate transpose. The frame number, For frequency; Based on beamforming algorithms, a three-dimensional scanning grid is divided within the target pigsty space. According to the spatial coordinates of each array element in the microphone array and the sound velocity parameter, the array steering vector corresponding to each scanning grid point is constructed using the propagation delay. , For each scan grid point Reaching the The propagation delay of each array element, where the superscript T denotes the transpose matrix. The imaginary unit; Substitute the array steering vector corresponding to each scanning grid point into the cross power spectrum matrix for weighted summation to obtain the spatial spectrum energy value of each scanning grid point, and construct the initial acoustic imaging data based on the spatial spectrum energy value. Local maxima search is performed on the initial acoustic imaging data. Grid points with spatial spectral energy values ​​greater than the average energy of adjacent grid points are marked as candidate sound source points. The sound pressure level intensity value at each candidate sound source point is extracted, and a local spatial neighborhood is determined with the candidate sound source point as the center. The spatial coordinate centroid of all grid points in the neighborhood is calculated as the spatial geometric center of the candidate sound source point. The distribution characteristics of the candidate sound source are constituted based on the sound pressure level intensity value and the spatial geometric center.

4. The method for identifying and locating pig coughs based on acoustic imaging according to claim 1, characterized in that, The step of performing acoustic deblurring on the initial acoustic imaging data based on the candidate sound source distribution characteristics to obtain the deblurred target acoustic imaging data specifically involves: The initial acoustic imaging data is transformed into spatial domain to obtain spatial energy distribution data. The focal point of the sound source is determined based on the spatial geometric center in the distribution characteristics of the candidate sound source. With each focal point of the sound source as the center, the spatial spectral energy gradient value between adjacent grid points is calculated along the spatial coordinate direction of the three-dimensional scanning grid points. The spatial spectrum energy gradient values ​​of adjacent grid points are compared with a preset gradient threshold. When the spatial spectrum energy gradient value changes from a positive value to a negative value, the grid point corresponding to the negative value is marked as an acoustic energy fuzzy boundary point. Traverse all acoustic energy fuzzy boundary points corresponding to the focal points of all sound sources, fit their spatial coordinates with a convex hull, and use the spatial region enclosed by the closed surface obtained by the convex hull fitting as the fuzzy boundary region. Extract the spatial spectrum energy values ​​of all grid points within the fuzzy boundary region, calculate the arithmetic mean of these energy values ​​as the background energy value of the fuzzy region, and construct an adaptive energy attenuation function based on the background energy value of the fuzzy region. The attenuation coefficient of the adaptive energy attenuation function is proportional to the absolute value of the spatial spectrum energy gradient value, and the attenuation coefficient increases monotonically as the distance between the grid point and the focal point of the sound source increases. The spatial spectrum energy value within the fuzzy boundary region is weighted point by point using the adaptive energy decay function. When the spatial spectrum energy value of a grid point is lower than the background energy value of the fuzzy region, the energy value of the grid point is set to the background energy value of the fuzzy region. Three-dimensional Gaussian smoothing filter is applied to the energy values ​​of grid points in the weighted fuzzy boundary region. The filtered grid point energy values ​​and the sound pressure level intensity values ​​at the sound source focal point are then normalized to obtain the defuzzified energy value corresponding to each sound source focal point. The deblurred energy value is used to determine the deblurred spatial energy distribution data, and the deblurred target acoustic imaging data is constructed based on the deblurred spatial energy distribution data.

5. The method for identifying and locating pig coughs based on acoustic imaging according to claim 1, characterized in that, The method involves extracting spectral texture features and time-frequency energy features from the deblurred target acoustic imaging data using a deep learning algorithm, and classifying coughs to obtain the identification results of pigs coughing in the target pigsty. Specifically: Candidate sound source signals in the deblurred target acoustic imaging data are separated and extracted to obtain the time-domain acoustic signals of each candidate sound source. The time-domain acoustic signals are then subjected to frame-by-frame windowing processing. The framed time-domain acoustic signals are then transformed to the frequency domain through Fourier transform to obtain the time-spectrum data of each candidate sound source. Mel frequency scaling filtering is applied to the time-spectrum data to extract Mel frequency cepstral coefficients. The Mel frequency cepstral coefficients are used to construct spectral texture features. At the same time, the energy amplitude of each time-frequency point is calculated based on the time-spectrum data to construct a time-frequency energy distribution matrix. The time-frequency energy distribution matrix is ​​used to construct time-frequency energy features. Collect audio samples of pig coughing and non-coughing. Plot the time-domain waveform of the pig coughing audio samples to obtain a coughing audio waveform map. Use the coughing audio waveform map as a reference to extract the corresponding spectral texture features and time-frequency energy features as positive sample labels. Use the spectral texture features and time-frequency energy features corresponding to the non-coughing audio samples as negative sample labels to construct a training dataset. A convolutional neural network model is constructed, and the training dataset is input into the convolutional neural network model for iterative training to obtain a cough recognition and classification model. The spectral texture features and time-frequency energy features corresponding to the candidate sound sources are input into the cough recognition and classification model for forward inference, and the recognition result data of the cough of pigs in the target pigsty is output.

6. The method for identifying and locating pig coughs based on acoustic imaging according to claim 1, characterized in that, The step involves determining the spatial coordinates of the cough sound source based on the recognition result data and the deblurred target sonographic image data, and then jointly calculating the spatial coordinates based on a multi-point localization algorithm to construct a spatial distribution map of cough hotspots in the target pigsty. Specifically: Based on the recognition result data, candidate sound source markers that are determined to be coughs are extracted. The candidate sound source markers that are determined to be coughs are spatially mapped with the deblurred target acoustic imaging data. The spatial grid point coordinates corresponding to the candidate sound source markers that are determined to be coughs in the deblurred target acoustic imaging data are obtained, and the spatial coordinates of the cough sound source are obtained. Using the spatial coordinates of the cough sound source as a positioning reference point, the spatial coordinate positions of each element in the microphone array after the acquisition parameters have been calibrated are obtained in the target pigsty. And randomly select one array element as the reference array element. A distance difference matrix is ​​constructed from the spatial distance differences between each array element and the cough sound source. This distance difference matrix and the spatial coordinates of each array element are then substituted into the positioning equations of a multi-point positioning algorithm. Using the spatial coordinates of the cough sound source as the initial values ​​for iteration, a weighted least squares joint solution is performed, i.e., the solution is obtained. , In the formula, For the first The weighted coefficients corresponding to each array element are greater than 0. For the speed of sound, To calculate the spatial distance difference between each array element and the reference array element based on the spatial coordinates of the cough sound source and the spatial coordinates of each array element, For the first The estimated arrival time difference of each array element relative to the reference array element is used to obtain the three-dimensional spatial coordinate solution value of the cough sound source in the target pig house through joint calculation. The spatial distribution density of cough sound sources in the target pigsty space is determined based on the calculated three-dimensional spatial coordinates. The density is then analyzed within a statistical window using a kernel density estimation method. Density estimation is performed on the three-dimensional spatial coordinates of each cough sound source to calculate the probability density value at each cough sound source location: , In the formula, It is a three-dimensional Gaussian kernel function. The bandwidth parameter is used; the probability density value is mapped to the three-dimensional spatial coordinate system of the target pig house, and a spatial distribution map of cough hotspots is generated from the probability density value to obtain the spatial distribution map of cough hotspots of the target pig house.

7. A system for recognizing and locating coughs in pigs based on acoustic imaging, characterized in that, The acoustic imaging-based pig cough recognition and localization system includes a memory and a processor. The memory includes a program for an acoustic imaging-based pig cough recognition and localization method. When the program is executed by the processor, it implements the steps of the acoustic imaging-based pig cough recognition and localization method as described in any one of claims 1 to 6.