Crop water monitoring method, system, device, and medium

CN122983131APending Publication Date: 2026-10-27BEIJING INFORMATION SCI & TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610802646.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0008]本发明主要目的是克服现有电阻抗成像算法在动态监测例如作物水分监测中存在的泛化能力差、噪声敏感以及成像分辨率低的问题,提供一种农作物水分监测方法、系统、设备及介质,通过差分成像逻辑,直接将边界差分电压作为条件,引导扩散模型在逆向去噪过程中学习电导率图像的先验分布,从而在滤除测量噪声的同时,高精度重建作物内部水分电导率的二维空间分布

Benefits of technology

[0019]本方案的优势效果是:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122983131A_ABST
    Figure CN122983131A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electric signal measurement, and provides a crop moisture monitoring method, system, device and medium, the method comprising the following steps: S1: obtaining the differential voltage of a sample crop; S2: constructing a training target; S3: converting the differential voltage into a voltage condition feature matrix, splicing the training target and the voltage condition feature matrix to obtain a double-channel tensor; S4: inputting the double-channel tensor into a denoising network, updating network parameters until the network model converges; S5: collecting the differential voltage of an actual crop and inputting it into the denoising network to output the internal moisture distribution of the crop. According to the present application, the boundary differential voltage is directly used as a condition through differential imaging logic, the diffusion model is guided to learn the prior distribution of the conductivity image in the reverse denoising process, and therefore the measurement noise is filtered out while the two-dimensional spatial distribution of the internal moisture conductivity of the crop is reconstructed with high precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electrical signal measurement technology, and in particular to a method, system, device and medium for monitoring crop moisture. Background Technology

[0002] Electrical Impedance Tomography (EIT) is a tomographic non-destructive testing technique that uses a weak, safe excitation current applied to the boundary of a target and measures the boundary voltage distribution to invert and calculate the spatial distribution of conductivity within the target. In modern agriculture, the water content and ion concentration within crop tissues (such as corn ears, crop stalks, and tubers) directly determine the spatial distribution characteristics of their dielectric conductivity. Due to its significant advantages such as non-invasiveness, lack of radiation, low cost, and high temporal resolution, EIT's introduction into agriculture, using electrical impedance tomography to reflect the water distribution within crops, has extremely high application value for crop growth assessment, precision irrigation guidance, drought-resistant breeding selection, and agricultural product storage and processing.

[0003] In the physical model of an EIT system, the electromagnetic field distribution inside the crop typically satisfies the Laplace equation with specific boundary conditions. When a current of a specific mode is injected at the boundary, the minute changes in the distribution of conductivity inside the target are nonlinearly mapped to changes in the boundary voltage. Existing EIT agricultural applications typically employ 16-electrode or 32-electrode arrays surrounding the crop to acquire boundary voltages and reconstruct images from them.

[0004] However, crop organs have complex internal structures and three-dimensional geometric morphology, and the EIT inverse problem itself is highly nonlinear and severely ill-conditioned, leading to significant technical bottlenecks for existing EIT algorithms in agricultural water monitoring. 1. Low image reconstruction resolution and high edge artifacts: Traditional calculation methods typically simplify the target to a two-dimensional plane. However, actual crops are three-dimensional, and the injected current flows three-dimensionally. Using planar algorithms to force calculations of three-dimensional physical phenomena leads to inaccurate results. Therefore, images reconstructed using traditional methods often have very low resolution, extremely blurry edges, and frequently contain non-existent color patches, making it impossible to accurately distinguish the boundaries of moisture levels.

[0005] 2. Poor Generalization and Anti-interference Ability of Deep Learning Networks: In recent years, deep learning has been introduced into the field of Electronic Information Processing (EIT), attempting to enable computers to directly learn the conversion from voltage to image. However, in real agricultural measurement environments, the roughness of crop surfaces can lead to unstable electrode contact, and changes in temperature and humidity can also generate interference signals. Ordinary neural networks often only recognize data seen during training and lack an understanding of physical laws. Once they encounter these environmental disturbances (noise) in actual measurements, their computation will completely collapse, outputting meaningless erroneous images. In other words, the model's generalization and anti-interference ability are extremely fragile.

[0006] Therefore, there is a need to provide a method, system, device and medium for monitoring crop moisture. By using differential imaging logic, the boundary differential voltage can be directly used as a condition to guide the diffusion model to learn the prior distribution of conductivity image during the reverse denoising process. This allows for the high-precision reconstruction of the two-dimensional spatial distribution of moisture conductivity inside the crop while filtering out measurement noise.

