CN113326899A - Piglet compression detection method based on deep learning model - Google Patents

Piglet compression detection method based on deep learning model Download PDF

Info

Publication number
CN113326899A
CN113326899A CN202110724368.2A CN202110724368A CN113326899A CN 113326899 A CN113326899 A CN 113326899A CN 202110724368 A CN202110724368 A CN 202110724368A CN 113326899 A CN113326899 A CN 113326899A
Authority
CN
China
Prior art keywords
microphone
piglet
sound
cnn
sound source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110724368.2A
Other languages
Chinese (zh)
Inventor
杜晓冬
樊士冉
张瑞雪
张志勇
陈麒麟
闫雪冬
赵铖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xinliu Agriculture And Animal Husbandry Technology Co ltd
New Hope Group Co ltd
Shandong New Hope Liuhe Agriculture And Animal Husbandry Technology Co ltd
Sichuan New Hope Liuhe Pig Breeding Technology Co ltd
Xiajin New Hope Liuhe Agriculture And Animal Husbandry Co ltd
Tibet Xinhao Technology Co ltd
Shandong New Hope Liuhe Group Co Ltd
New Hope Liuhe Co Ltd
Original Assignee
Beijing Xinliu Agriculture And Animal Husbandry Technology Co ltd
New Hope Group Co ltd
Shandong New Hope Liuhe Agriculture And Animal Husbandry Technology Co ltd
Sichuan New Hope Liuhe Pig Breeding Technology Co ltd
Xiajin New Hope Liuhe Agriculture And Animal Husbandry Co ltd
Tibet Xinhao Technology Co ltd
Shandong New Hope Liuhe Group Co Ltd
New Hope Liuhe Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xinliu Agriculture And Animal Husbandry Technology Co ltd, New Hope Group Co ltd, Shandong New Hope Liuhe Agriculture And Animal Husbandry Technology Co ltd, Sichuan New Hope Liuhe Pig Breeding Technology Co ltd, Xiajin New Hope Liuhe Agriculture And Animal Husbandry Co ltd, Tibet Xinhao Technology Co ltd, Shandong New Hope Liuhe Group Co Ltd, New Hope Liuhe Co Ltd filed Critical Beijing Xinliu Agriculture And Animal Husbandry Technology Co ltd
Priority to CN202110724368.2A priority Critical patent/CN113326899A/en
Publication of CN113326899A publication Critical patent/CN113326899A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a piglet stressed detection method based on a deep learning model, which relates to the technical field of breeding, and adopts the technical scheme that a microphone array is arranged in a column of a pig delivery room; collecting the sound of two columns through a microphone; judging the position of a sound source according to the collected sound; and (4) judging whether the piglets are pressed or not by combining a piglet pressed sounding model established based on the CNN and the spectrogram. The invention has the beneficial effects that: the method provided by the scheme can relieve the demand of the delivery room on labor force, reduce the production management cost of enterprises and improve the intelligence level of livestock breeding. In addition, from the production perspective, the method of the scheme can reduce the death and culling rate of piglets, save more piglets, convert the piglets into growing-finishing pigs which are continuously cultivated, and greatly help to further improve the operating profit of livestock enterprises.

Description

