Tobacco field planting detection method and device and electronic equipment
By using predictive networks and multi-agent decision-making mechanisms in tobacco field planting, the problem of the lack of unified standards in tobacco field planting management was solved, dynamic planting optimization was achieved, and tobacco yield and quality were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-03-24
AI Technical Summary
The existing tobacco field planting and management lacks unified standards, resulting in low management efficiency and difficulty in meeting the dynamic planting optimization needs of different plots, time periods, and growth stages. There are also problems such as delayed fertilization response and untimely identification of pests and diseases.
By acquiring tobacco field planting data, the potential state sequence and potential prediction sequence are determined using the feature coding unit, gated recurrent unit and potential prediction unit in the prediction network. Combined with the multi-agent decision-making mechanism, the planting instruction sequence is output, including irrigation parameters, fertilization intensity and pest and disease instructions, to achieve regionalized response.
It improved tobacco yield and quality, met the dynamic planting optimization needs of different regions and growth stages, and achieved faster response speed and more efficient resource utilization.
Smart Images

Figure CN121724342A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a detection method and device for tobacco field planting and electronic equipment. BACKGROUND
[0002] In the process of tobacco field planting, it is usually necessary to monitor tobacco plants in the tobacco field to realize management of the tobacco field planting process and ensure the yield and quality of the tobacco field.
[0003] At present, in the prior art, the planting management of the tobacco field is usually realized by experience and recorded information of corresponding planting personnel. However, the above-mentioned method has obvious limitations. Because the experience of different planting personnel is different, the management of the tobacco field is also different, that is, the management of the tobacco field lacks a unified standard, and there may be problems such as lagging response of fertilization, untimely identification of diseases and insect pests, and mismatch of regional management instructions. Moreover, the above-mentioned method has low planting management efficiency and is difficult to meet the dynamic planting optimization demand of different plots, time periods and growth stages. SUMMARY
[0004] The present application provides a detection method and device for tobacco field planting and electronic equipment, which realizes the guidance of the tobacco field planting behavior through intelligent monitoring of the tobacco field planting process, can meet the actual planting demand of the tobacco field, and effectively improves the yield and quality of tobacco plants in the tobacco field to be detected.
[0005] According to an aspect of the present application, a detection method for tobacco field planting is provided, which comprises the following steps.
[0006] Obtaining tobacco field planting data of a tobacco field to be detected at multiple time steps within a preset time length; wherein the tobacco field planting data at least includes soil humidity of the tobacco field, leaf feature images of tobacco leaves and fertilization record data;
[0007] Inputting the tobacco field planting data into a prediction network to determine a latent state sequence and a latent prediction sequence corresponding to the tobacco field planting data based on a feature encoding unit, a gated recurrent unit and a latent prediction unit in the prediction network; wherein the latent state sequence is used to represent time sequence dynamic evolution characteristics of the tobacco field to be detected in the planting process, and the latent prediction sequence is used to represent a time sequence evolution trend of potential dynamic adjustment of the tobacco field to be detected in the planting process;
[0008] Reconstructing the state and aligning the space of the latent prediction sequence, identifying a mutation point through first-order difference, obtaining a mark sequence, and re-determining a time window boundary of the latent state sequence based on the mark sequence to obtain an event feature sequence;
[0009] The event feature sequence is divided into multiple regional sequences according to the tobacco field area, and the target state difference sequence is extracted by a sliding window to determine the set of state indicators based on the target state difference sequence.
[0010] The set of state indicators is input into the multi-agent system to output a sequence of planting instructions;
[0011] The planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions.
[0012] According to another aspect of the present invention, a detection device for tobacco field planting is provided, the device comprising:
[0013] The data acquisition module is used to acquire tobacco planting data of the tobacco field to be detected at multiple time steps within a preset time period; wherein, the tobacco planting data includes at least tobacco field soil moisture, tobacco leaf feature images and fertilization record data;
[0014] The prediction sequence determination module is used to input tobacco field planting data into the prediction network, and determine the potential state sequence and potential prediction sequence corresponding to the tobacco field planting data based on the feature encoding unit, gated recurrent unit and potential prediction unit in the prediction network; wherein, the potential state sequence is used to characterize the temporal dynamic evolution characteristics of the tobacco field to be detected during the planting process, and the potential prediction sequence is used to characterize the temporal evolution trend of the potential dynamic adjustment of the tobacco field to be detected during the planting process;
[0015] The event feature sequence determination module is used to obtain a labeled sequence by reconstructing the state and aligning the space of the potential prediction sequence, identifying abrupt change points through first-order difference, and redetermining the time window boundary of the potential state sequence based on the labeled sequence to obtain the event feature sequence.
[0016] The state indicator set determination module is used to divide the event feature sequence into multiple region sequences according to the tobacco field area, and extract the target state difference sequence through a sliding window to determine the state indicator set based on the target state difference sequence.
[0017] The planting instruction sequence determination module is used to input the set of state indicators into the multi-agent system in order to output the planting instruction sequence.
[0018] The planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions.
[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0020] At least one processor; and
[0021] A memory that is communicatively connected to at least one processor; wherein,
[0022] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the detection method for tobacco field planting according to any embodiment of the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the detection method for tobacco field planting according to any embodiment of the present invention.
[0024] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, characterized in that the computer program, when executed by a processor, implements a method for detecting tobacco field planting as described in any embodiment of the present invention.
[0025] The technical solution of this invention acquires tobacco planting data of the tobacco field under test at multiple time steps within a preset time period, inputs the tobacco planting data into a prediction network, and determines the potential state sequence and potential prediction sequence corresponding to the tobacco planting data based on the feature encoding unit, gated recurrent unit and potential prediction unit in the prediction network. This achieves accurate trend prediction of the potential state of the tobacco plant growth process in the tobacco field under test, thereby greatly improving the foresight and reliability of the subsequently determined planting instruction sequence. By reconstructing and spatially aligning the potential prediction sequence, and identifying abrupt change points through first-order difference analysis, a labeled sequence is obtained. Based on this labeled sequence, the time window boundaries of the potential state sequence are redefined to obtain the event feature sequence. The event feature sequence is then divided into multiple regional sequences according to the tobacco field area, and a target state difference sequence is extracted using a sliding window to determine the state index set. This state index set is input into a multi-agent system to output a planting instruction sequence. This achieves differentiated response capabilities for multiple regions in the tested tobacco field based on regional sequence division and a multi-agent decision-making mechanism, making the determined planting instruction sequence more aligned with regional growth characteristics, resulting in faster response speeds and more efficient resource utilization. This invention solves the problems of lack of unified planting management standards, low management efficiency, and inability to meet actual planting needs caused by manual management of tobacco fields in existing technologies. Through intelligent monitoring of the tobacco field planting process, it guides tobacco field planting behavior, meeting the dynamic planting optimization needs of different regions, time periods, and growth stages in the tested tobacco field, thereby effectively improving the yield and quality of tobacco plants in the tested tobacco field.
[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a flowchart of a detection method for tobacco field planting provided by an embodiment of the present invention;
[0029] Figure 2 This is a flowchart of a detection method for tobacco field planting provided by an embodiment of the present invention;
[0030] Figure 3 This is a comparison table of multi-area detection results in tobacco fields provided in this embodiment of the invention;
[0031] Figure 4 This is a schematic diagram of the structure of a detection device for tobacco field planting provided in an embodiment of the present invention;
[0032] Figure 5 This is a schematic diagram of the structure of an electronic device for implementing the detection method for tobacco field planting according to an embodiment of the present invention. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] Example 1
[0036] Figure 1This is a flowchart of a detection method for tobacco field planting provided in Embodiment 1 of the present invention. This embodiment is applicable to situations involving intelligent monitoring of tobacco fields to be monitored and dynamic management of the planting process. The method can be executed by a tobacco field planting detection device, which can be implemented in hardware and / or software. This detection device can be configured in electronic devices such as mobile phones, computers, or servers. Figure 1 As shown, the method includes:
[0037] S110. Obtain tobacco planting data of the tobacco field to be detected at multiple time steps within a preset time period; wherein, the tobacco planting data includes at least the soil moisture of the tobacco field, tobacco leaf feature images and fertilization record data.
[0038] The tobacco field to be monitored can be any tobacco field currently requiring monitoring and management. Multiple tobacco plants are planted in the field. The preset duration is a pre-set time period for acquiring tobacco field planting data. The time step is determined by dividing the preset duration. The tobacco field planting data characterizes the planting status of the tobacco field to be monitored. The soil moisture in the tobacco field planting data characterizes the soil moisture level of the tobacco field to be monitored. The tobacco leaf feature map characterizes the growth status of the tobacco leaves in the tobacco field to be monitored. Fertilizer application records may include information on the fertilization time and amount for the tobacco field to be monitored.
[0039] Specifically, the method involves acquiring tobacco planting data from multiple time steps within a preset time period to determine the potential growth status of tobacco plants and thus enabling tobacco planting management.
[0040] In this embodiment of the invention, the method for determining the tobacco planting data corresponding to the tobacco field to be detected may be as follows: collecting the soil moisture, tobacco leaf images, and fertilization record data of the tobacco field to be detected within a preset time period; extracting image features from the tobacco leaf images to obtain the tobacco leaf feature images of each tobacco leaf image; and performing time sampling for a preset time period according to a preset acquisition step size to obtain the tobacco field soil moisture, tobacco leaf feature images, and fertilization record data at multiple time steps.
[0041] The data collected includes soil moisture in the tobacco field and images of tobacco leaves, which can be obtained from corresponding sensors. The tobacco leaf images can be images of tobacco plant leaves in the tobacco field to be tested. Image feature extraction is used to extract leaf features from the tobacco leaf images. The preset acquisition step size can be a pre-set fixed time interval between two adjacent time sampling points. By sampling for a preset duration using the preset acquisition step size, multiple time steps can be obtained, thereby determining the tobacco field planting data at each time step.
[0042] Specifically, the process involves acquiring soil moisture, tobacco leaf images, and fertilization records from the tobacco field under test within a preset time period. Feature extraction is performed on the tobacco leaf images to determine the corresponding feature images for each leaf. Time sampling is performed for the preset time period according to a preset acquisition step size to determine multiple time steps corresponding to the preset time period, and the corresponding soil moisture, tobacco leaf feature images, and fertilization records for each time step are then determined.
[0043] Optionally, the specific method for extracting image features from tobacco leaf images can be as follows: The tobacco leaf image is normalized for brightness and enhanced for color values to obtain a first image; the edges of the central region of the first image are enhanced based on a spatial attention mechanism to obtain a second image; the boundary contours of the leaves in the second image are extracted using an edge detection algorithm, and the foreground plant region and background region are separated by an edge segmentation method to obtain a foreground mask image; the foreground mask image is input into a monocular depth estimation network to obtain a tobacco leaf feature image reflecting changes in leaf structure; wherein, the monocular depth estimation network includes a feature encoding layer, a temporal state block, and a feature fusion layer.
[0044] Brightness normalization can be used to adjust the brightness distribution of tobacco leaf images, making the brightness values of the tobacco leaf images uniformly distributed within a specific range, or making the average brightness of the tobacco leaf images reach a certain preset brightness value. Color enhancement processing is used to enhance the color saturation, contrast, etc. of tobacco leaf images. The first image can be a leaf image obtained by performing brightness normalization and color enhancement processing on a tobacco leaf image.
[0045] Spatial attention mechanism is used to enhance the edge contrast of the central region of the first image. The second image is the first image after the edge contrast enhancement. An edge detection algorithm is used to separate the foreground plant region and the background region in the second image. The foreground plant region is the image region containing tobacco plants. The background region is the image region excluding tobacco plants. The foreground mask image can be a mask image corresponding to the foreground plant region.
[0046] Monocular depth estimation networks can be built on the Mamba framework and include feature encoding layers, temporal state blocks, and feature fusion layers. These networks are used to process foreground mask images to determine the feature images of tobacco leaves.
[0047] Specifically, the tobacco leaf image undergoes brightness normalization and color enhancement to obtain the first image. The edge contrast of the central region of the first image is then enhanced using a spatial attention mechanism to obtain the second image, thereby improving the feature representation capability of the leaf region in the tobacco leaf image. An edge detection algorithm is used to extract the leaf boundary contours of the second image, and edge segmentation is applied to segment the second image to obtain the foreground plant region and the background region. A foreground mask image is then determined based on the foreground plant region and the background region.
[0048] A foreground mask image is input into a monocular depth estimation network (MDN). Features are extracted from the foreground mask image through the MDN's feature encoding layer, temporal state blocks, and feature fusion layer to obtain a tobacco leaf feature image. Specifically, the MDN's feature encoding layer performs convolutional mapping on the foreground mask image to extract corresponding image structural features and compress spatial dimensions. Temporal state blocks, connected in a cascaded manner, extract image structural features based on state propagation and gating mechanisms to obtain temporal features reflecting local continuity and depth variation trends. The feature fusion layer fuses the temporal features output from the temporal state blocks using multiple receptive fields to obtain a depth feature map reflecting the leaf's structural state. The depth feature map is then processed to extract features in at least one of the following dimensions: region curvature, edge sparsity, and thickness gradient, to obtain a tobacco leaf feature image reflecting the leaf's growth state.
[0049] S120. Input the tobacco field planting data into the prediction network, and determine the potential state sequence and potential prediction sequence corresponding to the tobacco field planting data based on the feature coding unit, gated recurrent unit and potential prediction unit in the prediction network.
[0050] The prediction network, built upon a world-model-based reinforcement learning framework (Dreamer model), is used to predict the potential states of the tobacco field under test based on planting data. The feature encoding unit of the prediction network performs convolutional processing on the tobacco planting data. The gated recurrent unit processes the output of the feature encoding unit to determine the potential state sequence. This potential state sequence characterizes the temporal dynamic evolution of the tobacco field under test during the planting process. The latent prediction unit uses a Bayesian filtering algorithm to predict and update the potential state sequence output by the gated recurrent unit to obtain the potential prediction sequence. This potential prediction sequence characterizes the temporal evolution trend of the potential dynamic adjustments in the tobacco field under test during the planting process.
[0051] Specifically, tobacco field planting data is input into a prediction network, where the feature encoding unit performs convolution processing on the data to obtain the corresponding output. A gated recurrent unit processes the output of the feature encoding unit to determine the latent state sequence. A Bayesian filtering algorithm based on the latent prediction unit predicts and updates the latent state sequence to obtain a latent prediction sequence that characterizes the temporal evolution trend of the potential dynamic adjustments in the tobacco field during the planting process.
[0052] S130. By reconstructing the state and aligning the space of the potential prediction sequence, and identifying the mutation point through first-order difference, a labeled sequence is obtained. Based on the labeled sequence, the time window boundary of the potential state sequence is redefined to obtain the event feature sequence.
[0053] Among these processes, state reconstruction of the potential prediction sequences can be used to determine state representations that better meet actual needs, enabling these state labels to better reflect the actual planting situation. Spatial alignment is used to map the potential prediction sequences to a unified space, eliminating analytical obstacles caused by spatial differences. First-order differencing is used to identify abrupt change points in the time-series data corresponding to the potential prediction sequences. Label sequences are associated with abrupt change points and potential prediction sequences. Event feature sequences are used to characterize the local growth dynamics of tobacco plants in the tested tobacco field under the influence of temporal disturbances.
[0054] Specifically, by performing state reconstruction and spatial alignment on the potential prediction sequence, a standard prediction sequence corresponding to the potential prediction sequence is determined. First-order difference analysis is then performed on the standard prediction sequence to identify abrupt change points. Based on the abrupt change points and the standard prediction sequence, a label sequence is determined. The time window boundaries of the potential state sequence are then redefined using the label sequence to obtain the event feature sequence.
[0055] S140. Divide the event feature sequence into multiple region sequences according to the tobacco field area, and extract the target state difference sequence through a sliding window to determine the set of state indicators based on the target state difference sequence.
[0056] The region sequence can be derived from the division of tobacco fields to be tested. Each region sequence corresponds to one region of the tobacco field to be tested. The tobacco field to be tested may include multiple regions. The target state difference sequence may include multiple target state differences. The target state difference can be determined based on the latent state vector corresponding to each time step in the latent state sequence, and is used to represent the state differences between adjacent time steps. The set of state indicators is used to characterize the growth trend and fluctuation characteristics of tobacco plants in the tobacco field to be tested.
[0057] Specifically, the event feature sequence is divided into multiple region sequences according to the tobacco field area to be detected, and the region sequences are processed by a sliding window to extract the target state difference sequence corresponding to each sliding window. First-order differencing is performed on the target state difference sequence corresponding to each sliding window to determine the set of state indicators corresponding to the target state difference sequence.
[0058] S150. Input the set of state indicators into the multi-agent system to output the planting instruction sequence.
[0059] The multi-agent component analyzes the set of state indicators to determine the planting instruction sequence associated with each region corresponding to the set of state indicators. The multi-agent component can be a multi-agent system based on the Multi-Agent Proximal Policy Optimization (MAPPO) algorithm. The planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions. Irrigation parameter instructions are instructions used to control irrigation operations in the tobacco field under test. Optionally, irrigation parameters may include: irrigation volume, irrigation frequency, irrigation time, and irrigation method. Fertilization intensity instructions are instructions used to control the weight and concentration of fertilizer applied to tobacco plants per unit area or per unit time in the tobacco field under test. Optionally, fertilization intensity may include: fertilizer volume, fertilizer concentration, fertilization frequency, and fertilization method. Pest and disease instructions can be pest and disease monitoring instructions and pest and disease control instructions corresponding to potential pest and disease problems in the tobacco field under test. Pest and disease monitoring instructions can specify the time, frequency, and method of monitoring pests and diseases in the tobacco field under test. Pest and disease control instructions can specify the control methods, control time, and control scope corresponding to different pests and diseases in the tobacco field to be tested.
[0060] Specifically, the state indicator set is mapped according to a pre-defined regional relationship to determine the data corresponding to each region of the tobacco field to be tested. The data corresponding to each region is then input into the agent corresponding to that region within the multi-agent system. Based on this agent, a planting instruction sequence corresponding to each region is determined. Finally, based on the planting instruction sequence for each region, a planting instruction sequence corresponding to the tobacco field to be tested is determined.
[0061] In this embodiment of the invention, the specific method for determining the planting instruction sequence based on multiple agents may be as follows: inputting the data of each region in the state index set of the tobacco field to be detected into the corresponding agent, so that the agent determines the policy value corresponding to the candidate action based on the integrated execution strategy, and determines the planting behavior according to the execution probability of the policy value in the candidate action set; and generating the planting instruction sequence corresponding to each region in the tobacco field to be detected according to the planting behavior.
[0062] In this system, the data for each region in the tobacco field to be tested within the set of state indicators can be determined by parsing the set of state indicators based on the region mapping relationship. The multi-agent system comprises multiple agents, each responsible for processing the data in the set of state indicators for its corresponding region.
[0063] An execution policy can be an execution strategy corresponding to the rules followed by the agent. A candidate action can be a possible action that the agent can consider taking under a given execution policy. A policy value can be an indicator used to evaluate the merits of taking a candidate action by the agent under a given execution policy. An execution probability is used to characterize the likelihood of each candidate action in the candidate action set being executed. A planting action can be a specific planting operation corresponding to a candidate action.
[0064] Specifically, based on a pre-set regional mapping relationship, the state indicator set is parsed to determine the data (state indicators) corresponding to each region of the tobacco field to be detected. Based on the state indicators of the corresponding regions from the agent pairs matched with those regions in the state indicator set, execution strategy evaluation is performed to determine the strategy value of each candidate action in the set of candidate actions. Based on the strategy value of each candidate action, the execution probability of that candidate action in the candidate action set is determined. Based on the execution probability of the candidate actions in the candidate action set, the candidate actions are mapped to planting behaviors to obtain a planting instruction sequence matching the corresponding region. Based on this, the planting instruction sequences generated by all agents can be arranged in chronological and regional order to obtain a planting instruction sequence consistent with the actual spatial structure of the tobacco field to be detected.
[0065] Optionally, the operation process of a multi-agent system based on the MAPPO algorithm may include: constructing a training state set based on the state index corresponding to each agent; constructing a centralized training structure based on the MAPPO algorithm, where agents perform execution policy evaluation operations on each candidate action in the candidate action set to generate the execution probability of each candidate action; obtaining the execution probability of each candidate action from the current time step state index and calculating the difference with the average execution probability of each candidate action in the training state set to obtain a global evaluation value; iteratively updating the policy distribution of the current candidate action based on the global evaluation value; after the update is completed, each agent performs a sampling operation in the candidate action set and maps the sampling results to irrigation, fertilization, and pest and disease control instructions for the corresponding area to form a complete planting instruction sequence.
[0066] Optionally, the method further includes: collecting feedback data corresponding to each time step in the planting instruction sequence; wherein the feedback data includes at least actual soil moisture, actual leaf image features, and actual fertilization data; comparing the feedback data with the planting instruction sequence according to time steps to obtain the prediction error sequence and response deviation sequence corresponding to each time step; adjusting the network parameters in the prediction network according to the prediction error sequence, and adjusting the execution strategy parameters in the corresponding agent according to the response deviation sequence.
[0067] The feedback data can be the data obtained after each region performs the corresponding planting actions according to the planting instruction sequence. Actual soil moisture can be the soil moisture of the tobacco field under test, measured after performing the planting actions based on the planting instruction sequence. Actual leaf image features can be the image features of tobacco plant leaves in the tobacco field under test, determined after performing the planting actions based on the planting instruction sequence. Actual fertilization data can be the actual fertilization records corresponding to the tobacco field under test, based on the planting actions based on the planting instruction sequence. The prediction error sequence and response deviation sequence are used to characterize the degree of difference between the theoretical execution and the actual execution corresponding to the planting instruction sequence.
[0068] Specifically, after planting and managing the tobacco field under test based on the planting instruction sequence, feedback data corresponding to the planting instruction sequence at each time step is collected. The feedback data is then time-aligned with the event feature sequence corresponding to the planting instruction sequence at each time step to extract the latent state vector and feedback state vector corresponding to each time step.
[0069] A prediction error sequence is generated based on the element-wise difference between the latent state vector and the feedback state vector at each time step; a response bias sequence is generated based on the execution difference between the planting instruction sequence and the corresponding feedback behavior at each time step. The parameters of the latent prediction units in the prediction network are updated based on the prediction error sequence, and backpropagation is performed on the feature encoding unit and the gated recurrent unit to adjust their corresponding weights. Furthermore, the execution policy parameters in the multi-agent network are updated based on the response bias sequence to re-estimate the policy distribution of candidate actions.
[0070] By using the error comparison mechanism between feedback data and event feature sequences, a continuous optimization closed loop of the prediction network and multi-agents is achieved, enabling the planting instruction sequence to be quickly corrected after execution and the strategy to continuously adapt, effectively enhancing the adaptability, intelligence, and sustainable management capabilities of the tobacco field planting process under test.
[0071] The technical solution of this embodiment acquires tobacco planting data of the tobacco field under test at multiple time steps within a preset time period, inputs the tobacco planting data into a prediction network, and determines the potential state sequence and potential prediction sequence corresponding to the tobacco planting data based on the feature coding unit, gated recurrent unit and potential prediction unit in the prediction network. This achieves accurate trend prediction of the potential state of the tobacco plant growth process in the tobacco field under test, thereby greatly improving the foresight and reliability of the subsequent determined planting instruction sequence. By reconstructing and spatially aligning the potential prediction sequence, and identifying abrupt change points through first-order difference analysis, a labeled sequence is obtained. Based on this labeled sequence, the time window boundaries of the potential state sequence are redefined to obtain the event feature sequence. The event feature sequence is then divided into multiple regional sequences according to the tobacco field area, and a target state difference sequence is extracted using a sliding window to determine the state index set. This state index set is input into a multi-agent system to output a planting instruction sequence. This achieves differentiated response capabilities for multiple regions in the tested tobacco field based on regional sequence division and a multi-agent decision-making mechanism, making the determined planting instruction sequence more aligned with regional growth characteristics, resulting in faster response speeds and more efficient resource utilization. This invention solves the problems of lack of unified planting management standards, low management efficiency, and inability to meet actual planting needs caused by manual management of tobacco fields in existing technologies. Through intelligent monitoring of the tobacco field planting process, it guides tobacco field planting behavior, meeting the dynamic planting optimization needs of different regions, time periods, and growth stages in the tested tobacco field, thereby effectively improving the yield and quality of tobacco plants in the tested tobacco field.
[0072] Example 2
[0073] Figure 2 This is a flowchart of a detection method for tobacco field planting provided in Embodiment 2 of the present invention. This embodiment is a preferred embodiment of the above embodiments. For specific implementation details, please refer to the technical solution of this embodiment. Technical terms that are the same as or corresponding to those in the above embodiments will not be repeated here. Figure 2 As shown, the method includes:
[0074] S210. Obtain tobacco planting data of the tobacco field to be detected at multiple time steps within a preset time period; wherein, the tobacco planting data includes at least the soil moisture of the tobacco field, tobacco leaf feature images and fertilization record data.
[0075] The tobacco planting data is processed sequentially by the feature encoding unit, gated recurrent unit, and latent prediction unit in the prediction network, as detailed below.
[0076] S220. Based on the feature encoding unit, extract a preset number of data segments from the tobacco planting data at time steps, and perform a one-dimensional convolution operation on the data segments to generate a convolution response.
[0077] The preset quantity can be a pre-defined number of data segments. Each data segment includes tobacco field soil moisture, tobacco leaf feature images, and fertilization records at at least one time step. The convolutional response can be obtained by performing convolution processing on the data segments, reflecting the local feature representation of the data segments under the feature convolution kernel.
[0078] Specifically, the tobacco planting data at multiple time steps is extracted and processed according to time steps using the feature encoding units in the prediction network to obtain a preset number of data segments. A one-dimensional convolution operation is then performed on each data segment to obtain the convolution response corresponding to each data segment.
[0079] S230. Perform average pooling on the convolutional response according to the channel direction to generate a state feature vector corresponding to the time step.
[0080] Here, the channel direction refers to the direction of operation along the convolution channel dimension. Average pooling is a process that reduces the dimensionality of the convolutional response and fuses its features. The state feature vector can be the feature vector obtained after average pooling the convolutional response.
[0081] Specifically, the average pooling parameters of the convolution response are applied based on the channel direction corresponding to the convolution channel dimension to generate a state feature vector corresponding to the time step.
[0082] S240. Input the state feature vector into the gated loop unit to extract the historical state vector based on the gated loop unit and concatenate it with the state feature vector. Perform linear transformation and activation operations on the concatenated vector to generate update gate and reset gate.
[0083] The historical state vector is used to represent the state output vector previously generated by the gated loop unit. If there is no corresponding historical state vector for the state feature vector of the first time step, a preset vector can be used as the historical state vector corresponding to the state feature vector of the first time step.
[0084] Linear transformations and activation operations can be linear transformations and ramp function activation operations. Linear transformations involve linearly combining the concatenated vectors using matrix multiplication. Ramp function activation operations are used to generate gate values. The ramp function can be the sigmoid function. Updating and resetting gate values characterize the flow of information within the gated recurrent unit. Updating the gate value characterizes how much information from the historical state vector needs to be passed to the state feature vector. Resetting the gate value characterizes how much information in the historical state vector needs to be "reset" or "forgotten."
[0085] Specifically, all state feature vectors corresponding to each time step are input into the gated loop unit in chronological order. For each state feature vector at each time step, the state output vector generated by the gated loop unit based on the state feature vector of the previous time step is used as the historical state vector (the historical state vector corresponding to the first time step is a preset vector). The state feature vector and the corresponding historical state vector are concatenated to obtain the concatenated vector.
[0086] An update gate path and a reset gate path are constructed, with different computational coefficients assigned to each. The concatenated vector is then input into the update gate path and the reset gate path, respectively, and a linear transformation and ramp function activation operation are performed on each to generate an update gate value based on the update gate path and a reset gate value based on the reset gate path. The computational coefficients include a weight matrix and a bias term.
[0087] S250. Adjust the retention ratio of the historical state vector based on the reset threshold, and perform weighted fusion of the state feature vector and the adjusted historical state vector based on the update threshold to output the potential state vector.
[0088] The retention ratio can be understood as determining which information in the historical state vector should be retained and which should be forgotten at the current time step. The retention ratio depends on the magnitude of the reset threshold in each dimension; the closer the value is to 1, the more historical information in that dimension is retained; the closer it is to 0, the more thoroughly the historical information in that dimension is forgotten. The latent state vector is used to characterize the state output generated by the gated recurrent unit.
[0089] Specifically, the retention ratio of the historical state vector is adjusted according to the reset threshold to obtain the adjusted historical state vector. The state feature vector and the corresponding adjusted historical state vector are concatenated along the feature dimension to obtain a concatenated vector. A weight factor sequence is then generated according to the update threshold along the corresponding feature dimension. Element-wise multiplication is performed on the concatenated vector and the weight factor sequence to obtain the calculation result. The calculation result is then normalized to generate the latent state vector. The normalization process can be Min-Max normalization.
[0090] S260. Based on the potential state vector corresponding to each time step, a potential state sequence is obtained. The potential state sequence is input into the potential prediction unit to extract the feature probability distribution of the potential state vector at each time step based on the potential prediction unit. The feature probability distribution is then smoothed using a Bayesian filtering algorithm to obtain the potential prediction sequence.
[0091] The latent state sequence is generated by sequentially processing the latent state vectors corresponding to all time steps. The feature probability distribution can be extracted by performing forward inference on the latent state vectors in the latent state sequence. The Bayesian filtering algorithm is a probabilistic inference method used for real-time estimation of dynamic states.
[0092] Specifically, the multiple latent state vectors corresponding to all time steps are sorted in chronological order to obtain a latent state sequence. This latent state sequence is then input into a latent prediction unit, where a multilayer perceptron-based inference network performs forward inference on the latent state vector corresponding to each time step. Specifically, the inference network sequentially performs ramp function activation and normalization operations on the latent state vectors to obtain the feature probability distribution corresponding to each latent state vector.
[0093] The feature probability distributions corresponding to all time steps are sorted chronologically to obtain the initial prediction sequence. A Bayesian filtering algorithm is then used to recursively estimate the initial prediction sequence. Specifically, the preset distribution of the first time step is used as the prior distribution, the feature probability distribution corresponding to that time step is used as the observation information, the posterior probability distribution is calculated according to the Bayesian update rule, and this posterior probability distribution is used as the prior probability distribution for the next time step. This process is repeated until the posterior probability distributions corresponding to all time steps are obtained. Finally, the posterior probability distributions corresponding to all time steps are sorted chronologically to obtain the potential prediction sequence.
[0094] S270. By reconstructing the state and aligning the space of the potential prediction sequence, and identifying the mutation point through first-order difference, a labeled sequence is obtained. Based on the labeled sequence, the time window boundary of the potential state sequence is redefined to obtain the event feature sequence.
[0095] In this embodiment of the invention, the specific method for determining the event feature sequence may be as follows: Based on the posterior probability distribution of each time step in the potential prediction sequence and the historical state of the tobacco field to be detected, a state reconstruction sequence is determined, and a time-series fitting operation is performed on the state reconstruction sequence to obtain the state change trend of the tobacco field to be detected within the prediction time period; based on the state change trend and the actual change trend of the tobacco field to be detected, the state reconstruction sequence is adjusted, and a standard prediction sequence is determined based on the adjusted state reconstruction sequence; wherein, the actual change trend is related to the state value sequence of the tobacco field to be detected in the historical time period corresponding to the prediction time period; based on the time step, a first-order difference calculation is performed on the standard prediction sequence to obtain a first state difference sequence, and based on the local extreme points related to the first state difference sequence, a set of candidate points for the direction and intensity of state change is determined; based on the first state difference sequence... A set of mutation points is obtained by calculating the local change slope corresponding to each candidate point in the candidate point set using a state difference sequence. The local change slope is used to characterize the average rate of change of the first state difference within a fixed-length interaction region constructed with the candidate points as the focus. For all mutation points in the mutation point set, a time-series matching is performed based on the time step of the mutation point and the fertilization event to determine the label sequence. The time window boundary of the potential state sequence is redefined based on the label sequence, and the window length is adjusted in combination with the time interval between adjacent mutation points to divide the potential state sequence into multiple time segments to determine the state evolution segments. For each state evolution segment, the state change region and key transition features are extracted and arranged in chronological order to obtain the event feature sequence. The event feature sequence is used to characterize the local growth dynamic process of tobacco leaves under time-series intervention.
[0096] The historical state can be the historical tobacco planting data of the tobacco field to be detected within the historical time period corresponding to the predicted time period. The state reconstruction sequence includes multiple state reconstruction vectors. The state change trend represents the direction and rate of change of the state reconstruction vectors in the state reconstruction sequence over time. The actual change trajectory represents the sequence of actual state values collected from the tobacco field to be detected within the corresponding historical time period. The state value sequence corresponds to the historical tobacco planting data corresponding to the historical state.
[0097] The standard prediction sequence can be a sequence obtained by temporal fitting and spatial alignment of the state reconstruction sequence. The first state difference sequence can include multiple first state differences, which can be determined by performing a first-order difference on the standard prediction sequence to determine the difference in state values at adjacent time steps.
[0098] A local extremum can be understood as a point in the first state difference sequence that reaches its maximum or minimum value within a certain neighborhood. In the first state difference sequence, a local extremum represents a point where the rate of change of the state value reaches a local maximum or minimum. The direction and intensity of a state change include the direction and intensity of the change. The direction of the change can be understood as the direction of the change in the state value. The intensity of the change can be understood as the magnitude or rate of change of the state value, which can be measured by the absolute value or rate of change of the local extremum in the first state difference sequence.
[0099] The candidate point set refers to the set of points that may undergo state mutations, selected based on local extrema. The mutation point set can be the set of points determined from the candidate point set. The mutation point set can correspond to time steps of important growth events, external interventions, or abnormal fluctuations. Fertilization events can correspond to the fertilization time of the tobacco field to be tested in the fertilization record data. The marker sequence can be an ordered arrangement of time steps of multiple mutation points with temporal correlation to the fertilization record data in the standard prediction sequence. The state evolution segment can be a state feature extracted from the potential state sequence that corresponds to a time segment.
[0100] Specifically, digital twin technology is used to determine the mapping relationship between the posterior probability distribution of each time step in the potential prediction sequence and the historical state of the tobacco field to be detected. Based on the mapping relationship corresponding to each time step, a state reconstruction sequence is determined. A time-series fitting operation is performed on the state reconstruction sequence according to a preset sliding window to obtain the state change trend of the tobacco field to be detected within the prediction time period.
[0101] The state change trend is compared and analyzed with the actual change trend of the tobacco field to be detected. Linear interpolation and local resampling operations are performed on the state reconstruction sequence segments with large deviations to correct the drift error and obtain the adjusted state reconstruction sequence.
[0102] Based on the spatial structure mapping mechanism of digital twin technology, the spatial dimension of the state reconstruction vector corresponding to each time step in the adjusted state reconstruction sequence is aligned with the spatial structure of each region of the tobacco field to be detected. The state reconstruction sequence that has completed temporal fitting and spatial alignment is combined in chronological order to output a standard prediction sequence.
[0103] First-order difference calculations are performed on the standard prediction sequence based on the time step to obtain the first state difference sequence. Local extrema of the first state difference sequence are extracted through a fixed-length interactive region, and a set of candidate points representing the direction and intensity of state abrupt changes is determined based on the direction of extreme value change corresponding to the local extrema. The local change slope of each candidate point in the candidate point set is determined based on the first state difference sequence. Candidate points in the candidate point set are filtered according to a preset slope threshold and the local change slope of each candidate point to select those that meet the abrupt change characteristics as abrupt change points, thus obtaining a set of abrupt change points.
[0104] For all mutation points in the mutation point set, the time step corresponding to each mutation point is temporally matched with the fertilization time corresponding to the fertilization event to determine the time difference between the time step and the fertilization time. If the time difference is less than a preset time threshold, it is determined that the mutation point corresponding to the time step and the fertilization time have a temporal correlation, and a labeled sequence is generated. Based on the labeled sequence, the time window boundaries of the potential state sequence are redefined, and the window length is adjusted in combination with the time interval between adjacent mutation points to divide the potential state sequence into multiple time segments to determine the state evolution segments. For each state evolution segment, the state change region and key transition features are extracted and arranged in chronological order to obtain the event feature sequence.
[0105] S280. Divide the event feature sequence into multiple region sequences according to the tobacco field area, and extract the target state difference sequence through a sliding window to determine the set of state indicators based on the target state difference sequence.
[0106] In this embodiment of the invention, the specific method for determining the set of state indicators may be as follows: the event feature sequence is divided into multiple regional sequences according to the tobacco field area; a sliding window corresponding to each regional sequence is determined based on a preset time length; the regional sequences are extracted and processed according to the sliding window to determine the target state difference sequence; the target state difference sequence is then subjected to first-order difference processing based on the sliding window to obtain the rate of change sequence; the squared deviation corresponding to each time step is determined according to the target state difference sequence; and the local fluctuation value is determined according to the squared deviation and the distance weight; the set of state indicators is determined according to the local fluctuation value and the rate of change sequence.
[0107] The tobacco field to be detected can include multiple regions, each of which is a tobacco field region. The number of region sequences is the same as the number of tobacco field regions to be detected. The target state difference sequence includes multiple target state differences. The target state difference can be understood as the state difference between the numerical features (state values) of the corresponding latent state vectors in a specified dimension at adjacent time steps. The rate of change sequence can be obtained by performing first-order differencing on the state difference sequence within the sliding window. The squared deviation can be the squared deviation between the state difference at each time step and the average value of all state differences within the sliding window.
[0108] Distance weights can be weighted coefficients set based on the time distance between time steps and the time steps corresponding to the squared deviation. Local fluctuation values are determined by weighted summation of the squared deviations corresponding to all time steps based on the distance weights.
[0109] Specifically, the event feature sequence is divided into multiple region sequences according to the tobacco fields to be detected, ensuring the consistency of time steps across all region sequences. A sliding window of preset time length is used for each region sequence. Within each sliding window, the numerical features of a specified dimension in the latent state vector corresponding to the region sequence are analyzed. These numerical features are then used as state values. Following the time sequence, the target state difference between adjacent time steps is calculated sequentially to obtain the target state difference sequence.
[0110] A first-order differencing operation is performed on the target state difference sequence corresponding to each sliding window to obtain the rate of change sequence. The average value of all target state differences in the target state difference sequence corresponding to each sliding window is determined, and the squared deviation between each target state difference within the sliding window and this average value is determined. Based on the time distance between each time step within the sliding window and the time step corresponding to the squared deviation, the distance weight corresponding to the squared deviation is determined. All squared deviations corresponding to the sliding window and the distance weights corresponding to the squared deviations are weighted and summed to obtain the local fluctuation value. The rate of change sequence corresponding to all tobacco field areas to be detected is used as the trend feature, and the local fluctuation value corresponding to the sliding window is used as the fluctuation feature. These are arranged in chronological order to obtain the state index set.
[0111] S290. Input the set of state indicators into the multi-agent system to output the planting instruction sequence.
[0112] The planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions.
[0113] For example, the technical solution corresponding to the embodiment of the present invention is applied to a tobacco field to be tested with uneven terrain and significant local differences in moisture. For the three regions R1, R2, and R3 of the tobacco field to be tested, the same management time is applied under both the traditional tobacco field planting management method and the planting management method corresponding to the technical solution of the embodiment of the present invention. The resulting monitoring and evaluation results can be as follows: Figure 3 As shown.
[0114] based on Figure 3 As can be seen, the technical solution provided by the embodiments of the present invention significantly improves the timeliness and consistency of regional management. The response delay time in all tobacco field areas has generally decreased from more than 15 hours to less than 6 hours. That is, the processing speed and efficiency of the embodiments of the present invention in the mutation identification and strategy decision-making stages are significantly better than traditional methods. In terms of control accuracy, error analysis shows that the technical solution provided by the embodiments of the present invention significantly reduces the feedback error RMSE value. For example, the R3 region decreased from 0.177 to 0.059, and the command matching accuracy increased from 82.7% to 96.8%, demonstrating the advantages of the embodiments of the present invention in control accuracy and closed-loop correction capability. In summary, the embodiments of the present invention can effectively solve the problems of untimely identification, inaccurate control, and difficulty in correcting feedback in traditional tobacco field management, providing solid technical support for large-scale high-precision agricultural planting.
[0115] The technical solution of this embodiment acquires tobacco planting data of the tobacco field under test at multiple time steps within a preset duration. Based on the feature encoding unit of the prediction network, a preset number of data segments are extracted from the tobacco planting data at each time step, and a one-dimensional convolution operation is performed on the data segments to generate a convolutional response. An average pooling operation is performed on the convolutional response according to the channel direction to generate a state feature vector corresponding to each time step. The state feature vector is input into a gated recurrent unit to extract historical state vectors and concatenate them with the state feature vector. Linear transformation and activation operations are performed on the concatenated vector to generate an update gate and a reset gate. The retention ratio of historical state vectors is adjusted based on the reset gate, and the state feature vector and the adjusted historical state vector are weighted and fused based on the update gate to output a latent state vector. Based on the latent state vector corresponding to each time step, a latent state sequence is obtained. This sequence is then input into a latent prediction unit to extract the feature probability distribution of the latent state vector at each time step. A Bayesian filtering algorithm is used to smooth the feature probability distribution, resulting in a latent prediction sequence. This enables accurate trend prediction of the latent state of tobacco plant growth in the tested tobacco field, significantly improving the foresight and reliability of the subsequently determined planting instruction sequence. By reconstructing and spatially aligning the latent prediction sequence, and identifying abrupt change points using first-order difference, a labeled sequence is obtained. The time window boundaries of the latent state sequence are then redefined based on the labeled sequence to obtain an event feature sequence. This event feature sequence is divided into multiple region sequences according to the tobacco field area, and a target state difference sequence is extracted using a sliding window. A set of state indicators is then determined based on this target state difference sequence. The set of state indicators is input into a multi-agent system to output a planting instruction sequence. This system, based on region sequence division and a multi-agent decision-making mechanism, endows multiple regions in the tested tobacco field with differentiated response capabilities, making the determined planting instruction sequence more aligned with regional growth characteristics, resulting in faster response speeds and more efficient resource utilization. This invention solves the problems of lack of unified planting management standards, low management efficiency, and inability to meet actual planting needs caused by manual management of tobacco fields in the prior art. By intelligently monitoring the tobacco field planting process, it can guide the planting behavior of tobacco fields and meet the dynamic planting optimization needs of different areas, different time periods and different growth stages in the tobacco field under test, thereby effectively improving the yield and quality of tobacco plants in the tobacco field under test.
[0116] Example 3
[0117] Figure 4 This is a schematic diagram of the structure of a detection device for tobacco field planting provided in Embodiment 3 of the present invention. Figure 4As shown, the device includes: a data acquisition module 310, a prediction sequence determination module 320, an event feature sequence determination module 330, a state indicator set determination module 340, and a planting instruction sequence determination module 350.
[0118] The data acquisition module 310 is used to acquire tobacco planting data of the tobacco field to be detected at multiple time steps within a preset time period; wherein, the tobacco planting data includes at least tobacco soil moisture, tobacco leaf feature images, and fertilization record data; the prediction sequence determination module 320 is used to input the tobacco planting data into a prediction network to determine the potential state sequence and potential prediction sequence corresponding to the tobacco planting data based on the feature encoding unit, gated recurrent unit, and potential prediction unit in the prediction network; wherein, the potential state sequence is used to characterize the temporal dynamic evolution characteristics of the tobacco field to be detected during the planting process, and the potential prediction sequence is used to characterize the temporal evolution trend of the potential dynamic adjustment of the tobacco field to be detected during the planting process; event features The sequence determination module 330 is used to obtain a labeled sequence by reconstructing the state and aligning the spatial sequence of the potential prediction sequence, identifying abrupt change points through first-order difference, and redetermining the time window boundary of the potential state sequence based on the labeled sequence to obtain an event feature sequence; the state index set determination module 340 is used to divide the event feature sequence into multiple region sequences according to the tobacco field region, and extract the target state difference sequence through a sliding window to determine the state index set based on the target state difference sequence; the planting instruction sequence determination module 350 is used to input the state index set into the multi-agent to output a planting instruction sequence; wherein, the planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions.
[0119] The technical solution of this embodiment acquires tobacco planting data of the tobacco field under test at multiple time steps within a preset time period, inputs the tobacco planting data into a prediction network, and determines the potential state sequence and potential prediction sequence corresponding to the tobacco planting data based on the feature coding unit, gated recurrent unit and potential prediction unit in the prediction network. This achieves accurate trend prediction of the potential state of the tobacco plant growth process in the tobacco field under test, thereby greatly improving the foresight and reliability of the subsequent determined planting instruction sequence. By reconstructing and spatially aligning the potential prediction sequence, and identifying abrupt change points through first-order difference analysis, a labeled sequence is obtained. Based on this labeled sequence, the time window boundaries of the potential state sequence are redefined to obtain the event feature sequence. The event feature sequence is then divided into multiple regional sequences according to the tobacco field area, and a target state difference sequence is extracted using a sliding window to determine the state index set. This state index set is input into a multi-agent system to output a planting instruction sequence. This achieves differentiated response capabilities for multiple regions in the tested tobacco field based on regional sequence division and a multi-agent decision-making mechanism, making the determined planting instruction sequence more aligned with regional growth characteristics, resulting in faster response speeds and more efficient resource utilization. This invention solves the problems of lack of unified planting management standards, low management efficiency, and inability to meet actual planting needs caused by manual management of tobacco fields in existing technologies. Through intelligent monitoring of the tobacco field planting process, it guides tobacco field planting behavior, meeting the dynamic planting optimization needs of different regions, time periods, and growth stages in the tested tobacco field, thereby effectively improving the yield and quality of tobacco plants in the tested tobacco field.
[0120] Based on the above embodiments, optionally, the data acquisition module includes: a raw data acquisition unit, used to collect the soil moisture, tobacco leaf images, and fertilization record data of the tobacco field to be detected within a preset time period; an image feature extraction unit, used to extract image features from the tobacco leaf images to obtain a tobacco leaf feature image for each tobacco leaf image; and a data sampling unit, used to perform time sampling on the preset time period according to a preset acquisition step size to obtain the soil moisture, tobacco leaf feature images, and fertilization record data of the tobacco field at multiple time steps.
[0121] Optionally, an image feature extraction unit is used to perform brightness normalization and color value enhancement processing on the tobacco leaf image to obtain a first image; enhance the regional edges of the central region of the first image based on a spatial attention mechanism to obtain a second image; extract the boundary contours of the leaves in the second image using an edge detection algorithm, and separate the foreground plant region and background region using an edge segmentation method to obtain a foreground mask image; input the foreground mask image into a monocular depth estimation network to obtain a tobacco leaf feature image reflecting changes in leaf structure; wherein, the monocular depth estimation network includes a feature encoding layer, a temporal state block, and a feature fusion layer.
[0122] Optionally, the prediction sequence determination module is used to extract a preset number of data segments from the tobacco field planting data at time steps based on the feature encoding unit, and perform a one-dimensional convolution operation on the data segments to generate a convolution response; perform an average pooling operation on the convolution response according to the channel direction to generate a state feature vector corresponding to the time step; input the state feature vector into the gating recurrent unit to extract historical state vectors based on the gating recurrent unit and concatenate them with the state feature vectors, and perform linear transformation and activation operations on the concatenated vector to generate update gates and reset gates; wherein, the historical state vectors The state output vector generated by the gated loop unit in the previous time step is used to characterize the state output vector. The retention ratio of the historical state vector is adjusted based on the reset threshold, and the state feature vector and the adjusted historical state vector are weighted and fused based on the update threshold to output the potential state vector. The potential state sequence is obtained according to the potential state vector corresponding to each time step. The potential state sequence is input into the potential prediction unit to extract the feature probability distribution of the potential state vector at each time step based on the potential prediction unit. The feature probability distribution is then smoothed using a Bayesian filtering algorithm to obtain the potential prediction sequence.
[0123] Optionally, the event feature sequence determination module is used to determine a state reconstruction sequence based on the posterior probability distribution of each time step in the potential prediction sequence and the historical state of the tobacco field to be detected, and to perform a time series fitting operation on the state reconstruction sequence to obtain the state change trend of the tobacco field to be detected within the prediction time period; adjust the state reconstruction sequence according to the state change trend and the actual change trend of the tobacco field to be detected, and determine a standard prediction sequence based on the adjusted state reconstruction sequence; wherein, the actual change trend is related to the state value sequence of the tobacco field to be detected actually collected within the historical time period corresponding to the prediction time period; perform first-order difference calculation on the standard prediction sequence according to the time step to obtain a first state difference sequence, and determine a candidate point set for the direction and intensity of state change based on the local extreme points related to the first state difference sequence; and determine the first state difference sequence based on the first state difference sequence. A state difference sequence is used to calculate the local change slope corresponding to each candidate point in the candidate point set, resulting in a mutation point set. The local change slope characterizes the average rate of change of the first state difference within a fixed-length interaction region constructed with the candidate points as the focus. For all mutation points in the mutation point set, a time-series matching is performed between the time step of the mutation point and the fertilization event to determine a marker sequence. The time window boundary of the potential state sequence is then redefined based on the marker sequence, and the window length is adjusted by combining the time interval between adjacent mutation points to divide the potential state sequence into multiple time segments to determine state evolution sections. State change regions and key transition features are extracted from each state evolution section and arranged in chronological order to obtain the event feature sequence. The event feature sequence characterizes the local growth dynamics of tobacco leaves under time-series intervention.
[0124] Optionally, the state indicator set determination module is used to divide the event feature sequence into multiple region sequences according to the tobacco field area, determine a sliding window corresponding to each region sequence based on a preset time length; extract and process the region sequences according to the sliding window to determine the target state difference sequence, and perform first-order differencing processing on the target state difference sequence based on the sliding window to obtain the rate of change sequence; determine the squared deviation corresponding to each time step according to the target state difference sequence, and determine the local fluctuation value according to the squared deviation and distance weight; and determine the state indicator set according to the local fluctuation value and the rate of change sequence.
[0125] Optionally, a planting instruction sequence determination module is used to input the data of each region in the tobacco field to be detected in the state index set into the corresponding agent, so that the agent determines the strategy value corresponding to the candidate action based on the integrated execution strategy, and determines the planting behavior according to the execution probability of the strategy value in the candidate action set; and generates a planting instruction sequence corresponding to each region in the tobacco field to be detected according to the planting behavior.
[0126] Optionally, the device further includes: a feedback adjustment module, used to collect feedback data corresponding to each time step in the planting instruction sequence; wherein the feedback data includes at least actual soil moisture, actual leaf image features, and actual fertilization data; the feedback data is compared with the planting instruction sequence by time step to obtain a prediction error sequence and a response deviation sequence corresponding to each time step; the network parameters in the prediction network are adjusted according to the prediction error sequence, and the execution strategy parameters in the corresponding agent are adjusted according to the response deviation sequence.
[0127] The tobacco field planting detection device provided in this embodiment of the invention can execute the tobacco field planting detection method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0128] Example 4
[0129] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0130] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0131] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0132] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as detection methods for tobacco field planting.
[0133] In some embodiments, the method for detecting tobacco field planting can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for detecting tobacco field planting described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the method for detecting tobacco field planting by any other suitable means (e.g., by means of firmware).
[0134] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0135] Computer programs used for implementing the detection method for tobacco field planting according to the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0136] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 19, or installed from storage unit 18, or installed from ROM 12. When the computer program is executed by processor 11, it performs the functions defined in the methods of the embodiments of the present invention.
[0137] Example 5
[0138] Embodiment 5 of the present invention also provides a computer-readable storage medium storing computer instructions for causing a processor to execute a detection method for tobacco field planting, the method comprising:
[0139] Acquire tobacco planting data for a target tobacco field at multiple time steps within a preset time period; wherein the tobacco planting data includes at least soil moisture, tobacco leaf feature images, and fertilization records; input the tobacco planting data into a prediction network to determine a potential state sequence and a potential prediction sequence corresponding to the tobacco planting data based on the feature encoding unit, gated recurrent unit, and potential prediction unit in the prediction network; wherein the potential state sequence is used to characterize the temporal dynamic evolution characteristics of the target tobacco field during the planting process, and the potential prediction sequence is used to characterize the potential dynamic adjustments of the target tobacco field during the planting process. The temporal evolution trend is analyzed. The potential prediction sequence is reconstructed and spatially aligned, and abrupt change points are identified using first-order difference analysis to obtain a labeled sequence. The time window boundaries of the potential state sequence are then redefined based on the labeled sequence to obtain an event feature sequence. This event feature sequence is divided into multiple regional sequences according to the tobacco field area, and a target state difference sequence is extracted using a sliding window to determine a set of state indicators. The set of state indicators is input into a multi-agent system to output a planting instruction sequence. This planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions.
[0140] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0141] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0142] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0143] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0144] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0145] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for detecting tobacco planting, characterized in that, include: Acquire tobacco planting data of the tobacco field to be tested at multiple time steps within a preset time period; wherein, the tobacco planting data includes at least tobacco field soil moisture, tobacco leaf feature images, and fertilization record data; The tobacco field planting data is input into a prediction network to determine the potential state sequence and potential prediction sequence corresponding to the tobacco field planting data based on the feature encoding unit, gated recurrent unit, and potential prediction unit in the prediction network. The potential state sequence is used to characterize the temporal dynamic evolution characteristics of the tobacco field to be detected during the planting process, and the potential prediction sequence is used to characterize the temporal evolution trend of the potential dynamic adjustment of the tobacco field to be detected during the planting process. By reconstructing the state and aligning the space of the potential prediction sequence, and identifying abrupt change points through first-order difference, a labeled sequence is obtained. Based on the labeled sequence, the time window boundary of the potential state sequence is redefined to obtain the event feature sequence. The event feature sequence is divided into multiple region sequences according to the tobacco field area, and the target state difference sequence is extracted by a sliding window to determine the set of state indicators based on the target state difference sequence. The set of state indicators is input into the multi-agent system to output a sequence of planting instructions; The planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions.
2. The method according to claim 1, characterized in that, The acquisition of tobacco planting data at multiple time steps within a preset time period includes: Collect soil moisture, tobacco leaf images, and fertilization record data of the tobacco field to be tested within a preset time period; Image feature extraction is performed on the tobacco leaf images to obtain tobacco leaf feature images for each tobacco leaf image; Based on the preset acquisition step size, time sampling is performed on the preset duration to obtain soil moisture, tobacco leaf feature images, and fertilization record data of tobacco fields at multiple time steps.
3. The method according to claim 2, characterized in that, The step of extracting image features from the tobacco leaf images to obtain a tobacco leaf feature image for each tobacco leaf image includes: The tobacco leaf image is subjected to brightness normalization and color value enhancement processing to obtain a first image; The second image is obtained by enhancing the regional edges of the central region of the first image based on the spatial attention mechanism. An edge detection algorithm is used to extract the boundary contours of the leaves in the second image, and the foreground plant region and background region are separated by the edge segmentation method to obtain a foreground mask image; The foreground mask image is input into a monocular depth estimation network to obtain a tobacco leaf feature image that reflects changes in leaf structure. The monocular depth estimation network includes a feature encoding layer, a temporal state block, and a feature fusion layer.
4. The method according to claim 1, characterized in that, The step of inputting the tobacco field planting data into a prediction network to determine the potential state sequence and potential prediction sequence corresponding to the tobacco field planting data based on the feature encoding unit, gated recurrent unit, and potential prediction unit in the prediction network includes: Based on the feature encoding unit, a preset number of data segments are extracted from the tobacco field planting data at time steps, and a one-dimensional convolution operation is performed on the data segments to generate a convolution response; Averaging pooling is performed on the convolutional response according to the channel direction to generate a state feature vector corresponding to the time step. The state feature vector is input into the gated loop unit to extract historical state vectors based on the gated loop unit and concatenate them with the state feature vectors. Linear transformation and activation operations are then performed on the concatenated vectors to generate update gates and reset gates. The historical state vector is used to represent the state output vector previously generated by the gated loop unit. The retention ratio of the historical state vector is adjusted based on the reset threshold, and the state feature vector and the adjusted historical state vector are weighted and fused based on the update threshold to output the potential state vector. Based on the potential state vector corresponding to each time step, a potential state sequence is obtained. The potential state sequence is input into the potential prediction unit to extract the feature probability distribution of the potential state vector at each time step. The feature probability distribution is then smoothed using a Bayesian filtering algorithm to obtain the potential prediction sequence.
5. The method according to claim 1, characterized in that, The process involves reconstructing and spatially aligning the potential prediction sequence, identifying abrupt changes using first-order difference to obtain a labeled sequence, and then redetermining the time window boundaries of the potential state sequence based on the labeled sequence to obtain an event feature sequence, including: Based on the posterior probability distribution of each time step in the potential prediction sequence and the historical state of the tobacco field to be detected, a state reconstruction sequence is determined, and a time series fitting operation is performed on the state reconstruction sequence to obtain the state change trend of the tobacco field to be detected within the prediction time period. Based on the state change trend and the actual change trend of the tobacco field to be detected, the state reconstruction sequence is adjusted, and a standard prediction sequence is determined based on the adjusted state reconstruction sequence; wherein, the actual change trend is related to the actual state value sequence of the tobacco field to be detected in the historical time period corresponding to the prediction time period; The first-order difference calculation is performed on the standard prediction sequence according to the time step to obtain the first state difference sequence, and the candidate point set for the direction and intensity of state change is determined based on the local extreme points related to the first state difference sequence. The local change slope corresponding to each candidate point in the candidate point set is calculated based on the first state difference sequence to obtain the set of mutation points; wherein, the local change slope is used to characterize the average rate of change of the first state difference within a fixed-length interactive region constructed with the candidate points as the focus; For all mutation points in the mutation point set, the time steps of the mutation points are matched with the fertilization event to determine the marker sequence. The time window boundary of the potential state sequence is redefined according to the marker sequence, and the window length is adjusted in combination with the time interval between adjacent mutation points to divide the potential state sequence into multiple time segments to determine the state evolution segment. Extract the state change region and key turning point features for each state evolution segment, and arrange them in chronological order to obtain the event feature sequence; The event feature sequence is used to characterize the local growth dynamics of tobacco leaves under time-series intervention.
6. The method according to claim 1, characterized in that, The step of dividing the event feature sequence into multiple region sequences according to the tobacco field area, and extracting the target state difference sequence through a sliding window, to determine the state index set based on the target state difference sequence, includes: The event feature sequence is divided into multiple region sequences according to the tobacco field area, and a sliding window corresponding to each region sequence is determined based on a preset time length. The region sequence is extracted based on the sliding window to determine the target state difference sequence, and the target state difference sequence is subjected to first-order difference processing based on the sliding window to obtain the rate of change sequence. Based on the target state difference sequence, determine the squared deviation corresponding to each time step, and determine the local fluctuation value based on the squared deviation and distance weight; The set of state indicators is determined based on the local fluctuation values and the change rate sequence.
7. The method according to claim 1, characterized in that, The step of inputting the set of state indicators into the multi-agent system to output a planting instruction sequence includes: The data of each region in the tobacco field to be detected in the state index set is input into the corresponding agent, so that the agent determines the strategy value corresponding to the candidate action based on the integrated execution strategy, and determines the planting behavior according to the execution probability of the strategy value in the candidate action set; Based on the planting behavior, a planting instruction sequence corresponding to each region in the tobacco field to be tested is generated.
8. The method according to claim 1, characterized in that, The method further includes: The feedback data corresponding to each time step in the planting instruction sequence is collected; wherein, the feedback data includes at least the actual soil moisture, actual leaf image features, and actual fertilization data; The feedback data is compared with the planting instruction sequence at each time step to obtain the prediction error sequence and response deviation sequence corresponding to each time step; The network parameters in the prediction network are adjusted according to the prediction error sequence, and the execution policy parameters in the corresponding agent are adjusted according to the response deviation sequence.
9. A detection device for tobacco field planting, characterized in that, include: The data acquisition module is used to acquire tobacco planting data of the tobacco field to be detected at multiple time steps within a preset time period; wherein, the tobacco planting data includes at least tobacco field soil moisture, tobacco leaf feature images and fertilization record data; The prediction sequence determination module is used to input the tobacco field planting data into the prediction network, and to determine the potential state sequence and potential prediction sequence corresponding to the tobacco field planting data based on the feature encoding unit, gated recurrent unit and potential prediction unit in the prediction network; wherein, the potential state sequence is used to characterize the temporal dynamic evolution characteristics of the tobacco field to be detected during the planting process, and the potential prediction sequence is used to characterize the temporal evolution trend of the potential dynamic adjustment of the tobacco field to be detected during the planting process; The event feature sequence determination module is used to obtain a labeled sequence by reconstructing the state and aligning the space of the potential prediction sequence, identifying abrupt change points by first-order difference, and redetermining the time window boundary of the potential state sequence based on the labeled sequence to obtain the event feature sequence. The state indicator set determination module is used to divide the event feature sequence into multiple region sequences according to the tobacco field area, and extract the target state difference sequence through a sliding window, so as to determine the state indicator set based on the target state difference sequence. The planting instruction sequence determination module is used to input the set of state indicators into the multi-agent system to output the planting instruction sequence; The planting instruction sequence includes at least irrigation parameter instructions, fertilization intensity instructions, and pest and disease instructions.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the detection method for tobacco field planting as described in any one of claims 1-8.