[0007] The information disclosed in the background section is only intended to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0008] The main objective of this invention is to overcome the problems of poor generalization ability, noise sensitivity, and low imaging resolution of existing electrical impedance imaging algorithms in dynamic monitoring, such as crop moisture monitoring. This invention provides a method, system, device, and medium for monitoring crop moisture. By using differential imaging logic, the boundary differential voltage is directly used as a condition to guide the diffusion model to learn the prior distribution of conductivity image during the reverse denoising process. This allows for the high-precision reconstruction of the two-dimensional spatial distribution of moisture conductivity inside the crop while filtering out measurement noise.

[0009] To achieve the above objectives, the first aspect of the present invention provides a method for monitoring crop moisture, comprising the following steps: S1: Obtain the differential voltage of the sample crops; S2: Construct training objectives; S3: Convert the differential voltage into a voltage condition feature matrix, and concatenate the training target and the voltage condition feature matrix to obtain a two-channel tensor; S4: Input the dual-channel tensor into the denoising network and update the network parameters until the network model converges; S5: Collect the differential voltage of actual crops and input it into the denoising network to output the internal moisture distribution of the crops.

[0010] According to an exemplary embodiment of the present invention, in step S1, obtaining the differential voltage of the sample crop includes: The boundary voltage of crops under the reference state and the boundary voltage under the test state are collected using the adjacent excitation-adjacent measurement mode; the change is calculated by subtraction to obtain a one-dimensional differential voltage data sequence.

[0011] According to an exemplary embodiment of the present invention, in step S2, the construction of the training objective includes: constructing a Kalkov chain and generating Gaussian white noise, wherein the Gaussian white noise is Gaussian white noise with a specified spatial resolution.

[0012] According to an exemplary embodiment of the present invention, in step S3, converting the differential voltage into a voltage condition feature matrix includes: Reconstruct the one-dimensional differential voltage data sequence into a two-dimensional impedance mapping; The two-dimensional impedance mapping is upsampled to a specified spatial resolution to obtain the voltage condition characteristic matrix.

[0013] According to an exemplary embodiment of the present invention, in step S4, the denoising network adopts a Transformer-based U-Net structure that includes an encoder and a decoder, which includes multiple multi-scale feature extraction layers.

[0014] According to an exemplary embodiment of the present invention, in step S4, updating the network parameters until the network model converges includes: By calculating the absolute error between the denoised image predicted by the network and the real image, the network parameters are updated using the Adam optimizer until the network model converges.

[0015] According to an exemplary embodiment of the present invention, the absolute value error is calculated using the following formula: ; Among them, L simple (θ): Simplified target loss function, used to evaluate the error between the network's predicted image and the real image; θ: The learnable parameter set of the denoising network, which consists of the network's weights and biases; σ0: The true physical label, i.e., the two-dimensional water content image; σ θ (σ) t U,t): the output predicted value of the denoising network, where σ t It is the noisy image at the current time step t, and U is the voltage condition feature matrix.

[0016] As a second aspect of the present invention, the present invention provides a crop moisture monitoring system, comprising: a sample acquisition module, a training target construction module, a splicing module, a training module, and a moisture reconstruction module; The sample acquisition module is used to acquire the differential voltage of the sample crops; The training objective construction module is used to construct training objectives; The splicing module is connected to the sample acquisition module and the training target construction module, and is used to convert the differential voltage into a voltage condition feature matrix, and splice the training target and the voltage condition feature matrix to obtain a dual-channel tensor. The training module is connected to the splicing module and is used to input dual-channel tensors into the denoising network and update the network parameters until the network model converges. The moisture reconstruction module is connected to the training module and is used to collect the differential voltage of actual crops and input it into the denoising network to output the internal moisture distribution of the crops.

[0017] As a third aspect of the present invention, the present invention provides an electronic device comprising: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the crop moisture monitoring method.

[0018] As a fourth aspect of the present invention, the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the crop moisture monitoring method described above.

[0019] The advantages of this solution are: This scheme utilizes differential imaging logic, directly using the boundary differential voltage as a condition to guide the diffusion model in learning the prior distribution of conductivity images during the inverse denoising process. This allows for high-precision reconstruction of the two-dimensional spatial distribution of water conductivity within crops while filtering out measurement noise. Compared to existing crop detection technologies, this scheme offers the following significant technical advantages: 1. Restores the true physical form, without distortion or deformation of the image position.

[0020] Previous algorithms treated three-dimensional crops as a plane for calculation, leading to interference from the electric current in the three-dimensional space, resulting in severely distorted and misaligned images. This invention, during preprocessing, precisely projects and compresses the electric field data from the three-dimensional simulation onto a two-dimensional plane. This solves the image distortion problem during calculation, making the final reconstructed water distribution location more accurate and realistic.

