Greenhouse rock candy jujube temperature and humidity prediction method and system based on double-path multi-scale feature extraction module
By using a dual-path, multi-scale feature extraction module, combined with depthwise separable convolution and channel attention mechanisms, the problem of capturing high and low frequency features and ignoring physical coupling relationships in greenhouse temperature and humidity prediction is solved, achieving accurate prediction and improved stability, and supporting intelligent control of the greenhouse environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DALIAN UNIV
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for predicting greenhouse temperature and humidity struggle to simultaneously and accurately capture both high-frequency changes such as light intensity and low-frequency changes such as soil moisture, and they also neglect the physical coupling between data from different sensors, leading to inaccurate prediction results.
A dual-path, multi-scale feature extraction module, including local and global feature extraction paths, is employed. Through depthwise separable convolution and channel attention mechanisms, fine-grained fluctuations and long-term dependency patterns in environmental data are captured. Multi-scale fused features are generated through an adaptive gating fusion module and input into the improved iTransformer model for prediction.
It significantly improves the accuracy and stability of temperature and humidity prediction for greenhouse jujubes, provides a reliable basis for greenhouse environmental control, ensures the stability of fruit quality and yield, and promotes the high-quality and large-scale development of the industry.
Smart Images

Figure CN121958970A_ABST
Abstract
Description
A method and system for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module Technical Field
[0001] This invention relates to the field of smart agriculture technology, specifically to a method and system for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module. Background Technology
[0002] As a high-value fresh jujube variety, rock sugar jujube is widely favored by consumers in the market due to its crisp, juicy, and honey-sweet taste, and has become a highly promising advantageous variety in agricultural planting. However, this variety exhibits a high degree of sensitivity to changes in the growing environment, especially the key environmental factors of root zone temperature and humidity. Even slight fluctuations in these factors can directly affect the physiological metabolism, nutrient absorption, and fruit development of rock sugar jujube, thus significantly impacting the final yield and quality.
[0003] Under traditional cultivation methods, the planting of rock sugar jujubes is severely constrained by the uncertainty of natural climate, and it is difficult to maintain a stable soil temperature and humidity. This environmental instability easily leads to problems such as uneven fruit size, large differences in sweetness, and low marketability, resulting in inconsistent fruit quality. This not only reduces the product's market competitiveness but also directly affects the yield stability and economic benefits for growers, thus restricting the large-scale and high-quality development of the rock sugar jujube industry.
[0004] With the advancement of smart agriculture technology, greenhouse cultivation has gradually become an important way to solve the constraints of natural environment and achieve efficient planting of jujubes. Accurate temperature and humidity prediction is the core prerequisite for intelligent control of the greenhouse environment. However, existing greenhouse temperature and humidity prediction methods still have obvious limitations and cannot meet the needs of refined planting of jujubes. On the one hand, greenhouse environmental data has typical multi-scale characteristics. Parameters such as light intensity and air temperature fluctuate rapidly with cloud movement and ventilation operations, showing high-frequency change characteristics. On the other hand, parameters such as soil moisture and root zone temperature are buffered by the soil medium and change slowly, showing low-frequency change characteristics. Ordinary prediction models use a single convolution kernel for feature extraction, which makes it difficult to accurately capture the change patterns of these two different scales at the same time. On the other hand, traditional prediction models often focus too much on the sequential continuity in the time dimension, treating each environmental parameter as an independent variable for prediction, but ignoring the inherent physical coupling relationship and lag effect between environmental factors collected by different sensors (such as soil conductivity and air humidity, soil temperature and root water absorption efficiency, etc.), resulting in deviations between the prediction results and actual environmental changes, and failing to provide a reliable decision-making basis for greenhouse environmental control. Summary of the Invention
[0005] The purpose of this invention is to propose a method and system for predicting the temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module. This method achieves collaborative modeling of local features and global dependencies, effectively improving the accuracy, stability, and engineering practicality of temperature and humidity prediction for greenhouse jujubes, and providing reliable technical support for precise control of the greenhouse environment.
[0006] According to a first aspect of the present disclosure, a method for predicting the temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module is provided, comprising the following steps: preprocessing the acquired jujube growth environment data to obtain structured training sample data; constructing a dual-path multi-scale feature extraction module DPMS-FEM, which adopts a parallel dual-branch architecture, including a local feature extraction path LFEP and a global feature extraction path GCP: wherein, the local feature extraction path is used to capture fine-grained fluctuation features of adjacent time steps in the environmental data, and the global feature extraction path is used to mine long-term dependency patterns across time steps; then, the output features of the two paths are dynamically integrated through an adaptive gating fusion module to generate multi-scale fusion features; the above multi-scale fusion features are input into an improved iTransformer model, and after model training, the temperature and humidity prediction results of greenhouse jujubes are output.
[0007] In one embodiment, the preprocessing method for the acquired rock sugar jujube growth environment data is as follows: The environmental data, including the time information of rock sugar jujube growth, air humidity, air temperature, carbon dioxide concentration, light intensity, soil temperature, soil humidity, and soil conductivity, are organized into an N×11 dimensional data matrix. Outliers are identified using the interquartile range (IQ) outlier detection method, and then the outliers are repaired using cubic spline interpolation. Year, month, date, hour, minute, and weekday time features are extracted from the timestamps, and the month and hour features are optimized using sine and cosine coding. The features of each rock sugar jujube growth environment data are uniformly scaled to the [0,1] interval based on the min-max normalization method. The time-series data is traversed through a sliding window with a fixed step size, and the continuous data is cut into a large number of overlapping sequence pairs. , ),in Given the input sequence, This is the corresponding label sequence.
[0008] In one embodiment, the processing flow of the Local Feature Extraction Path (LFEP) is as follows: Let the input features of the jujube growing environment be... Where B is the batch size, D is the number of input channels, and L is the sequence length; the input features are split into a main feature extraction branch and a residual connection branch, which are processed in parallel; residual connection branch processing: first, the features are processed... After performing Laynorm distribution stabilization, we obtain ∈ Then through convolution operations Increase the number of feature channels from D to D' to complete the residual branch feature mapping, and obtain ∈ Main branch processing: Features Through convolutional layers Expanding the feature dimensions yields ∈ After introducing a nonlinear transformation using the GELU activation function, we obtain... ∈ The GELU function is defined as follows: , The cumulative distribution function of the standard normal distribution. As input features; depthwise separable convolution is used to extract local spatiotemporal features: first, one-dimensional depthwise convolution is used. Independent spatial filtering is performed on each input channel to obtain ∈ Then through pointwise convolution Achieve cross-channel feature fusion to obtain ∈ .
[0009] In one embodiment, the Local Feature Extraction Path (LFEP) introduces a channel rearrangement operation. The operation process is as follows: in The number of groups; the specific process of this operation is: grouping shapes into... The tensor is reshaped into Then transpose the dimensions Then reshape back to the original shape The features after channel rearrangement are further enhanced with the GELU activation function to obtain... ∈ Output the residual branch Output of the main branch Adding element by element, we get Applying a Dropout layer to randomly discard some neurons with probability p yields the following results: ∈ ; through convolutional layers Reduce the feature dimension from D' back to D to obtain local features. ∈ .
[0010] In one embodiment, the processing flow of the Global Feature Extraction Path (GCP) is as follows: Let the input features of the jujube growing environment be... Where B is the batch size, D is the number of input channels, and L is the sequence length; the input features Through convolution operations Expanding the feature dimensions yields ∈ Then, a nonlinear transformation is introduced using the GELU activation function to obtain... ∈ ;right Perform one-dimensional transpose convolution Initially expanding the perceptual field in the time dimension, and obtaining ∈ And the output sequence length is the same as the input; [The feature] Through convolution After aligning the channels, with By summing the residuals, the original features and the extended receptive field features are reused to obtain... ∈ ;right Perform transposed convolution again Operations further expand the long-range dependent receptive field, resulting in ∈ After introducing a nonlinear transformation using the GELU activation function, we obtain... ∈ ;right By point-by-point convolution After completing feature mapping and dimension preservation, we obtain ∈ ;Will and Adding them together achieves complementary features across multiple paths, resulting in... ∈ ; Features Through convolution After aligning the channels, with Residual fusion is performed again to enhance the preservation of original information, resulting in... ∈ .
[0011] In one embodiment, the Global Feature Extraction Path (GCP) introduces a channel attention module, specifically implemented by obtaining global statistical features for each channel through Global Average Pooling (GAP). Channel attention weights are generated based on fully connected networks. ,in , For the reduction rate, The function compresses the weights to Interval; after expanding the dimension of the attention weight 'a' through the Unsqueeze operation, and then... Feature channels are recalibrated by element-wise multiplication along the channel dimension. ∈ ;right Applying a Dropout layer to randomly drop some neurons with probability p, followed by regularization, yields... ∈ ; through convolutional layers Reduce the feature dimension from D' back to D to obtain the global features. ∈ .
[0012] In one embodiment, the processing flow of the adaptive gating fusion module is as follows: local features are processed along the channel dimension. ∈ With global features ∈ Perform a concatenation operation to obtain a composite feature tensor. ;right Perform a global average pooling (GAP) operation to extract the global statistics for each channel: s = GAP( Then through convolutional layers Dimensionality reduction, where r is the dimensionality reduction ratio, and after passing through the ReLU activation function, we obtain... ∈ Finally, through convolutional layers After dimensionality increase and passing through the Sigmoid function, the weights are compressed to the [0,1] interval, resulting in... ∈ , Each scalar corresponds to one channel of the output feature; the weight vector and Element-wise multiplication along the channel dimension, (1- )and Element-wise multiplication along the channel dimension, followed by addition, yields the initial fused feature. Introducing a feature refinement layer, through convolutional layers right Cross-channel integration and nonlinear enhancement were performed to obtain ∈ ;right Perform a transpose operation to transform the dimensions from [B,D,L] to [B,L,D], resulting in multi-scale fused features. ,in , This represents the feature vector at time step t after fusion.
[0013] According to a second aspect of the present disclosure, a greenhouse jujube temperature and humidity prediction system based on a dual-path multi-scale feature extraction module is provided, comprising: a data preprocessing module for preprocessing acquired jujube growth environment data to obtain structured training sample data; a dual-path multi-scale feature extraction module for constructing a dual-path multi-scale feature extraction module DPMS-FEM, which adopts a parallel dual-branch architecture, including a local feature extraction path LFEP and a global feature extraction path GCP: wherein the local feature extraction path is used to capture fine-grained fluctuation features of adjacent time steps in the environmental data, and the global feature extraction path is used to mine long-term dependency patterns across time steps, and then the output features of the two paths are dynamically integrated by an adaptive gating fusion module to generate multi-scale fused features; and a temperature and humidity prediction module for inputting the above multi-scale fused features into an improved iTransformer model, and after model training, outputting the temperature and humidity prediction results of greenhouse jujubes.
[0014] According to a third aspect of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the memory. When the processor executes the program, it implements the aforementioned method for predicting the temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module.
[0015] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the aforementioned method for predicting the temperature and humidity of greenhouse rock sugar dates based on a dual-path multi-scale feature extraction module.
[0016] Compared with the prior art, the above technical solution adopted in this invention has the following advantages: 1. This invention designs a parallel dual-path architecture. The local path captures high-frequency local fluctuations such as sudden changes in illumination through depthwise separable convolution, while the global path uses transposed convolution to mine low-frequency long-range trends such as day-night temperature difference and seasonal changes. The fusion of the two breaks through the limitation of ordinary models where a single convolution kernel cannot take into account the characteristics of fast and slow changes, and provides comprehensive feature support for accurate prediction.
[0017] 2. This invention improves the prediction framework by using the iTransformer structure to embed each environmental factor as an independent token, enabling the model to directly learn the nonlinear coupling and hysteresis relationship between parameters such as soil conductivity and air humidity. This overcomes the defect of traditional Transformer that ignores the physical correlation of sensor data and improves prediction reliability.
[0018] 3. Local paths introduce channel rearrangement to promote information flow and enhance feature robustness; global paths embed channel attention mechanisms to adaptively strengthen the weights of key factors and suppress noise; depthwise separable convolutions reduce the number of model parameters and computational complexity, improving operational efficiency while ensuring accuracy and facilitating practical deployment.
[0019] In summary, this invention significantly improves the accuracy and stability of temperature and humidity prediction for greenhouse jujubes, enhances the practicality of the model, provides a reliable basis for intelligent greenhouse control, ensures stable fruit quality and yield, and promotes the high-quality and large-scale development of the jujube industry. Attached Figure Description
[0020] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.
[0021] Figure 1 is an overall flowchart of the greenhouse jujube temperature and humidity prediction method based on the dual-path multi-scale feature extraction module; Figure 2 is a structural block diagram of the dual-path multi-scale feature extraction module DPMS-FEM; Figure 3 is a detailed structural diagram of the local feature extraction path LFEP; Figure 4 is a detailed structural diagram of the global feature extraction path GCP; Figure 5 is a schematic diagram of the adaptive feature fusion mechanism; Figure 6 is a comparison diagram of temperature prediction curves; Figure 7 is a comparison diagram of humidity prediction curves. Detailed Implementation
[0022] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0023] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0024] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0025] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and systems according to various embodiments of this disclosure. It should be noted that each block in a flowchart or block diagram may represent a module, segment, or portion of code, which may include one or more executable instructions for implementing the logical functions specified in the various embodiments. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutively represented blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, may be implemented using a dedicated hardware-based system that performs the specified functions or operations, or using a combination of dedicated hardware and computer instructions.
[0026] Example 1: As shown in Figure 1, this example provides a method for predicting temperature and humidity in greenhouse jujubes based on a dual-path multi-scale feature extraction module, including the following steps: S1. Preprocessing the acquired jujube growth environment data to obtain structured training sample data; specifically, collecting multi-dimensional environmental parameters during the jujube growth process, including time information, air humidity, air temperature, carbon dioxide concentration, light intensity, soil temperature, soil moisture, soil conductivity, etc., and standardizing the above parameters to construct a data matrix of dimension N×11 (where N represents the total number of samples in the dataset). To ensure data quality, an outlier detection method based on IQR (interquartile range) is used to identify outliers in the data. Subsequently, cubic spline interpolation is used to repair the identified outliers, achieving dataset cleaning and smoothing. The specific formula for outlier detection is as follows: Third quartile After outlier detection is used to identify outliers in the data, in order to reconstruct reasonable values for these outliers and maintain the continuity of the time series, this invention uses cubic spline interpolation for data repair. The principle is as follows: (1) For a given data point , In each sub-interval Construct a cubic polynomial above: (2) To ensure the smoothness and continuity of the interpolation curve, the following four conditions must be met: ① The function values are continuous ② The first derivative is continuous ③Continuity of the second derivative (3) Use natural spline boundary conditions to ensure that the curve is smooth at the endpoints: (4) Construction of linear equation system: Define the second derivative Based on the above conditions, the following tridiagonal linear equation system can be derived: For : Combined with boundary conditions and To obtain the complete A system of linear equations.
[0027] (5) Solving for coefficients: The coefficients are obtained by solving the above tridiagonal linear equation system. Then, the coefficients of each cubic polynomial can be obtained from the following formula: (6) Outlier repair: For each data point marked as an outlier Determine the interval in which it is located. Using the corresponding cubic polynomial The repair value is obtained: This method ensures, through constraints, that the repaired data points not only satisfy the continuity of function values, but also maintain the continuity of first and second derivatives. Thus, while eliminating outliers, it preserves the true changing trend and curve smoothness characteristics of the growing environment parameters of jujubes to the greatest extent.
[0028] Before inputting environmental parameters of rock sugar jujubes into the model encoder for feature learning, it is necessary to extract multi-dimensional time information from the original data timestamps to construct a hierarchical time feature system that adapts to the growth cycle of rock sugar jujubes. By decomposing time information into structured features of different granularities, support is provided for the model to capture the temporal periodicity and dynamic changes of environmental parameters.
[0029] First, basic time features are extracted directly from the original timestamps. These features are the core foundation for constructing the time system. Specifically, key information such as year, month, date, hour, minute, and day of the week are separated from the timestamps using time parsing tools. These basic features directly reflect the time nodes of environmental parameter collection and provide an important basis for subsequent derived feature calculations.
[0030] Given the inherent periodicity of time features such as months and hours, sine and cosine coding is employed to optimize them and help the model better understand this cyclical attribute. This coding method transforms discrete time features into continuous features that are easy for the model to learn, effectively improving the model's ability to capture periodic patterns and providing richer temporal information to support the time-series prediction of environmental parameters for rock sugar dates.
[0031] ① For the month feature (month), the encoding is: ② For the hour feature, the encoding is: Considering that the environmental parameters of rock sugar dates are multivariate data with varying numerical ranges, the min-max normalization method is used to uniformly scale all features to the [0,1] interval: In the formula: These are the normalized environmental parameter values; These are the environmental parameter values before normalization; This is the minimum value in the environmental characteristic column; This is the maximum value in the environmental feature column.
[0032] By traversing the entire time series data through a sliding window with a fixed step size, continuous data is segmented into a large number of overlapping sequence pairs. This greatly expands the training sample size. For indexing... The truncation rules for each component of the sample at a given location are defined by the following formula: in, These are the historical length, tag length, and predicted length, respectively.
[0033] S2. Dual-Path Multi-Scale Feature Extraction Module: A dual-path multi-scale feature extraction module (DPMS-FEM) is constructed. This module adopts a parallel dual-branch architecture, including a local feature extraction path (LFEP) and a global feature extraction path (GCP). The local feature extraction path is used to capture fine-grained fluctuation features of adjacent time steps in the environmental data, while the global feature extraction path is used to mine long-term dependency patterns across time steps. Then, the output features of the two paths are dynamically integrated through an adaptive gating fusion module to generate multi-scale fused features. As shown in Figure 2, the core purpose of the dual-path multi-scale feature extraction module (DPMS-FEM) in this embodiment is to simultaneously capture the local detailed features and long-term dependency patterns of the jujube growth environment from the preprocessed time-series data, providing richer feature representations for the subsequent Transformer encoder. This module adopts a parallel dual-branch architecture: a channel shuffle operation is introduced in the local feature extraction path to effectively promote information interaction and flow between different channels in the depthwise separable convolution and enhance feature robustness; a channel attention mechanism is embedded in the global feature extraction path to enable the model to adaptively assign higher weights to key influencing factors (such as root temperature) while suppressing redundant noise interference.
[0034] The input to the dual-path multi-scale feature extraction module is a high-dimensional temporal feature tensor processed by the pre-embedding layer, denoted as: in, For batch size, Given the length of the input sequence, For feature dimension, Indicates time step eigenvectors.
[0035] This module first transposes the input to fit the standard format of one-dimensional convolution operations: Subsequently, They are simultaneously fed into two processing paths with different structures and complementary functions.
[0036] As shown in Figure 3, the Local Feature Extraction Path (LFEP), as the first branch in the dual-path architecture, has the core function of efficiently capturing fine-grained features between adjacent time points in the input sequence. Its processing flow is as follows: (1) Let the input features be... (Where B is the batch size, D is the number of input channels, and L is the sequence length). The input features are split into a feature extraction branch and a residual connection branch, which are processed in parallel to achieve feature enhancement and gradient stabilization.
[0037] (2) The residual branch directly performs dimension mapping on the input features. The specific operations are: ① Stabilize the distribution of the input features: ②Increase the number of feature channels from Upgraded to (generally ), complete the feature mapping of the residual branch: in, This indicates that the kernel size is 1 and the input channels are... Output channels are The convolution operation.
[0038] (3) Main branch: Input features First, a 1×1 pointwise convolutional layer is used to expand the feature dimension, increasing the number of channels from... Upgraded to (generally To increase the expressive power of the model: in, This indicates that the kernel size is 1 and the input channels are... Output channels are The convolution operation.
[0039] (4) Introduce nonlinear transformation through the GELU activation function: The GELU function is defined as follows: ,in It is the cumulative distribution function of the standard normal distribution.
[0040] (5) In order to further extract the local spatiotemporal features of the sequence efficiently, while significantly reducing the computational complexity and number of parameters of the model, depthwise separable convolution was adopted as the core feature extraction component.
[0041] ① First, perform depthwise convolution, and then perform spatial filtering independently for each input channel: This operation is only used The number of parameters (kernel size 3) compared to the standard convolution requires [number of parameters]. The number of parameters has been significantly reduced.
[0042] ② Subsequently, cross-channel feature fusion and information integration are achieved through pointwise convolution: The total computational complexity of depthwise separable convolution is The complexity of standard convolution is... (in (where the kernel size is), in The computational efficiency is significantly improved when the value is large.
[0043] (6) To avoid the problem of limited information exchange between feature groups in depthwise separable convolution, a channel rearrangement operation is introduced: in The number of groups. The specific process of this operation is as follows: ① Group the shapes as... The tensor is reshaped into ② Transpose dimension: ③ Reshape back to the original shape: (7) The features after channel rearrangement are further enhanced with the GELU activation function to improve their nonlinear expressive power: (8) Output the residual branch Output of the main branch Element-wise addition achieves residual join: = + (9) To prevent overfitting, a Dropout layer is applied with probability. Randomly discard some neurons: (10) Finally, the feature dimension is reduced from 1×1 through a 1×1 convolutional layer. Return to the original dimension This forms the final output of the local path: As shown in Figure 4, the Global Context Path (GCP), as the second branch in the dual-path architecture, focuses on capturing long-term dependencies across multiple time steps in the sequence. This path expands the receptive field through deconvolutional layers and combines a channel attention mechanism to achieve efficient modeling of the global contextual information of the input sequence.
[0044] (1) Input features First, a 1×1 pointwise convolutional layer is used to expand the feature dimension, increasing the number of channels from... Upgraded to (generally ): Then, a nonlinear transformation is introduced using the GELU activation function: (2) To Perform a 3×1 transposed convolution to initially expand the receptive field in the temporal dimension, and split the output features into two paths for processing: in, It is a one-dimensional transpose convolution with kernel size 3, stride 1, and padding 1, ensuring that the length of the output sequence is consistent with that of the input.
[0045] (3) Input features After aligning the channels, with The residuals are summed to reuse the original features and the features of the initially expanded receptive field: (4) After residual fusion Perform a second 3×1 transposed convolution operation to further expand the receptive field for long-range dependencies: Then, a nonlinear transformation is introduced using the GELU activation function: (5) Perform a 1×1 pointwise convolution operation to complete feature mapping and dimension preservation: (6) and Adding them together achieves complementary features across multiple paths: (7) Input features After aligning the channels, with Perform residual fusion again to enhance the preservation of original information: (8) To enable the model to adaptively focus on the feature channels most important to the prediction task, a lightweight channel attention module is introduced: ① First, global statistical features of each channel are obtained through Global Average Pooling (GAP): ② Subsequently, channel attention weights are generated through a two-layer fully connected network (equivalent to 1×1 convolutions): in, For the reduction rate, The function compresses the weights to Interval.
[0046] ③ Apply the generated attention weights to the original features to recalibrate the feature channels: in, This represents element-wise multiplication along the channel dimension.
[0047] (9) Apply a Dropout layer to the attention-weighted features for regularization: Finally, a 1×1 convolutional layer is used to reduce the feature dimension from... Return to the original dimension This forms the final output of the global path: As shown in Figure 5, after the local feature extraction path and the global feature extraction path have completed feature processing respectively, the output features of the two paths are dynamically integrated through an adaptive gating fusion module to form the final multi-scale fusion feature.
[0048] (1) To preserve the complementary feature information extracted from the two paths, a concatenation operation is first performed along the channel dimension: in, This indicates a stitching operation along the channel dimension (the first dimension). Local features are preserved. With global features Complete information, forming a collection Composite feature tensor of each channel.
[0049] (2) To dynamically determine whether to emphasize local or global features in each feature channel, a lightweight gating mechanism is designed. This mechanism analyzes the spliced features... Generate an adaptive weight vector α related to the data: Where GAP(⋅) represents global average pooling, used to extract global statistics for each channel; r is the dimensionality reduction ratio (usually set to 4 or 8), used to compress parameters; the sigmoid function compresses the weights to the [0,1] interval, and each scalar in α corresponds to a channel of the final output feature. The closer its value is to 1, the more dependent the channel is on the global features. Conversely, the more it depends on local features. .
[0050] (3) The generated channel weights α are applied to the outputs of both paths simultaneously, and then weighted and summed to obtain preliminary fusion features: (4) The features obtained by adaptive gating fusion have initially integrated multi-scale information. To further promote cross-channel information interaction, enhance feature representation capabilities, and ensure that the output dimension matches the subsequent Transformer encoder, a feature refinement layer is introduced. This layer consists of a 1×1 convolution, and its function is to perform cross-channel integration and non-linear enhancement on the weighted and fused features, rather than simply reducing dimensionality.
[0051] (5) To adapt to the subsequent Transformer-based encoder architecture, the fused feature tensor is transposed back to the main sequence format: This transpose operation changes the dimension from Convert to ,in , Indicates the time step after fusion eigenvectors.
[0052] S3. Input the above multi-scale fusion features into the improved iTransformer model. After model training, output the temperature and humidity prediction results of greenhouse rock sugar dates, as shown in Figure 6-7.
[0053] Example 2: This example provides a greenhouse jujube temperature and humidity prediction system based on a dual-path multi-scale feature extraction module, including: a data preprocessing module, which preprocesses the acquired jujube growth environment data to obtain structured training sample data; a dual-path multi-scale feature extraction module, which constructs a dual-path multi-scale feature extraction module DPMS-FEM, which adopts a parallel dual-branch architecture, including a local feature extraction path LFEP and a global feature extraction path GCP: the local feature extraction path is used to capture fine-grained fluctuation features of adjacent time steps in the environmental data, and the global feature extraction path is used to mine long-term dependency patterns across time steps. Then, the output features of the two paths are dynamically integrated through an adaptive gating fusion module to generate multi-scale fused features; and a temperature and humidity prediction module, which inputs the above multi-scale fused features into an improved iTransformer model, and after model training, outputs the temperature and humidity prediction results for greenhouse jujubes.
[0054] The above modules can be deployed on the same device or distributed devices; the division of modules is only a functional logic description and does not limit the specific physical boundaries or implementation order.
[0055] Example 3: An electronic device for running the above-mentioned "a method for predicting the temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module". The electronic device includes a processor, a memory, and optional communication interfaces / display devices / input devices, etc.; the memory stores a computer program that can run on the processor. When the processor executes the program, it implements steps S1 to S3 of the method described in Embodiment 1, specifically including but not limited to: S1. Preprocessing the acquired rock sugar jujube growth environment data to obtain structured training sample data; S2. A dual-path multi-scale feature extraction module is constructed, which adopts a parallel dual-branch architecture, including a local feature extraction path LFEP and a global feature extraction path GCP: the local feature extraction path is used to capture the fine-grained fluctuation features of adjacent time steps in the environmental data, and the global feature extraction path is used to mine the long-term dependency patterns across time steps. Then, the output features of the two paths are dynamically integrated through an adaptive gating fusion module to generate multi-scale fusion features; S3. The above multi-scale fusion features are input into the improved iTransformer model. After model training, the temperature and humidity prediction results of greenhouse rock sugar jujubes are output.
[0056] The electronic device hardware can be one of a server, personal computer, workstation, industrial controller, edge computing device, or mobile terminal; the processor can be a general-purpose CPU, GPU, NPU, FPGA, or a combination thereof; the memory can be RAM, ROM, flash memory, or disk array. The device can interact with local / remote data storage (acquiring observation data and outputting inversion results) through a communication interface. The above hardware configuration does not constitute a limitation of the present invention.
[0057] Example 4: A computer-readable storage medium storing a computer program, which, when run on a processor of an electronic device, causes the program to execute the method steps S1 to S3 described in Example 1; the storage medium may be a disk, optical disk, flash memory, solid-state drive, read-only memory, random access memory, or any combination of the above media.
[0058] Those skilled in the art will understand that the modules or steps described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, which can then be stored in a storage device for execution by a computer device. Alternatively, they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. This disclosure is not limited to any particular combination of hardware and software.
[0059] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0060] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.
Claims
1. A method for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module, characterized in that, Includes the following steps: The acquired data on the growth environment of jujubes were preprocessed to obtain structured training sample data. A dual-path multi-scale feature extraction module DPMS-FEM was constructed. This module adopts a parallel dual-branch architecture, including a local feature extraction path LFEP and a global feature extraction path GCP. The local feature extraction path is used to capture the fine-grained fluctuation features of adjacent time steps in the environmental data, while the global feature extraction path is used to mine long-term dependency patterns across time steps. The output features of the two paths are then dynamically integrated through an adaptive gating fusion module to generate multi-scale fusion features. The above multi-scale fusion features are input into the improved iTransformer model. After model training, the temperature and humidity prediction results of greenhouse rock sugar dates are output.
2. The method for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module according to claim 1, characterized in that, The preprocessing method for the acquired rock sugar jujube growth environment data is as follows: the acquired rock sugar jujube growth environment data is organized into an N×11 dimensional data matrix, outliers are identified using the interquartile range (IQ) outlier detection method, and then the outliers are repaired using cubic spline interpolation; year, month, date, hour, minute, and weekday time features are extracted from the timestamps, and the month and hour features are optimized using sine and cosine coding; the features of each rock sugar jujube growth environment data are uniformly scaled to the [0,1] interval based on the min-max normalization method; the time series data is traversed through a sliding window with a fixed step size, and the continuous data is cut into a large number of overlapping sequence pairs ( , ),in Given the input sequence, This is the corresponding label sequence.
3. The method for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module according to claim 1, characterized in that, The processing flow of the Local Feature Extraction Path (LFEP) is as follows: Let the input features of the jujube growing environment be... Where B is the batch size, D is the number of input channels, and L is the sequence length; the input features are split into a main feature extraction branch and a residual connection branch, which are processed in parallel; residual connection branch processing: first, the features are processed... After performing Laynorm distribution stabilization, we obtain ∈ Then through convolution operations Increase the number of feature channels from D to D' to complete the residual branch feature mapping, and obtain ∈ Main branch processing: Features Through convolutional layers Expanding the feature dimensions yields ∈ ; By introducing a nonlinear transformation through the GELU activation function, we obtain ∈ The GELU function is defined as follows: , The cumulative distribution function of the standard normal distribution. As input features; depthwise separable convolution is used to extract local spatiotemporal features: first, one-dimensional depthwise convolution is used. Independent spatial filtering is performed on each input channel to obtain ∈ ; Then through pointwise convolution Achieve cross-channel feature fusion to obtain ∈ 。 4. The method for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module according to claim 3, characterized in that, The Local Feature Extraction Path (LFEP) introduces a channel rearrangement operation. The operation process is as follows: in The number of groups; the specific process of this operation is: grouping shapes into... The tensor is reshaped into Then transpose the dimensions Then reshape back to the original shape The features after channel rearrangement are further enhanced with the GELU activation function to obtain... ∈ Output the residual branch Output of the main branch Adding element by element, we get Applying a Dropout layer to randomly discard some neurons with probability p yields the following results: ∈ ; through convolutional layers Reduce the feature dimension from D' back to D to obtain local features. ∈ 。 5. The method for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module according to claim 1, characterized in that, The processing flow of the Global Feature Extraction Path (GCP) is as follows: Let the input features of the jujube growing environment be... Where B is the batch size, D is the number of input channels, and L is the sequence length; the input features Through convolution operations Expanding the feature dimensions yields ∈ Then, a nonlinear transformation is introduced using the GELU activation function to obtain... ∈ ;right Perform one-dimensional transpose convolution Initially expanding the perceptual field in the time dimension, and obtaining ∈ And the length of the output sequence is the same as that of the input; Features Through convolution After aligning the channels, with By summing the residuals, the original features and the extended receptive field features are reused to obtain... ∈ ; right Perform transposed convolution again Operations further expand the long-range dependent receptive field, resulting in ∈ ; By introducing a nonlinear transformation through the GELU activation function, we obtain ∈ ;right By point-by-point convolution After completing feature mapping and dimension preservation, we obtain ∈ ; Will and Adding them together achieves complementary features across multiple paths, resulting in... ∈ ; Features Through convolution After aligning the channels, with Residual fusion is performed again to enhance the preservation of original information, resulting in... ∈ 。 6. The method for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module according to claim 5, characterized in that, The Global Feature Extraction Path (GCP) introduces a channel attention module, which is specifically implemented by obtaining the global statistical features of each channel through Global Average Pooling (GAP). Channel attention weights are generated based on fully connected networks. ,in , For the reduction rate, The function compresses the weights to Interval; after expanding the dimension of the attention weight 'a' through the Unsqueeze operation, and then... Feature channels are recalibrated by element-wise multiplication along the channel dimension. ∈ ; right Applying a Dropout layer to randomly drop some neurons with probability p, followed by regularization, yields... ∈ ; through convolutional layers Reduce the feature dimension from D' back to D to obtain the global features. ∈ 。 7. A method for predicting temperature and humidity of greenhouse jujubes based on a dual-path multi-scale feature extraction module according to claim 4 or 6, characterized in that, The processing flow of the adaptive gating fusion module is as follows: Local features are processed along the channel dimension. ∈ With global features ∈ Perform a concatenation operation to obtain a composite feature tensor. ;right Perform a global average pooling (GAP) operation to extract the global statistics for each channel: s = GAP( Then through convolutional layers Dimensionality reduction, where r is the dimensionality reduction ratio, and after passing through the ReLU activation function, we obtain... ∈ Finally, through convolutional layers After dimensionality increase and passing through the Sigmoid function, the weights are compressed to the [0,1] interval, resulting in... ∈ , Each scalar in the output corresponds to one channel of the feature; Weight vector and Element-wise multiplication along the channel dimension, (1- )and Element-wise multiplication along the channel dimension, followed by addition, yields the initial fused feature. Introducing a feature refinement layer, through convolutional layers right Cross-channel integration and nonlinear enhancement were performed to obtain ∈ ;right Perform a transpose operation to transform the dimensions from [B,D,L] to [B,L,D], resulting in multi-scale fused features. ,in , This represents the feature vector at time step t after fusion.
8. A greenhouse jujube temperature and humidity prediction system based on a dual-path multi-scale feature extraction module, characterized in that, include: The data preprocessing module preprocesses the acquired jujube growth environment data to obtain structured training sample data. The dual-path multi-scale feature extraction module constructs the dual-path multi-scale feature extraction module DPMS-FEM. This module adopts a parallel dual-branch architecture, including a local feature extraction path LFEP and a global feature extraction path GCP. The local feature extraction path is used to capture the fine-grained fluctuation features of adjacent time steps in the environmental data, while the global feature extraction path is used to mine long-term dependency patterns across time steps. Then, the output features of the two paths are dynamically integrated through an adaptive gating fusion module to generate multi-scale fused features. The temperature and humidity prediction module inputs the above multi-scale fusion features into the improved iTransformer model. After model training, it outputs the temperature and humidity prediction results for greenhouse jujubes.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and running thereon, characterized in that, When the processor executes the program, it implements the method for predicting the temperature and humidity of greenhouse rock sugar dates based on a dual-path multi-scale feature extraction module as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for predicting the temperature and humidity of greenhouse rock sugar dates based on a dual-path multi-scale feature extraction module as described in any one of claims 1-8.