Piglet compression detection method based on deep learning model
Technical Field
The invention relates to the technical field of breeding, in particular to a piglet pressure detection method based on a deep learning model.
Background
According to statistics, the phenomenon that 1 piglet is pressed by the sow every 10 piglets occurs in the farrowing process of the sow. Nearly half of the deaths occur in the first 3 days after birth. Piglets have a hope of surviving if they stand up within 3 minutes of the sow pressing on them. When the piglet is pressed, the piglet rushes to the sow by a feeder, the piglet is taken up by beating the piglet, and the sow does not stand after the piglet is beaten, so that the piglet is relieved by artificial subjective intention and behavior, time and labor are wasted, and the problem of pain spots cannot be effectively solved.
Furthermore, the complexity of the livestock farming environment also presents a significant challenge to the operational stability of some automated farming plants, such as: the invention discloses a statistical method for evaluating the effectiveness of piglet pressed detection, which aims at solving the problem and combines actual production performance indexes to provide a statistical method for evaluating the effectiveness of the piglet pressed detection by combining image or sound technology, wherein the statistical method is used for researching that the problem can be solved by image or sound technology, hopefully acquiring the sound near a obstetric table where a sow lies in a real-time non-contact manner, identifying whether a piglet sends a distress signal by using a pattern recognition technology, providing timely feedback information to an actuating mechanism (such as a mechanical arm, an electric stimulation device and the like) and a professional feeding manager, rescuing the piglet at the first time, but no mature commercial product or scheme exists on the market, and the accuracy of piglet pressed detection based on the image/sound detection technology is lower than that of human ear/human eye detection in some aspects and cannot be accurately recognized by percentage, the method can analyze whether the detected pressed event is effectively processed or not, so that the similar technology has wide research and promotion space and the application feasibility of the similar technology is evaluated.
Disclosure of Invention
Aiming at the technical problems, the invention provides a piglet pressure detection method based on a deep learning model.
The technical scheme includes that S1 microphone arrays are arranged in the pig delivery room columns, the microphone arrays are arranged on column walls adjacent to the two pig delivery room columns, the microphone arrays are arranged in the middle of the column walls, the microphone arrays comprise even numbers of microphones, and the microphones are symmetrically distributed towards the two columns;
s2, collecting the sound of two columns through a microphone;
s3, judging the position of the sound source according to the sound collected in S2;
s4, judging whether the piglet is pressed or not by combining a piglet pressed sounding model established based on the CNN and the spectrogram;
and carrying out short-time Fourier transform on the voice signal to obtain linear frequency scale characteristics, converting the linear frequency scale into MEL frequency scale, and taking the MEL frequency scale as an input parameter of the CNN model.
Preferably, the S3 is a method for determining the sound source position according to the sound collected in S2, specifically,
each microphone array comprises 4 microphones, and sound source signals can be positioned in a two-dimensional plane based on any 3 microphones;
let the sound source position be P (x, y), where 3 microphone positions are located at point S respectively1(-a,0)、S2(0,0)、S3(b,0) point P (x, y) is formed by θ and PS2Denotes that theta is a line segment S2S3And a segment PS2Angle between, PO i.e. r2These parameters are obtained by geometric calculations:
Figure BDA0003137965290000021
Figure BDA0003137965290000022
Figure BDA0003137965290000023
in the formula, r1From the sound source point P to the respective microphone points Si(i ═ 1,2, 3); a is a microphone S1And S2The distance between them; b is a microphone S2And S3Distance between r1The units of a and b are m;
suppose that the speed of sound c is 340m/s, t12Indicating the arrival of the sound source signal at the microphone S1And S2Time difference between t23Indicating the arrival of the sound source signal at the microphone S2And S3Time difference between t12And t23The unit of (a) is s; the time delay estimation can be obtained by the trigonometric cosine theorem:
Figure BDA0003137965290000024
Figure BDA0003137965290000025
r1-r2=ct12
r2-r3=ct23
thereby obtaining r by the following formula2And the value of cos θ:
Figure BDA0003137965290000026
Figure BDA0003137965290000027
preferably, in S4, MEL frequency scale is used as an input parameter of the CNN model, wherein the MEL frequency scale conversion formula adopts a MEL frequency filter bank, the MEL frequency scale conversion formula includes M filters, and the M value is usually 22 to 26, which mainly considers that the M value is to conform to the distribution of the critical frequency band. Human perception of pitch is non-linear, with the filter bank being approximately linear on a scale below 1000Hz and logarithmic on a scale above 1000 Hz. Assuming that the center frequency of the triangular band-pass filter is f (M), M is 1,2, …, M, the interval between the center frequencies increases with the increase of the value of M and decreases with the decrease of the value of M, the center frequencies of the filter group are distributed at equal intervals on the Mel frequency axis,
Figure BDA0003137965290000031
preferably, the specific case provided by the present scheme can identify a sound type n _ classes ═ 16, that is, 16 types of sound, including: the method has the advantages that the sound of water drinking of the sows, the sound of a fan, the sound of food intake of the sows, the sound of hurling the sows, the humming sound of the sows, the barking sound of the sows, the snoring sound of the sows, the sound of pressed piglets, the sound of dry-calling piglets, the sound of milk robbing of the piglets and the like can be detected, namely the CNN model method provided by the scheme can be used for detecting the sound of pressed piglets and can also be used as a reference model for detecting the sounds of other types, and the average recognition rate is more than 90%.
The convolution kernel size in the CNN model is kernel _ h, kernel _ w is 5, dropout is 0.2, the reason for setting dropout is to avoid model training overfitting, and the number of spectrogram channels is depth _ in is 3, namely RGB three channels.
Preferably, in the CNN model, the number of convolution kernels of the first layer of convolution is depth _ out1 ═ 32, the number of convolution kernels of the second layer of convolution is depth _ out2 ═ 64, the type of image data fed to the CNN network is a four-dimensional array dimension, the data size of the first dimension training is batch _ size ═ 32, that is, the size of a training image block is 32, the second dimension and the third dimension are the image size of a spectrogram, and the fourth dimension is the number of image channels, that is, depth _ in;
x=tf.placeholder(tf.float32,[None,360,360,3])
y=tf.placeholder(tf.float32,[None,n_classes])
x and y are image data and image labels, respectively.
Preferably, the activation function in the CNN network structure selects a relu function, and the mathematical formula is as follows:
Figure BDA0003137965290000032
selecting a cross entropy loss function, namely a Softmax function, from a CNN network structure, calculating a loss value of the network, using AdamaOptizer as an optimizer to perform iterative learning training, assuming that the original output of the neural network is y1, y2, … and yn, and the output after Softmax regression processing is as follows:
Figure BDA0003137965290000033
wherein, yiAnd e is a natural constant, namely an Euler number, the output of a single node is changed into a probability value, and the result is used as the final output of the neural network after the Softmax processing. The recognition model of the voice is trained by means of the strong characteristic learning ability of deep learning, the learning rate is 0.0001 after 1000 epochs, the final loss function value is 236408, and the average accuracy rate is 96.88%.
The technical scheme provided by the embodiment of the invention has the following beneficial effects: the scheme adopts a non-contact sound and image detection technology, has the advantages of high detection speed, low long-term running cost, time and labor saving and the like, and has wide research space and good application effect. The method provided by the scheme can relieve the demand of the delivery room on labor force, reduce the production management cost of enterprises and improve the intelligence level of livestock breeding. In addition, from the production perspective, the method of the scheme can reduce the death and culling rate of piglets, save more piglets, convert the piglets into growing-finishing pigs which are continuously cultivated, and greatly help to further improve the operating profit of livestock enterprises.
Drawings
FIG. 1 is a flow chart of a method according to an embodiment of the present invention.
Fig. 2 is a diagram of a microphone array arrangement according to an embodiment of the invention.
Fig. 3 is a schematic diagram of sound source location coordinates according to an embodiment of the present invention.
Fig. 4 is a spectrogram of an embodiment of the present invention.
Fig. 5 is a schematic diagram of a mel-frequency filter bank according to an embodiment of the present invention.
Fig. 6 is a structural visualization diagram of a CNN model according to an embodiment of the present invention.
Wherein the reference numerals are: 1. an array of microphones.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative of the invention and are not intended to be limiting.
It should be noted that the embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like are used in the orientation or positional relationship indicated in the drawings, which are merely for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced device or element must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be construed as limiting the invention. Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the invention, the meaning of "a plurality" is two or more unless otherwise specified.
In the description of the invention, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted", "connected" and "disposed" are to be construed broadly, e.g. as being fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the creation of the present invention can be understood by those of ordinary skill in the art through specific situations.
Example 1
The invention provides a piglet pressed detection method based on a deep learning model, and S1, a microphone array 1 is arranged in a pig delivery room column, the microphone array 1 is arranged on column walls adjacent to two pig delivery room columns, the microphone array 1 is arranged in the middle of the column walls, the microphone array comprises an even number of microphones, and the microphones are symmetrically distributed towards the two columns;
s2, collecting the sound of two columns through a microphone;
s3, judging the position of the sound source according to the sound collected in S2;
s4, judging whether the piglet is pressed or not by combining a piglet pressed sounding model established based on the CNN and the spectrogram;
and carrying out short-time Fourier transform on the voice signal to obtain linear frequency scale characteristics, converting the linear frequency scale into MEL frequency scale, and taking the MEL frequency scale as an input parameter of the CNN model.
S3 a method of judging the position of the sound source based on the sound collected at S2, specifically,
each microphone array 1 comprises 4 microphones, and sound source signals can be positioned in a two-dimensional plane based on any 3 microphones;
as can be seen from the above figure, let the sound source position be P (x, y), where 3 microphone positions are located at the point S respectively1(-a,0)、S2(0,0)、S3(b,0) point P (x, y) is formed by θ and PS2Denotes that theta is a line segment S2S3And a segment PS2Angle between, PO i.e. r2These parameters are obtained by geometric calculations:
Figure BDA0003137965290000051
Figure BDA0003137965290000052
Figure BDA0003137965290000053
in the formula, r1From the sound source point P to the respective microphone points Si(i ═ 1,2, 3); a is a microphone S1And S2The distance between them; b is a microphone S2And S3Distance between r1The units of a and b are m;
suppose that the speed of sound c is 340m/s, t12Indicating the arrival of the sound source signal at the microphone S1And S2Time difference between t23Indicating the arrival of the sound source signal at the microphone S2And S3Time difference between t12And t23The unit of (a) is s; the time delay estimation can be obtained by the trigonometric cosine theorem:
Figure BDA0003137965290000061
Figure BDA0003137965290000062
r1-r2=ct12
r2-r3=ct23
thereby obtaining r by the following formula2And the value of cos θ:
Figure BDA0003137965290000063
Figure BDA0003137965290000064
in S4, MEL frequency scale is used as an input parameter of the CNN model, wherein a Mel frequency scale conversion formula adopts a Mel frequency filter bank, the filter bank comprises M filters, the M value is usually 22-26, and the M value is mainly considered to be in accordance with the distribution of a critical frequency band. Human perception of pitch is non-linear, with the filter bank being approximately linear on a scale below 1000Hz and logarithmic on a scale above 1000 Hz. Assuming that the center frequency of the triangular band-pass filter is f (M), M is 1,2, …, M, the intervals between the center frequencies are as shown in FIG. 4, the center frequencies of the filter group are distributed with equal intervals on the Mel frequency axis as the M value increases and the M value decreases,
Figure BDA0003137965290000065
the specific case provided by the present scheme can identify a sound type n _ classes ═ 16, that is, 16 types of sound, including: the method has the advantages that the sound of water drinking of the sows, the sound of a fan, the sound of food intake of the sows, the sound of hurling the sows, the humming sound of the sows, the barking sound of the sows, the snoring sound of the sows, the sound of pressed piglets, the sound of dry-calling piglets, the sound of milk robbing of the piglets and the like can be detected, namely the CNN model method provided by the scheme can be used for detecting the sound of pressed piglets and can also be used as a reference model for detecting the sounds of other types, and the average recognition rate is more than 90%.
The convolution kernel size in the CNN model is kernel _ h, kernel _ w is 5, dropout is 0.2, and the reason for setting dropout is to avoid model training overfitting, and the number of spectrogram channels is depth _ in is 3, namely RGB three channels.
In the CNN model, the number of convolution kernels of the first layer of convolution is depth _ out 1-32, the number of convolution kernels of the second layer of convolution is depth _ out 2-64, the image data type fed to the CNN network is in a four-dimensional array dimension, the data size of the first dimension training is batch _ size-32, namely the size of a training image block is 32, the second dimension and the third dimension are the image size of a spectrogram, and the fourth dimension is the number of image channels, namely depth _ in;
x=tf.placeholder(tf.float32,[None,360,360,3])
y=tf.placeholder(tf.float32,[None,n_classes])
x and y are image data and image labels, respectively.
The activating function in the CNN network structure selects a relu function, and the mathematical formula is as follows:
Figure BDA0003137965290000071
selecting a cross entropy loss function, namely a Softmax function, from a CNN network structure, calculating a loss value of the network, using AdamaOptizer as an optimizer to perform iterative learning training, assuming that the original output of the neural network is y1, y2, … and yn, and the output after Softmax regression processing is as follows:
Figure BDA0003137965290000072
wherein, yiAnd e is a natural constant, namely an Euler number, the output of a single node is changed into a probability value, and the result is used as the final output of the neural network after the Softmax processing. The recognition model of the voice is trained by means of the strong characteristic learning ability of deep learning, the learning rate is 0.0001 after 1000 epochs, the final loss function value is 236408, and the average accuracy rate is 96.88%.
Example 2
On the basis of the embodiment 1, the hardware of the microphone array 1 is selected from a professional recording microphone K053, the sensitivity is minus 38 +/-3 dB, the directivity is heart-shaped pointing, the frequency response is 50 Hz-16 kHz, the output impedance is less than or equal to 680 omega, and the signal-to-noise ratio is greater than or equal to 70dB, and is 3.5mm or a USB (universal serial bus) conversion head. The microphone array is used for predicting the specific column of the pressed piglet by the sound source localization technology, as shown in figure 2,
in fig. 2, the mounting position of the microphone array 1 is the center of two adjacent delivery room columns, and the sound direction is judged by comparing the spectral energy or the time domain energy of the sound sources from the two columns. If the number of microphones is increased from 2 (default) to 4, the positions of sound sources inside the same column, for example, the area positions of positive 2 (15-29 sound source angles) and positive 1 (0-15 sound source angles) in the left column in fig. 2, can be further known.
Taking an algorithm of sound source localization with 4 microphones as a linear array as an example, the method is based on sound source signals that any 3 microphones can localize to a two-dimensional plane.
As can be seen from FIG. 3, let the sound source position be P (x, y), where the 3 microphone positions are located at the point S respectively1(-a,0)、S2(0,0)、S3(b,0) point P (x, y) is formed by θ and PS2Denotes that theta is a line segment S2S3And a segment PS2Angle between, PO i.e. r2These parameters are obtained by geometric calculations:
Figure BDA0003137965290000081
Figure BDA0003137965290000082
Figure BDA0003137965290000083
in the formula, r1From the sound source point P to the respective microphone points Si(i ═ 1,2, 3); a is a microphone S1And S2The distance between them; b is a microphone S2And S3Distance between r1The units of a and b are m;
suppose that the speed of sound c is 340m/s, t12Indicating the arrival of the sound source signal at the microphone S1And S2Time difference between t23Indicating the arrival of the sound source signal at the microphone S2And S3Time difference between t12And t23The unit of (a) is s; the time delay estimation can be obtained by the trigonometric cosine theorem:
Figure BDA0003137965290000084
Figure BDA0003137965290000085
r1-r2=ct12formula (6)
r2-r3=ct23Formula (7)
Solving the equation, obtaining nested formulas (6) to (7) and obtaining r2And solution of cos θ
Figure BDA0003137965290000086
Figure BDA0003137965290000087
According to the scheme, a deep learning model is taken as an example, and modeling of the piglet squawk is realized based on the CNN and the spectrogram in a pattern recognition process. The specific case of the invention is to convert the spectrum into Mel frequency scale by using python library 0.6, then the spectrum is used as the input parameter of the CNN model, 80% of the spectrum is used as a training set and a verification set, about 8000 images, 20% of the images are used as a test set, and about 2000 images.
The Mel frequency scale conversion formula adopts a Mel frequency filter bank, the filter bank comprises M filters, the M value is usually 22-26, and the M value is mainly considered to be in accordance with the distribution of a critical frequency band. Human perception of pitch is non-linear, with the filter bank being approximately linear on a scale below 1000Hz and logarithmic on a scale above 1000 Hz. Assuming that the center frequency of the triangular band-pass filter is f (M), M is 1,2, …, M, the intervals between the center frequencies are as shown in FIG. 5, the center frequencies of the filter group are distributed with equal intervals on the Mel frequency axis as the M value increases and the M value decreases,
Figure BDA0003137965290000091
the scheme can identify a sound type n _ classes ═ 16, namely 16 types of sound, and comprises the following steps: the CNN model method provided by the invention can detect the sound of pressed piglets and can also be used as a reference model for detecting other types of sounds, and the average recognition rate is more than 90%.
The convolution kernel size in the model is kernel _ h, kernel _ w is 5, dropout is 0.2, and the reason for setting dropout is to avoid model training overfitting, and the number of channels in the spectrogram is depth _ in is 3, namely, three channels of RGB. The number of convolution kernels of the first layer of convolution is depth _ out1 ═ 32, the number of convolution kernels of the second layer of convolution is depth _ out2 ═ 64, the type of image data fed to the CNN network is a four-dimensional array dimension, the data size of the first dimension training is batch _ size ═ 32, that is, the size of the training image block is 32, the second and third dimensions are the image size of the spectrogram, and the fourth dimension is the number of image channels, that is, the aforementioned depth _ in. x and y are image data and image labels, respectively:
x=tf.placeholder(tf.float32,[None,360,360,3])
y=tf.placeholder(tf.float32,[None,n_classes])
referring to fig. 6, fig. 6 is a visual diagram of the structure of the CNN model of the present solution. The activating function in the CNN network structure selects a relu function, and the mathematical formula is as follows:
Figure BDA0003137965290000092
selecting a cross entropy loss function, namely a Softmax function, from a CNN network structure, calculating a loss value of the network, using AdamaOptizer as an optimizer to perform iterative learning training, assuming that the original output of the neural network is y1, y2, … and yn, and the output after Softmax regression processing is as follows:
Figure BDA0003137965290000093
wherein, yiAnd e is a natural constant, namely an Euler number, the output of a single node is changed into a probability value, and the result is used as the final output of the neural network after the Softmax processing. The recognition model of the voice is trained by means of the strong characteristic learning ability of deep learning, the learning rate is 0.0001 after 1000 epochs, the final loss function value is 236408, and the average accuracy rate is 96.88%.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (6)