[0021] 2. It has extremely strong anti-interference capabilities and can work stably in complex agricultural sites.

[0022] In real-world agricultural measurement environments, uneven crop surfaces leading to poor electrode contact and fluctuations in temperature and humidity within greenhouses can generate severe interference signals, making ordinary artificial intelligence algorithms extremely prone to crashing and outputting garbled images. This invention cleverly solves this problem: the differential voltage used in the hardware data directly cancels out most environmental interference at its physical source; and a diffusion algorithm is used to gradually strip away interference noise under the constraint of the differential voltage. Therefore, even in harsh field environments, this system can still stably output accurate images.

[0023] 3. The image resolution is extremely high, and the boundaries of moisture changes are clearly visible.

[0024] Traditional algorithms often produce moisture maps with poor resolution, limited effective boundary information, and difficulty in clearly distinguishing areas of high and low moisture content. This invention introduces a special local attention mechanism (Swin-Transformer) into its denoising network, specifically targeting the areas with the greatest moisture differences for focused computation. This results in a final 128×128 resolution heatmap that is not only free of blurry artifacts but also exhibits extremely clear boundaries between high and low moisture levels, accurately discerning even subtle differences in moisture content within crops.

[0025] 4. Fast imaging speed, fully meeting the needs of real-time non-destructive monitoring.

[0026] Although a deep diffusion network is used, this solution abandons the traditional slow calculation process of thousands of steps in the actual field application stage and introduces an accelerated sampling algorithm. Guided by real-time voltage measurement, the computer only needs to perform 5 to 10 skip calculations to quickly present the results. This allows the system not only to perform static detection, but also to be directly installed on production lines or processing workshops for real-time dynamic monitoring of the dehydration process of crops. Attached Figure Description

[0027] The above and other objects, features, and advantages of this application will become more apparent from the detailed description of exemplary embodiments with reference to the accompanying drawings. The drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0028] Figure 1 The diagram illustrates the structure of a crop moisture monitoring system.

[0029] Figure 2 The diagram illustrates the steps of a method for monitoring crop moisture.

[0030] Figure 3 A schematic diagram of the electronic device is shown.

[0031] Figure 4 A schematic diagram of the structure of a computer medium is shown.

[0032] Figure 5 The schematic diagram illustrates the structure of the denoising network. Detailed Implementation

[0033] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this application will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0034] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0037] It should be understood that although the terms first, second, third, etc., may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another. Therefore, the first component discussed below may be referred to as the second component without departing from the teachings of this application. As used herein, the term "and / or" includes all combinations of any one and more of the associated listed items.

[0038] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of exemplary embodiments, and the modules or processes in the drawings are not necessarily essential for implementing this application, and therefore cannot be used to limit the scope of protection of this application.

[0039] To address the issues of poor generalization ability, noise sensitivity, and low imaging resolution in existing electrical impedance imaging algorithms for dynamic monitoring such as crop moisture monitoring, this solution uses differential imaging logic to directly use the boundary differential voltage as a condition to guide the diffusion model to learn the prior distribution of conductivity images during the reverse denoising process. This allows for the high-precision reconstruction of the two-dimensional spatial distribution of water conductivity within the crop while filtering out measurement noise.

[0040] The core processing flow of this solution is a closed-loop system tightly integrated with data preprocessing, model training, and real-time inference. First, to eliminate reconstruction distortion caused by the three-dimensional physical electric field, in the preliminary data preparation stage, simulated grid data of crops is extracted and dimensionality-reduced to a 128×128 pixel 2D image as the true label. Simultaneously, benchmark and measured differential voltage signals at the measurement boundary are acquired. In the model training stage, Gaussian noise is progressively injected into the true 2D moisture image label over time to construct a diffusion-generated target. Simultaneously, the one-dimensional differential voltage array is reshaped and interpolated to a 2D feature matrix with the exact same size as the image. Subsequently, these two data sets are stitched together along the channel dimension and then fed into a denoising network. This network learns how to extract and reconstruct the structural image from pure random noise under the guidance of physical differential voltage conditions. Finally, in the practical application stage, once real-time differential voltage data is acquired, a high-resolution true moisture distribution map of the target's interior can be reconstructed.

[0041] According to a first specific embodiment of the present invention, the present invention provides a crop moisture monitoring system, such as... Figure 1 As shown, it includes: a sample acquisition module, a training target construction module, a splicing module, a training module, and a water content reconstruction module.

