Grain storage ventilation decision method based on GNN and cross-attention
By combining GNN and Cross-Attention methods with multimodal data from inside and outside the grain depot, the problem of inaccurate ventilation decisions in grain depots was solved, achieving more reliable temperature and humidity control and reducing the risk of grain mold.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2024-09-30
- Publication Date
- 2026-06-02
Smart Images

Figure CN119513716B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of grain depot ventilation prediction technology, specifically relating to a grain storage ventilation decision-making method based on GNN and Cross-Attention. Background Technology
[0002] During grain storage, the most important aspect is controlling the temperature and humidity inside the grain silo. Inappropriate temperatures can easily cause grain to overheat and mold, especially when the temperature and humidity reach critical values, condensation will form on the grain, easily leading to mold growth. This critical temperature and humidity value is known as the dew point. Therefore, strict control of temperature and humidity is essential for grain storage, and appropriate ventilation measures should be implemented when necessary.
[0003] For the temperature inside a grain depot, a temperature sequence from a single sensor is insufficient to accurately represent the temperature: the temperature differs between the grain-covered and ungrained areas, as does the temperature at the center and edges of the grain pile. Furthermore, temperature changes vary depending on the grain volume during loading and unloading. Therefore, grain depot temperature data must be collected in two parts: the ungrained area, located at the top of the grain silo and entirely composed of air, has a relatively small temperature difference and can be collected by a single temperature sensor; however, the grain pile exhibits significant temperature variations at different locations, requiring a temperature sensor array based on the grain silo structure. This temperature data is only meaningful when combined with spatial location information.
[0004] Current grain storage ventilation decision-making technologies primarily rely on ResNet networks combined with self-attention mechanisms. ResNet is an improved convolutional neural network (CNN) that solves the gradient vanishing and exploding problems of traditional CNNs, but it is essentially still a CNN. CNNs are highly efficient at processing regular grid data (such as planar matrices of image pixels). However, the temperature sensor arrays inside grain depots are irregular three-dimensional structures; sensor arrays inside shallow circular silos are even cylindrical. In such scenarios, it is difficult to fully aggregate and utilize spatial information using CNNs. The main purpose of self-attention is to establish relationships between different elements within the same sequence. Its advantage is that it can process the entire sequence in parallel, achieving a global perspective. However, relying solely on a single sequence is insufficient for accurate and reliable grain storage ventilation decisions. In addition to internal temperature and humidity information, we also need multimodal information such as external temperature and humidity data, weather data, and dew points. However, most existing grain depot temperature prediction technologies are based solely on temperature data. For example, the application CN202410234796.0, "A Method for Predicting Grain Pile Temperature Field Variation Based on EEMD-LSTM and Similarity," uses "a large dataset of grain depot and grain warehouse information, grain types, grain condition collection time, and temperatures at various monitoring points in the grain pile within the target grain storage ecological zone" to predict grain pile temperature data. Therefore, existing technologies need improvement. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a grain storage ventilation decision-making method based on GNN and Cross-Attention, which is used to make overall decisions on the ventilation of the grain depot based on the temperature and humidity information of the air inside the grain depot, combined with the temperature and humidity of the outside of the grain depot, dew point data and weather data.
[0006] To address the aforementioned technical problems, this invention provides a grain storage ventilation decision-making method based on GNN and Cross-Attention, comprising:
[0007] S1. Real-time data acquisition, including the collection of internal and external temperature and humidity data of the grain depot, as well as weather data and grain pile temperature data;
[0008] S2. The collected grain pile temperature data and weather data are preprocessed respectively, and the grain equilibrium relative humidity, atmospheric dew point temperature and grain dew point temperature are calculated as inputs to the pre-trained ventilation decision model.
[0009] S3. In the pre-trained ventilation decision model, the pre-processed grain pile temperature data is processed through a linear layer and a node embedding layer, and then through a graph convolutional neural network to obtain feature 1. The external temperature and humidity data of the grain depot and the pre-processed weather data are processed through a linear layer to obtain feature 2. The internal temperature and humidity data of the grain depot, as well as the equilibrium relative humidity of the grain, atmospheric dew point temperature, and grain dew point temperature, are processed through a linear layer to obtain feature 3. Then, feature 1, feature 2, and feature 3 are processed through a cross-attention mechanism to obtain the attention matrix between each pair, and then concatenated according to the first dimension. Finally, the model is processed through a linear layer, a global pooling layer, and softmax to obtain the classification result of the ventilation decision.
[0010] As an improvement to the grain storage ventilation decision-making method based on GNN and Cross-Attention of this invention:
[0011] The preprocessing includes:
[0012] The grain pile temperature data were processed using the Z-SCORE normalization method:
[0013]
[0014]
[0015] Where μ represents the sample mean, N represents the total number of samples, and σ represents the sample variance;
[0016] The weather data is processed using unique thermal encoding and encoded into a six-dimensional vector.
[0017] As a further improvement to the grain storage ventilation decision-making method based on GNN and Cross-Attention of the present invention:
[0018] The equilibrium relative humidity of the grain is:
[0019]
[0020] Where M represents the moisture content of the grain (%), t r Represents the temperature of the grain (°C), and A1, B2, B1, B2, and D are the parameters of the equation;
[0021] The atmospheric dew point temperature is:
[0022]
[0023] Among them, t a Represents atmospheric temperature (°C), RH a Represents the relative humidity of the atmosphere (%);
[0024] The grain dew point temperature is:
[0025]
[0026] Among them, ERH r Represents the equilibrium relative humidity of grains (%), t r Represents the temperature of the grain (°C).
[0027] As a further improvement to the grain storage ventilation decision-making method based on GNN and Cross-Attention of the present invention:
[0028] The training process of the ventilation decision model is as follows:
[0029] Historical data of grain storage and historical data of ventilation are collected. The historical data of grain storage includes internal temperature and humidity data, external temperature and humidity data, weather data, and grain pile temperature data. Then, the grain pile temperature data and weather data are preprocessed as described above. The historical data of grain storage and historical data of ventilation are matched and labeled according to time.
[0030] For each sample in the historical data of the grain warehouse, the equilibrium relative humidity of the grain, the atmospheric dew point temperature, and the grain pile dew point temperature are calculated; then, the data are divided into three modes, namely:
[0031] (1) Temperature data of the grain pile after pretreatment;
[0032] (2) External temperature and humidity of the grain depot and weather data after pretreatment;
[0033] (3) Temperature and humidity data inside the grain depot, as well as the equilibrium relative humidity of the grain, atmospheric dew point temperature and grain pile dew point temperature;
[0034] The data from the three modalities were randomly divided into training and test sets in an 8:2 ratio and input into the ventilation decision model. During training, the preprocessed grain pile temperature data was passed through a linear layer and a node embedding layer, and then combined with the adjacency matrix of the spatial coordinates of the grain pile temperature sensor array before being input into the graph convolutional neural network. The cross-entropy loss function was used, and the Adam optimizer was employed. The learning rate was set to 0.001, and the training epochs of the model were set to 100. At the end of each training epoch, the model was evaluated on the test set.
[0035] As a further improvement to the grain storage ventilation decision-making method based on GNN and Cross-Attention of the present invention:
[0036] The adjacency matrix of the spatial coordinates of the grain pile temperature sensor array is:
[0037] Based on the position coordinates of the grain pile temperature sensors in the temperature sensor array, the Gaussian kernel method is used to calculate the distance between each sensor, and an adjacency matrix of the grain pile temperature sensor array spatial coordinates based on the actual distance is established.
[0038] θ=std(x) (1)
[0039]
[0040] Where std(x) represents the standard deviation of the distance between sensors, x represents the physical distance between sensors, and θ represents the standard deviation of these distances.
[0041] As a further improvement to the grain storage ventilation decision-making method based on GNN and Cross-Attention of the present invention:
[0042] The temperature and humidity data inside the grain depot are collected by temperature and humidity sensors on the top of the grain depot.
[0043] The external temperature and humidity data of the grain depot, as well as the weather data, were obtained from publicly available data from the meteorological bureau.
[0044] The grain pile temperature data is collected through a temperature sensor array in a shallow circular silo.
[0045] The beneficial effects of this invention are mainly reflected in:
[0046] This invention leverages the advantages of graph neural networks and cross-attention mechanisms, particularly in processing spatial temperature data and introducing a multimodal data attention mechanism, to more accurately extract temperature characteristics of grain depots. Furthermore, by incorporating data from more modalities, it makes ventilation decisions for grain depots more reliable. Attached Figure Description
[0047] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0048] Figure 1 Examples of labeling for grain pile temperature sensors on the same plane of the temperature sensor array of the present invention;
[0049] Figure 2 This is a schematic diagram of the grain storage ventilation decision method based on GNN and Cross-Attention of the present invention. Detailed Implementation
[0050] The present invention will be further described below with reference to specific embodiments, but the scope of protection of the present invention is not limited thereto:
[0051] Example 1: A grain storage ventilation decision-making method based on GNN and Cross-Attention, the specific steps of which are as follows:
[0052] 1. Data Acquisition and Preprocessing
[0053] Collect and organize temperature data of grain piles in the grain depot, spatial location information of sensors in the grain depot, air temperature and humidity data inside and outside the grain depot, weather data, and ventilation execution data, and perform preprocessing to ensure data quality and consistency.
[0054] 1.1 Data Acquisition
[0055] The data source for this invention comes from on-site collection by our laboratory's partner companies. The grain depot (i.e., grain silo) used is a shallow circular silo, a type of cylindrical above-ground grain silo with a height-to-diameter ratio not exceeding 1.5 (the shallow circular silo on which this invention is based has a diameter of 20 meters and a height of 30 meters). The grain silo is equipped with a temperature sensor array to collect grain pile temperature data. During loading, conveying equipment such as belt conveyors or bucket elevators are used to pour the grain directly from the top into the shallow circular silo, where the grain is evenly and slowly accumulated from the bottom, covering and submerging the temperature sensor array. The collected data includes grain silo data and ventilation execution data. The grain silo data includes internal and external temperature and humidity data, grain pile temperature data, and weather data. One data point is shown in Table 1.
[0056] Table 1: Sample Data Display of Grain Depots
[0057]
[0058] (1) The collection of temperature and humidity inside the grain depot refers to the collection of temperature and humidity data of the part of the grain depot that is not covered by grain. Since this part is all air, there is almost no difference in temperature and humidity. Therefore, the temperature and humidity data inside the grain depot can be obtained by installing a grain depot temperature sensor and a grain depot humidity sensor on the top of the grain depot.
[0059] (2) External temperature and humidity data and weather data of the grain depot are provided by the meteorological bureau.
[0060] (3) Temperature data acquisition of the grain pile is achieved using a temperature sensor array. From the inside out, there are four cylindrical cable groups consisting of 3, 5, 10, and 16 sensor cables respectively. The radius difference between each cable group is 2 meters. Each sensor cable is spaced 2.5 meters apart and contains a total of 11 temperature sensors. One temperature sensor array is used for each shallow circular silo, which includes a total of 374 grain pile temperature sensors. Figure 1 Example of labeling for temperature sensors on a grain pile on the same plane.
[0061] Temperature and humidity data were collected from 10 grain depots. The temperature and humidity sensors (including grain warehouse temperature sensors, grain warehouse humidity sensors, and temperature sensor arrays) in the grain depots measured the temperature at regular intervals, once every 8 hours, thus obtaining a total of 10,950 sets of data.
[0062] Ventilation execution data is automatically recorded by the grain depot's ventilation equipment during operation. According to grain depot ventilation regulations, ventilation measures are divided into six types: no ventilation, dehumidification ventilation, heat dissipation ventilation, timed ventilation, forced upward ventilation, and forced exhaust upward ventilation. Table 2 shows a single record of ventilation execution data.
[0063] Table 2: Ventilation Execution Data Display Table
[0064]
[0065]
[0066] 1.2 Data Processing (Adjacency Matrix Extraction and Preprocessing of Temperature, Humidity, and Weather Data)
[0067] Data preprocessing first requires establishing the spatial information adjacency matrix needed for the graph neural network based on the position coordinates of the 374 grain pile temperature sensors in the temperature sensor array. Then, the data collected by the grain pile temperature sensors are standardized and the weather data is quantified. Finally, these quantized data and ventilation execution data are labeled according to time correspondence.
[0068] (1) Based on the position coordinates of 374 grain pile temperature sensors in the temperature sensor array, the Gaussian kernel method is used to calculate the distance between each sensor, thereby establishing an adjacency matrix of the grain pile temperature sensor array spatial coordinates based on the actual distance. This matrix not only reflects the physical distance between the sensors but also reveals the interaction strength between them, which is used to extract spatial information by graph convolutional neural network GCN.
[0069] The specific formula for calculating the Gaussian kernel is as follows:
[0070] θ=std(x) (1)
[0071]
[0072] Where std(x) represents the standard deviation of the distance between sensors, x represents the physical distance between sensors, and θ represents the standard deviation of these distances.
[0073] (2) The temperature data of the grain pile collected by the temperature sensor array inside the grain depot is standardized using the Z-SCORE standardization method. The specific formula is as follows:
[0074]
[0075]
[0076] Where μ represents the average of the sample, i.e., the average of 374 temperature values, N represents the total number of samples, i.e., 374, and σ represents the sample variance.
[0077] (3) Weather data quantification. One-hot encoding is used to process the data, expanding each categorical variable into an independent binary feature. Only one of these features is activated (i.e., has a value of 1), while the others are inactive (i.e., have a value of 0). There are six weather types: sunny, cloudy, overcast, showers, rain, and heavy rain. Therefore, the weather is encoded as a six-dimensional vector, with each dimension representing a weather type, as shown in Table 3.
[0078] Table 3: Display Table of Weather-Specific Hot Codes
[0079] weather Weather_0 Weather_1 Weather_2 Weather_3 Weather_4 Weather_5 clear 0 0 0 0 0 1 partly cloudy 0 0 0 0 1 0 cloudy day 0 0 0 1 0 0 shower 0 0 1 0 0 0 rain 0 1 0 0 0 0 heavy rain 1 0 0 0 0 0
[0080] 1.3 Data Labeling
[0081] The data creation time column of the ventilation execution data is matched with the data acquisition time column in the grain depot data sample, and the grain depot data sample shown in Table 1 is annotated.
[0082] We numbered the six ventilation methods used in the grain depot: 0 No ventilation, 1 Dehumidification ventilation, 2 Heat accumulation ventilation, 3 Timed ventilation, 4 Forced upward ventilation, and 5 Forced upward ventilation. Since grain depot data is collected every 8 hours, while ventilation is irregular, discrepancies in time data are inevitable. For example, the grain depot data might only have records for 8:00 and 16:00, but ventilation occurred at 9:00. To address this, we marked the most recent grain depot data entry before ventilation was performed with the ventilation measure, such as: 2 Heat accumulation ventilation. For grain depot data that has not been ventilated for more than two days, we marked it as 0 No ventilation.
[0083] 2. Calculate parameters such as the equilibrium relative humidity and dew point temperature of grains using physical formulas, and use them as features perceived by the attention mechanism.
[0084] Ventilation in grain depots aims to alter the internal temperature and humidity to achieve optimal conditions for grain storage. Therefore, grain depot ventilation measures are categorized into six types, including dehumidification ventilation, heat dissipation ventilation, and forced upward ventilation, rather than simply opening windows. We need an accurate and reliable reference standard for ventilation decisions, specifically calculating the dew point temperature inside and outside the grain depot. This requires three key parameters: the equilibrium relative humidity of the grain, the atmospheric dew point temperature, and the grain pile dew point temperature. The following is an explanation and calculation process for these three parameters:
[0085] (1) The equilibrium relative humidity of grain is calculated using the Chen-Clayton Approximation Equation (CAE). This parameter can be used to determine whether the grain has reached its optimal storage condition. If the grain's humidity is higher than the equilibrium humidity, it will release moisture until its humidity drops to a level matching the equilibrium humidity. Conversely, if the grain's humidity is lower than the equilibrium humidity, it will absorb moisture from the air until its humidity rises to the equilibrium humidity. The calculation formula is as follows:
[0086]
[0087] ERH r The value represents the equilibrium relative humidity of the grain (%), M represents the moisture content of the grain (%), and t r The average temperature data (°C) of the grain pile obtained from 374 grain pile temperature sensors is represented by A1, A2, B1, B2, and D, which are CAE equation parameters.
[0088] (2) Atmospheric dew point temperature refers to the temperature at which air reaches saturation and begins to condense under a certain pressure. This means that water vapor in the air, upon cooling, reaches a saturated state and forms water droplets, i.e., dew. The temperature at this point is called the dew point temperature. The calculation formula is as follows:
[0089]
[0090] DPT a Represents atmospheric dew point temperature (°C), t a Represents atmospheric temperature (°C), RH a Represents the relative humidity of the atmosphere (%).
[0091] (3) Grain dew point temperature refers to the temperature at which moisture begins to condense in the space formed by piled grains. If the temperature of the grain pile is higher than this dew point temperature, the moisture in the pile will begin to condense, which may cause the grain to mold and spoil. The calculation formula is as follows:
[0092]
[0093] Among them, DPT r ERH represents the dew point temperature of the grain pile (°C). r Represents the equilibrium relative humidity of grains (%), t r This represents the average temperature data (°C) of the grain pile.
[0094] 3. Construct a ventilation decision model that integrates graph neural networks and cross-attention mechanisms.
[0095] A ventilation decision-making model combines a graph neural network (GNN) and a cross-attention mechanism to make ventilation decisions for grain depots. Specifically, the model fuses spatial information through a graph convolutional network (GCN) and establishes attention relationships between multimodal information through a cross-attention mechanism to achieve the decision-making function. Figure 2 As shown.
[0096] 3.1 Processing of three-modal data: grain pile temperature data, meteorological data, and dew point data.
[0097] (1) The preprocessed grain pile temperature data is input into the linear layer in the matrix format of [374,1] (374 temperature sensor arrays in total) to increase the dimension to [374,32]. Then it is input into the node embedding layer to extract the temperature feature information and then input into the graph convolutional neural network (GCN). During training, the adjacency matrix obtained by processing the spatial coordinate information of the temperature sensor array in step 1.2 is combined to extract the grain pile temperature feature data and output the feature data of [374,32], which is denoted as feature 1.
[0098] (2) The external temperature and humidity data of the grain depot and the weather data after the unique thermal coding are integrated into a matrix format of [8,1] and input into the linear layer to increase the dimension to [8,32], which is denoted as feature 2.
[0099] (3) The temperature and humidity inside the grain depot, the equilibrium relative humidity of the grain, the atmospheric dew point temperature and the grain dew point temperature obtained in step 2 are integrated into a matrix format of [5,1] and input into a linear layer to increase the dimension to [5,32], which is denoted as feature 3.
[0100] 3.2 Introducing a cross-attention mechanism
[0101] For the three feature data obtained in step 3.1, establish attention relationships between each pair of them. The formula for calculating the attention matrix is as follows:
[0102]
[0103] Where Q is the Query, K is the Key, and V is the Value. This is a scaling factor, used to keep the gradient values stable during training.
[0104] Let's take the establishment of the attention matrix between feature 1 and feature 2 as an example to illustrate the process of establishing the attention relationship:
[0105] (1) Set Q, K, V. Let feature 1 be Query with shape [374,32], and feature 2 be Key and Value with shape [8,32].
[0106] (2) Calculate the attention score. As shown in Formula 8, the dot product of Query and Key is used to calculate the matching degree between Query and each Key. To prevent the value after the dot product from being too large, a scaling factor is multiplied. Then, the softmax function is applied to make the obtained attention score between 0 and 1, and the sum of all scores is 1. The shape of the obtained attention score matrix is [374, 8].
[0107] (3) Calculate the final result. Use the attention score obtained in the previous step to weight the value corresponding to the key, that is, multiply the attention score matrix and the value to finally obtain the attention matrix of feature 1 to feature 2, with the shape [374,32].
[0108] Similarly, we can construct attention matrices for feature 2 on feature 1, feature 1 on feature 3, feature 3 on feature 1, feature 2 on feature 3, and feature 3 on feature 2. There are a total of six attention matrices.
[0109] 3.3 Attention Matrix Assembly and Ventilation Decision Making
[0110] According to step 3.2, two attention matrices of shapes [374,32], [8,32], and [5,32] were generated. The six attention matrices were concatenated along the first dimension to form a concatenated matrix of shape [(374+8+5)×2,32], which is [774,32].
[0111] The concatenated matrix is input into the linear layer, outputting [774,32]. It is then input into the global pooling layer, becoming [1,32]. After passing through softmax, the final ventilation decision result is obtained.
[0112] 3.4 Model Training Process
[0113] According to step 1.1, historical data of grain storage and historical data of ventilation are collected. The historical data of grain storage includes internal temperature and humidity data, external temperature and humidity data, weather data, and grain pile temperature data. Then, according to step 1.2, the weather data and grain pile temperature data are preprocessed. Then, according to step 1.3, the historical data of grain storage and historical data of ventilation are matched with the ventilation mode according to the time. For example, the data in this group is labeled as 0 (i.e., no ventilation). In this way, data label pairs are obtained. The model learns the relationship between input and output based on the data label pairs. The training process of the model is to compare the predicted output generated by the forward propagation of the input data with the labels to calculate the loss function and update the model parameters.
[0114] Then, based on step 2, calculate the equilibrium relative humidity of the grain, atmospheric dew point temperature, and grain pile dew point temperature for each sample in the historical data of the grain warehouse.
[0115] Then, the data is divided into three modalities:
[0116] (1) Temperature data of the grain pile after pretreatment;
[0117] (2) Temperature and humidity outside the grain depot and weather data after pretreatment
[0118] (3) Temperature and humidity data inside the grain depot, as well as the equilibrium relative humidity of the grain, atmospheric dew point temperature, and grain pile dew point temperature.
[0119] The data from the three modalities were randomly divided into training and test sets in an 8:2 ratio, serving as input for building the ventilation decision model in step 3. The model used the cross-entropy loss function and the Adam optimizer, with a learning rate set to 0.001. The training epochs were set to 100. During each training epoch, the model was evaluated on the test set at the end of each epoch to monitor the training process and prevent overfitting, thereby obtaining a well-trained and tested model ready for online use.
[0120] 4. Online ventilation decision-making
[0121] 4.1 Data Acquisition:
[0122] (1) Real-time temperature and humidity data inside the grain warehouse are collected from the temperature sensor and humidity sensor at the top of the grain warehouse.
[0123] (2) Obtain current external temperature and humidity data and weather data from the meteorological bureau;
[0124] (3) Collect grain pile temperature data in real time from the temperature sensor array of each shallow circular silo;
[0125] 4.2 Data Processing
[0126] Preprocess the real-time collected weather data and grain pile temperature data according to step 1.2.
[0127] Based on step 2, the equilibrium relative humidity and dew point temperature of the grain are calculated; thus, data for three modes are obtained, namely:
[0128] (1) Temperature data of the grain pile after pretreatment;
[0129] (2) Temperature and humidity outside the grain depot and weather data after pretreatment
[0130] (3) Temperature and humidity data inside the grain depot, as well as the equilibrium relative humidity of the grain, atmospheric dew point temperature, and grain pile dew point temperature.
[0131] The data is input into the ventilation decision model trained and tested in step 3 for ventilation decision-making. The preprocessed grain pile temperature data is processed through a linear layer and a node embedding layer, and then through a graph convolutional neural network to obtain feature 1. The external temperature and humidity data of the grain depot and the preprocessed weather data are processed through a linear layer to obtain feature 2. The internal temperature and humidity data of the grain depot, as well as the equilibrium relative humidity of the grain, atmospheric dew point temperature, and grain dew point temperature, are processed through a linear layer to obtain feature 3. Then, feature 1, feature 2, and feature 3 are processed through a cross-attention mechanism to obtain the attention matrix between each pair, and then concatenated according to the first dimension. After passing through a linear layer, a global pooling layer, and softmax, the classification result of the ventilation decision is obtained, which is one of the six ventilation strategies (0 no ventilation, 1 dehumidification ventilation, 2 exhaust heat accumulation ventilation, 3 timed ventilation, 4 forced upward ventilation, 5 forced exhaust upward ventilation).
[0132] Compared to the applicant's earlier patent application, "A Method for Predicting Grain Stack Temperature in Grain Depots Based on Graph Neural Networks and Recurrent Neural Networks," this invention, while employing the same type of temperature sensor array for collecting grain stack temperature data, also incorporates multimodal data comprised of internal and external temperature and humidity data from the grain depot, as well as weather data. This allows for more accurate extraction of grain depot temperature characteristics. Furthermore, unlike the earlier application which focused solely on grain stack temperature prediction, this invention extends the prediction purpose to include ventilation decisions in grain depots, making it more practically applicable.
[0133] experiment:
[0134] To further verify the accuracy of the proposed method for grain depot ventilation decisions, based on the above-mentioned data preprocessing and network model, this experiment compares the ventilation decision model combining the GCN and Cross-Attention mechanism of this invention with the literature model ResNet+Self-Attention, and conducts ablation experiments with the simple GCN model and the Cross-Attention model without GCN.
[0135] The model in Reference 1 (see Zhu, Y.; Li, H.; Zhen, T.; Li, Z. Integrating Self-Attention Mechanisms and ResNet for Grain Storage Ventilation Decision Making: A Study. Appl. Sci. 2023, 13, 7655.) uses ResNet+Self-Attention for ventilation decision making.
[0136] Our proposed model was trained and validated on the same dataset and tested on the test set. Using the same evaluation metric, we compared the performance of different models.
[0137] The experimental evaluation indicators are as follows:
[0138] (1) Recall
[0139] Recall is the proportion of all actual positive samples that are correctly predicted as positive by the model. A high recall indicates that the model can identify the majority of positive samples. The calculation formula is as follows, where TP represents the true positives (the number of samples that the model predicted as positive and that are actually positive), and FN represents the false negatives (the number of samples that the model predicted as negative but that are actually positive).
[0140]
[0141] (2) Precision
[0142] Precision is the proportion of samples that the model predicts to be positive but are actually positive. High precision means that most of the samples predicted as positive by the model are actually positive. The formula is as follows, where FP represents false positives (the number of samples that the model predicts to be positive but are actually negative).
[0143]
[0144] (3) F1 (F1 Score)
[0145] The F1 score is the harmonic mean of precision and recall, providing a balance between the two and allowing us to focus on more than one metric. If both precision and recall are high, the F1 score will also be high. The calculation formula is:
[0146]
[0147] The results of the comparative experiment are shown in Table 2 below:
[0148] Table 2: Comparison of Experimental Results of Grain Pile Temperature Prediction Algorithms
[0149]
[0150] The results show that, compared to other models, the model of this invention achieves excellent ventilation decision-making results by fusing spatial information from temperature sensors with GCN and incorporating multimodal features through a Cross-Attention mechanism. The model proposed in this invention demonstrates superior performance in evaluation metrics, with higher recall, precision, and F1 score than other models.
[0151] Finally, it should be noted that the above examples are merely some specific embodiments of the present invention. Obviously, the present invention is not limited to the above embodiments and many variations are possible. All variations that can be directly derived or conceived by those skilled in the art from the disclosure of the present invention should be considered within the scope of protection of the present invention.
Claims
1. A grain storage ventilation decision-making method based on GNN and Cross-Attention, characterized by: S1. Real-time data acquisition, including the collection of internal and external temperature and humidity data of the grain depot, as well as weather data and grain pile temperature data; S2. The collected grain pile temperature data and weather data are preprocessed respectively, and the grain equilibrium relative humidity, atmospheric dew point temperature and grain dew point temperature are calculated as inputs to the pre-trained ventilation decision model. The preprocessing includes: The grain pile temperature data were processed using the Z-SCORE normalization method: (3) (4) in, Represents the average value of the sample. Represents the total number of samples. Represents the sample variance; The weather data is processed using one-hot encoding and encoded into a six-dimensional vector. There are six types of weather data: sunny, cloudy, overcast, showers, rain, and heavy rain. Therefore, the weather is encoded into a six-dimensional vector, with each dimension representing a type of weather. The equilibrium relative humidity of the grain is: (5) in, Represents the moisture content of grain. Represents the temperature of the grain. , , , , These are the equation parameters; The atmospheric dew point temperature is: (6) in, Represents atmospheric temperature. Represents atmospheric relative humidity; The grain dew point temperature is: (7) in, Represents the equilibrium relative humidity of grains. Represents the temperature of the grain; S3. In the pre-trained ventilation decision model, the pre-processed grain pile temperature data is processed through a linear layer and a node embedding layer, and then through a graph convolutional neural network to obtain feature 1. The external temperature and humidity data of the grain depot and the pre-processed weather data are processed through a linear layer to obtain feature 2. The internal temperature and humidity data of the grain depot, as well as the equilibrium relative humidity of the grain, atmospheric dew point temperature, and grain dew point temperature, are processed through a linear layer to obtain feature 3. Then, feature 1, feature 2, and feature 3 are processed through a cross-attention mechanism to obtain the attention matrix between each pair, and then concatenated according to the first dimension. After passing through a linear layer, a global pooling layer, and softmax, the classification result of the ventilation decision is obtained, which is one of the following six ventilation strategies: 0 No ventilation, 1 Dehumidification ventilation, 2 Exhaust heat accumulation ventilation, 3 Timed ventilation, 4 Forced upward ventilation, and 5 Forced upward ventilation.
2. The grain storage ventilation decision-making method based on GNN and Cross-Attention according to claim 1, characterized in that: The training process of the ventilation decision model is as follows: Historical data of grain storage and historical data of ventilation are collected. The historical data of grain storage includes internal temperature and humidity data, external temperature and humidity data, weather data, and grain pile temperature data. Then, the grain pile temperature data and weather data are preprocessed as described above. The historical data of grain storage and historical data of ventilation are matched and labeled according to time. For each sample in the historical data of the grain warehouse, the equilibrium relative humidity of the grain, the atmospheric dew point temperature, and the grain pile dew point temperature are calculated; then, the data are divided into three modes, namely: (1) Temperature data of the grain pile after pretreatment; (2) External temperature and humidity of the grain depot and weather data after pretreatment; (3) Temperature and humidity data inside the grain depot, as well as the equilibrium relative humidity of the grain, atmospheric dew point temperature, and grain pile dew point temperature; The data from the three modalities were randomly divided into training and testing sets in an 8:2 ratio and input into the ventilation decision model. During training, the preprocessed grain pile temperature data was processed through a linear layer and a node embedding layer, and then combined with the adjacency matrix of the spatial coordinates of the grain pile temperature sensor array and input into the graph convolutional neural network. The loss function used is the cross-entropy loss function, and the Adam optimizer is employed. The learning rate is set to 0.001, and the training epochs of the model are set to 100. During the training cycle, at the end of each cycle, the model is evaluated on the test set; Temperature data acquisition of the grain pile is achieved using a temperature sensor array, consisting of four cylindrical cable groups formed by 3, 5, 10, and 16 sensor cables from the inside out. The radius difference between each cable group is 2 meters, and each sensor cable is equipped with 11 temperature sensors spaced 2.5 meters apart.
3. The grain storage ventilation decision-making method based on GNN and Cross-Attention according to claim 2, characterized in that: The adjacency matrix of the spatial coordinates of the grain pile temperature sensor array is: Based on the position coordinates of the grain pile temperature sensors in the temperature sensor array, the Gaussian kernel method is used to calculate the distance between each sensor, and an adjacency matrix of the grain pile temperature sensor array spatial coordinates based on the actual distance is established. (1) (2) in, The standard deviation representing the distance between sensors, Indicates the physical distance between sensors. This represents the standard deviation of these distances.
4. The grain storage ventilation decision-making method based on GNN and Cross-Attention according to claim 3, characterized in that: The temperature and humidity data inside the grain depot are collected by temperature and humidity sensors on the top of the grain depot. The external temperature and humidity data of the grain depot, as well as the weather data, were obtained from publicly available data from the meteorological bureau. The grain pile temperature data is collected through a temperature sensor array in a shallow circular silo.