1. A piglet pressure detection method based on a deep learning model is characterized by comprising the following steps of,
s1, microphone arrays (1) are arranged in the pig delivery room columns, the microphone arrays (1) are arranged on column walls adjacent to the two pig delivery room columns, the microphone arrays (1) are arranged in the middle of the column walls, the microphone arrays comprise an even number of microphones, and the microphones are symmetrically distributed towards the two columns;
s2, collecting the sound of two columns through a microphone;
s3, judging the position of the sound source according to the sound collected in S2;
s4, judging whether the piglet is pressed or not by combining a piglet pressed sounding model established based on the CNN and the spectrogram;
and carrying out short-time Fourier transform on the voice signal to obtain linear frequency scale characteristics, converting the linear frequency scale into MEL frequency scale, and taking the MEL frequency scale as an input parameter of the CNN model.
2. The method for detecting the piglet pressed based on the deep learning model as claimed in claim 1, wherein the step S3 is a method for determining the sound source position according to the sound collected in the step S2,
each microphone array (1) comprises 4 microphones, and sound source signals can be positioned in a two-dimensional plane based on any 3 microphones;
let the sound source position be P (x, y), where 3 microphone positions are located at point S respectively1(-a,0)、S2(0,0)、S3(b,0) point P (x, y) is formed by θ and PS2Denotes that theta is a line segment S2S3And a segment PS2Angle between, PO i.e. r2
R is obtained by2And the value of cos θ:
Figure FDA0003137965280000011
Figure FDA0003137965280000012
wherein a is the microphone S1And S2B is the microphone S2And S3C is the speed of sound, t12Indicating the arrival of the sound source signal at the microphone S1And S2Time difference between t23Indicating the arrival of the sound source signal at the microphone S2And S3The time difference between them.
3. The method for detecting piglet stress according to claim 1, wherein in S4, MEL frequency scale is used as an input parameter of the CNN model, wherein MEL frequency scale conversion formula adopts MEL frequency scale filter bank, M filters are included in the filter bank, M is 22-26, M is the center frequency of the triangular band pass filter (f) (M), M is 1,2, …, M, the interval between the center frequencies increases with the increase of M and decreases with the decrease of M, the center frequencies of the filter bank are distributed at equal intervals on MEL frequency axis,
Figure FDA0003137965280000021
4. the piglet stress detection method based on the deep learning model as claimed in claim 3, wherein the CNN model has a kernel _ h, a kernel _ w-5, a dropout-0.2, and a spectrogram channel number depth _ in-3.
5. The piglet stress detection method based on the deep learning model according to claim 4, wherein the number of convolution kernels of the first layer of convolution in the CNN model is depth _ out 1-32, the number of convolution kernels of the second layer of convolution is depth _ out 2-64, the type of image data fed to the CNN network is four-dimensional array dimension, the amount of data of the first dimension training is batch _ size-32, the second and third dimensions are image sizes of the spectrogram, and the fourth dimension is the number of image channels, i.e. depth _ in;
x=tf.placeholder(tf.float32,[None,360,360,3])
y=tf.placeholder(tf.float32,[None,n_classes])
x and y are image data and image labels, respectively.
6. The piglet stress detection method based on the deep learning model as claimed in claim 5, wherein the activation function in the CNN network structure is a relu function, and the mathematical formula is as follows:
Figure FDA0003137965280000022
selecting a cross entropy loss function, namely a Softmax function, from a CNN network structure, calculating a loss value of the network, using AdamaOptizer as an optimizer to perform iterative learning training, assuming that the original output of the neural network is y1, y2, … and yn, and the output after Softmax regression processing is as follows:
Figure FDA0003137965280000023
wherein, yiAnd e is a natural constant, the probability value of the output of the single node is changed, and the result is used as the final output of the neural network after the Softmax processing.
CN202110724368.2A 2021-06-29 2021-06-29 Piglet compression detection method based on deep learning model Pending CN113326899A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110724368.2A CN113326899A (en) 2021-06-29 2021-06-29 Piglet compression detection method based on deep learning model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110724368.2A CN113326899A (en) 2021-06-29 2021-06-29 Piglet compression detection method based on deep learning model