[0042] The sample acquisition module is used to acquire the differential voltage of sample crops.

[0043] The training objective building module is used to build training objectives.

[0044] The splicing module is connected to the sample acquisition module and the training target construction module. It is used to convert the differential voltage into a voltage condition feature matrix, and splice the training target and the voltage condition feature matrix to obtain a dual-channel tensor.

[0045] The training module is connected to the splicing module and is used to input dual-channel tensors into the denoising network to update the network parameters until the network model converges.

[0046] The moisture reconstruction module is connected to the training module and is used to collect the differential voltage of actual crops and input it into the denoising network to output the internal moisture distribution of the crops.

[0047] According to a second embodiment of the present invention, the present invention provides a method for monitoring crop moisture, employing the crop moisture monitoring system of the first embodiment, such as... Figure 2 As shown, it includes the following steps: S1: Obtain the differential voltage of the sample crop.

[0048] To eliminate edge distortion caused by the true three-dimensional physical electric field of crops and to build a data foundation resistant to common-mode interference, data acquisition and preprocessing were first performed. The differential voltage of the sample crops was obtained, including: The boundary voltage U of the crop under reference conditions was acquired using an adjacent excitation-adjacent measurement mode. (0) and the boundary voltage U under the test state (t) By calculating the difference, a one-dimensional differential voltage data sequence is obtained: δU=U (t) -U (0) ; Where δU represents the differential voltage of the analyte, U (t) U represents the boundary voltage under the measured state. (0) This represents the boundary voltage under the reference condition.

[0049] This sequence contains 208 valid measured voltage values. Differential logic is used to significantly eliminate static contact impedance and system background noise at the physical level.

[0050] The adjacent excitation-adjacent measurement mode employed is as follows: Excitation method: Two adjacent electrodes are selected as excitation electrodes each time, current is injected into one of them, and the other serves as the current outlet. Measurement method: The boundary potential difference is measured sequentially between the remaining adjacent electrode pairs excluding the two excitation electrodes. N is the number of electrodes, and the amount of measurement data = N(N-3), resulting in 16*13=208 data points.

[0051] Differential voltage: Extracts the difference between the boundary measurement voltage of the target under reference conditions (such as standard moisture content) and the conditions to be measured, aiming to cancel static contact impedance and common-mode interference in the field from the physical signal source.

[0052] S2: Construct training objectives.

[0053] During the training phase, it is necessary to construct Markov chains so that the model can understand the mathematical process of high-resolution images degrading into noise.

[0054] The training objectives include: constructing a Kalkov chain and generating Gaussian white noise with a specified spatial resolution.

[0055] S21: Set the total diffusion time step to T (set T=100). At any time step t∈1,2,...,T, in the actual 128×128 two-dimensional water content image σ0, according to the preset variance sequence β... t Gaussian white noise is injected gradually. The state transition probability distribution of a single step strictly follows: ; Where, β t The hyperparameter sequence is used to control the noise variance. I represents the identity matrix, σt represents the conductivity image after adding noise at step t, N represents the Gaussian distribution, and q represents the state transition probability distribution. Standard Gaussian noise. Preset variance sequence β t It is a uniformly growing variance sequence.

[0056] The randomness of this state transition probability distribution comes from Gaussian white noise, which is essentially adding Gaussian noise to the state at the previous time step.

[0057] Construction of a realistic 128×128 2D moisture image σ0 (ground truth): A 3D simulation model of a crop containing 16 electrodes was established using the finite element method. Conductivity data was extracted from the 3D mesh, projected along the principal gradient direction of the electric field, and precisely resampled and mapped into a high-resolution 128×128 pixel 2D matrix. This matrix serves as the ground truth for model training and is denoted as the initial conductivity image σ0.

[0058] S22: Utilizing the reparameterization property of the Gaussian distribution, the noisy image σ0 can be directly calculated from the initial clean 2D water content image σ0 to the noisy image σ at any time step t. t Skip the tedious intermediate iterations: ; Among them, parameters As t approaches T, σ t It will completely degenerate into random pure Gaussian white noise. Since the resolution of the water content 2D image σ0 is 128×128, the calculated noisy image σ t Its resolution is also 128×128.

[0059] S3: Convert the differential voltage into a voltage condition feature matrix, and concatenate the training target and the voltage condition feature matrix to obtain a dual-channel tensor.

[0060] To guide the network in solving the EIT inverse problem, the one-dimensional differential voltage signal must be transformed into two-dimensional spatial conditional characteristics. The inverse problem is: given an excitation current applied to the boundary and the boundary response voltage measured, to inversely deduce the conductivity distribution within the measured field.

