Grain moisture detection method, device, combine harvester, apparatus, and medium
By combining temperature, relative permittivity, and volumetric weight using a GA-BP neural network model for nonlinear regression prediction, the problem of low accuracy in existing grain moisture content detection methods has been solved, achieving high-precision and applicable detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INTELLIGENT EQUIPMENT RESEARCH CENTER BEIJING ACADEMY OF AGRICULTURE AND FORESTRY SCIENCES
- Filing Date
- 2024-10-10
- Publication Date
- 2026-06-02
AI Technical Summary
Existing methods for detecting grain moisture content are not very accurate. In particular, the capacitance method is affected by conductivity and is costly, while the infrared method has strict requirements for environmental conditions, resulting in unstable test results.
A GA-BP neural network model was used, which combines temperature, relative permittivity, and volumetric weight. The model was trained to detect the moisture content of grains, and nonlinear regression prediction was performed considering multiple influencing factors.
It improves the accuracy and applicability of grain moisture content detection, is applicable to grains from different regions and varieties, and achieves long-term stable detection.
Smart Images

Figure CN119366339B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of grain detection technology, and in particular to a method, apparatus, combine harvester, equipment and medium for detecting grain moisture content. Background Technology
[0002] The moisture content of grains refers to the percentage of water contained in the grains. It is a key quality parameter that directly affects the grains' storage capacity, the operability during processing, and the quality of the final product.
[0003] Currently, the method for detecting grain moisture content is the indirect method. The indirect method utilizes physical quantities related to the moisture content of the substance being measured to reflect the moisture content, making it suitable for rapid detection during harvesting. Indirect methods often use capacitance or infrared methods to detect grain moisture content. Capacitance methods mostly use electrode plates as the detection means; at lower detection frequencies, the capacitance value is affected by conductivity, and it is easily affected by marginal effects during use. Infrared methods use expensive equipment, and they are highly sensitive to environmental conditions; changes in temperature and humidity can affect the measurement results. Therefore, the accuracy of these methods in actual grain moisture content detection is not high. Summary of the Invention
[0004] This invention provides a method, apparatus, combine harvester, equipment, and medium for detecting the moisture content of grains, in order to solve the problem of low accuracy in the detection of grain moisture content in the prior art.
[0005] In a first aspect, the present invention provides a method for detecting the moisture content of grains, comprising:
[0006] Collect the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period;
[0007] Based on the temperature, the relative permittivity, and the volumetric weight, the moisture content of the grain within the preset time period is obtained by training a grain moisture content detection model; the grain moisture content detection model is built based on a GA-BP neural network model.
[0008] The moisture content of grains is periodically detected using the grain moisture content detection model.
[0009] In one embodiment, the collection of the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight within a preset time period includes:
[0010] The temperature sensor is controlled to collect the temperature of the environment in which the grain is located within a preset time period;
[0011] The moisture content sensor is controlled to collect the relative permittivity of the grain within the preset time period;
[0012] Control the gravity sensor to collect the volumetric weight of the grain within the preset time period;
[0013] The temperature sensor, the moisture content sensor, and the gravity sensor are located inside the grain collection box, which is used to store grains.
[0014] In one embodiment, obtaining the grain moisture content within the preset time period by training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight includes:
[0015] Determine the geographical location and variety information of the grain;
[0016] The location information, variety information, temperature, relative permittivity, and volumetric weight are input into the grain moisture content detection model to obtain the grain moisture content within the preset time period output by the grain moisture content detection model.
[0017] In one embodiment, the step of periodically detecting the moisture content of the grain using the grain moisture content detection model includes:
[0018] Stop controlling the temperature sensor, the moisture content sensor, and the gravity sensor to collect data;
[0019] Grain is discharged from the grain collection box into the unloading silo via the grain discharger within the preset time period;
[0020] Stop discharging grain from the grain collection box into the unloading silo via the grain discharger;
[0021] If the grain in the unloading bin reaches the preset position, the periodic detection of grain moisture content will end.
[0022] If the grain in the unloading bin has not reached the preset position, the steps of collecting the temperature of the environment where the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain are repeated within a preset time period until the grain in the unloading bin reaches the preset position. The moisture content of the grain within multiple preset time periods output by the grain moisture content detection model is obtained, and the periodic detection of grain moisture content ends.
[0023] In one embodiment, after periodically detecting the moisture content of the grain using the grain moisture content detection model, the process includes:
[0024] After the grain in the unloading silo reaches the preset position, the control display terminal displays information that the unloading silo is full, and displays the moisture content of the grain within multiple preset time periods.
[0025] In one embodiment, the grain moisture content detection model is trained in the following manner:
[0026] Initialize the GA-BP neural network model;
[0027] Obtain grain samples from different regions and of different varieties;
[0028] Collect temperature samples, relative permittivity samples, and volumetric weight samples of the environment in which the grain samples are located within the preset time period;
[0029] Determine the moisture content label data of the grain sample within the preset time period;
[0030] Based on the grain sample, the region information sample of the grain sample, the variety information sample of the grain sample, the temperature sample, the relative permittivity sample, the volumetric weight sample, and the moisture content label data, the GA-BP neural network model is trained to obtain the grain moisture content detection model.
[0031] Secondly, the present invention also provides a grain moisture content detection device, comprising:
[0032] The data acquisition module is used to collect the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period.
[0033] The grain moisture content detection module is used to obtain the grain moisture content within the preset time period by training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight; the grain moisture content detection model is built based on the GA-BP neural network model.
[0034] The periodic moisture content detection module is used to periodically detect the moisture content of grains using the grain moisture content detection model.
[0035] Thirdly, the present invention also provides a combine harvester, including a grain moisture content detection device, a grain collection box, a grain discharger, a grain unloading bin, a temperature sensor, a moisture content sensor, a gravity sensor, and a display terminal.
[0036] The grain collection box is used to store grains;
[0037] The grain discharger is used to discharge the grain stored in the grain collection box into the grain unloading silo;
[0038] The unloading bin is used to store the grain discharged from the grain collection box;
[0039] The temperature sensor is used to collect the temperature of the environment in which the grain is located;
[0040] The moisture content sensor is used to collect the relative permittivity of the grain;
[0041] The gravity sensor is used to collect the volumetric weight of the grain;
[0042] The temperature sensor, the moisture content sensor, and the gravity sensor are disposed inside the grain collection box; the grain discharger is disposed between the grain collection box and the grain unloading bin.
[0043] Fourthly, the present invention provides an apparatus comprising an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the above-described grain moisture content detection methods.
[0044] Fifthly, the present invention also provides a medium comprising a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described grain moisture content detection methods.
[0045] The present invention provides a method, apparatus, combine harvester, equipment, and medium for detecting grain moisture content. It comprehensively considers multiple influencing factors such as the temperature of the grain's environment, the relative permittivity of the grain, and its volumetric weight. A grain moisture content detection model built using a GA-BP neural network is employed for regression prediction to obtain the grain moisture content within a preset time period. Compared to existing detection methods that mostly use linear fitting, this invention uses a nonlinear method with multiple influencing factors for data regression prediction. By considering multiple influencing factors, the accuracy of the grain moisture content detection model's fitting regression is improved. Furthermore, the grain moisture content detection model is used to periodically detect the grain moisture content, achieving long-term stable detection with high reliability, thereby improving the overall accuracy of grain moisture content detection. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0047] Figure 1 This is one of the flowcharts of the grain moisture content detection method provided by the present invention.
[0048] Figure 2 This is a system hardware block diagram of the combine harvester provided by the present invention.
[0049] Figure 3 This is a schematic diagram comparing the measured moisture content with the calculated moisture content provided in an embodiment of the present invention.
[0050] Figure 4 This is the second flowchart of the grain moisture content detection method provided by the present invention.
[0051] Figure 5 This is a comparative diagram of the model predictions provided by the present invention.
[0052] Figure 6 This is a schematic diagram of the grain moisture content detection device provided by the present invention.
[0053] Figure 7 This is a schematic diagram of the combine harvester device provided by the present invention.
[0054] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0056] The terms "first," "second," etc., used in this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein.
[0057] The following is combined Figures 1-8 The present invention describes the grain moisture content detection method, apparatus, combine harvester, equipment and medium provided by the present invention.
[0058] Combination Figure 1 and Figure 2 , Figure 1 This is one of the flowcharts of the grain moisture content detection method provided by the present invention. Figure 2 This is a system hardware block diagram of the combine harvester provided by the present invention.
[0059] like Figure 1 As shown, the method includes the following:
[0060] Step 101: Collect the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period;
[0061] Step 102: Based on the temperature, the relative permittivity, and the volumetric weight, train the grain moisture content detection model to obtain the moisture content of the grain within the preset time period;
[0062] Step 103: Periodically detect the moisture content of the grain using the grain moisture content detection model.
[0063] It should be noted that the grain moisture content detection method provided in this embodiment of the invention is based on a combine harvester. A combine harvester is an agricultural machine mainly used for harvesting crops such as wheat, barley, and corn. Its function is to complete harvesting, threshing, and cleaning of crops in one step. Figure 2 As shown, the combine harvester system consists of a sampling mechanism, a data acquisition module, a host computer terminal, and several wires and serial data transmission lines that provide circuit connections. The control chip inside the system is an STM32F103 chip.
[0064] The sampling mechanism consists of a grain collection box, a grain discharge motor, a motor drive module, a grain discharger, a grain unloading bin, and a support beam. The grain collection box stores the grain harvested by the combine harvester. The grain discharge motor drive module drives the grain discharge motor, which in turn drives the grain discharger to discharge the grain from the collection box into the grain unloading bin. The grain unloading bin stores the grain discharged from the collection box. The support beam provides structural support and stability for multiple components. The sampling mechanism is tightly connected to the support beam using four M8 screws. The data acquisition module consists of a temperature sensor, a moisture content sensor, a gravity sensor, a grain level sensor 1, and a grain level sensor 2. The temperature sensor, moisture content sensor, and gravity sensor all collect data related to the grain moisture content. Grain level sensor 1 detects whether the grain in the collection box has reached a certain level, and grain level sensor 2 detects whether the grain in the unloading bin has reached a certain level. The two grain level sensors determine the current grain sampling status and enable automatic start-up and shutdown of the system. The host computer terminal is used to control the sampling mechanism and data acquisition module to jointly complete the detection of grain moisture content. It can realize data storage and data processing. In addition, the host computer terminal also includes a display terminal, which can realize data display. Since the host computer terminal can control the sampling mechanism and data acquisition module to jointly complete the detection of grain moisture content, the host computer terminal is the execution subject of the grain moisture content detection method of the present invention, which is equivalent to the grain moisture content detection device. The embodiments of the present invention use the host computer terminal to describe the whole process.
[0065] In addition, the combine harvester's internal system uses RS485 and serial communication to achieve data transmission between different modules. RS485 utilizes the Modbus protocol to collect data related to grain moisture content, and the Modbus protocol is used to set the header and footer of the transmitted hexadecimal data, enabling data verification and eliminating distorted data.
[0066] The following describes the process of grain moisture content testing.
[0067] Specifically, when the combine harvester starts harvesting in the field, the harvested grain is thrown into the grain collection box by the elevator and axial auger. The grain collection box is equipped with multiple sensors to provide a stable detection environment for the sensors and a relatively sealed grain container to ensure that the grain is contained in a stable container after being thrown out of the elevator.
[0068] Furthermore, when the grain collection box is filled with grain, the grain level sensor 1 installed on the top of the grain collection box is triggered. The grain level sensor 1 transmits a grain level signal to the host computer terminal, so that the host computer terminal activates multiple sensors and starts the detection mode.
[0069] Furthermore, the host computer terminal controls multiple sensors to collect the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight within a preset time period. The preset time period can be set to 4 seconds according to the actual situation.
[0070] Furthermore, multiple sensors transmit the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight collected within a preset time period to the host computer terminal.
[0071] Furthermore, the host computer terminal trains a grain moisture content detection model based on the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period, to obtain the moisture content of the grain within the preset time period. The grain moisture content detection model is built based on the GA-BP neural network model, which is a neural network model that combines genetic algorithm and back propagation algorithm.
[0072] It should be noted that, considering the large sample size and numerous input features, traditional linear modeling methods cannot well fit nonlinear data, and Support Vector Machine (SVM) regression performs poorly on large sample datasets. Therefore, this embodiment of the invention introduces the BP neural network algorithm for data fitting and prediction. The backpropagation neural network model (BP) is a multi-layer feedforward neural network model that processes information through three layers of neurons: an input layer, a hidden layer, and an output layer. Forward propagation of the signal optimizes the initialization parameters, while backward propagation of the error adjusts the network's weights and thresholds. Factors affecting grain moisture content include relative permittivity, temperature, and volumetric weight; therefore, relative permittivity, temperature, and volumetric weight are used as input features, and grain moisture content is used as the output parameter. The genetic algorithm is designed based on Darwinian evolutionary theory. The main idea of the genetic algorithm is to simulate the natural selection and fitness increasing process in biological evolution. Through operations such as selection, crossover, and mutation, the fitness of the population is continuously optimized, ultimately obtaining the optimal solution. When using GA-BP neural networks for regression prediction, research combines the search capabilities of genetic optimization algorithms with the learning capabilities of BP neural networks, making full use of the advantages of both to obtain more accurate prediction results.
[0073] Furthermore, the host computer terminal will stop multiple sensors from collecting data, start the grain discharge mode, execute a preset time period, and then stop the grain discharge process. Further, the host computer terminal will reactivate multiple sensors to collect data, and make predictions based on the collected data using a grain moisture content detection model. The detection mode and grain discharge mode will be switched periodically in the above manner. During this period, the moisture content of the grain in the grain storage bin will be predicted online using the grain moisture content detection model.
[0074] The grain moisture content detection method provided by this invention comprehensively considers multiple influencing factors such as the temperature of the grain's environment, the relative permittivity of the grain, and its volumetric weight. It uses a grain moisture content detection model built from a GA-BP neural network to perform regression prediction, thereby obtaining the grain moisture content within a preset time period. Compared to existing detection methods that mostly use linear fitting, this method employs a nonlinear method with multiple influencing factors for data regression prediction. By considering multiple influencing factors, it improves the fitting and regression accuracy of the grain moisture content detection model. Furthermore, by periodically detecting the grain moisture content through the model, it achieves long-term stable detection of grain moisture content with high reliability, thus improving the overall accuracy of grain moisture content detection.
[0075] Further, based on step 101, the collection of the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight within a preset time period includes:
[0076] The temperature sensor is controlled to collect the temperature of the environment in which the grain is located within a preset time period;
[0077] The moisture content sensor is controlled to collect the relative permittivity of the grain within the preset time period;
[0078] Control the gravity sensor to collect the volumetric weight of the grain within the preset time period;
[0079] The temperature sensor, the moisture content sensor, and the gravity sensor are located inside the grain collection box, which is used to store grains.
[0080] It should be noted that the grain collection box is equipped with at least a temperature sensor, a moisture content sensor, and a gravity sensor. The grain collection box provides a stable detection environment, enabling the temperature sensor, moisture content sensor, and gravity sensor to reliably collect data related to the moisture content of the grain.
[0081] Specifically, the host computer terminal controls the temperature sensor to collect the temperature of the environment in which the grain is located within a preset time period, controls the moisture content sensor to collect the relative permittivity of the grain within a preset time period, and controls the gravity sensor to collect the volumetric weight of the grain within a preset time period.
[0082] It should be noted that the relative permittivity of grains changes with moisture content. The permittivity is a measure of a medium's response to an electric field. An increase in moisture content will increase the permittivity of grains. Therefore, changes in moisture content directly affect the grains' response and performance in an electromagnetic field. The volumetric weight of grains also changes with increasing moisture content. Generally, as moisture content increases, the density of grains decreases because the addition of water increases the volume of grains while the mass remains relatively unchanged or increases slightly. The moisture content of grains is usually affected by ambient temperature. At high temperatures, the rate of moisture evaporation from grains increases, while at low temperatures, condensation may occur or the evaporation rate may decrease. Therefore, ambient temperature directly affects the moisture content of grains.
[0083] It should be further explained that, for the factor of relative permittivity affecting moisture content, a detection method based on dielectric properties was selected for data acquisition. This avoids many drawbacks of commonly used methods on the market, such as high sensor cost, susceptibility of parallel electrode plates to edge effects and vibration, and unsuitability of hyperspectral methods for online monitoring outside the laboratory. This results in a high-precision online detection method for grain moisture content that can be mounted on a combine harvester.
[0084] In this embodiment of the invention, the sampling mechanism provides a stable detection environment and an installation environment suitable for combine harvesters, enabling the temperature sensor, moisture sensor, and gravity sensor installed inside the grain collection box to stably collect data related to the moisture content of the grain. This results in more accurate data on the temperature of the grain's environment, the relative permittivity of the grain, and the volumetric weight within a preset time period.
[0085] Further, based on step 102, the step of training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight to obtain the moisture content of the grain within the preset time period includes:
[0086] Determine the geographical location and variety information of the grain;
[0087] The location information, variety information, temperature, relative permittivity, and volumetric weight are input into the grain moisture content detection model to obtain the grain moisture content within the preset time period output by the grain moisture content detection model.
[0088] Specifically, the host computer terminal determines the region and variety information of the grain.
[0089] Furthermore, the host computer terminal inputs the information of the region where the grain is located, the variety information of the grain, the temperature of the environment where the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain into the grain moisture content detection model, so as to obtain the moisture content of the grain within a preset time period output by the grain moisture content detection model.
[0090] In one embodiment, the implementation process of the grain moisture content detection model is as follows: Data is read, the validation and test sets of the BP neural network model are confirmed, the experimental data is scaled to eliminate systematic errors caused by different units, and the data is normalized to between 0 and 1; network parameters are set, with the maximum number of iterations set to 1000, the learning rate set to 1×10⁻⁴, and the learning error threshold set to 1×10⁻⁶; parameters are initialized, with the initial population size N and maximum number of iterations T of the GA algorithm set to 20 and the number of generations set to 100; fitness is calculated and stored, with individuals calculating their fitness values using a fitness function, and the genetic algorithm finding the individual with the optimal fitness through selection, crossover, and mutation operations; the BP neural network uses the optimal individual obtained by the genetic algorithm to assign initial weights and thresholds to the network, and the network predicts sample outputs after training samples.
[0091] In one embodiment, combined with Figure 3 , Figure 3This is a schematic diagram comparing the measured moisture content with the calculated moisture content provided in this embodiment of the invention. The grain moisture content calculated by the grain moisture content detection model is compared with the grain moisture content measured by the drying method; the correlation coefficient of determination R² is 0.986. Figure 3 It can be seen that the error between the grain moisture content calculated by the model and the grain moisture content measured by the drying method is small. The drying method detects moisture content by destroying the original physical properties of the grain grains, and the test results are relatively accurate. However, it is costly and has a long testing cycle, making it unsuitable for rapid online detection. Therefore, by comparison, it was found that the moisture content calculated by the model has a small error compared with the moisture content measured by the drying method. Thus, the moisture content calculated by the model can be considered more accurate, and rapid online detection can be achieved through model calculation.
[0092] This invention inputs collected information such as relative permittivity, temperature, and volumetric weight into a grain moisture content detection model built using a GA-BP neural network. Through regression prediction, the real-time moisture content can be calculated based on data affecting moisture content, including temperature, collected volumetric weight, and relative permittivity under the current harvesting conditions. Compared to existing detection methods that mostly use linear fitting, this invention employs a nonlinear method with multiple influencing factors for data regression prediction. By considering various influencing factors, particularly volumetric weight, the accuracy of the grain moisture content detection model's regression fitting is improved, enhancing the accuracy of online grain moisture content detection by combine harvesters. Furthermore, the grain moisture content detection process also considers factors such as the grain's geographical location and variety. Therefore, regression prediction using the grain moisture content detection model is not only applicable to single-variety grains in a single region but also provides accurate detection results for different varieties of grains in different regions, thereby improving the applicability of grain moisture content detection.
[0093] Further, based on step 103, the periodic detection of grain moisture content using the grain moisture content detection model includes:
[0094] Stop controlling the temperature sensor, the moisture content sensor, and the gravity sensor to collect data;
[0095] Grain is discharged from the grain collection box into the unloading silo via the grain discharger within the preset time period;
[0096] Stop discharging grain from the grain collection box into the unloading silo via the grain discharger;
[0097] If the grain in the unloading bin reaches the preset position, the periodic detection of grain moisture content will end.
[0098] If the grain in the unloading bin has not reached the preset position, the steps of collecting the temperature of the environment where the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain are repeated within a preset time period until the grain in the unloading bin reaches the preset position. The moisture content of the grain within multiple preset time periods output by the grain moisture content detection model is obtained, and the periodic detection of grain moisture content ends.
[0099] Combination Figure 4 , Figure 4 This is the second flowchart of the grain moisture content detection method provided by the present invention.
[0100] Specifically, after system initialization, when the grain collection bin is full of grain, the grain level sensor 1 installed on the top of the grain collection box is triggered. The grain level sensor 1 transmits the grain level signal to the host computer terminal. The host computer terminal activates the temperature sensor, moisture content sensor and gravity sensor to collect the temperature of the environment where the grain is located, the relative permittivity of the grain and the volumetric weight of the grain within a preset time period. Based on the collected data and the information on the region and variety of the grain, the moisture content of the grain in the grain collection bin is predicted by the grain moisture content detection model.
[0101] Furthermore, the host computer terminal shuts down the temperature sensor, moisture content sensor, and gravity sensor to stop them from collecting data. In other words, after the preset time period for the detection mode is activated, the grain discharge mode is activated.
[0102] Furthermore, the host computer terminal controls the grain discharge electrical drive module to start the grain discharge. After receiving the start signal, the grain discharge electrical drive module drives the grain discharge motor to start. The grain discharge motor drives the grain discharge device located between the grain collection box and the grain unloading bin, and drives the grain discharge shaft inside the grain discharge device. The grain discharge device discharges the grain from the grain collection box into the grain unloading bin within a preset time period.
[0103] Furthermore, after the host computer terminal starts the preset time period for the grain discharge operation, it shuts down the grain discharge motor to stop the grain discharger from the grain collection box into the unloading bin.
[0104] Furthermore, when the grain in the unloading bin reaches the preset position, it means that the unloading bin is nearly full of received grain. The grain will accumulate under the support beam, thereby triggering the grain level sensor 2 installed at the bottom of the support beam. Therefore, if the grain in the unloading bin reaches the preset position, the grain level sensor 2 will be triggered. The grain level sensor 2 will transmit the grain level signal to the host computer terminal, and the host computer terminal will then end the periodic detection of the moisture content of the grain in the unloading bin.
[0105] Furthermore, if the grain in the unloading silo does not reach the preset position and the grain level sensor 2 is not triggered, the host computer terminal will repeatedly execute the steps of collecting the temperature of the environment where the grain is located, the relative permittivity of the grain, and the volumetric weight within a preset time period until the grain in the unloading silo reaches the preset position, obtain the grain moisture content within multiple preset time periods output by the grain moisture content detection model, and end the periodic detection of grain moisture content.
[0106] Therefore, by switching between the detection and discharge conditions in the above manner, a cycle of operation can be achieved, and the moisture content of the grain can be periodically detected.
[0107] In this embodiment of the invention, when the grain silo is full of grain, the grain level sensor 1 is triggered. Following the detection logic, motor control and signal acquisition are implemented, periodically switching between detection and discharge modes. This achieves a workflow of dynamic sampling, static intermittent detection, and periodic discharge, avoiding the impact of vibrations generated by the combine harvester during discharge on data collected from multiple sensors, which could lead to inaccurate predictions from the grain moisture content detection model. Therefore, by setting up a workflow of dynamic sampling, static intermittent detection, and periodic discharge, stable measurement of data related to grain moisture content, such as temperature, relative permittivity, and volumetric weight, can be achieved, along with accurate output of grain moisture content data.
[0108] Further, after periodically detecting the moisture content of the grain using the aforementioned grain moisture content detection model, the process includes:
[0109] After the grain in the unloading silo reaches the preset position, the control display terminal displays information that the unloading silo is full, and displays the moisture content of the grain within multiple preset time periods.
[0110] Specifically, after the grain in the unloading silo reaches the preset position, in order to prevent the grain in the unloading silo from being too full and squeezing into the sampling mechanism, the host computer terminal will stop periodically detecting the moisture content of the grain and control the display terminal to display the information that the unloading silo is full, so as to remind the product user.
[0111] Furthermore, the host computer terminal will control the display terminal to display the moisture content of the grain within multiple preset time periods output by the grain moisture content detection model.
[0112] This invention embodiment displays information indicating that the grain unloading silo is full via a display terminal, prompting product users to promptly empty the grain from the silo. Simultaneously, the display terminal also shows the grain moisture content data output by the model, providing product users with an intuitive understanding of the moisture content status. This facilitates assessment of the quality of the harvested grain and allows for planning of the next stage of production.
[0113] Furthermore, the grain moisture content detection model is trained in the following manner:
[0114] Initialize the GA-BP neural network model;
[0115] Obtain grain samples from different regions and of different varieties;
[0116] Collect temperature samples, relative permittivity samples, and volumetric weight samples of the environment in which the grain samples are located within the preset time period;
[0117] Determine the moisture content label data of the grain sample within the preset time period;
[0118] Based on the grain sample, the region information sample of the grain sample, the variety information sample of the grain sample, the temperature sample, the relative permittivity sample, the volumetric weight sample, and the moisture content label data, the GA-BP neural network model is trained to obtain the grain moisture content detection model.
[0119] Specifically, the host computer terminal initializes the GA-BP neural network model.
[0120] Furthermore, the host computer terminal acquires grain samples from different regions and different varieties.
[0121] Furthermore, the host computer terminal can use sensors to collect temperature samples, relative permittivity samples, and volumetric weight samples of the grain samples within a preset time period.
[0122] Furthermore, the host computer terminal determines the moisture content label data of the grain sample within a preset time period, which can be obtained through direct or indirect methods.
[0123] Furthermore, the host computer terminal trains the GA-BP neural network model based on grain samples, grain sample location information samples, grain sample variety information samples, temperature samples, relative permittivity samples, volumetric weight samples, and moisture content label data to obtain a grain moisture content detection model.
[0124] To verify the stability and reliability of the BP neural network algorithm based on genetic optimization, four models were used to divide the original data into 80 training sets and 25 validation sets for prediction. The relevant validation evaluation metrics are shown in the table. Table 1 shows the prediction results of the support vector machine, BP neural network, GA-BP neural network based on genetic optimization, and neural network model based on particle swarm optimization and back propagation (PSO-BP) algorithm. The results are shown in Appendix Table 1.
[0125] The model prediction accuracy is mainly assessed using the root mean square error (RMSE), mean absolute error (MAE), mean bias error (MBE), and coefficient of determination (R²). The specific calculation formulas are as follows:
[0126]
[0127]
[0128]
[0129]
[0130] in, Represents the actual value; The predicted value is represented by n; the sample size is represented by n; the sum of squares of residuals is represented by SSE; and the sum of squares of total deviations is represented by SST.
[0131] The smaller the MAE, MBE, and RMSE values, the closer the fit is to the actual value, indicating a better fit and a more accurate prediction model. The coefficient of determination R² represents the goodness of fit of the function, ranging from [0,1]. The closer the value is to 1, the better the fit.
[0132] Table 1 Model Results
[0133]
[0134] Table 1 shows that, compared to SVM (Support Vector Machine), BP neural network and GA-BP and PSO-BP neural network models can predict the moisture content of grains under different temperatures and bulk densities relatively well. The root mean square error (RMESE) of the GA-BP neural network model based on the genetic optimization algorithm on the retraining and validation sets are 0.2591 and 0.3061, respectively; the mean absolute error (MAE) is 0.17263 and 0.194, respectively; the mean partial square error (MBE) is 0.02355 and -0.016, respectively; and the coefficient of determination (R²) is 0.99633 and 0.99631, respectively. Compared to the traditional BP neural network model and PSO-BP neural network model, the GA-BP neural network model has lower MAE and MBE on both the retraining and validation sets, and a coefficient of determination (R²) closer to 1, indicating higher computational accuracy than both the BP neural network model and the PSO-BP neural network model. This indicates that the GA-BP neural network model outperforms other models in predicting the moisture content of grains at different temperatures and bulk densities, and can better uncover the nonlinear mapping relationship between temperature, bulk density, dielectric constant and grain moisture content.
[0135] The trained neural network model was used to predict water content. Optimal performance was achieved after 41 training epochs, and the training error was 0.01764 after 100 training epochs. Figure 5 , Figure 5 This is a comparative diagram of the model predictions provided by the present invention. Figure 5 It can be seen that the maximum and minimum errors between the training set and the validation set are 5.52% and 0.018%, respectively, with an average relative error of 1.34%. The minimum error between the validation set and the experimental set is 0.0538%, the maximum error is 8.1984%, and the average relative error is 2.3%. Therefore, the GA-BP neural network model, after training, is suitable for predicting and analyzing the moisture content of grains. It can effectively explore the relationship between temperature, dielectric constant, and moisture content, providing a feasible solution for regression prediction of moisture content of grains with different volumetric weights and temperatures.
[0136] This invention, through obtaining temperature samples, relative permittivity and volumetric weight samples, regional information samples, and variety information samples of the grain sample's environment, takes into account factors related to different regions and varieties of grain samples, as well as various factors affecting grain moisture content. Based on comprehensive factors, grain sample data, and grain sample moisture content label data, a GA-BP neural network model is trained to obtain a grain moisture content detection model. This model can calculate dynamic real-time moisture content, thereby improving the accuracy and applicability of grain moisture content detection.
[0137] The grain moisture content detection device provided by the present invention is described below. The grain moisture content detection device described below can be referred to in correspondence with the grain moisture content detection method described above.
[0138] Reference Figure 6 , Figure 6 This is a schematic diagram of the grain moisture content detection device provided by the present invention.
[0139] The grain moisture content detection device includes:
[0140] The data acquisition module 610 is used to collect the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period.
[0141] The grain moisture content detection module 620 is used to obtain the moisture content of the grain within the preset time period by training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight; the grain moisture content detection model is built based on the GA-BP neural network model.
[0142] The periodic moisture content detection module 630 is used to periodically detect the moisture content of grains using the grain moisture content detection model.
[0143] The grain moisture content detection device provided by this invention comprehensively considers multiple influencing factors such as the temperature of the grain's environment, the relative permittivity of the grain, and its volumetric weight. It uses a grain moisture content detection model built from a GA-BP neural network to perform regression prediction, thereby obtaining the grain moisture content within a preset time period. Compared to existing detection methods that mostly use linear fitting, this device employs a nonlinear method with multiple influencing factors for data regression prediction. By considering multiple influencing factors, it improves the fitting and regression accuracy of the grain moisture content detection model. Furthermore, through the grain moisture content detection model, it periodically detects the grain moisture content, achieving long-term stable detection with high reliability, thus improving the overall accuracy of grain moisture content detection.
[0144] Furthermore, the acquisition module 610 is also used for:
[0145] The temperature sensor is controlled to collect the temperature of the environment in which the grain is located within a preset time period;
[0146] The moisture content sensor is controlled to collect the relative permittivity of the grain within the preset time period;
[0147] Control the gravity sensor to collect the volumetric weight of the grain within the preset time period;
[0148] The temperature sensor, the moisture content sensor, and the gravity sensor are located inside the grain collection box, which is used to store grains.
[0149] Furthermore, the grain moisture content detection module 620 is also used for:
[0150] Determine the geographical location and variety information of the grain;
[0151] The location information, variety information, temperature, relative permittivity, and volumetric weight are input into the grain moisture content detection model to obtain the grain moisture content within the preset time period output by the grain moisture content detection model.
[0152] Furthermore, the periodic moisture content detection module 630 is also used for:
[0153] Stop controlling the temperature sensor, the moisture content sensor, and the gravity sensor to collect data;
[0154] Grain is discharged from the grain collection box into the unloading silo via the grain discharger within the preset time period;
[0155] Stop discharging grain from the grain collection box into the unloading silo via the grain discharger;
[0156] If the grain in the unloading bin reaches the preset position, the periodic detection of grain moisture content will end.
[0157] If the grain in the unloading bin has not reached the preset position, the steps of collecting the temperature of the environment where the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain are repeated within a preset time period until the grain in the unloading bin reaches the preset position. The moisture content of the grain within multiple preset time periods output by the grain moisture content detection model is obtained, and the periodic detection of grain moisture content ends.
[0158] Furthermore, the grain moisture content detection device is also used for:
[0159] After the grain in the unloading silo reaches the preset position, the control display terminal displays information that the unloading silo is full, and displays the moisture content of the grain within multiple preset time periods.
[0160] Furthermore, the grain moisture content detection device is also used for:
[0161] Initialize the GA-BP neural network model;
[0162] Obtain grain samples from different regions and of different varieties;
[0163] Collect temperature samples, relative permittivity samples, and volumetric weight samples of the environment in which the grain samples are located within the preset time period;
[0164] Determine the moisture content label data of the grain sample within the preset time period;
[0165] Based on the grain sample, the region information sample of the grain sample, the variety information sample of the grain sample, the temperature sample, the relative permittivity sample, the volumetric weight sample, and the moisture content label data, the GA-BP neural network model is trained to obtain the grain moisture content detection model.
[0166] It should be noted that the grain moisture content detection device provided by the present invention can execute the grain moisture content detection method described in any of the above embodiments during specific operation, and this embodiment will not elaborate on this.
[0167] The combine harvester provided by the present invention is described below. The combine harvester described below and the grain moisture content detection method described above can be referred to in correspondence.
[0168] Reference Figure 7 , Figure 7 This is a schematic diagram of the combine harvester device provided by the present invention.
[0169] The combine harvester consists of a sampling mechanism 1, a data acquisition module 2, a display terminal 3, and a built-in host terminal.
[0170] The sampling mechanism consists of a grain collection box, a grain discharge motor, a motor drive module, a grain discharger, a grain unloading bin, and a support beam. The grain collection box stores the grain harvested by the combine harvester. The grain discharge motor drive module drives the grain discharge motor, which in turn drives the grain discharger to discharge the grain from the collection box into the grain unloading bin. The grain unloading bin stores the grain discharged from the collection box. The support beam provides structural support and stability for multiple components. The sampling mechanism is tightly connected to the support beam using four M8 screws. The data acquisition module consists of a temperature sensor, a moisture content sensor, a gravity sensor, a grain level sensor 1, and a grain level sensor 2. The temperature sensor, moisture content sensor, and gravity sensor all collect data related to the grain moisture content. Grain level sensor 1 detects whether the grain in the collection box has reached a certain level, and grain level sensor 2 detects whether the grain in the unloading bin has reached a certain level. The two grain level sensors determine the current grain sampling status and enable automatic start-up and shutdown of the system. The host computer terminal is used to control the sampling mechanism and data acquisition module to jointly complete the detection of grain moisture content. It can realize data storage and data processing. In addition, the host computer terminal also includes a display terminal to realize data display.
[0171] It should be noted that the combine harvester provided by the present invention can perform the grain moisture content detection method described in any of the above embodiments during actual operation, which will not be elaborated in this embodiment.
[0172] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 8 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840. The processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a grain moisture content detection method. This method includes: collecting the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period; training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight to obtain the moisture content of the grain within the preset time period; the grain moisture content detection model is built based on a GA-BP neural network model; and periodically detecting the moisture content of the grain using the grain moisture content detection model.
[0173] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, 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 steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0174] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer is able to execute the grain moisture content detection method provided in the above embodiments, the method including: collecting the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period; training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight to obtain the moisture content of the grain within the preset time period; the grain moisture content detection model is built based on a GA-BP neural network model; and periodically detecting the moisture content of the grain using the grain moisture content detection model.
[0175] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the grain moisture content detection method provided in the above embodiments. The method includes: collecting the temperature of the environment in which the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain within a preset time period; training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight to obtain the moisture content of the grain within the preset time period; the grain moisture content detection model is built based on a GA-BP neural network model; and periodically detecting the moisture content of the grain using the grain moisture content detection model.
[0176] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0177] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting the moisture content of grains, characterized in that, include: If the first grain level sensor installed in the grain collection box detects that the grain in the grain collection box has reached the preset position, the temperature of the environment in which the grain is located, the relative permittivity and volumetric weight of the grain are collected within a preset time period, and the regional information and variety information of the grain are determined. Based on the location information, variety information, temperature, relative permittivity, and volumetric weight, the grain moisture content detection model is trained to obtain the grain moisture content within the preset time period; the grain moisture content detection model is built based on the GA-BP neural network model. The moisture content of grains is periodically detected using the aforementioned grain moisture content detection model, specifically including: Stop collecting data on the temperature of the environment in which the grain is located, the relative permittivity of the grain, and its volumetric weight; Grain is discharged from the grain collection box into the grain unloading silo via the grain discharger within the preset time period; Stop discharging grain from the grain collection box into the unloading silo via the grain discharger; If the second grain level sensor installed in the unloading silo detects that the grain in the unloading silo has reached the preset position, the periodic detection of the grain moisture content will end. If the second grain level sensor installed in the unloading silo detects that the grain in the unloading silo has not reached the preset position, the steps of collecting the temperature of the environment where the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain are repeated within a preset time period until the grain in the unloading silo reaches the preset position. The moisture content of the grain within multiple preset time periods output by the grain moisture content detection model is obtained, and the periodic detection of the grain moisture content ends. By switching between detection and discharge conditions, a cycle of operation can be achieved, enabling periodic detection of grain moisture content.
2. The method for detecting the moisture content of grains according to claim 1, characterized in that, The data collection includes the temperature of the environment in which the grain is located, the relative permittivity of the grain, and its volumetric weight within a preset time period. The temperature sensor is controlled to collect the temperature of the environment in which the grain is located within a preset time period; The moisture content sensor is controlled to collect the relative permittivity of the grain within the preset time period; Control the gravity sensor to collect the volumetric weight of the grain within the preset time period; The temperature sensor, the moisture content sensor, and the gravity sensor are located inside the grain collection box, which is used to store grains.
3. The method for detecting the moisture content of grains according to claim 1, characterized in that, The process of obtaining the grain moisture content within the preset time period by training a grain moisture content detection model based on the temperature, the relative permittivity, and the volumetric weight includes: The location information, variety information, temperature, relative permittivity, and volumetric weight are input into the grain moisture content detection model to obtain the grain moisture content within the preset time period output by the grain moisture content detection model.
4. The method for detecting the moisture content of grains according to claim 2, characterized in that, After periodically detecting the moisture content of the grain using the aforementioned grain moisture content detection model, the process includes: After the grain in the unloading silo reaches the preset position, the control display terminal displays information that the unloading silo is full, and displays the moisture content of the grain within multiple preset time periods.
5. The method for detecting the moisture content of grains according to any one of claims 1-4, characterized in that, The grain moisture content detection model was trained in the following manner: Initialize the GA-BP neural network model; Obtain grain samples from different regions and of different varieties; Collect temperature samples, relative permittivity samples, and volumetric weight samples of the environment in which the grain samples are located within the preset time period; Determine the moisture content label data of the grain sample within the preset time period; Based on the grain sample, the region information sample of the grain sample, the variety information sample of the grain sample, the temperature sample, the relative permittivity sample, the volumetric weight sample, and the moisture content label data, the GA-BP neural network model is trained to obtain the grain moisture content detection model.
6. A grain moisture content detection device, characterized in that, include: The data acquisition module is used to collect the temperature of the environment in which the grain is located, the relative permittivity and volumetric weight of the grain within a preset time period if the first grain level sensor installed in the grain collection box detects that the grain in the grain collection box has reached a preset position, and to determine the location and variety information of the grain. The grain moisture content detection module is used to obtain the grain moisture content within the preset time period by training a grain moisture content detection model based on the local area information, the variety information, the temperature, the relative permittivity, and the volumetric weight; the grain moisture content detection model is built based on the GA-BP neural network model. The periodic moisture content detection module is used to periodically detect the moisture content of grains using the grain moisture content detection model, specifically including: Stop collecting data on the temperature of the environment in which the grain is located, the relative permittivity of the grain, and its volumetric weight; Grain is discharged from the grain collection box into the grain unloading silo via the grain discharger within the preset time period; Stop discharging grain from the grain collection box into the unloading silo via the grain discharger; If the second grain level sensor installed in the unloading silo detects that the grain in the unloading silo has reached the preset position, the periodic detection of the grain moisture content will end. If the second grain level sensor installed in the unloading silo detects that the grain in the unloading silo has not reached the preset position, the steps of collecting the temperature of the environment where the grain is located, the relative permittivity of the grain, and the volumetric weight of the grain are repeated within a preset time period until the grain in the unloading silo reaches the preset position. The moisture content of the grain within multiple preset time periods output by the grain moisture content detection model is obtained, and the periodic detection of the grain moisture content ends. By switching between detection and discharge conditions, a cycle of operation can be achieved, enabling periodic detection of grain moisture content.
7. A combine harvester, comprising the grain moisture content detection device as described in claim 6, and further comprising a grain collection box, a grain discharger, a grain unloading bin, a temperature sensor, a moisture content sensor, a gravity sensor, and a display terminal; The grain collection box is used to store grains; The grain discharger is used to discharge the grain stored in the grain collection box into the grain unloading silo; The unloading bin is used to store the grain discharged from the grain collection box; The temperature sensor is used to collect the temperature of the environment in which the grain is located; The moisture content sensor is used to collect the relative permittivity of the grain; The gravity sensor is used to collect the volumetric weight of the grain; The temperature sensor, the moisture content sensor, and the gravity sensor are disposed inside the grain collection box. The grain discharger is located between the grain collection box and the grain unloading bin.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the grain moisture content detection method as described in any one of claims 1 to 5.
9. A computer-readable storage medium, comprising a non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the grain moisture content detection method as described in any one of claims 1 to 5.