Feed putting amount prediction and model construction method based on bidirectional recurrent neural network
The feed volume prediction model based on the bidirectional recursive neural network solves the problem that the traditional animal husbandry feeding system cannot be personalized and controlled, achieves precise feeding of individual differences in animals, and improves prediction accuracy and breeding efficiency.
Patent Information
- Application Number
- CN202410714448.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-08-30
AI Technical Summary
The traditional animal husbandry feeding system cannot perform personalized regulation according to the needs of different individual animals, resulting in feed waste and reduced health status, low accuracy, and high labor costs, which limits the automation and intelligence of the system.
A feed amount prediction model based on a bidirectional recurrent neural network is used to collect the animal's age, weight, water drinking and feed intake data to construct a deep autoencoder and attention encoding network, and combine the particle swarm algorithm to optimize the network structure to achieve prediction. Accurate prediction of feed volume.
It achieves precise feeding of individual differences in animals, reduces prediction costs, improves the prediction accuracy of feed volume, reduces labor costs, and improves breeding efficiency and the intelligence of the system.
Smart Images

Figure CN118568415A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of intelligent animal husbandry, and in particular relates to a method for predicting feed delivery amount and building a model based on a bidirectional recursive neural network. Background Art
[0002] The livestock feeding system plays a vital role in livestock production, providing precise feed delivery and management, ensuring the healthy growth of livestock and poultry, improving production efficiency and economic benefits, and promoting the intelligent development of livestock industry. However, traditional livestock feeding systems usually adopt quantitative feeding methods, which have certain limitations:
[0003] 1. Traditional animal husbandry feeding cannot be personalized according to the needs of different animals. Each animal's growth status, health status, weight and eating habits are different. If the same amount of feed is given to different animals, it will lead to feed waste and a decline in animal health.
[0004] 2. Traditional livestock feeding technology has low accuracy and cannot accurately measure and control the amount of feed distribution based on individual differences between animals, resulting in overfeeding or underfeeding, which affects the growth, development and health of animals.
[0005] 3. Traditional feeding requires a lot of labor costs. While increasing labor costs, it can also cause human negligence or misoperation, affecting the growth and breeding benefits of livestock and poultry. In addition, manual operation also limits the automation and intelligence of the feeding system, making it impossible to achieve efficient management and operation. Summary of the invention
[0006] In view of the above problems, the present invention provides a method for constructing a feed input amount prediction model based on a bidirectional recurrent neural network, which is characterized by comprising the following processes:
[0007] S1, collect the age, weight, water intake, feed intake and ideal feed input amount of multiple healthy animal individuals at a certain time; use the age, weight, water intake and feed intake of the animal individual as sample data, and the ideal feed input amount of the animal as the sample label to establish a training data set Data = {Data1, ata2, ata3, ata4, abel}; where Data1, Data2, Data3 and Data4 are the animal age sequence, animal weight sequence, animal water intake sequence and animal feed intake sequence respectively; label is the ideal feed input amount sequence;
[0008] S2, build a deep autoencoder neural network to remove the noise in the sample data in the Data dataset described in S1, and obtain the denoised dataset:
[0009]
[0010] S3, design a feature fusion module based on the attention encoding network to * The sample data of the sample data set are feature fused, and the fused feature vector is recorded as Fe;
[0011] S4, constructing a bidirectional recurrent neural network model for predicting the amount of feed delivered to individual animals, wherein the bidirectional recurrent neural network model effectively learns the positive dependency and the reverse dependency of the Fe feature vector described in S3;
[0012] S5, using a particle swarm algorithm to optimize the network structure of the bidirectional recurrent neural network model described in S4, and finally obtaining a feed input amount prediction model with an optimal network structure.
[0013] Preferably, S2 removes the noise of sample data in Data by constructing a deep autoencoder neural network, and the specific process is:
[0014] Input the sample data Data1, Data2, Data3 and Data4 in Data into formulas (1), (2), (3) and (4) respectively to obtain the corresponding feature vectors s1, s2, s3 and s4;
[0015]
[0016]
[0017]
[0018]
[0019] Among them, Sigmoid is the activation function, ω is the filter, and λ is the bias value;
[0020] s1, s2, s3 and s4 are respectively input into formulas (5), (6), (7) and (8) to obtain the corresponding denoised data and
[0021]
[0022]
[0023]
[0024]
[0025] Preferably, the feature fusion module based on the attention encoding network in S3 includes four attention encoder networks and one fully connected network; each attention encoder network can be layer-by-layer deep from and Valuable feature information can be extracted from the network; at the same time, the attention mechanism is introduced to enable the encoder network to improve the expressiveness of the features; the fully connected network is responsible for fusing the features extracted by the four attention encoder networks.
[0026] Preferably, the bidirectional recurrent neural network model constructed in S4 includes two hidden layers, namely a forward hidden layer and a backward hidden layer, which are defined as shown in formulas (9) and (10) respectively:
[0027] H f ( )=δ(Fe( )·w f )+H f ( -1) · w f + f (9)
[0028] H b ( )=δ(Fe b ( )·w b )+ b ( -1) · w b + b (10)
[0029] Among them, Fe b It is the reverse sequence of Fe, ω f is the weight value of the forward hidden layer, the weight value of the backward hidden layer, b f is the bias value of the forward hidden layer, b b is the bias value of the backward hidden layer; H f (t) is the hidden layer feature calculated when the t-th data in Fe is input into the bidirectional recurrent neural network; H b (t) is Fe b The hidden layer features calculated when the tth data is input into the bidirectional recurrent neural network; H f (t-1) is the hidden layer feature calculated when the t-1th data in Fe is input into the bidirectional recurrent neural network; H b (t-1) is Fe b The hidden layer features calculated when the t-1th data is input into the bidirectional recurrent neural network; δ is the learning rate;
[0030] The prediction output of the bidirectional recurrent neural network is shown in formula (11):
[0031]
[0032] Among them, W out is the weight matrix of the output layer, b out is the bias parameter of the output layer; label * (t) is the predicted value of feed feeding amount calculated when the tth data in Fe is input into the bidirectional recurrent neural network.
[0033] Preferably, the specific process of S5 is:
[0034] S51, based on the learning rate δ of the bidirectional recurrent neural network, the number of hidden layer network nodes K, and the number of hidden layer layers L, a bidirectional recurrent neural network optimization problem objective function is established, as shown in formula (12):
[0035]
[0036] S52, initialize the particle swarm: randomly generate T particles, each particle represents a combination of a learning rate δ, the number of hidden layer network nodes K and the number of hidden layer layers L, that is, X j =[δ j ,K j ,L j ], j∈[1,T];
[0037] S53, obtaining the fitness of the initialized particle: Substitute each initialized particle into the bidirectional recurrent neural network, and calculate the fitness value of the particle according to formula (12); the particle with the smallest fitness in the particle swarm is taken as the optimal particle X of the particle swarm. best ;
[0038] S54, update particles: use formula (13) to update each particle
[0039] X j ′=X j +z·rand(X best -X j ) (13)
[0040] Where z is the speed update weight, and z = 0.5, rand(·) is a random number in the interval [0,1], X j ′ is the jth particle after update;
[0041] S55, obtaining the updated particle fitness: substituting each updated particle into the bidirectional recurrent neural network, and calculating the fitness value of the particle according to formula (12);
[0042] S56, determine the global optimal particle: if X′ j The fitness is less than X best , then X best =X′ j ;
[0043] S57, repeat steps S54 to S56 for 100 times, and use the optimal particle X obtained in the last iteration best :
[0044] X best =[δ best ,K best ,L best ]
[0045] S58, based on the optimal combination solution obtained in S57, finally determine the optimal network structure of the bidirectional recurrent neural network model.
[0046] The second aspect of the present invention provides a method for predicting feed input quantity based on a bidirectional recursive neural network, wherein the feed input quantity prediction model constructed by the construction method described in the first aspect is deployed on a farm control terminal, and includes the following process:
[0047] Collect the age, weight, water intake and feed intake of the animals that need to be fed in the farm and store them in a text file on the backend computer;
[0048] The text file is read in the pycharm programming environment, and the feed input amount prediction model is used to predict the feed input amount of each animal individual on that day.
[0049] The third aspect of the present invention provides a feed input quantity prediction device based on a bidirectional recursive neural network, the device includes at least one processor and at least one memory, the processor and the memory are coupled; the memory stores a computer execution program of the feed input quantity prediction model constructed by the construction method described in the first aspect; when the processor executes the computer execution program stored in the memory, the processor executes a feed input quantity prediction method based on a bidirectional recursive neural network.
[0050] The fourth aspect of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program or instruction of a feed input quantity prediction model constructed by the construction method described in the first aspect, and when the program or instruction is executed by a processor, the processor executes a feed input quantity prediction method based on a bidirectional recursive neural network.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] In view of the high labor cost of traditional animal husbandry feeding technology and the inability to accurately feed animals according to individual differences, the present invention designs a feed input amount prediction technology for farms based on a bidirectional recurrent neural network, which can effectively reduce the prediction cost and realize accurate feeding according to individual differences of animals. Specifically:
[0053] (1) The present invention designs a deep autoencoder neural network to remove noise from the animal age sequence, weight sequence, water intake sequence and food intake sequence, respectively, to obtain high-quality data suitable for neural network training.
[0054] (2) The present invention designs a feature fusion module based on an attention encoding network, which can effectively capture the features of the animal age sequence, weight sequence, water intake sequence and food intake sequence, and obtain a low-dimensional feature vector suitable for neural network training.
[0055] (3) The present invention adopts a bidirectional recurrent neural network to learn the positive dependency and reverse dependency of the fusion features to improve the prediction accuracy of the feed feeding amount.
[0056] (4) The present invention adopts the particle swarm algorithm to obtain the optimal network structure of the bidirectional recurrent neural network, which can improve the prediction accuracy of the bidirectional recurrent neural network. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 The figure is an overall flow chart of the feed input amount prediction method of the present invention.
[0058] Figure 2 This is a structural diagram of the deep autoencoder neural network of the present invention.
[0059] Figure 3 Schematic diagram of the feature fusion module based on the attention encoding network.
[0060] Figure 4 Schematic diagram of the bidirectional recurrent neural network model structure.
[0061] Figure 5 This is a simplified diagram of the feed quantity prediction equipment structure. DETAILED DESCRIPTION
[0062] The present invention is further described below in conjunction with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] The present invention mainly provides a method for predicting the amount of feed put into a farm based on a bidirectional recursive neural network. Figure 1 As shown:
[0064] S1, collect the age, weight, water intake, feed intake and ideal feeding amount of multiple healthy animal individuals at a certain moment, where the ideal feeding amount is determined by expert evaluation. Using the age, weight, water intake and feed intake of individual animals as sample data, and the ideal feed intake of the animal as the sample label, a data set Data = {Data1, ata2, ata3, ata4, abel} is established for training a farm feed input prediction model based on a bidirectional recurrent neural network. Among them, Data1, Data2, Data3 and Data4 are animal age sequence, animal weight sequence, animal water intake sequence and animal feed intake sequence respectively. label is the ideal feed intake sequence.
[0065] S2, build a deep autoencoder neural network to remove the noise in the sample data in the Data dataset and obtain the denoised dataset:
[0066]
[0067] S3, design a feature fusion module based on attention encoding network to * The sample data of the sample data is subjected to feature fusion, and the fused feature vector is recorded as Fe.
[0068] S4, construct a bidirectional recurrent neural network to predict the feed intake of individual animals. This network can effectively learn the positive and negative dependencies of the Fe feature vector in S3.
[0069] S5, uses particle swarm algorithm to optimize the network structure of the bidirectional recurrent neural network and obtains a bidirectional recurrent neural network with the optimal network structure.
[0070] S6 deploys a bidirectional recurrent neural network with the optimal network structure on the back-end terminal of the farm to accurately predict the feeding amount of individual animals.
[0071] 1. Build a deep autoencoder neural network to remove noise from sample data in the Data dataset:
[0072] Constructing a deep autoencoder neural network such as Figure 2 As shown. The network contains 7 convolutional layers and 8 pooling layers, which can better capture the characteristics of the sample data in the Data data set. The steps of removing the noise of the sample data in Data by the deep autoencoder neural network constructed by the present invention are as follows:
[0073] Input the sample data Data1, Data2, Data3 and Data4 in Data into formulas (1), (2), (3) and (4) respectively to obtain the corresponding feature vectors s1, s2, s3 and s4.
[0074]
[0075]
[0076]
[0077]
[0078] Among them, Sigmoid is the activation function, ω is the filter, and λ is the bias value.
[0079] s1, s2, s3 and s4 are respectively input into formulas (5), (6), (7) and (8) to obtain the corresponding denoised data and
[0080]
[0081]
[0082]
[0083]
[0084] 2. Feature fusion module based on attention encoding network:
[0085] Feature fusion module based on attention encoding network Figure 3 It mainly consists of four attention encoder networks and a fully connected network. Each attention encoder has a strong feature extraction capability and can extract features from the and The introduction of the attention mechanism enables the encoder network to improve the expressiveness of features. The fully connected network is responsible for fusing the features extracted by the four attention encoder networks. The specific parameter settings are shown in Table 1.
[0086] Table 1 Feature fusion module based on attention encoding network
[0087]
[0088] 3. Bidirectional recurrent neural network structure:
[0089] The bidirectional recurrent neural network structure proposed in the present invention is as follows: Figure 4 As shown. The neural network has two hidden layers, namely the forward hidden layer and the backward hidden layer, which are defined as shown in formulas (9) and (10) respectively:
[0090] H f ()=δ(Fe()·w f )+ f (-1)·w f + f (9)
[0091] H b ()=δ(Fe b ()·w b )+ b (-1)·w b + b (10)
[0092] Among them, Fe b It is the reverse sequence of Fe, ω f is the weight value of the forward hidden layer, the weight value of the backward hidden layer, b f is the bias value of the forward hidden layer, b b is the bias value of the backward hidden layer. f () is the hidden layer feature calculated when the t-th data in Fe is input into the bidirectional recurrent neural network. b () is Fe b The hidden layer features calculated when the tth data is input into the bidirectional recurrent neural network. f (-1) is the hidden layer feature calculated when the t-1th data in Fe is input into the bidirectional recurrent neural network. b (-1) is Fe b The hidden layer features calculated when the t-1th data is input into the bidirectional recurrent neural network. δ is the learning rate.
[0093] Furthermore, the prediction output of the bidirectional recurrent neural network is shown in formula (11).
[0094]
[0095] Among them, W out is the weight matrix of the output layer, b out is the bias parameter of the output layer. label * () is the predicted value of feed feeding amount calculated when the tth data in Fe is input into the bidirectional recurrent neural network.
[0096] 4. Use particle swarm algorithm to optimize the network structure of bidirectional recurrent neural network:
[0097] S1, based on the learning rate δ of the bidirectional recurrent neural network, the number of hidden layer network nodes K, and the number of hidden layer layers L, establish the objective function of the bidirectional recurrent neural network optimization problem, as shown in formula (12):
[0098]
[0099] S2, initialize the particle swarm: randomly generate T particles, each particle represents a combination of a learning rate δ, the number of hidden layer network nodes K and the number of hidden layer layers L, that is, X j =[δ j ,K j ,L j ], j∈[1,T];
[0100] S3, obtain the fitness of the initialized particle: substitute each initialized particle into the bidirectional recurrent neural network, and calculate the fitness value of the particle according to formula (12); the particle with the smallest fitness in the particle swarm is taken as the optimal particle X of the particle swarm. best ;
[0101] S4, update particles: use formula (13) to update each particle
[0102] X j ′=C j +z·rand(X best -X j ) (13)
[0103] Where z is the speed update weight, and z = 0.5, rand(·) is a random number in the interval [0,1], X j ′ is the jth particle after update;
[0104] S5, obtaining the updated particle fitness: substituting each updated particle into the bidirectional recurrent neural network, and calculating the fitness value of the particle according to formula (12);
[0105] S6, determine the global optimal particle: if X j The fitness of ′ is less than X best , then X best =X j ′;
[0106] S7, repeat steps S4 to S6 for 100 times, and use the optimal particle X obtained in the last iteration best :
[0107] X best =[δ best ,K best ,K best ]
[0108] S8, based on the optimal combination solution obtained in S7, finally determines the optimal network structure of the bidirectional recurrent neural network model.
[0109] Finally, the constructed feed input amount prediction model is deployed on the farm control terminal, and the age, weight, water intake and feed intake of the animals that need to be fed in the farm are collected and stored in a text file on the background computer; the text file is read in the pycharm programming environment, and the feed input amount prediction model is used to predict the feed feeding amount of each individual animal on that day.
[0110] Embodiment 2:
[0111] like Figure 5 As shown, the present invention also provides a feed delivery amount prediction device based on a bidirectional recursive neural network, the device includes at least one processor and at least one memory, and also includes a communication interface and an internal bus; the memory stores a computer execution program of the feed delivery amount prediction model constructed by the construction method described in Example 1; when the processor executes the computer execution program stored in the memory, the processor can execute a feed delivery amount prediction method based on a bidirectional recursive neural network. The internal bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus. The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a U disk, a mobile hard disk, a read-only memory, a disk or an optical disk.
[0112] The device may be provided as a terminal, a server or other forms of devices.
[0113] Figure 5 is a block diagram of a device shown as an example. The device may include one or more of the following components: a processing component, a memory, a power component, a multimedia component, an audio component, an input / output (I / O) interface, a sensor component, and a communication component. The processing component generally controls the overall operation of the electronic device, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component may include one or more processors to execute instructions to complete all or part of the steps of the above method. In addition, the processing component may include one or more modules to facilitate interaction between the processing component and other components. For example, the processing component may include a multimedia module to facilitate interaction between the multimedia component and the processing component.
[0114] The memory is configured to store various types of data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0115] The power supply assembly provides power to various components of the electronic device. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device. The multimedia assembly includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia assembly includes a front camera and / or a rear camera. When the electronic device is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0116] The audio component is configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the electronic device is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal. The I / O interface provides an interface between the processing component and the peripheral interface module, and the above-mentioned peripheral interface module can be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
[0117] The sensor assembly includes one or more sensors for providing various aspects of status assessment for the electronic device. For example, the sensor assembly can detect the on / off state of the electronic device, the relative positioning of components, such as the display and keypad of the electronic device, and the sensor assembly can also detect the position change of the electronic device or a component of the electronic device, the presence or absence of user contact with the electronic device, the orientation or acceleration / deceleration of the electronic device and the temperature change of the electronic device. The sensor assembly may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0118] The communication component is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0119] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0120] Embodiment 3:
[0121] The present invention also provides a computer-readable storage medium, which stores a computer program or instruction of a feed input quantity prediction model constructed by the construction method described in Example 1. When the program or instruction is executed by a processor, the processor can execute a feed input quantity prediction method based on a bidirectional recursive neural network.
[0122] Specifically, a system, device or equipment equipped with a readable storage medium may be provided, on which a software program code for implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system, device or equipment reads and executes the instructions stored in the readable storage medium. In this case, the program code read from the readable medium itself can implement the functions of any of the above-mentioned embodiments, so the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of the present invention.
[0123] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk (such as CD-ROM, CD-R, CD-RW, DVD-20ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tape, etc. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0124] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0125] It should be understood that the storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in a terminal or server.
[0126] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0127] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0128] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0129] Although the above describes the specific implementation methods of the present invention, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for constructing a feed input amount prediction model based on a bidirectional recurrent neural network, characterized in that: The process includes: S1, collect the age, weight, water intake, feed intake and ideal feed input amount of multiple healthy animal individuals at a certain time; use the age, weight, water intake and feed intake of the animal individual as sample data, and the ideal feed input amount of the animal as the sample label to establish a training data set Data = {Data1, Data2, Data3, Data4, label}; where Data1, Data2, Data3 and Data4 are the animal age sequence, animal weight sequence, animal water intake sequence and animal feed intake sequence respectively; label is the ideal feed input amount sequence; S2, build a deep autoencoder neural network to remove the noise in the sample data in the Data dataset described in S1, and obtain the denoised dataset: S3, design a feature fusion module based on the attention encoding network to * The sample data of the sample data set are feature fused, and the fused feature vector is recorded as Fe; S4, constructing a bidirectional recurrent neural network model for predicting the amount of feed delivered to individual animals, wherein the bidirectional recurrent neural network model effectively learns the positive dependency and the reverse dependency of the Fe feature vector described in S3; S5, using a particle swarm algorithm to optimize the network structure of the bidirectional recurrent neural network model described in S4, and finally obtaining a feed input amount prediction model with an optimal network structure.
2. A method for constructing a feed input amount prediction model based on a bidirectional recurrent neural network as claimed in claim 1, characterized in that: The S2 is to remove the noise of the sample data in Data through the constructed deep autoencoder neural network. The specific process is as follows: Input the sample data Data1, Data2, Data3 and Data4 in Data into formulas (1), (2), (3) and (4) respectively to obtain the corresponding feature vectors s1, s2, s3 and s4; Among them, Sigmoid is the activation function, ω is the filter, and λ is the bias value; s1, s2, s3 and s4 are respectively input into formulas (5), (6), (7) and (8) to obtain the corresponding denoised data and 3. A method for constructing a feed input amount prediction model based on a bidirectional recurrent neural network as claimed in claim 2, characterized in that: The feature fusion module based on the attention encoding network in S3 includes four attention encoder networks and a fully connected network; each attention encoder network can be layered and deep from and Valuable feature information can be extracted from the network; at the same time, the attention mechanism is introduced to enable the encoder network to improve the expressiveness of the features; the fully connected network is responsible for fusing the features extracted by the four attention encoder networks.
4. The method for constructing a feed quantity prediction model based on a bidirectional recurrent neural network according to claim 1, characterized in that: The bidirectional recurrent neural network model constructed in S4 includes two hidden layers, namely a forward hidden layer and a backward hidden layer, which are defined as shown in formulas (9) and (10) respectively: H f (t)=δ(Fe(t)·w f )+H f (t-1)·w f +b f (9) H b (t)=δ(Fe b (t)·w b )+H b (t-1)·w b +b b (10) Among them, Fe b It is the reverse sequence of Fe, ω f is the weight value of the forward hidden layer, ω b is the weight value of the backward hidden layer, b f is the bias value of the forward hidden layer, b b is the bias value of the backward hidden layer; H f (t) is the hidden layer feature calculated when the t-th data in Fe is input into the bidirectional recurrent neural network; H b (t) is Fe b The hidden layer features calculated when the tth data is input into the bidirectional recurrent neural network; H f (t-1) is the hidden layer feature calculated when the t-1th data in Fe is input into the bidirectional recurrent neural network; H b (t-1) is Fe b The hidden layer features calculated when the t-1th data is input into the bidirectional recurrent neural network; δ is the learning rate; The prediction output of the bidirectional recurrent neural network is shown in formula (11): Among them, W out is the weight matrix of the output layer, b out is the bias parameter of the output layer; label * (t) is the predicted value of feed feeding amount calculated when the tth data in Fe is input into the bidirectional recurrent neural network.
5. The method for constructing a feed quantity prediction model based on a bidirectional recurrent neural network according to claim 1, characterized in that: The specific process of S5 is as follows: S51, based on the learning rate δ of the bidirectional recurrent neural network, the number of hidden layer network nodes K, and the number of hidden layer layers L, a bidirectional recurrent neural network optimization problem objective function is established, as shown in formula (12): S52, initialize the particle swarm: randomly generate T particles, each particle represents a combination of a learning rate δ, the number of hidden layer network nodes K and the number of hidden layer layers L, that is, X j =[δ j ,K j ,L j ], j∈[1,T]; S53, obtaining the fitness of the initialized particle: Substitute each initialized particle into the bidirectional recurrent neural network, and calculate the fitness value of the particle according to formula (12); the particle with the smallest fitness in the particle swarm is taken as the optimal particle X of the particle swarm. best ; S54, update particles: use formula (13) to update each particle X j ′=X j +z·rand(X best -X j ) (13) Where z is the speed update weight, and z = 0.5, rand(·) is a random number in the interval [0,1], X j ′ is the jth particle after update; S55, obtaining the updated particle fitness: substituting each updated particle into the bidirectional recurrent neural network, and calculating the fitness value of the particle according to formula (12); S56, determine the global optimal particle: if X′ j The fitness is less than X best , then X best =X′ j ; S57, repeat steps S54 to S56 for 100 times, and use the optimal particle X obtained in the last iteration best : X best =[δ best ,K best ,L best ] S58, based on the optimal combination solution obtained in S57, finally determine the optimal network structure of the bidirectional recurrent neural network model.
6. A method for predicting feed delivery amount based on a bidirectional recurrent neural network, characterized in that: The feed input amount prediction model constructed by the construction method according to any one of claims 1 to 5 is deployed on a farm control terminal, and includes the following process: Collect the age, weight, water intake and feed intake of the animals that need to be fed in the farm and store them in a text file on the backend computer; The text file is read in the pycharm programming environment, and the feed input amount prediction model is used to predict the feed input amount of each animal individual on that day.
7. A feed quantity prediction device based on a bidirectional recurrent neural network, characterized in that: The device includes at least one processor and at least one memory, the processor and the memory are coupled; the memory stores a computer execution program of a feed input quantity prediction model constructed by the construction method according to any one of claims 1 to 5; when the processor executes the computer execution program stored in the memory, the processor executes a feed input quantity prediction method based on a bidirectional recurrent neural network.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction of a feed input quantity prediction model constructed by the construction method according to any one of claims 1 to 5. When the program or instruction is executed by a processor, the processor executes a feed input quantity prediction method based on a bidirectional recurrent neural network.
Citation Information
Patent Citations
Air quality prediction optimization method based on dynamic adaptive particle swarm
CN116256468A
Cited By
Intelligent prediction method for feed feeding amount of modernized pig farm
CN119047533A
AI-driven animal nutrition prediction supervision method and system
CN121747841A