[0061] S31: Reconstructing the Electrical Immunity Map (EIM): The one-dimensional differential voltage data sequence is reconstructed into a two-dimensional electrical impedance map. Specifically, the 208-dimensional differential voltage array obtained in step S1 is reconstructed into an M×M two-dimensional matrix according to the spatial geometric measurement relationship of the M electrodes. In this matrix, the invalid voltage values ​​corresponding to the excitation electrodes are set to zero. M represents the number of electrodes, which can be 16 or 32.

[0062] The electrical signals of the plant are collected by excitation electrodes. A circular ring is set up with 1-16 electrodes evenly distributed in a counterclockwise order. The excitation current is from e1-e2, then e2-e3... all the way to e15-e16. When collecting voltage, because the adjacent excitation adjacent measurement mode is set, the excitation current pair and the two current pairs adjacent to the excitation current pair are not collected when measuring voltage. The voltage of the excitation electrode that is not collected is set to zero.

[0063] This method yields the most independent measurement data, provides more complete information, and is more sensitive to boundary signals. Therefore, the resulting measurement data is 208 bits.

[0064] Electrical Impedance Map (EIM): The one-dimensional differential voltage array acquired by the sensor is reconstructed and interpolated and upsampled into a two-dimensional feature matrix with the same spatial resolution (128×128) as the image to be generated, according to the spatial geometric topology of the array electrodes.

[0065] S32: Aligning Spatial Resolution: By using nearest-neighbor interpolation or bilinear interpolation algorithms, the two-dimensional impedance map is upsampled to the specified spatial resolution to obtain the voltage condition feature matrix U. up Specify a spatial resolution of 128×128.

[0066] The reason for choosing a spatial resolution of 128×128 is twofold. First, this resolution is just right; too low a resolution would result in a blurry image, while too high a resolution would amplify noise and limit computing power. Second, the algorithm is based on the UET network, which requires the resolution to be a power of 2 during continuous downsampling.

[0067] S33: Channel Concatenation: Concatenate the training target and voltage condition feature matrix to obtain a two-channel tensor.

[0068] Before inputting the noise image σ at the current time step into the denoising network, t (Channel number is 1) and voltage condition characteristic matrix U up (With 1 channel) The layers are tightly stitched together along the channel dimension to synthesize a two-channel input tensor X=[σ] with a size of 128×128×2. t U up ].

[0069] S4: Input the dual-channel tensor into the denoising network and update the network parameters until the network model converges.

[0070] The synthesized dual-channel tensor is fed into the denoising network, driving the network to learn the inverse mapping that recovers the physical structure from the noise.

[0071] S41: Backbone Architecture and Feature Extraction: such as Figure 5 As shown, the denoising network adopts a Transformer-based U-Net structure that includes an encoder and a decoder, containing four multi-scale feature layers of 128×128, 64×64, 32×32, and 16×16. The feature extraction layer deeply fuses the Swin-Transformer module (which captures local small conductivity jumps through a window self-attention mechanism) and the global Transformer module (which captures long-range topological dependencies across the entire field).

[0072] like Figure 5 As shown, the four multi-scale feature layers refer to the resolution of the data at different depths in the network.

[0073] The feature extraction layer is a process in which the encoder downsamples the image from 128×128 to 16×16. In the shallow layer (large size), geometric details are extracted, while in the deep layer (small size), conductivity distribution trend features are extracted.

[0074] The denoising network is a transformer-based U-net network, mainly composed of an encoder, a decoder, and skip connections.

[0075] like Figure 5As shown, the entire network consists of six modules: Transformer Block (global self-attention module), Swin-Transformer Block (local window attention module), Concatenation & Linear (feature concatenation and fusion), Patch Merging (patch merging and downsampling), Upsampling & Linear (upsampling and linear transformation), and Patch Embedding or Unembedding (embedding and unembedding).

[0076] The Transformer Block (global self-attention module) and Swim-Transformer (local window attention module) are deeply integrated to perform global correlation calculations in the feature extraction layer during the process of deep size compression. Their function is to enable a deep mapping between boundary voltage perturbations and the conductivity of each spatial node inside.

[0077] The Swin-Transformer Block (Local Window Attention Module) segments the image and performs computations within a window. Its purpose is to address the high computational cost associated with using a global transformer, saving memory and refining the processing of local regions.

[0078] Concatenation & Linear (feature splicing and fusion) uses skip connections to concatenate and splice features from the decoder and encoder at the same scale channel before linear fusion. Purpose: Since multiple downsampling operations can easily lose the spatial coordinate information of the initial image, this module can fuse deep and shallow features, preventing spatial drift.

[0079] Patch merging (or patch downsampling) halves the spatial resolution of feature maps by merging adjacent patches, while simultaneously increasing feature depth to construct multi-scale feature layers. Its purpose is to shift the network's focus from shallow, detailed features to deeper, more complex water gradient trends. It also more completely preserves voltage field topology information and reduces computational cost through spatial dimensionality reduction.

[0080] Upsampling & Linear Transformation at the decoder end multiplies the spatial resolution of the feature map and maps the feature dimensions through a linear layer. Its function is to restore the image resolution as the inverse process of image reconstruction, ensuring smooth alignment of features during the reconstruction process.

[0081] In Patch Embedding or Unembedding, Embedding splits the 2D pixel matrix of the input layer into small patches and maps them to high-dimensional feature vectors that can be processed by the Transformer. Unembedding works similarly in the reverse direction. Function: converting 2D images into sequences that the Transformer can understand.

[0082] S42: Timestep feature injection: the discrete diffusion timestep t is converted into a continuous time embedding vector through a fully connected layer, which is used as the scaling and offset coefficients of the affine transformation to inject into each attention module of the network.

[0083] Specifically: Converting the discrete diffusion timestep t into a continuous time embedding vector through a fully connected layer: Extract the current timestep parameter t (where 0 < t < T, and T is the total number of denoising steps), use sinusoidal position encoding to forcibly expand the single number t into a one-dimensional high-dimensional vector; then feed the obtained trigonometric function vector into a multi-layer perceptron composed of a fully connected layer and an activation function, and map the time vector to the same semantic space as the image feature by adjusting the weights and offsets, so as to obtain a continuous time embedding vector.

[0084] Using it as the scaling and offset coefficients of the affine transformation to inject into each attention module of the network: a. The time embedding vector is split into a scaling coefficient vector γ and an offset coefficient vector β through a linear projection layer.

[0085] b. Use root mean square normalization to flatten the numerical distribution of the image feature matrix X into a standard feature matrix Xn, and perform affine transformation according to the mathematical formula: Xnew=Xn×γ+β.

[0086] If the discrete timestep t is not processed, the loss function cannot converge, and the network will be invalid.

[0087] S43: Loss function optimization: adopt a simplified variational lower bound, abandon the conventional L2 mean square error, and instead use the L1 norm which is more robust to sensor measurement outliers, to calculate the absolute error between the denoised image predicted by the network and the real image σ0: ; where, L simple(θ): Simplified target loss function, used to evaluate the error between the network's predicted image and the real image; θ: The learnable parameter set of the denoising network, which consists of the network's weights and biases, learned through iterative training using the loss function and optimizer on training samples (voltage condition matrix and conductivity image); σ0: The true physical label, i.e., the two-dimensional water content image; σ θ (σ) t U,t): the output predicted value of the denoising network, where σ t It is the noisy image at the current time step t, and U is the voltage condition feature matrix.

[0088] The Adam optimizer is used to continuously update the network parameters θ until the model converges and implicitly grasps the spatial prior distribution of the target conductivity.

[0089] Implicit is in contrast to the traditional EIT algorithm, which uses a series of mathematical formulas with clear correspondences and is an explicit solution. Since this algorithm is a deep learning framework, it automatically adjusts the network parameters through a loss function to gradually converge.

[0090] In step S4, step S41 describes the entire denoising network structure, step S43 continuously optimizes the parameter θ in step S41 until there is no error and the network converges, and step S42 processes the discrete time parameters by injecting diffusion time information into each attention module of the network through a time embedding mechanism, so that the network can identify the noise level of the input image according to the current diffusion time step and adaptively adjust the denoising strategy, thereby achieving stable conductivity image reconstruction under different diffusion stages.

[0091] The model is trained by step S4. In subsequent practical applications, the water distribution can be obtained directly by inputting the collected real data.

[0092] S5: Collect the differential voltage of actual crops and input it into the denoising network to output the internal moisture distribution of the crops.

[0093] After the model is deployed at the actual agricultural monitoring site, rapid inversion imaging is performed.

[0094] The hardware system captures the current 16 boundary differential voltage data U' of the crop in real time, and also reshapes and upsamples it to 128×128 field condition differential voltage U'. up .

[0095] The system initializes a standard Gaussian white noise image in memory. .

[0096] The DDIM (Denoising Diffusion Implicit Models) accelerated sampling algorithm is adopted under the field differential voltage condition U' up Under the constraint of the non-Markov forward process, the reverse denoising sampling is performed in a skip-like manner, taking advantage of the characteristics of the non-Markov forward process. (For example, the sampling process can be performed a few times and at any interval. If the forward training has a total of 1000 steps, the reverse sampling can be performed in 5 steps, that is, the first step is from 1000 to 800, the second step is from 800 to 500, the third step is from 500 to 200, the fourth step is from 200 to 10, and the fifth step is from 10 to 0.) Finally, within milliseconds, a high-fidelity 128×128 resolution map of the internal moisture distribution of crops with completely noise-free output is generated.

[0097] DDIM Accelerated Sampling Algorithm: A skip-step inverse denoising acceleration algorithm based on non-Markov processes. Guided by real-time voltage characteristics, it can significantly reduce the number of inverse iterations of the diffusion model, compressing high-resolution imaging time to the millisecond level, and achieving non-destructive real-time monitoring.

[0098] This scheme can skip the tedious intermediate iterations, so that the state at time t does not depend on the previous time t-1. It combines the input features to predict the result and calculates the state after the skip step based on the known mathematical formula for adding noise in step S22.

[0099] In summary, this scheme, through differential imaging logic, directly uses the boundary differential voltage as a condition to guide the diffusion model to learn the prior distribution of conductivity images during the inverse denoising process. This allows for the high-precision reconstruction of the two-dimensional spatial distribution of water conductivity within crops while filtering out measurement noise. Compared with existing crop detection technologies, it has the following significant technical advantages: 1. Restores the true physical form, without distortion or deformation of the image position.

[0100] Previous algorithms treated three-dimensional crops as a plane for calculation, leading to interference from the electric current in the three-dimensional space, resulting in severely distorted and misaligned images. This invention, during preprocessing, precisely projects and compresses the electric field data from the three-dimensional simulation onto a two-dimensional plane. This solves the image distortion problem during calculation, making the final reconstructed water distribution location more accurate and realistic.

[0101] 2. It has extremely strong anti-interference capabilities and can work stably in complex agricultural sites.

[0102] In real-world agricultural measurement environments, uneven crop surfaces leading to poor electrode contact and fluctuations in temperature and humidity within greenhouses can generate severe interference signals, making ordinary artificial intelligence algorithms extremely prone to crashing and outputting garbled images. This invention cleverly solves this problem: the differential voltage used in the hardware data directly cancels out most environmental interference at its physical source; and a diffusion algorithm is used to gradually strip away interference noise under the constraint of the differential voltage. Therefore, even in harsh field environments, this system can still stably output accurate images.

[0103] 3. The image resolution is extremely high, and the boundaries of moisture changes are clearly visible.

[0104] Traditional algorithms often produce moisture maps with poor resolution, limited effective boundary information, and difficulty in clearly distinguishing areas of high and low moisture content. This invention introduces a special local attention mechanism (Swin-Transformer) into its denoising network, specifically targeting the areas with the greatest moisture differences for focused computation. This results in a final 128×128 resolution heatmap that is not only free of blurry artifacts but also exhibits extremely clear boundaries between high and low moisture levels, accurately discerning even subtle differences in moisture content within crops.

[0105] 4. Fast imaging speed, fully meeting the needs of real-time non-destructive monitoring.

[0106] Although a deep diffusion network is used, this solution abandons the traditional slow calculation process of thousands of steps in the actual field application stage and introduces an accelerated sampling algorithm. Guided by real-time voltage measurement, the computer only needs to perform 5 to 10 skip calculations to quickly present the results. This allows the system not only to perform static detection, but also to be directly installed on production lines or processing workshops for real-time dynamic monitoring of the dehydration process of crops.

[0107] According to a third specific embodiment of the present invention, the present invention provides an electronic device, such as... Figure 3 As shown, Figure 3 This is a block diagram illustrating an electronic device according to an exemplary embodiment.

[0108] The following reference Figure 3 To describe an electronic device 300 according to this embodiment of the present application. Figure 3 The electronic device 300 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0109] like Figure 3As shown, the electronic device 300 is presented in the form of a general-purpose computing device. The components of the electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one storage unit 320, a bus 330 connecting different system components (including storage unit 320 and processing unit 310), a display unit 340, etc.

[0110] The storage unit stores program code that can be executed by the processing unit 310, causing the processing unit 310 to perform the steps described in this specification according to various exemplary embodiments of this application. For example, the processing unit 310 can perform the steps shown in the second specific embodiment.

[0111] The storage unit 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache storage unit 3202, and may further include a read-only memory unit (ROM) 3203.

[0112] The storage unit 320 may also include a program / utility 3204 having a set (at least one) program module 3205, such program module 3205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0113] Bus 330 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0114] Electronic device 300 can also communicate with one or more external devices 300' (e.g., keyboard, pointing device, Bluetooth device, etc.), enabling users to communicate with devices that interact with electronic device 300, and / or any device (e.g., router, modem, etc.) that allows electronic device 300 to communicate with one or more other computing devices. This communication can be performed via input / output (I / O) interface 350. Furthermore, electronic device 300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 360. Network adapter 360 can communicate with other modules of electronic device 300 via bus 330. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0115] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware.

[0116] Therefore, according to a fourth specific embodiment of the present invention, the present invention provides a computer-readable medium. For example... Figure 4 As shown, the technical solution according to the embodiments of the present invention can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.) or on a network, and includes several instructions to cause a computing device (such as a personal computer, server, or network device, etc.) to execute the above-described method according to the embodiments of the present invention.

[0117] The software product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0118] The computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0119] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0120] The aforementioned computer-readable medium carries one or more programs, which, when executed by a device, cause the computer-readable medium to perform the functions of the second specific embodiment.

[0121] Those skilled in the art will understand that the above modules can be distributed in the device as described in the embodiments, or they can be modified accordingly and placed in one or more devices that are unique to this embodiment. The modules in the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0122] Through the description of the above embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions of the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of the present invention.

[0123] Exemplary embodiments of the present invention have been specifically shown and described above. It should be understood that the present invention is not limited to the detailed structures, arrangements, or implementations described herein; rather, the present invention is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.

Claims

1. A method for monitoring crop moisture, characterized in that, Includes the following steps: S1: Obtain the differential voltage of the sample crops; S2: Construct training objectives; S3: Convert the differential voltage into a voltage condition feature matrix, and concatenate the training target and the voltage condition feature matrix to obtain a two-channel tensor; S4: Input the dual-channel tensor into the noisy network and update the network parameters until the network model converges; S5: Collect the differential voltage of actual crops and input it into the denoising network to output the internal moisture distribution of the crops.

2. The method for monitoring crop moisture according to claim 1, characterized in that, In step S1, obtaining the differential voltage of the sample crop includes: The boundary voltage of crops under the reference state and the boundary voltage under the test state are collected using the adjacent excitation-adjacent measurement mode; the change is calculated by subtraction to obtain a one-dimensional differential voltage data sequence.

3. The method for monitoring crop moisture according to claim 1, characterized in that, In step S2, the construction of the training objective includes: constructing a Markov chain and generating Gaussian white noise, wherein the Gaussian white noise is Gaussian white noise with a specified spatial resolution.

4. The method for monitoring crop moisture according to claim 2, characterized in that, In step S3, converting the differential voltage into a voltage condition feature matrix includes: Reconstruct the one-dimensional differential voltage data sequence into a two-dimensional impedance mapping; The two-dimensional impedance mapping is upsampled to a specified spatial resolution to obtain the voltage condition feature matrix.

5. The method for monitoring crop moisture according to claim 1, characterized in that, In step S4, the denoising network adopts a Transformer-based U-Net structure that includes an encoder and a decoder, which contains multiple multi-scale feature extraction layers.

6. The method for monitoring crop moisture according to claim 1, characterized in that, In step S4, updating the network parameters until the network model converges includes: By calculating the absolute error between the denoised image predicted by the network and the real image, the network parameters are updated using the Adam optimizer until the network model converges.

7. The method for monitoring crop moisture according to claim 5, characterized in that, The absolute value error is calculated using the following formula: ; Among them, L simple (θ): Simplified target loss function; θ: Learnable parameter set of the denoising network; σ0: True physical label, i.e., 2D water content image; σ θ (σ) t U,t): the output predicted value of the denoising network, where σ t It is the noisy image at the current time step t, and U is the voltage condition feature matrix.

8. A crop moisture monitoring system, characterized in that, include: Sample acquisition module, training target construction module, stitching module, training module, and water content reconstruction module; The sample acquisition module is used to acquire the differential voltage of the sample crops; The training objective construction module is used to construct training objectives; The splicing module is connected to the sample acquisition module and the training target construction module, and is used to convert the differential voltage into a voltage condition feature matrix, and splice the training target and the voltage condition feature matrix to obtain a dual-channel tensor. The training module is connected to the splicing module and is used to input dual-channel tensors into the denoising network and update the network parameters until the network model converges. The moisture reconstruction module is connected to the training module and is used to collect the differential voltage of actual crops and input it into the denoising network to output the internal moisture distribution of the crops.

9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the crop moisture monitoring method as described in any one of claims 1-7.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the crop moisture monitoring method as described in any one of claims 1-7.