Publications (1)

Publication Number Publication Date
CN113326899A true CN113326899A (en) 2021-08-31

Family

ID=77425103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110724368.2A Pending CN113326899A (en) 2021-06-29 2021-06-29 Piglet compression detection method based on deep learning model

Country Status (1)

Country Link
CN (1) CN113326899A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008236077A (en) * 2007-03-16 2008-10-02 Kobe Steel Ltd Target sound extracting apparatus, target sound extracting program
US20180139565A1 (en) * 2016-11-17 2018-05-17 Glen A. Norris Localizing Binaural Sound to Objects
CN108089154A (en) * 2017-11-29 2018-05-29 西北工业大学 Distributed acoustic source detection method and the sound-detection robot based on this method
CN109009129A (en) * 2018-08-20 2018-12-18 南京农业大学 Sow respiratory disease method for early warning based on acoustic analysis
CN110068795A (en) * 2019-03-31 2019-07-30 天津大学 A kind of indoor microphone array sound localization method based on convolutional neural networks
CN111543348A (en) * 2020-05-14 2020-08-18 深聆科技(北京)有限公司 Sound positioning device and method for farm and cub monitoring method
US20200302949A1 (en) * 2019-03-18 2020-09-24 Electronics And Telecommunications Research Institute Method and apparatus for recognition of sound events based on convolutional neural network
US20200402527A1 (en) * 2019-06-21 2020-12-24 Hitachi, Ltd. Abnormal Sound Detection System, Artificial Sound Creation System, and Artificial Sound Creating Method
CN112802484A (en) * 2021-04-12 2021-05-14 四川大学 Panda sound event detection method and system under mixed audio frequency
CN112820275A (en) * 2021-01-15 2021-05-18 华中农业大学 Automatic monitoring method for analyzing abnormality of suckling piglets based on sound signals

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008236077A (en) * 2007-03-16 2008-10-02 Kobe Steel Ltd Target sound extracting apparatus, target sound extracting program
US20180139565A1 (en) * 2016-11-17 2018-05-17 Glen A. Norris Localizing Binaural Sound to Objects
CN108089154A (en) * 2017-11-29 2018-05-29 西北工业大学 Distributed acoustic source detection method and the sound-detection robot based on this method
CN109009129A (en) * 2018-08-20 2018-12-18 南京农业大学 Sow respiratory disease method for early warning based on acoustic analysis
US20200302949A1 (en) * 2019-03-18 2020-09-24 Electronics And Telecommunications Research Institute Method and apparatus for recognition of sound events based on convolutional neural network
CN110068795A (en) * 2019-03-31 2019-07-30 天津大学 A kind of indoor microphone array sound localization method based on convolutional neural networks
US20200402527A1 (en) * 2019-06-21 2020-12-24 Hitachi, Ltd. Abnormal Sound Detection System, Artificial Sound Creation System, and Artificial Sound Creating Method
CN111543348A (en) * 2020-05-14 2020-08-18 深聆科技(北京)有限公司 Sound positioning device and method for farm and cub monitoring method
CN112820275A (en) * 2021-01-15 2021-05-18 华中农业大学 Automatic monitoring method for analyzing abnormality of suckling piglets based on sound signals
CN112802484A (en) * 2021-04-12 2021-05-14 四川大学 Panda sound event detection method and system under mixed audio frequency

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
WHAI-EN CHEN ET.AL: "PigTalk: An AI-Based IoT Platform for Piglet Crushing Mitigation", 《IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS 》, vol. 17, no. 6, 20 August 2020 (2020-08-20), XP011843250, DOI: 10.1109/TII.2020.3012496 *
丁冬兵: "智能声纹识别方法研究", 《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》, no. 10, 15 October 2019 (2019-10-15) *
赵晓洋: "基于动物发声分析的畜禽舍环境评估", 《中国优秀硕士学位论文全文数据库》, no. 05, 15 May 2019 (2019-05-15) *

