Method, device and storage medium for predicting root length density of greenhouse tomatoes

By using semi-supervised adversarial generation network and deep separable graph convolutional network to train the root length density prediction model, the problem of low prediction accuracy of tomato root length density in greenhouse is solved, and a fast, accurate and lossless prediction effect is achieved.

CN118799109BActive Publication Date: 2025-03-14SHIJIAZHUANG ACADEMY OF AGRI & FORESTRY SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411269112.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-03-14
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

In the prior art, the prediction accuracy of greenhouse tomato root length density is low, and the traditional measurement methods are cumbersome, time-consuming and lossless.

Method used

The root length density prediction model is trained using semi-supervised adversarial generation network and depth separable graph convolutional network. By obtaining the root length density factor data and inputting it into the pre-trained model, the root length density prediction value and attention weight are generated.

Benefits of technology

The prediction accuracy of the root length density of greenhouse tomatoes is improved, and a fast, accurate and lossless prediction method is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799109B_ABST
    Figure CN118799109B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and storage medium for predicting the root length density of greenhouse tomatoes, and relates to the technical field of data processing for prediction purposes. The method comprises: obtaining root length density influencing factor data; inputting the root length density influencing factor data into a pre-trained root length density prediction model, and obtaining a root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is obtained by training based on the root length density prediction value and the attention weight of each root length density influencing factor. The method, device and storage medium for predicting the root length density of greenhouse tomatoes provided by the present invention input the root length density influencing factor data into the pre-trained root length density prediction model, and the root length density prediction value can be obtained through a semi-supervised adversarial generative network and a deep separable graph convolutional network, thereby improving the prediction accuracy of the root length density of greenhouse tomatoes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing for prediction purposes, and in particular to a method, device and storage medium for predicting the root length density of greenhouse tomatoes. Background Art

[0002] Root length density (RLD) is an important parameter that describes the spatial distribution of roots in the soil. It reflects the efficiency of the roots in using soil resources and also affects the stress resistance and adaptability of crops. Therefore, accurately predicting the root length density of greenhouse tomatoes has important theoretical significance and practical value for optimizing the root zone environment, improving the efficiency of water and fertilizer use, and achieving water-saving and high-yield greenhouse tomatoes.

[0003] However, since the roots grow in the soil, it is not easy to observe and measure directly. The traditional root length density determination method usually requires tedious steps such as soil excavation, cleaning, and analysis, which is not only time-consuming and labor-intensive, but also destroys the structure of the root system and soil, affecting the normal growth of crops. Therefore, developing a fast, accurate, and non-destructive method for predicting greenhouse tomato root length density is an urgent need and challenge in current agricultural scientific research. Summary of the invention

[0004] The invention provides a method, a device and a storage medium for predicting the root length density of greenhouse tomatoes, which are used to solve the technical problem of low prediction accuracy of the root length density of greenhouse tomatoes in the prior art.

[0005] The invention provides a method for predicting root length density of greenhouse tomatoes, comprising the following steps.

[0006] Obtain data on factors affecting root length and density;

[0007] The root length density influencing factor data is input into a pre-trained root length density prediction model to obtain a root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is trained based on the root length density prediction value and the attention weights of each root length density influencing factor, and the root length density prediction value is determined based on implicit features, and the implicit features are determined based on a semi-supervised adversarial generative network and a deep separable graph convolutional network.

[0008] In some embodiments, the training step of the root length density prediction model includes:

[0009] Acquire an unlabeled data set and a labeled data set, wherein the unlabeled data set is determined based on the root length density influencing factor data, and the labeled data set is determined based on the root length density influencing factor data and the root length density value;

[0010] Based on the semi-supervised generative adversarial network, data enhancement is performed on the unlabeled data set and the labeled data set to generate synthetic data, wherein the semi-supervised generative adversarial network is obtained by training based on conditional variables, and the conditional variables are used to improve the diversity of the root length density influencing factor data;

[0011] Extracting implicit features from the synthetic data based on the deep separable graph convolutional network;

[0012] The implicit features are converted into root length density prediction values ​​based on a deep residual network, and the attention weight of each root length density influencing factor is determined based on a multi-head self-attention mechanism and the implicit features;

[0013] Based on the root length density prediction value and the attention weight of each root length density influencing factor, the model parameters of the root length density prediction model are updated through back propagation and adaptive moment estimation.

[0014] In some embodiments, obtaining an unlabeled dataset and a labeled dataset includes:

[0015] Acquire root length density influencing factor data and a root length density value corresponding to the root length density influencing factor data, wherein the root length density influencing factor data includes soil moisture content, greenhouse temperature, greenhouse light intensity and soil fertilizer content, and the root length density value is determined based on the root system scanning image data;

[0016] An unlabeled data set is determined based on the root length density influencing factor data, and a labeled data set is determined based on the root length density influencing factor data and the root length density value.

[0017] In some embodiments, the step of performing data enhancement on the unlabeled dataset and the labeled dataset based on the semi-supervised generative adversarial network to generate synthetic data includes:

[0018] Training the semi-supervised generative adversarial network based on the unlabeled dataset and the labeled dataset;

[0019] The unlabeled data set and conditional variables are synthesized based on the trained semi-supervised generative adversarial network to obtain synthetic data.

[0020] In some embodiments, the training of the semi-supervised generative adversarial network based on the unlabeled dataset and the labeled dataset includes:

[0021] The unlabeled data set and the conditional variables are synthesized based on the generator in the semi-supervised generative adversarial network to obtain synthetic data, and the labeled data set and the conditional variables are synthesized based on the discriminator in the semi-supervised generative adversarial network to obtain real data;

[0022] Based on the synthetic data, the real data and the binary cross entropy loss, a synthetic loss and a real loss are obtained, and the discriminator is optimized based on the synthetic loss and the real loss;

[0023] Based on the synthetic data and the binary cross entropy loss, an adversarial loss and a reconstruction loss are obtained, and the generator is optimized based on the adversarial loss and the reconstruction loss.

[0024] In some embodiments, extracting implicit features from the synthetic data based on the deep separable graph convolutional network includes:

[0025] Implicit features are extracted from the synthetic data based on deep convolution and point convolution in the deep separable graph convolutional network, wherein the deep convolution refers to performing a convolution operation on each node, and the point convolution refers to performing a convolution operation on each neighboring node.

[0026] In some embodiments, the method further comprises:

[0027] The model parameters of the root length density prediction model are optimized based on meta-learning.

[0028] In some embodiments, the optimizing the model parameters of the root length density prediction model based on meta-learning includes:

[0029] Use data from multiple different greenhouse scenarios as meta-learning data;

[0030] The model parameters of the root length density prediction model are optimized based on the meta-learning data.

[0031] The present invention also provides a device for predicting the root length density of greenhouse tomatoes, comprising the following modules:

[0032] The first acquisition module is used to obtain the data of factors affecting root length density;

[0033] The second acquisition module is used to input the root length density influencing factor data into a pre-trained root length density prediction model to obtain the root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is trained based on the root length density prediction value and the attention weights of each root length density influencing factor, and the root length density prediction value is determined based on implicit features, and the implicit features are determined based on a semi-supervised adversarial generative network and a deep separable graph convolutional network.

[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for predicting the root length density of greenhouse tomatoes as described above is implemented.

[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for predicting the root length density of greenhouse tomatoes as described in any one of the above is implemented.

[0036] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for predicting the root length density of greenhouse tomatoes.

[0037] The method, device and storage medium for predicting the root length density of greenhouse tomatoes provided by the present invention input the data of factors affecting root length density into a pre-trained root length density prediction model, and obtain the root length density prediction value through a semi-supervised generative adversarial network and a deep separable graph convolutional network, thereby improving the prediction accuracy of the root length density of greenhouse tomatoes. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 The present invention is a schematic flow chart of a method for predicting greenhouse tomato root length density.

[0040] Figure 2 The present invention is a schematic diagram of the structure of a device for predicting the root length density of greenhouse tomatoes provided by the present invention.

[0041] Figure 3 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] Figure 1 FIG. 1 is a flow chart of a method for predicting root length density of greenhouse tomatoes provided by the present invention. Figure 1 As shown, the method includes the following:

[0044] Step 101: Obtain root length density influencing factor data.

[0045] Step 102: input the root length density influencing factor data into a pre-trained root length density prediction model to obtain a root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is trained based on the root length density prediction value and the attention weights of each root length density influencing factor, and the root length density prediction value is determined based on implicit features, and the implicit features are determined based on a semi-supervised generative adversarial network and a deep separable graph convolutional network.

[0046] Specifically, a variety of instruments and methods can be used to collect data on factors affecting root length density of tomatoes in a greenhouse. The data on factors affecting root length density may include at least one of soil moisture content, greenhouse temperature, greenhouse light intensity, and soil fertilizer content.

[0047] The data of factors affecting root length density are input into a pre-trained root length density prediction model. The root length density prediction model performs data enhancement on the data of factors affecting root length density through a semi-supervised generative adversarial network, and then extracts features of the enhanced data of factors affecting root length density through a deep separable graph convolutional network to obtain implicit features. Finally, the predicted value of root length density is determined based on the implicit features.

[0048] Furthermore, the implicit features are input into the multi-head self-attention mechanism to obtain the attention weight of each influencing factor as the basis for prediction. Finally, the predicted value of root length density and the attention weight are output to provide decision support and feedback for agricultural managers, and the loss function of the model is calculated. The parameters of the model are updated through back propagation and adaptive moment estimation to achieve model training and optimization.

[0049] The method for predicting the root length density of greenhouse tomatoes provided by the present invention inputs the data of root length density influencing factors into a pre-trained root length density prediction model, and obtains the root length density prediction value through a semi-supervised adversarial generative network and a deep separable graph convolutional network, which can improve the prediction accuracy of the root length density of greenhouse tomatoes.

[0050] In some embodiments, the training step of the root length density prediction model includes:

[0051] Acquire an unlabeled data set and a labeled data set, wherein the unlabeled data set is determined based on the root length density influencing factor data, and the labeled data set is determined based on the root length density influencing factor data and the root length density value;

[0052] Based on the semi-supervised generative adversarial network, data enhancement is performed on the unlabeled data set and the labeled data set to generate synthetic data, wherein the semi-supervised generative adversarial network is obtained by training based on conditional variables, and the conditional variables are used to improve the diversity of the root length density influencing factor data;

[0053] Extracting implicit features from the synthetic data based on the deep separable graph convolutional network;

[0054] The implicit features are converted into root length density prediction values ​​based on a deep residual network, and the attention weight of each root length density influencing factor is determined based on a multi-head self-attention mechanism and the implicit features;

[0055] Based on the root length density prediction value and the attention weight of each root length density influencing factor, the model parameters of the root length density prediction model are updated through back propagation and adaptive moment estimation.

[0056] Specifically, in order to solve key problems such as insufficient data volume, weak model generalization ability, and low model interpretability, the present invention proposes a root length density prediction model based on a semi-supervised adversarial generative network, a deep separable graph convolutional network, and meta-learning.

[0057] First, the data required for root length density prediction model training is obtained, including root length density influencing factor data and root length density value. Then, the unlabeled data set is determined based on the root length density influencing factor data. In the unlabeled data set, each data only contains root length density influencing factor data, but not root length density value. The labeled data is determined based on the root length density influencing factor data and root length density value. In the labeled data, each data contains root length density influencing factor data and root length density value. The labeled data can also be called a small amount of labeled data.

[0058] Combining unlabeled data and labeled data, conditional variational autoencoders and attention mechanisms are used to generate high-quality synthetic data and extract topological features of the data. Implicit features are sampled from the distribution of latent variables, and then the implicit features are input into a deep residual network and converted into predicted values ​​of root length density. Bayesian optimization is used to optimize the output results. At the same time, the implicit features are input into a multi-head self-attention mechanism to obtain the attention weight of each influencing factor as the basis for prediction. Finally, the predicted value of root length density and the attention weight are output to provide decision support and feedback for agricultural managers, and the loss function of the model is calculated. The parameters of the model are updated through backpropagation and adaptive moment estimation to achieve model training and optimization.

[0059] The method for predicting the root length density of greenhouse tomatoes provided by the present invention combines the ideas of semi-supervised learning and generative adversarial networks to generate high-quality synthetic data, increase the quality and quantity of data, utilizes the structure of a deep separable graph convolutional network to extract the graph structure features of the data, and utilizes Bayesian optimization and multi-head self-attention mechanisms to optimize the output results and attention weights of the model, thereby improving the prediction accuracy of the model.

[0060] In some embodiments, obtaining an unlabeled dataset and a labeled dataset includes:

[0061] Acquire root length density influencing factor data and a root length density value corresponding to the root length density influencing factor data, wherein the root length density influencing factor data includes soil moisture content, greenhouse temperature, greenhouse light intensity and soil fertilizer content, and the root length density value is determined based on the root system scanning image data;

[0062] An unlabeled data set is determined based on the root length density influencing factor data, and a labeled data set is determined based on the root length density influencing factor data and the root length density value.

[0063] Specifically, a variety of instruments and methods, such as soil moisture sensors, temperature sensors, light sensors, fertilizer sensors, root scanners, etc., are used to collect data on the root length density of tomatoes in the greenhouse and its influencing factors. The data are then preprocessed by cleaning, normalizing, and dividing to obtain unlabeled data sets and a small amount of labeled data sets as input to the model.

[0064] The collected data include the following five variables. Soil moisture content (S): The unit is %, indicating the percentage of moisture in the soil, ranging from 0-100%. Greenhouse temperature (T): The unit is ℃, indicating the temperature of the air in the greenhouse, ranging from -55℃-125℃. Greenhouse light intensity (L): The unit is lux, indicating the light intensity of the air in the greenhouse, ranging from 0-65535lx. Soil fertilizer content (F): The unit is milligrams per liter, indicating the fertilizer content in the soil, ranging from 0-20mg / L. Tomato root length density (R): The unit is millimeters per cubic centimeter, indicating the distribution of tomato root length per unit volume, ranging from .

[0065] The following preprocessing operations are performed on the collected data to obtain unlabeled data sets and a small number of labeled data sets as inputs for the model. Data cleaning: Outlier detection and missing value filling are performed on the collected data to remove or correct data that does not conform to the actual situation. The specific methods are as follows: Outlier detection: The box plot method is used to detect outliers on the data of each variable - data that exceeds the upper and lower quartiles ±1.5 times the interquartile range are regarded as outliers and deleted. Missing value filling: The interpolation method is used to fill missing values ​​on the data of each variable - the missing data is replaced by the arithmetic mean of the two data before and after it. Data normalization: The collected data is normalized to eliminate the dimension and scale differences between different variables and improve the convergence speed and accuracy of the model. The specific methods are as follows: Normalization: The minimum-maximum normalization method is used to normalize the data of each variable. The minimum value of each variable is subtracted from each data, and then divided by the difference between the maximum and minimum values ​​of the variable, so that the normalized data is between 0-1. The normalization formula is as follows:

[0066]

[0067] in, is the original data, is the normalized data, is the minimum value of the variable, is the maximum value of the variable.

[0068] The collected data is divided into unlabeled data sets and a small number of labeled data sets as the input of the model. 80% of the collected data is randomly selected as the unlabeled data set for training the autoencoder to achieve data dimensionality reduction and feature extraction. In the unlabeled data set, each data contains only four influencing factor variables ( , , , ), excluding the target variable ( ). A small number of labeled data sets, randomly extract 20% of the data from the collected data as a small number of labeled data sets, used to train the support vector machine to achieve data classification and prediction. In the small number of labeled data sets, each data contains four influencing factor variables ( , , , ) and a target variable ( ), which is the root length density of tomatoes. The target variable of a small number of labeled data sets is obtained by image analysis and image processing of the image data of the root scanner. The specific method is as follows:

[0069]

[0070] in, is the between-class variance, and is the ratio of the two types of pixels, and is the average gray value of the two types of pixels.

[0071] Image measurement uses connected domain analysis and geometric measurement methods to measure the segmented image data to extract the connected domain, length, width, area and other features of the root system. Connected domain analysis uses the eight-neighborhood method to analyze the segmented image data, that is, to compare each foreground pixel in the image with the eight pixels around it. If they are the same, they are considered to be the same connected domain, otherwise they are considered to be different connected domains, so as to achieve the segmentation and marking of the root system.

[0072] The geometric measurement uses the Euclidean distance and pixel counting method to perform geometric measurement on each connected domain to extract the length, width, area and other characteristics of the root system. The length uses the farthest point pair method to measure the length of each connected domain, that is, the Euclidean distance between every two pixels in the connected domain is calculated, and the maximum distance is found as the length of the connected domain. The length measurement formula is as follows:

[0073]

[0074] in, is the length, and are any two pixels in the connected domain, and Pixel The horizontal and vertical coordinates of and Pixel The horizontal and vertical coordinates of .

[0075] The width is measured using the minimum circumscribed rectangle method for each connected domain, that is, all pixels in the connected domain are surrounded by a minimum rectangle whose sides are parallel to the coordinate axis, which is used as the width of the connected domain. The width measurement formula is as follows:

[0076]

[0077] in, is the width, is any pixel in the connected domain, Pixel The horizontal axis of .

[0078] The area is measured by pixel counting method, that is, the number of all pixels in the connected domain is added up to get the area of ​​the connected domain. The area measurement formula is as follows:

[0079]

[0080] in, is the area, is any pixel in the connected domain.

[0081] Image processing is performed on the root characteristics obtained by image analysis to obtain the root length density of tomatoes. The root length density is calculated using the root length density formula for each connected domain, that is, the length of the connected domain is divided by the area of ​​the connected domain to obtain the root length density of the connected domain. The root length density formula is as follows:

[0082]

[0083] in, is the root length density, is the length, For the area.

[0084] The root length density of tomatoes is calculated by weighted average method, which summarizes the root length density of all connected domains to obtain the root length density of tomatoes. That is, the root length density of each connected domain is multiplied by the area of ​​the connected domain, and then divided by the sum of the areas of all connected domains as the weight of the connected domain. Then, the weights of all connected domains are multiplied by the root length density, and then added to obtain the root length density of tomatoes. The formula for tomato root length density is as follows:

[0085]

[0086] in, is the tomato root density, For the The root length density of the connected domain, For the The area of ​​a connected domain, For the The area of ​​a connected domain, are the indices of all connected domains.

[0087] The method for predicting the root length density of greenhouse tomatoes provided by the present invention utilizes unlabeled data sets and labeled data sets to train a root length density prediction model, which can effectively process nonlinear and complex data, improve the expression ability and diversity of data, improve the fitting ability and adaptability of the model, and improve the prediction accuracy of the root length density of greenhouse tomatoes, thereby providing more accurate data support and guidance for agricultural managers.

[0088] In some embodiments, the step of performing data enhancement on the unlabeled dataset and the labeled dataset based on the semi-supervised generative adversarial network to generate synthetic data includes:

[0089] Training the semi-supervised generative adversarial network based on the unlabeled dataset and the labeled dataset;

[0090] The unlabeled data set and conditional variables are synthesized based on the trained semi-supervised generative adversarial network to obtain synthetic data.

[0091] Specifically, a semi-supervised generative adversarial network (SAGAN) is used for data enhancement. The network consists of a conditional variational autoencoder (CVAE) as a generator and a deep residual network (DRN) as a discriminator. The generator uses conditional information (such as soil moisture, temperature, etc.) to generate synthetic data that meets specific conditions, and the discriminator uses a small amount of labeled data to judge the authenticity of the data.

[0092] The generator uses a conditional variational autoencoder (CVAE) as a generator, and uses conditional information (such as soil moisture, temperature, etc.) to generate synthetic data that meets specific conditions. The conditional variational autoencoder (CVAE) is based on the generative model of the variational autoencoder (VAE). Its characteristic is that conditional variables are introduced in the encoder and decoder so that the generated data is affected by the conditional variables. The structure of the conditional variational autoencoder (CVAE) is as follows: The encoder uses a multi-layer perceptron (MLP) as an encoder to map the input data and conditional variables to an implicit space to obtain the mean and variance of the implicit variables. The structure of the encoder is as follows: The input layer concatenates the input data and conditional variables as the input of the encoder. The input data is the four influencing factor variables in the unlabeled dataset ( , , , ), with a dimension of 4, the input conditional variables are soil moisture and temperature, with a dimension of 2, and the concatenated input dimension is 6. The hidden layer uses two fully connected layers as hidden layers, and each fully connected layer is followed by a ReLU activation function to increase the nonlinearity of the model. The input dimension of the first fully connected layer is 6 and the output dimension is 32. The input dimension of the second fully connected layer is 32 and the output dimension is 16. The output layer uses two fully connected layers as the output layer, which outputs the mean and variance of the hidden variables respectively. The input dimension of the two fully connected layers is 16 and the output dimension is 8, indicating that the dimension of the hidden variable is 8. The output layer does not use an activation function.

[0093] The decoder uses a multi-layer perceptron (MLP) as a decoder to map the latent variables and conditional variables back to the original data space to obtain synthetic data. The structure of the decoder is as follows: the input layer concatenates the latent variables and conditional variables as the input of the decoder. The dimension of the latent variables is 8, the dimension of the conditional variables is 2, and the concatenated input dimension is 10. The hidden layer uses two fully connected layers as hidden layers, each of which is followed by a ReLU activation function to increase the nonlinearity of the model. The input dimension of the first fully connected layer is 10 and the output dimension is 16, and the input dimension of the second fully connected layer is 16 and the output dimension is 32. The output layer uses a fully connected layer as the output layer to output synthetic data. The input dimension of the output layer is 32 and the output dimension is 4, which means that the dimension of the synthetic data is 4, which is the same as the dimension of the original data. The output layer uses the Sigmoid activation function so that the output data is between 0 and 1, which matches the normalized data.

[0094] The loss function uses the variational lower bound (ELBO) as the loss function, which measures the reconstruction error between the input data and the synthetic data, as well as the divergence between the latent variables and the standard normal distribution. The formula of the loss function is as follows:

[0095]

[0096] in, For input data, is the conditional variable, is an implicit variable, is the output distribution of the encoder, is the output distribution of the decoder, is the standard normal distribution, The Kullback-Leibler divergence is used to measure the difference between two distributions. The reparameterization technique is used to transform the sampling process of the latent variables into a differentiable function, and the gradient descent optimization of the loss function is realized.

[0097] The discriminator uses a deep residual network (DRN) as a discriminator, using a small amount of labeled data to judge the authenticity of the data and improve the generation quality of the generator. The deep residual network (DRN) is based on the discriminant model of the convolutional neural network (CNN). Its characteristic is that a residual connection is added after each convolutional layer, so that the network skips layers, achieves a deeper network structure, and improves the expression ability of the model. The structure of the deep residual network (DRN) is as follows: The input layer concatenates the input data and conditional variables as the input of the discriminator. The input data is the four influencing factor variables in the unlabeled dataset ( , , , ), or synthetic data generated by the generator, with a dimension of 4, the input conditional variables are soil moisture and temperature, with a dimension of 2, and the concatenated input dimension is 6. The convolution layer uses four convolution layers as convolution layers, each of which is followed by a batch normalization layer (BN) and a LeakyReLU activation function to increase the stability and nonlinearity of the model. The input and output dimensions of each convolution layer are 6, the size of the convolution kernel is 3, the stride is 1, and the padding is 0, so that the output dimension after convolution remains unchanged. A residual connection is added after each convolution layer, that is, the input before convolution and the output after convolution are added as the final output of the layer. The formula for the residual connection is as follows:

[0098]

[0099] in, For the final output, For input, is the convolution operation.

[0100] The fully connected layer uses a fully connected layer as a fully connected layer to output the true or false probability of the data. The input dimension of the fully connected layer is 6, and the output dimension is 1, which represents the true or false probability of the data. The fully connected layer uses the Sigmoid activation function so that the output data is between 0 and 1, matching the true and false labels.

[0101] The loss function uses binary cross entropy (BCE) as the loss function, which measures the true and false probabilities of the data and the error between the true and false labels. The formula of the loss function is as follows:

[0102]

[0103] in, is the number of data, For the True or false labels of data, For the The probability of a piece of data being true or false. The stochastic gradient descent (SGD) optimization algorithm is used to perform gradient descent optimization on the loss function.

[0104] The training process of the semi-supervised adversarial generative network (SAGAN) is designed in detail as follows: The training data uses an unlabeled dataset and a small number of labeled datasets as training data, where the unlabeled dataset is used to train the generator and the small number of labeled datasets are used to train the discriminator. The unlabeled dataset and the small number of labeled datasets are divided into a training set and a validation set, respectively, where the training set accounts for 80% and the validation set accounts for 20%, which are used for model training and evaluation.

[0105] Training parameters Set the following training parameters to control the training process and effect. Batch size (batchsize) Set the batch size to 64, and use 64 data as a batch each time you train and update the model. Learning rate (learning rate) Set the learning rate to 0.0001, and use 0.0001 times the gradient as the update step size each time you update the model. Number of training rounds (epochs) Set the number of training rounds to 100, and perform 100 complete traversals and training on all training data. Adversarial coefficient Set the adversarial coefficient to 0.1, and add 0.1 times the discriminator's loss function to the generator's loss function to enhance the generator's adversarial performance.

[0106] The method for predicting the root length density of greenhouse tomatoes provided by the present invention utilizes unlabeled data and a small amount of labeled data, combined with the ideas of semi-supervised learning and adversarial generative networks, to generate high-quality synthetic data, increase the quantity and quality of data, and improve the generalization ability and prediction accuracy of the model.

[0107] In some embodiments, the training of the semi-supervised generative adversarial network based on the unlabeled dataset and the labeled dataset includes:

[0108] The unlabeled data set and the conditional variables are synthesized based on the generator in the semi-supervised generative adversarial network to obtain synthetic data, and the labeled data set and the conditional variables are synthesized based on the discriminator in the semi-supervised generative adversarial network to obtain real data;

[0109] Based on the synthetic data, the real data and the binary cross entropy loss, a synthetic loss and a real loss are obtained, and the discriminator is optimized based on the synthetic loss and the real loss;

[0110] Based on the synthetic data and the binary cross entropy loss, an adversarial loss and a reconstruction loss are obtained, and the generator is optimized based on the adversarial loss and the reconstruction loss.

[0111] Specifically, the training process is carried out according to the following steps to realize the function of the semi-supervised adversarial generation network (SAGAN).

[0112] Step 1: Randomly extract a batch of data from the training set of the unlabeled data set as the input of the generator, and randomly extract a batch of data from the training set of a small number of labeled data sets as the input of the discriminator. Set the true and false labels of the input data of the discriminator to 1, indicating real data, and set the true and false labels of the input data of the generator to 0, indicating false data. Step 2: Input the input data and conditional variables of the generator into the generator to obtain synthetic data, and set the true and false labels of the synthetic data to 0, indicating false data. Step 3: Input the input data and conditional variables of the discriminator into the discriminator to obtain the true and false probabilities of the real data, and calculate the binary cross entropy loss between the true and false probabilities of the real data and the true and false labels as the real loss of the discriminator. Step 4: Input the synthetic data and conditional variables generated by the generator into the discriminator to obtain the true and false probabilities of the synthetic data, and calculate the binary cross entropy loss between the true and false probabilities of the synthetic data and the true and false labels as the synthetic loss of the discriminator. Step 5: Add the real loss and synthetic loss of the discriminator as the total loss of the discriminator, and then perform gradient descent optimization on the parameters of the discriminator to update the model of the discriminator. Step 6: Input the input data and conditional variables of the generator into the generator to obtain synthetic data, and input the synthetic data and conditional variables into the discriminator to obtain the true and false probabilities of the synthetic data, and calculate the binary cross entropy loss between the true and false probabilities of the synthetic data and the true and false labels as the adversarial loss of the generator. Step 7: Input the input data and conditional variables of the generator into the generator to obtain synthetic data, and calculate the variational lower bound loss between the synthetic data and the input data as the reconstruction loss of the generator. Step 8: Multiply the adversarial loss of the generator by the adversarial coefficient, and then add it to the reconstruction loss of the generator as the total loss of the generator, and then perform gradient descent optimization on the parameters of the generator to update the model of the generator. Step 9: Repeat steps 1 to 8 until all training rounds are completed, or the preset stop conditions are reached, such as the convergence of the loss function, or the stability of the evaluation indicators of the validation set.

[0113] The method for predicting the root length density of greenhouse tomatoes provided by the present invention utilizes unlabeled data and a small amount of labeled data, combined with the ideas of semi-supervised learning and adversarial generative networks, to generate high-quality synthetic data, increase the quality and quantity of data, and improve the generalization ability and prediction accuracy of the model.

[0114] In some embodiments, extracting implicit features from the synthetic data based on the deep separable graph convolutional network includes:

[0115] Implicit features are extracted from the synthetic data based on deep convolution and point convolution in the deep separable graph convolutional network, wherein the deep convolution refers to performing a convolution operation on each node, and the point convolution refers to performing a convolution operation on each neighboring node.

[0116] Specifically, a deep separable graph convolutional network (DSGCN) is used to extract the topological features of the data. This network is based on the graph neural network of deep separable convolution (DSC), which decomposes the graph convolution operation into two steps: deep convolution and point convolution, reducing the number of parameters and calculations, and improving the training speed and efficiency of the model. At the same time, the attention mechanism (AM) is used to enhance the effect of graph convolution. According to the importance and correlation between nodes, different attention weights are dynamically assigned to highlight the characteristics of key nodes and suppress the interference of noise nodes. Finally, implicit features are sampled from the distribution of latent variables as the intermediate output of the model.

[0117] The structure and parameters of the deep separable graph convolutional network (DSGCN) are designed in detail as follows: The network input uses the unlabeled dataset obtained after data enhancement and a small amount of labeled dataset as the network input, where the unlabeled dataset contains four influencing factor variables ( , , , ), with a dimension of 4, and a small number of labeled data sets containing four influencing factor variables ( , , , ) and a target variable ( ), the dimension is 5. The unlabeled dataset and the small amount of labeled dataset are divided into training set and test set respectively, where the training set accounts for 80% and the test set accounts for 20%, which are used for model training and evaluation.

[0118] The network structure uses a three-layer deep separable graph convolutional network (DSGCN) as the network structure. Each layer consists of a deep separable convolution layer (DSC) and an attention mechanism layer (AM) to extract the topological features of the data. The structure of each layer is as follows: The deep separable convolution layer (DSC) uses deep separable convolution (DSC) as the graph convolution operation, which decomposes the graph convolution into two steps: deep convolution and point convolution, reducing the number of parameters and calculations, and improving the training speed and efficiency of the model. Deep convolution refers to the convolution operation on each node, and point convolution refers to the convolution operation on each neighboring node. The formula for deep separable convolution is as follows:

[0119]

[0120] in, For the The node feature matrix of the layer, For the The node feature matrix of the layer, is the adjacency matrix of the graph, is the degree matrix of the graph, For the The depthwise convolution weight matrix of the layer, For the The point convolution weight matrix of the layer, The ReLU activation function is used to increase the nonlinearity of the model. The input dimension and output dimension of each layer are set as follows: the input dimension of the first layer is 4, the output dimension is 8, the input dimension of the second layer is 8, the output dimension is 16, and the input dimension of the third layer is 16, and the output dimension is 32, indicating that the dimension of the implicit feature is 32.

[0121] The attention mechanism layer (AM) uses the attention mechanism (AM) as an enhancement of graph convolution. This mechanism dynamically assigns different attention weights according to the importance and relevance between nodes, highlights the features of key nodes, and suppresses the interference of noise nodes. The formula of the attention mechanism is as follows:

[0122]

[0123] in, For the Nodes and The attention score between nodes, For the Nodes and The attention score between nodes, is a multi-head attention mechanism, used to calculate the attention score, and For the Layer Nodes and The feature vector of each node, For the Nodes and The attention weights between nodes, For the The set of neighbor nodes of a node, For the Layer The feature vector of each node, The ReLU activation function is used to increase the nonlinearity of the model. The input dimension and output dimension of each layer are set as follows: the input dimension of the first layer is 8, the output dimension is 8, the input dimension of the second layer is 16, the output dimension is 16, the input dimension of the third layer is 32, and the output dimension is 32, indicating that the dimension of the implicit feature is 32.

[0124] The network output samples implicit features from the distribution of latent variables as the output of the network. Gaussian distribution is used as the distribution of latent variables, and its mean and variance are calculated by the feature matrix of the last layer of the network. Using the reparameterization technique, the sampling process of implicit features is transformed into a differentiable function to achieve gradient descent optimization of the network. The sampling formula of implicit features is as follows:

[0125]

[0126] in, is the mean of the latent variable, is the variance of the latent variable, is the feature matrix of the last layer of the network, is the random noise of standard normal distribution, is the Hadamard product, that is, the corresponding elements are multiplied, is a hidden feature with a dimension of 32, representing the output of the network. The hidden feature is used as the intermediate output of the model for subsequent prediction and optimization.

[0127] Furthermore, a deep residual network (DRN) can be used to convert implicit features into predicted values ​​of root length density. This network is based on a deep neural network with residual connections (RC). Skip connections (SC) are used to avoid the problems of gradient vanishing (GV) and overfitting (OF), thereby improving the learning and generalization capabilities of the model. At the same time, Bayesian optimization (BO) is used to optimize the output results, and the Gaussian process (GP) is used to establish the posterior distribution of the objective function, find the optimal output parameters, and improve the prediction accuracy and stability of the model.

[0128] The structure and parameters of the deep residual network (DRN) are designed in detail as follows: The network input uses the implicit features obtained after feature extraction as the input of the network, with a dimension of 32, representing the topological features of each data. The network structure uses a four-layer deep residual network (DRN) as the network structure. Each layer consists of a fully connected layer and a residual connection, which is used to convert implicit features into predicted values. The structure of each layer is as follows: The fully connected layer uses the fully connected layer as the basic unit of the network. This layer maps the input feature vector to a new feature space to increase the expression ability of the model. The formula of the fully connected layer is as follows:

[0129]

[0130] in, is the output feature vector, is the weight matrix, is the input feature vector, The input dimension and output dimension of each layer are set as follows: the input dimension of the first layer is 32, the output dimension is 16, the input dimension of the second layer is 16, the output dimension is 8, the input dimension of the third layer is 8, the output dimension is 4, the input dimension of the fourth layer is 4, the output dimension is 1, and the dimension of the predicted value is 1.

[0131] Residual connection uses residual connection as the enhancement unit of the network. This unit avoids the problems of gradient vanishing (GV) and overfitting (OF) through skip connection (SC), and improves the learning ability and generalization ability of the model. The formula of residual connection is as follows:

[0132]

[0133] in, For the final output, For input, is the output of the fully connected layer. The network output uses the output of the last layer of the network as the predicted value of the root length density, with a dimension of 1, indicating the predicted value of the root length density of each data.

[0134] The process and parameters of Bayesian optimization (BO) are designed in detail as follows: The optimization objective takes the predicted value of the network output as the optimization objective, that is, it is required to find a set of optimal output parameters to minimize the error between the predicted value and the true value, thereby improving the prediction accuracy and stability of the model. The formula for the optimization objective is as follows:

[0135]

[0136] in, is the output parameter, is the error function between the predicted value and the true value, and the mean square error (MSE) is used as the error function, and its formula is as follows:

[0137]

[0138] in, is the number of data, For the The true value of the data, For the The predicted value of the data.

[0139] The optimization process uses Gaussian process (GP) as the optimization process, which establishes the posterior distribution of the objective function through observation data and finds the optimal output parameters. The formula of Gaussian process is as follows:

[0140]

[0141] in, is the objective function, is the mean function, is the covariance function, and the zero mean function and radial basis function (RBF) are used as the mean function and covariance function.

[0142] Follow the steps below to perform optimization to implement the Bayesian optimization (BO) function. Step 1: Randomly extract a batch of data from the test set of a small number of labeled data sets as the initial observation data, and calculate the true value and predicted value of these data as the initial observation values. Step 2: Based on the initial observation data and observation values, use the Gaussian process (GP) to establish the posterior distribution of the objective function, that is, calculate the mean and variance of the objective function as the parameters of the posterior distribution. Step 3: Based on the posterior distribution, use the expected improvement (EI) as the sampling criterion, that is, select the output parameters that give the objective function the maximum expected improvement. , as the next observation point. The formula for expected improvement is as follows:

[0143]

[0144] in, is the objective function, is the best value observed so far, is the expected value. The Monte Carlo method (MC) is used to approximate the expected improvement, that is, to sample multiple objective function values ​​from the posterior distribution, and then calculate the average value as the approximate value of the expected improvement. Step 4: According to the next observation point, calculate the corresponding true value and predicted value as the next observation, and then add it to the observed data and observed value to update the posterior distribution. Step 5: Repeat steps 2 to 4 until all output parameter searches are completed, or the preset stop conditions are reached, such as the upper limit of the number of sampling times, or the lower limit of the expected improvement, to find the optimal output parameters as the final predicted value. Set the upper limit of the number of sampling times to 100 and the lower limit of the expected improvement to 0.01 as hyperparameters.

[0145] Furthermore, the multi-head self-attention mechanism (MAAM) can be used to analyze the attention weights of implicit features. This mechanism is based on the multi-head attention (MA) method of self-attention (SA). It captures different feature subspaces (FSS) through multiple parallel self-attention layers (SAL), and then fuses different attention outputs (AO) through concatenation (CC) and linear transformation (LT) to obtain the attention weights of each influencing factor as the basis for prediction, thereby improving the interpretability and credibility of the model. The structure and parameters of the multi-head self-attention mechanism (MAAM) are designed in detail as follows: The mechanism input uses the implicit features obtained after the prediction conversion as the input of the mechanism, with a dimension of 32, representing the topological features of each data. The mechanism structure adopts a multi-head self-attention mechanism (MAAM) as the structure of the mechanism, which consists of a multi-head self-attention layer (MAL) and an output layer (OL) to analyze the attention weights of implicit features. The structure of the mechanism is as follows: Multi-head self-attention layer (MAL) uses multi-head self-attention (MA) as the core unit of the mechanism, which captures different feature subspaces (FSS) through multiple parallel self-attention layers (SAL), and then fuses different attention outputs (AO) through concatenation (CC) and linear transformation (LT) to obtain the attention weight of each influencing factor. The formula of multi-head self-attention is as follows:

[0146]

[0147] in, are the input and output feature matrices, For the The output of the self-attention layer (SAL), For the concatenation (CC) operation, is the linear transformation (LT) operation, is the number of self-attention layers (SAL), that is, the number of heads (headnumber). Setting the number of heads to 4 means using 4 self-attention layers (SAL) to capture different feature subspaces (FSS). The structure of each self-attention layer (SAL) is as follows: The self-attention layer (SAL) uses self-attention (SA) as the basic unit of the self-attention layer (SAL). The unit calculates the similarity between each feature vector to obtain the attention weight of each feature vector, and then obtains the attention output (AO) of each feature vector through weighted averaging. The formula for self-attention is as follows:

[0148]

[0149] in, For the The eigenvector and The similarity between feature vectors is For the The eigenvector and The similarity between feature vectors is and For the The eigenvector and feature vectors, is the dimension of the feature vector, For the The feature vector The attention weights of the feature vectors, is the number of eigenvectors, For the The input dimension and output dimension of each self-attention layer (SAL) are set as follows: the input dimension is 32 and the output dimension is 8.

[0150] The output layer (OL) uses a fully connected layer as the output layer (OL) to output the attention weight of each influencing factor as the basis for prediction, improving the interpretability and credibility of the model. The formula of the output layer is as follows:

[0151]

[0152] in, is the output attention weight matrix, is the input feature matrix, is the weight vector, is the bias vector. The input dimension and output dimension of the output layer are set as follows: the input dimension is 32, the output dimension is 4, and the dimension of the attention weight of each influencing factor is 1.

[0153] The output of the mechanism output layer is used as the attention weight of each influencing factor, with a dimension of 4, representing the four influencing factors of each data ( , , , ). The attention weight is used as the final output of the model to explain the basis of the prediction and improve the interpretability and credibility of the model.

[0154] Finally, the predicted value of root length density and attention weight are output to provide decision support and feedback for agricultural managers. At the same time, the loss function (LF) of the model is calculated, and the parameters of the model are updated through back propagation (BP) and adaptive moment estimation (AM) to achieve model training and optimization.

[0155] The process and parameters of result output and feedback are designed in detail, as follows: The result output outputs the predicted value and attention weight of root length density to provide decision support and feedback for agricultural managers. Visualization and text are used to display the result output to improve the readability and comprehensibility of the result. The result output is as follows: Visualization uses line charts and bar charts to visualize the predicted value and attention weight of root length density. Text is used to explain the predicted value and attention weight of root length density, as well as to provide decision support and feedback. The content of the text is as follows: The predicted value gives the predicted value of the root length density of each data, as well as the error with the true value, which is used to evaluate the prediction effect of the model. The format of the text is "data index: predicted value (true value) ± error", for example, "1: 0.56 (0.54) ± 0.02", which means that the predicted value of the first data is 0.56, the true value is 0.54, and the error is 0.02. The attention weight gives the attention weight of each influencing factor of each data, as well as the correlation with the predicted value, which is used to explain the prediction basis of the model. The format of the text is "data index: influencing factors: attention weight (correlation)", for example, "1: soil moisture: 0.25 (positive correlation)", which means that the attention weight of the soil moisture of the first data is 0.25, which is positively correlated with the predicted value, that is, the higher the soil moisture, the higher the root length density. Decision support: According to the predicted value and attention weight of each data, the corresponding decision support is given to guide agricultural managers to regulate the greenhouse. The format of the text is "data index: decision support", for example, "1: increase soil moisture, reduce greenhouse temperature, increase greenhouse light intensity, and reduce soil fertilizer content", which means that the decision support for the first data is to increase soil moisture, reduce greenhouse temperature, increase greenhouse light intensity, and reduce soil fertilizer content to increase root length density. According to the true value and predicted value of each data, the corresponding feedback is given to evaluate the effect of decision support. The format of the text is "data index: feedback", for example, "1: root length density increased by 0.02, decision support is effective", which means that the feedback of the first data is that the root length density increased by 0.02, and the decision support is effective, indicating that the decision support regulation scheme is correct.

[0156] Model training and optimization The process and parameters of model training and optimization are designed in detail as follows: Training data uses a small number of labeled data sets as training data, each of which contains four influencing factor variables ( , , , ) and a target variable ( ) dimension is 5 to represent the input and output of each data. Training parameters Set the following training parameters to control the training process and effect. Batch size Set the batch size to 64, and use 64 data as a batch each time you train and update the model. Learning rate Set the learning rate to 0.0001, and use 0.0001 times the gradient as the update step size each time you update the model. Training rounds Set the number of training rounds to 100, and perform 100 complete traversals and training on all training data.

[0157] The training process is carried out according to the following steps to achieve model training and optimization.

[0158] Step 1: Randomly extract a batch of data from the training set of a small number of labeled data sets as the input and output of the model, and calculate the true value and predicted value of these data as the evaluation indicators of the model. Step 2: Input the input data and conditional variables of the model into the deep separable graph convolutional network (DSGCN) to obtain the latent features as the intermediate output of the model. Step 3: Input the latent features into the deep residual network (DRN) to obtain the predicted value of the root length density as the output of the model. Step 4: Input the latent features into the multi-head self-attention mechanism (MAAM) to obtain the attention weight of each influencing factor as the output of the model. Step 5: Calculate the mean square error (MSE) between the output of the model and the true value as the loss function (LF) of the model to measure the prediction effect of the model. The formula of the loss function is as follows:

[0159]

[0160] in, is the number of data, For the The true value of the data, For the The predicted value of the data. Step 6: Use the back propagation (BP) algorithm to calculate the gradient of the loss function and obtain the gradient of the model parameters, which is used to update the model parameters. The formula for back propagation is as follows:

[0161]

[0162] in, are the parameters of the model, is the output of the model, is the loss function, is the gradient of the model parameters, is the gradient of the model’s output, is the partial derivative of the model's parameters to the model's output. Step 7: Use the adaptive moment estimation (AM) algorithm to perform gradient descent optimization on the model's parameters, update the model's parameters, and improve the model's prediction effect. The formula for adaptive moment estimation is as follows:

[0163]

[0164] in, For the The parameters of the model at iterations, For the The parameters of the model at iterations, is the learning rate, For the The exponential moving average of the second-order moment of the gradient at iterations, For the The exponential moving average of the first moment of the gradient at iterations, A small positive number is used to prevent division by zero errors. Step 8: Repeat steps 1 to 7 until all training rounds are completed, or the preset stopping conditions are reached, such as the convergence of the loss function or the stability of the evaluation indicators of the test set, to complete the training and optimization of the model.

[0165] The method for predicting the root length density of greenhouse tomatoes provided by the present invention improves the prediction accuracy and interpretability of the model by extracting the graph structure features of the data using the structure of a deep separable graph convolutional network. The deep separable graph convolutional network decomposes the convolution operation of the graph convolutional network into a network of deep convolution and spatial convolution, reducing the number of parameters and the complexity of calculation, while also increasing the depth and expression ability of the network. The data topology feature extraction based on the deep separable graph convolutional network uses the graph structure features of the data to predict the root length density, and also uses the output of the spatial convolution to represent the importance of each node, thereby improving the interpretability of the model, being able to effectively capture the topological relationship and local features of the data, and improving the expression ability and diversity of the data.

[0166] In some embodiments, the method further comprises:

[0167] The model parameters of the root length density prediction model are optimized based on meta-learning.

[0168] Specifically, meta-learning is a technique for learning how to learn, which allows the training and optimization of models. It allows models to quickly adapt to new tasks based on a small amount of training data, improves the flexibility and generalization ability of models, and solves the problems of data scarcity and diversity. It has a wide range of applications in reinforcement learning, transfer learning, and few-sample learning.

[0169] Meta-learning (ML) methods can be used to optimize the parameters and structure of the model. The learning-based learning (LTL) method uses data from multiple different greenhouse scenarios to learn a general model through fast adaptation (FA). In new greenhouse scenarios, a small amount of data and iterations can be used to achieve rapid generalization and transfer, thereby improving the prediction accuracy and stability of the model. The gradient-based meta-learning algorithm (GBML) - model-independent meta-learning (MAML) is used to use gradient descent (GD) to learn an initial model parameter suitable for a variety of tasks. In the new task, this parameter can be quickly optimized and adapted through a small amount of gradient updates (GU).

[0170] The method for predicting the root length density of greenhouse tomatoes provided by the present invention optimizes the parameters and structure of the model through a meta-learning method, can achieve rapid generalization and transfer, and improve the prediction accuracy and stability of the model.

[0171] In some embodiments, the optimizing the model parameters of the root length density prediction model based on meta-learning includes:

[0172] Use data from multiple different greenhouse scenarios as meta-learning data;

[0173] The model parameters of the root length density prediction model are optimized based on the meta-learning data.

[0174] Specifically, the meta-learning data uses data from multiple different greenhouse scenes as meta-learning data, where each greenhouse scene is regarded as a task, and each task contains four influencing factor variables ( , , , ) and a target variable ( ), with a dimension of 5, representing the input and output of each data. The data of each task is divided into a training set and a test set, where the training set accounts for 80% and the test set accounts for 20%, which are used for model training and evaluation. Assume that there are K tasks, represented as , the training set and test set of each task are represented as and ,in .

[0175] Meta-learning parameters Set the following meta-learning parameters to control the process and effect of meta-learning. Batch size Set the batch size to 64, and use 64 data as a batch each time you train and update the model. Learning rate Set the learning rate to 0.0001, and use 0.0001 times the gradient as the update step size each time you update the model. Number of training epochs: Set the number of training epochs to 100, and perform 100 complete traversals and training on all training data. Number of update steps Set the number of update steps to 5, and perform 5 gradient updates on the training set of each task to obtain the final model parameters.

[0176] The meta-learning process performs meta-learning in the following steps to optimize the parameters and structure of the model. Step 1: Initialize the parameters of the model , as the initial model parameters, used to adapt to different tasks. Step 2: Randomly extract a batch of tasks from the K tasks as the input of meta-learning, and randomly extract a batch of data from the training set and test set of each task as the input and output of the model. Step 3: Perform 5 gradient updates on the training set of each task to obtain the final model parameters of each task , as the output of the model. The formula for gradient update is as follows:

[0177]

[0178] in, are the initial model parameters, For the The final model parameters for each task, is the learning rate, is the gradient operator, As the loss function, the mean square error (MSE) is used as the loss function, and its formula is as follows:

[0179]

[0180] in, For the data set, is the number of data, For the The true value of the data, For the The predicted value of data is given by the model parameters Step 4: Calculate the loss function of the model for the test set of each task to obtain the loss value of each task, and then average the loss values ​​of all tasks to obtain the meta-learning loss value as the evaluation indicator of meta-learning. The formula for the meta-learning loss value is as follows:

[0181]

[0182] in, is the loss value of meta-learning, is the number of tasks, is the loss function, For the The test set of tasks, For the The final model parameters of each task. Step 5: Perform gradient calculation on the meta-learning loss value to obtain the initial model parameters The gradient of is used to update the initial model parameters. The formula for gradient calculation is as follows:

[0183]

[0184] in, is the gradient operator, is the loss value of meta-learning, is the number of tasks, is the loss function, For the The test set of tasks, For the The final model parameters of each task. Step 6: Initial model parameters Perform gradient descent optimization, update the initial model parameters, and improve the adaptability of the model. The formula for gradient descent optimization is as follows:

[0185]

[0186] in, are the initial model parameters, is the learning rate, is the gradient operator, is the loss value of meta-learning. Step 7: Repeat steps 2 to 6 until all training rounds are completed, or the preset stop condition is reached, such as the convergence of the loss function, or the stability of the evaluation index of the test set, to complete the training and optimization of the model. Set the convergence threshold of the loss function to 0.01, and the evaluation index of the test set to the root mean square error (RMSE):

[0187]

[0188] in, is the number of data, For the The true value of the data, For the The predicted value of the data. The stable threshold of the evaluation index of the test set is set to 0.001 as a hyperparameter.

[0189] The method for predicting the root length density of greenhouse tomatoes provided by the present invention optimizes the parameters and structure of the model through a meta-learning method, can achieve rapid generalization and transfer, and improve the prediction accuracy and stability of the model.

[0190] The above method is further illustrated below with reference to a specific example.

[0191] In order to simulate the root length density of tomatoes in a greenhouse, the following types of data need to be obtained. Greenhouse environmental data include indicators such as temperature, humidity, light, carbon dioxide concentration, soil moisture, etc., which reflect the climate conditions in the greenhouse and affect the growth and development of tomatoes. A greenhouse environmental monitoring system is selected to collect this data and upload the data to a cloud database in real time through a wireless sensor network or an Internet of Things platform.

[0192] Tomato root data include root length, root diameter, root fork number, root surface area and other indicators, which reflect the root structure of tomatoes and affect the water and nutrient absorption of tomatoes. Select a root scanner to collect data, and convert the data into digital format through image processing software. The unit symbol, value range, and collection frequency are shown in Table 1:

[0193] Table 1. Root Scanner Collection Standards

[0194]

[0195] Tomato growth data include stem length, stem thickness, number of leaves, leaf area, number of flowers, number of fruits, fruit weight and other indicators. These indicators reflect the growth status of tomatoes and affect the yield and quality of tomatoes. A plant growth analyzer is selected to collect these data, and the data is converted into digital format through image analysis software. The unit symbols, value ranges and collection frequencies of these indicators are shown in Table 2:

[0196] Table 2. Plant growth analyzer collection standards

[0197]

[0198] In addition to collecting data by ourselves, we also obtained relevant data from the following public access methods / channels to increase the diversity and richness of the data. Literature: Retrieve scientific literature on greenhouse tomato roots from academic search engines, and extract data and information from them—experimental design, experimental results, experimental parameters, etc. as reference and supplement. Dataset: Download the dataset on greenhouse tomato roots from the data sharing platform, and obtain data and characteristic root length density, root morphology, root function, etc. as training and testing data. Expert consultation: Contact experts and scholars on greenhouse tomato roots from professional social networks, and consult data and knowledge—physiological and biochemical processes of the root system, environmental response of the root system, genetic variation of the root system, etc. as guidance and support.

[0199] For the acquired data, the following steps of data processing are required before it can be used in the model: Data cleaning: Perform quality checks on the data to remove invalid, missing, abnormal, duplicate, and inconsistent data to ensure the integrity, accuracy, consistency, and reliability of the data. Use the pandas library to clean the data, and use dropna(), fillna(), drop_duplicates(), replace() and other functions to handle missing values, duplicate values, abnormal values, inconsistent values, etc. Data integration: Integrate data from different sources, formats, and dimensions into a unified data set to facilitate subsequent analysis and modeling. Use the pandas library to integrate the data, use concat(), merge(), join() and other functions to merge different data tables, use pivot(), melt(), stack(), unstack() and other functions to transform the shape of the data, and use to_csv(), to_excel(), to_sql() and other functions to export data to different formats and storage media. Data transformation: Transform, standardize, normalize, discretize, encode, reduce dimensionality, etc. the data to meet the input requirements of the model and improve the performance and efficiency of the model. Use sklearn library to transform data, use StandardScaler(), MinMaxScaler(), Binarizer(), OneHotEncoder(), LabelEncoder(), PCA(), TSNE() and other functions to perform standardization, normalization, discretization, encoding, dimensionality reduction and other operations. Data partitioning: Divide the data into training set, validation set and test set to facilitate model training, validation, and testing, using sklearn library.

[0200] For the three core model components, the model is constructed in the following steps.

[0201] Semi-supervised Generative Adversarial Networks Build a semi-supervised generative adversarial network (SGAN) to use unlabeled data and a small amount of labeled data to generate high-quality synthetic data, increase data diversity and richness, and improve the generalization ability of the model. Use the PyTorch library to build SGAN, use the torch.nn module to define the network structure of the generator and discriminator, use the torch.optim module to define the optimizer, use the torch.utils.data module to define the data loader, use the torch.autograd module to implement automatic differentiation, use the torch.distributions module to define the distribution of the latent variables of the conditional variational autoencoder (CVAE), and use the torch.nn.functional module to define the loss function and activation function. The core parameter configuration of SGAN is shown in Table 3:

[0202] Table 3. SGAN core parameter configuration

[0203]

[0204] Deep Separable Graph Convolutional Network Build a Deep Separable Graph Convolutional Network (DSGCN) to extract the topological features of the data using graph structure data, enhance the expressiveness of the data, and improve the efficiency and effect of the model. Use the PyTorchGeometric library to build DSGCN, use the torch_geometric.nn module to define the Deep Separable Graph Convolution Layer, use the torch_geometric.data module to define the graph dataset, use the torch_geometric.utils module to define the graph adjacency matrix, and use the torch_geometric.transforms module to define the graph data augmentation. The core parameter configuration of DSGCN is shown in Table 4:

[0205] Table 4. Core parameter configuration of DSGCN

[0206]

[0207] Meta-learning builds a meta-learning framework, using multiple different tasks to learn a general model to improve the model's adaptability and generalization capabilities. Use the learn2learn library to build a meta-learning framework, use the learn2learn.algorithms module to define the meta-learning algorithm, model-independent meta-learning (MAML) uses the learn2learn.data module to define the meta-learning dataset and the Few-ShotClassification Dataset, and use the learn2learn.optim module to define the meta-learning optimizer, stochastic gradient descent (SGD), etc. The core parameter configuration of meta-learning is shown in Table 5:

[0208] Table 5. Core parameter configuration of meta-learning

[0209]

[0210] The method for predicting the root length density of greenhouse tomatoes provided by the present invention combines unlabeled data and a small amount of labeled data, uses conditional variational autoencoders and attention mechanisms to generate high-quality synthetic data and extract topological features of data, samples implicit features from the distribution of potential variables, inputs the implicit features into a deep residual network, converts them into predicted values ​​of root length density, and optimizes the output results using Bayesian optimization. At the same time, the implicit features are input into a multi-head self-attention mechanism to obtain the attention weight of each influencing factor as a basis for prediction, and finally outputs the predicted value and attention weight of root length density to provide decision support and feedback for agricultural managers, and calculates the loss function of the model, and updates the parameters of the model through back propagation and adaptive moment estimation to achieve model training and optimization. The hybrid model can effectively utilize unlabeled data and a small amount of labeled data, improve the quantity and quality of data, improve the generalization ability and prediction accuracy of the model, and also improve the interpretability and adaptability of the model, providing an efficient, accurate and lossless method for predicting the root length density of greenhouse tomatoes.

[0211] Figure 2 FIG. 1 is a schematic diagram of the structure of the device for predicting the root length density of greenhouse tomatoes provided by the present invention. Figure 2 As shown, the prediction device for greenhouse tomato root length density provided by the present invention includes a first acquisition module 201 and a second acquisition module 202, wherein:

[0212] The first acquisition module 201 is used to acquire root length density influencing factor data;

[0213] The second acquisition module 202 is used to input the root length density influencing factor data into a pre-trained root length density prediction model to obtain the root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is obtained based on the root length density prediction value and the attention weight training of each root length density influencing factor, and the root length density prediction value is determined based on implicit features, and the implicit features are determined based on a semi-supervised adversarial generative network and a deep separable graph convolutional network.

[0214] Specifically, the reasoning device for the above-mentioned text answer provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned text answer reasoning method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those of the method embodiment will not be described in detail here.

[0215] Figure 3 is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communications interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the method for predicting the root length density of greenhouse tomatoes, and the method includes:

[0216] Obtain data on factors affecting root length and density;

[0217] The root length density influencing factor data is input into a pre-trained root length density prediction model to obtain a root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is trained based on the root length density prediction value and the attention weights of each root length density influencing factor, and the root length density prediction value is determined based on implicit features, and the implicit features are determined based on a semi-supervised adversarial generative network and a deep separable graph convolutional network.

[0218] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0219] Specifically, the above-mentioned electronic device provided in the embodiment of the present application can implement all the method steps implemented by the method embodiment in which the execution subject is the electronic device, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0220] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the greenhouse tomato root length density prediction method provided by the above methods. On the other hand, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, when the computer program is executed by a processor, the greenhouse tomato root length density prediction method provided by the above methods is implemented.

[0221] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0222] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0223] It should also be noted that the terms "first", "second", etc. in the embodiments of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first" and "second" are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.

[0224] In the embodiments of the present application, the term "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0225] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.

[0226] In this application, "determine B based on A" means that the factor A should be considered when determining B. It is not limited to "B can be determined based on A alone", but should also include: "determine B based on A and C", "determine B based on A, C and E", "determine C based on A, and further determine B based on C", etc. In addition, it can also include taking A as a condition for determining B, for example, "when A meets the first condition, use the first method to determine B"; for example, "when A meets the second condition, determine B", etc.; for example, "when A meets the third condition, determine B based on the first parameter", etc. Of course, it can also be a condition that takes A as a factor for determining B, for example, "when A meets the first condition, use the first method to determine C, and further determine B based on C", etc.

[0227] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting root length density of greenhouse tomatoes, characterized in that: include: Obtain data on factors affecting root length and density; Inputting the root length density influencing factor data into a pre-trained root length density prediction model, obtaining a root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is trained based on the root length density prediction value and the attention weight of each root length density influencing factor, and the root length density prediction value is determined based on implicit features, and the implicit features are determined based on a semi-supervised adversarial generative network and a deep separable graph convolutional network; The training steps of the root length density prediction model include: Acquire an unlabeled data set and a labeled data set, wherein the unlabeled data set is determined based on the root length density influencing factor data, and the labeled data set is determined based on the root length density influencing factor data and the root length density value; Performing data enhancement on the unlabeled dataset and the labeled dataset based on the semi-supervised generative adversarial network to generate synthetic data; Extracting implicit features from the synthetic data based on the deep separable graph convolutional network; The implicit features are converted into root length density prediction values ​​based on a deep residual network, and the attention weight of each root length density influencing factor is determined based on a multi-head self-attention mechanism and the implicit features; Based on the root length density prediction value and the attention weight of each root length density influencing factor, updating the model parameters of the root length density prediction model through back propagation and adaptive moment estimation; The step of performing data enhancement on the unlabeled dataset and the labeled dataset based on the semi-supervised generative adversarial network to generate synthetic data includes: Training the semi-supervised generative adversarial network based on the unlabeled dataset and the labeled dataset; The unlabeled data set and conditional variables are synthesized based on the trained semi-supervised generative adversarial network to obtain synthetic data; the conditional variables are used to improve the diversity of the root length density influencing factor data; The training of the semi-supervised generative adversarial network based on the unlabeled data set and the labeled data set includes: The unlabeled data set and the conditional variables are synthesized based on the generator in the semi-supervised generative adversarial network to obtain synthetic data, and the labeled data set and the conditional variables are synthesized based on the discriminator in the semi-supervised generative adversarial network to obtain real data; Based on the synthetic data, the real data and the binary cross entropy loss, a synthetic loss and a real loss are obtained, and the discriminator is optimized based on the synthetic loss and the real loss; Based on the synthetic data and the binary cross entropy loss, an adversarial loss and a reconstruction loss are obtained, and the generator is optimized based on the adversarial loss and the reconstruction loss.

2. The method for predicting root length density of greenhouse tomatoes according to claim 1, characterized in that: The obtaining of the unlabeled data set and the labeled data set includes: Acquire root length density influencing factor data and a root length density value corresponding to the root length density influencing factor data, wherein the root length density influencing factor data includes soil moisture content, greenhouse temperature, greenhouse light intensity and soil fertilizer content, and the root length density value is determined based on the root system scanning image data; An unlabeled data set is determined based on the root length density influencing factor data, and a labeled data set is determined based on the root length density influencing factor data and the root length density value.

3. The method for predicting root length density of greenhouse tomatoes according to claim 1, characterized in that: The extracting implicit features from the synthetic data based on the deep separable graph convolutional network includes: Implicit features are extracted from the synthetic data based on deep convolution and point convolution in the deep separable graph convolutional network, wherein the deep convolution refers to performing a convolution operation on each node, and the point convolution refers to performing a convolution operation on each neighboring node.

4. The method for predicting root length density of greenhouse tomatoes according to claim 2, characterized in that: The method further comprises: The model parameters of the root length density prediction model are optimized based on meta-learning.

5. The method for predicting root length density of greenhouse tomatoes according to claim 4, characterized in that: The model parameters of the root length density prediction model are optimized based on meta-learning, including: Use data from multiple different greenhouse scenarios as meta-learning data; The model parameters of the root length density prediction model are optimized based on the meta-learning data.

6. A device for predicting the root length density of greenhouse tomatoes, characterized in that: include: The first acquisition module is used to obtain the root length density influencing factor data; A second acquisition module is used to input the root length density influencing factor data into a pre-trained root length density prediction model to obtain a root length density prediction value output by the root length density prediction model, wherein the root length density prediction model is obtained based on the root length density prediction value and the attention weight training of each root length density influencing factor, and the root length density prediction value is determined based on implicit features, and the implicit features are determined based on a semi-supervised adversarial generative network and a deep separable graph convolutional network; The training steps of the root length density prediction model include: Acquire an unlabeled data set and a labeled data set, wherein the unlabeled data set is determined based on the root length density influencing factor data, and the labeled data set is determined based on the root length density influencing factor data and the root length density value; Performing data enhancement on the unlabeled dataset and the labeled dataset based on the semi-supervised generative adversarial network to generate synthetic data; Extracting implicit features from the synthetic data based on the deep separable graph convolutional network; The implicit features are converted into root length density prediction values ​​based on a deep residual network, and the attention weight of each root length density influencing factor is determined based on a multi-head self-attention mechanism and the implicit features; Based on the root length density prediction value and the attention weight of each root length density influencing factor, updating the model parameters of the root length density prediction model through back propagation and adaptive moment estimation; The step of performing data enhancement on the unlabeled dataset and the labeled dataset based on the semi-supervised generative adversarial network to generate synthetic data includes: Training the semi-supervised generative adversarial network based on the unlabeled dataset and the labeled dataset; The unlabeled data set and conditional variables are synthesized based on the trained semi-supervised generative adversarial network to obtain synthetic data; the conditional variables are used to improve the diversity of the root length density influencing factor data; The training of the semi-supervised generative adversarial network based on the unlabeled data set and the labeled data set includes: The unlabeled data set and the conditional variables are synthesized based on the generator in the semi-supervised generative adversarial network to obtain synthetic data, and the labeled data set and the conditional variables are synthesized based on the discriminator in the semi-supervised generative adversarial network to obtain real data; Based on the synthetic data, the real data and the binary cross entropy loss, a synthetic loss and a real loss are obtained, and the discriminator is optimized based on the synthetic loss and the real loss; Based on the synthetic data and the binary cross entropy loss, an adversarial loss and a reconstruction loss are obtained, and the generator is optimized based on the adversarial loss and the reconstruction loss.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for predicting the root length density of greenhouse tomatoes as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method for calculating greenhouse tomato root system density spatial distribution

    CN111311428A

  • Soil space temperature and humidity prediction method, device, equipment, medium and program product

    CN118132964A