Similar Documents

Publication Publication Date Title
CN108198562A (en) A kind of method and system for abnormal sound in real-time positioning identification animal house
US10856520B1 (en) Methods for generating consensus feeding appetite forecasts
CN109243470B (en) Broiler cough monitoring method based on audio technology
CN109009129B (en) Sow respiratory disease early warning system based on acoustic analysis
Møhl Target detection by echolocating bats
CN109258509A (en) A kind of live pig abnormal sound intelligent monitor system and method
Silva et al. Cough localization for the detection of respiratory diseases in pig houses
US11950576B2 (en) Multi-factorial biomass estimation
Kastelein et al. Underwater hearing sensitivity of a male and a female Steller sea lion (Eumetopias jubatus)
Brown The active space of blue monkey and grey-cheeked mangabey vocalizations
CN107667904A (en) Live pig big data system based on technology of Internet of things
CN103578036A (en) Method for monitoring poultry physical health in real time based on data extraction
Bates et al. Spatial location influences vocal interactions in bullfrog choruses
CN110580916A (en) weight acoustic measurement model creation method and weight measurement method and device
CN109479750A (en) A kind of plum mountain pig heat monitoring method based on acoustic information
Simon et al. Acoustic traits of bat-pollinated flowers compared to flowers of other pollination syndromes and their echo-based classification using convolutional neural networks
CN109186752A (en) Underwater sound signal acquisition, transmission and detection system based on graphics processor
CN113326899A (en) Piglet compression detection method based on deep learning model
Bohn et al. Auditory sensitivity and frequency selectivity in greater spear-nosed bats suggest specializations for acoustic communication
Goerlitz et al. Bats’ avoidance of real and virtual objects: Implications for the sonar coding of object size
Feugère et al. Behavioural analysis of swarming mosquitoes reveals high hearing sensitivity in Anopheles coluzzii
Pereira et al. Identification of acoustic parameters for broiler welfare estimate
CN113331135A (en) Statistical method for death and washout rate and survival rate of pressed piglets
Guillette et al. Black-capped (Poecile atricapillus) and mountain chickadee (Poecile gambeli) contact call contains species, sex, and individual identity features
Megela Simmons et al. Analyzing acoustic interactions in natural bullfrog (Rana catesbeiana) choruses.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination