Methods for constructing moisture content detection models, methods for detecting moisture content, and moisture content detection systems.

By constructing a machine learning model based on a microwave resonant cavity sensor and combining multiple operating frequencies and physicochemical properties, the problem of low accuracy in detecting the moisture content of complex mixtures in existing technologies has been solved, achieving higher detection accuracy and adaptability.

CN121281687BActive Publication Date: 2026-05-26TIANDA NAXON SENSING TECHNOLOGY (TIANJIN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANDA NAXON SENSING TECHNOLOGY (TIANJIN) CO LTD
Filing Date
2025-12-10
Publication Date
2026-05-26

Smart Images

  • Figure CN121281687B_ABST
    Figure CN121281687B_ABST
Patent Text Reader

Abstract

This application provides a method for constructing a moisture content detection model, a moisture content detection method, and a moisture content detection system. The method may include: determining multiple operating frequencies of a microwave resonant cavity sensor based on the moisture content measurement range; determining an experimental dataset based on the multiple operating frequencies; wherein the experimental dataset includes multiple experimental data, including microwave amplitude attenuation data measured by the microwave resonant cavity sensor for the experimental material and the moisture content corresponding to the microwave amplitude attenuation data; using the microwave amplitude attenuation data from the experimental data as input to a pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label to train the pre-built model to obtain a target moisture content detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of material content measurement technology, and more specifically, to a method for constructing a moisture content detection model, a moisture content detection method, and a moisture content detection system. Background Technology

[0002] Currently, methods such as distillation, centrifugation, and capacitance are commonly used to detect the moisture content of mixtures containing multiple substances.

[0003] Distillation involves heating the mixture to evaporate water, then condensing and collecting the water for measurement. Its drawbacks include cumbersome operation, long processing time, and potential errors due to the volatilization or decomposition of other components, especially for volatile or thermally unstable substances. Centrifugation uses centrifugal force to separate water from other components in a mixture, then determines the water content by measuring the volume or weight of the water. This method is highly dependent on the fluid state; for heavily emulsified mixtures, the separation effect is poor, resulting in low measurement accuracy. Capacitance methods measure water content based on the relationship between the dielectric constant of the mixture and its water content. Its drawback is susceptibility to interference from other polar substances in the mixture; measurement accuracy is affected when the sample composition is complex. Microwave methods are a highly efficient, non-contact, real-time detection technology with broad application prospects. Because microwaves experience different losses when propagating in different media, this can be used to predict phase content.

[0004] Currently, the detection of moisture content in mixtures containing multiple substances has been achieved by constructing measurement models and establishing models through fitting steps. However, for some complex mixtures, such as those containing multiple different substances and different forms, the accuracy of the moisture content prediction model determined by the fitting method is relatively low. Summary of the Invention

[0005] The purpose of this application is to provide a method for constructing a moisture content detection model, a moisture content detection method, and a moisture content detection system, which can improve the accuracy of moisture content prediction.

[0006] In a first aspect, the present invention provides a method for constructing a moisture content detection model, comprising: determining multiple operating frequencies of a microwave resonant cavity sensor based on the moisture content measurement range; determining an experimental dataset based on the multiple operating frequencies; wherein the experimental dataset includes multiple experimental data, the experimental data including microwave amplitude attenuation data measured by the microwave resonant cavity sensor for the experimental material and the moisture content corresponding to the microwave amplitude attenuation data; using the microwave amplitude attenuation data in the experimental data as input to a pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label to train the pre-built model to obtain a target moisture content detection model.

[0007] In the above implementation, by using machine learning to train the moisture content detection model, the resulting model can better adapt to various changing scenarios, improving the accuracy of moisture content detection. Furthermore, based on the actual required moisture content measurement range, multiple operating frequencies of the microwave resonant cavity sensor can be determined. This selection allows data obtained at specific operating frequencies to better meet training requirements, improving training effectiveness.

[0008] In an optional implementation, determining multiple operating frequencies of the microwave resonant cavity sensor based on the water content measurement range includes: detecting experimental materials with different water contents and different mineralizations based on the microwave resonant cavity sensor to obtain microwave amplitude attenuation curves of the experimental materials under different water contents and different mineralizations; and obtaining multiple operating frequencies of the microwave resonant cavity sensor based on the microwave amplitude attenuation curves under different water contents and different mineralizations.

[0009] In the above implementation method, the microwave amplitude attenuation curves under different moisture contents and mineralization are combined to screen multiple working frequencies for learning. This allows the trained model to better adapt to the moisture content detection of the test material with different moisture contents and mineralization, and improves the detection of moisture content of materials in more complex backgrounds.

[0010] In an optional implementation, obtaining multiple operating frequencies of the microwave resonant cavity sensor based on microwave amplitude attenuation curves under different moisture contents and different mineralization degrees includes: determining the peak coverage range, rising range, and falling range of the microwave amplitude based on each microwave amplitude attenuation curve; wherein, the peak coverage range represents the range in which the peak value of each microwave amplitude attenuation curve is located, the rising range represents the range in which all microwave amplitude attenuation curves are rising, and the falling range represents the range in which all microwave amplitude attenuation curves are falling; and obtaining multiple operating frequencies of the microwave resonant cavity sensor based on the peak coverage range, the rising range, and the falling range.

[0011] In the above implementation method, the working frequency is screened based on multiple different intervals such as peak coverage interval, rising interval, and falling interval, which can make the experimental data coverage wider and improve the ability of the trained target moisture content detection model to adapt to complex environments and complex substances.

[0012] In an optional implementation, the experimental data further includes the physicochemical properties of the experimental substance; the microwave amplitude attenuation data and the physicochemical properties in the experimental data are used as inputs to a pre-built model, and the moisture content corresponding to the microwave amplitude attenuation data is used as a label to train the pre-built model to obtain a target moisture content detection model.

[0013] In an optional implementation, the pre-built model includes a support vector machine containing a kernel function; the step of using the microwave amplitude attenuation data and the physicochemical properties in the experimental data as inputs to the pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label, to train the pre-built model includes: using the microwave amplitude attenuation data and the physicochemical properties in the experimental data as inputs to the support vector machine, and using the moisture content corresponding to the microwave amplitude attenuation data as a label, to train the support vector machine.

[0014] In an optional implementation, the pre-built model includes a Gaussian process model; the step of using the microwave amplitude attenuation data and the physicochemical properties in the experimental data as inputs to the pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label, to train the pre-built model includes: using the microwave amplitude attenuation data and the physicochemical properties in the experimental data as inputs to the Gaussian process model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label, to train the Gaussian process model.

[0015] In an optional implementation, the pre-built model includes a BP neural network model; the BP neural network includes an input layer, a hidden layer, and an output layer, wherein the number of nodes in the input layer is the same as the number of selected features, wherein the selected features include features corresponding to the operating frequency and features corresponding to the physicochemical properties; the step of using the microwave amplitude attenuation data and the physicochemical properties in the experimental data as inputs to the pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label to train the pre-built model includes: using the microwave amplitude attenuation data and the physicochemical properties in the experimental data as inputs to the BP neural network model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label to train the BP neural network model.

[0016] Secondly, the present invention provides a method for detecting moisture content, comprising: using the microwave resonant cavity sensor to test the microwave amplitude attenuation data of the substance to be tested; inputting the microwave amplitude attenuation data into a target moisture content detection model to obtain the moisture content of the substance to be tested, wherein the target moisture content detection model is a model constructed using the moisture content detection model construction method provided in any of the foregoing embodiments.

[0017] In an optional implementation, before inputting the microwave amplitude attenuation data into the target moisture content detection model to obtain the moisture content of the substance to be tested, the method further includes: obtaining the physicochemical properties of the substance to be tested; the step of inputting the microwave amplitude attenuation data into the target moisture content detection model to obtain the moisture content of the substance to be tested includes: inputting the microwave amplitude attenuation data and the physicochemical properties into the target moisture content detection model to obtain the moisture content of the substance to be tested.

[0018] Thirdly, the present invention provides an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method described in any of the foregoing embodiments.

[0019] Fourthly, the present invention provides a moisture content detection system, comprising: a microwave resonant cavity sensor and an electronic device; the microwave resonant cavity sensor is used to output a microwave signal; the electronic device is used to determine microwave amplitude attenuation data based on the microwave signal, and to perform the steps of the method described in any one of the foregoing embodiments based on the processing of the microwave amplitude attenuation data.

[0020] Fifthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method described in any of the foregoing embodiments.

[0021] In a sixth aspect, the present invention provides a computer program product comprising a computer program that, when executed by a processor, implements the method described in any one of the foregoing embodiments. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A block diagram of the moisture content detection system provided in the embodiments of this application;

[0024] Figure 2 A block diagram illustrating an electronic device provided in an embodiment of this application;

[0025] Figure 3 A flowchart illustrating the method for constructing a moisture content detection model provided in this application embodiment;

[0026] Figure 4 A schematic diagram of the S21 amplitude attenuation characteristic curves of tap water at 55°C and different moisture contents provided in the embodiments of this application;

[0027] Figure 5 A schematic diagram of the amplitude attenuation characteristic curves of microwave resonant cavity S21 at 55°C, mineralization of 10000ppm, and different water contents provided for embodiments of this application.

[0028] Figure 6 A schematic diagram of the amplitude attenuation characteristic curves of microwave resonant cavity S21 at 55°C, mineralization of 50000ppm, and different water contents provided for embodiments of this application.

[0029] Figure 7 A schematic diagram summarizing microwave amplitude attenuation curves under different moisture contents and different mineralizations provided in the embodiments of this application;

[0030] Figure 8 A schematic diagram showing the change of amplitude of microwave resonant cavity S21 with water content at a working frequency of 1470MHz, provided for embodiments of this application.

[0031] Figure 9 A schematic diagram showing the change of amplitude of microwave resonant cavity S21 with water content at a working frequency of 1480MHz for embodiments of this application.

[0032] Figure 10 A schematic diagram showing the change of amplitude of microwave resonant cavity S21 with water content at a working frequency of 1490MHz, provided for embodiments of this application.

[0033] Figure 11 A schematic diagram showing the change of amplitude of microwave resonant cavity S21 with water content at a working frequency of 1500MHz, provided for embodiments of this application.

[0034] Figure 12 A schematic diagram showing the change of amplitude of microwave resonant cavity S21 with water content at a working frequency of 1510MHz, provided for embodiments of this application.

[0035] Figure 13 The microwave resonant cavity sensor frequency sweep curve and the electric field distribution cloud diagram corresponding to the resonant mode of the resonant peak are provided in the embodiments of this application.

[0036] Figure 14 A schematic diagram of the electric field distribution cloud obtained under different resonance modes corresponding to various flow patterns provided in the embodiments of this application;

[0037] Figure 15 A schematic diagram of microwave amplitude attenuation as a function of water content when the resonance modes provided in the embodiments of this application are TM010 and TM110 modes;

[0038] Figure 16 A schematic diagram illustrating the distribution of absolute error obtained using a support vector machine on a training set with a moisture content in the range of 0-3% provided in this embodiment of the application;

[0039] Figure 17 A schematic diagram of the distribution of absolute error obtained using a support vector machine on a validation set with a moisture content in the range of 0-3% provided in this application embodiment;

[0040] Figure 18 A schematic diagram illustrating the distribution of absolute error obtained using Gaussian process regression on a training set with a moisture content in the range of 0-3% provided in this embodiment of the application;

[0041] Figure 19 A schematic diagram showing the distribution of absolute error obtained using Gaussian process regression on a validation set with a moisture content in the range of 0-3% provided in this application embodiment;

[0042] Figure 20 A schematic diagram illustrating the distribution of absolute error obtained using a BP neural network on a training set with a moisture content in the range of 0-3% provided in this application embodiment;

[0043] Figure 21 A schematic diagram showing the distribution of absolute error obtained using a BP neural network on a validation set with a moisture content in the range of 0-3% provided in this application embodiment;

[0044] Figure 22 A flowchart of a moisture content detection method provided in an embodiment of this application. Detailed Implementation

[0045] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0046] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0047] like Figure 1 The diagram shown is a schematic of a moisture content detection system provided in an embodiment of this application. The moisture content detection system may include a microwave resonant cavity sensor 110 and an electronic device 120.

[0048] The microwave resonant cavity sensor 110 may include a receiving cavity 111, a microwave detector 112, and a microwave resonant cavity 113 disposed around the periphery of the receiving cavity 111.

[0049] The accommodating cavity 111 is used to accommodate the analyte; the microwave detector 112 is used to send microwave signals to the microwave resonant cavity 113, and to receive and detect the resonant signals within the microwave resonant cavity 113; wherein, the resonant signals can be used to detect the water content or the flow rate of each phase in the analyte. Figure 1In the example shown, if the test substance is a multiphase flow, it can pass through the receiving cavity 111 along the direction Sp. If the test substance is a solid, the receiving cavity 111 can be sealed, and the test substance can be placed inside the receiving cavity 111.

[0050] Taking the microwave resonant cavity sensor 110 for detecting the water content in petroleum (which can be crude oil, refined oil, or tar) as an example: Specifically, the microwave resonant cavity sensor 110 can be connected to crude oil wellhead production pipes, crude oil transfer station pipelines, inter-plant handover pipelines, pump house crude oil export pipelines, refinery input pipelines, tanker loading and unloading pipelines, refined oil transportation pipelines, or shipping tanker terminal pipelines, and the oil transported in the pipeline flows through the receiving cavity 111. The water content in the oil transported in the corresponding pipeline can then be detected based on the microwave resonant cavity sensor 110. The microwave resonant cavity sensor 110 can also be used for water content detection in the three-phase separation process of crude oil joint stations; tar water content measurement; or detection of ultra-low water content in transformer oil and aviation kerosene fuel. The receiving cavity 111 can be made of a microwave-transparent material, such as polycarbonate, polyvinyl chloride, plexiglass, or ceramic materials. The analyte can include grains, soil, composite materials, fertilizers, or crude oil or its mixture with liquids or gases. The shape and size of the receiving cavity 111 can be adjusted according to the actual application. Taking the measurement of water content in crude oil as an example, the receiving cavity 111 can be a cylindrical cavity with openings on both sides along the axial direction, and the size of the openings is consistent with the size of the crude oil transport pipeline. The microwave detector 112 can include an excitation unit, a transmitting antenna, a receiving antenna, and a receiving unit. The excitation unit is used to output a microwave signal with a certain power and frequency to drive the transmitting antenna. The transmitting antenna is used to receive the microwave signal from the excitation unit and then transmit the microwave signal into the microwave resonant cavity 113 in a certain direction and manner. The receiving antenna is used to receive the microwave signal in the microwave resonant cavity 113. The receiving unit is used to convert the microwave signal received by the receiving antenna into a resonant signal to detect the substance content of the analyte based on the resonant signal. The transmitting antenna and the receiving antenna can be inserted into the microwave resonant cavity 113 and are symmetrically distributed on both sides of the receiving cavity 111.

[0051] The electronic device 120 can obtain the microwave amplitude attenuation signal determined after the microwave signal output by the microwave resonant cavity sensor 110 is attenuated by the microwave resonant cavity 113. This microwave amplitude attenuation signal can reflect the water content within the receiving cavity 111 of the microwave resonant cavity sensor 110. Based on this, the water content of the substance to be measured can be determined.

[0052] In this embodiment of the application, the electronic device 120 performs relevant calculations on the microwave amplitude attenuation signal and can execute the steps of the moisture content detection model construction method or the moisture content detection method.

[0053] like Figure 2 The diagram shown is a block diagram of an electronic device. The electronic device 120 may include a memory 121 and a processor 123. Those skilled in the art will understand that... Figure 2 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device 120. For example, the electronic device 120 may also include components that are more... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown.

[0054] The memory 121 and processor 123 described above are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The processor 123 described above is used to execute executable modules stored in the memory.

[0055] The memory 121 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 121 stores programs, and the processor 123 executes these programs upon receiving execution instructions. The methods executed by the electronic device 120 according to the process definition disclosed in any embodiment of this application can be applied to the processor 123, or implemented by the processor 123.

[0056] The aforementioned processor 123 may be an integrated circuit chip with signal processing capabilities. The processor 123 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a digital signal processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.

[0057] The electronic device 120 in this embodiment can be used to execute various steps in the various methods provided in the embodiments of this application. The following describes in detail the method for constructing a moisture content detection model and the implementation process of the moisture content detection method through several embodiments.

[0058] Please see Figure 3 This is a flowchart of the moisture content detection model construction method provided in this application embodiment. The moisture content detection model construction method provided in this application embodiment can be applied to electronic devices, which then execute the steps in the moisture content detection model construction method. The following will describe... Figure 3 The specific process shown will be explained in detail.

[0059] Step 210: Based on the moisture content measurement range, determine multiple operating frequencies of the microwave resonant cavity sensor.

[0060] For example, if the moisture content measurement range is relatively large, the number of operating frequencies can be relatively large in order to cover more situations; if the moisture content measurement range is relatively small, the trend of the corresponding microwave amplitude attenuation curve is relatively simple, and a relatively small number of operating frequencies can be selected in order to reduce the subsequent calculation workload.

[0061] For example, if the moisture content measurement range is relatively small, such as 0-3% or 90%-100%, then 4-7 fewer operating frequencies can be selected. For example, if the moisture content measurement range is relatively large, such as 0-50% or 80%-100%, then 6-10 more operating frequencies can be selected. For example, if the moisture content measurement range is the full 0-100%, then 10 or more more operating frequencies can be selected.

[0062] Taking a moisture content measurement range of 0-3% and an experimental substance of petroleum mixture as an example, five operating frequencies can be selected: 1470MHz, 1480MHz, 1490MHz, 1500MHz, and 1510MHz. These five operating frequencies can cover various positions on the microwave amplitude attenuation curve, making the experimental data determined based on these five operating frequencies richer, improving the machine learning capabilities, and enabling the obtained model to more accurately identify moisture content.

[0063] Step 220: Determine the experimental dataset based on multiple operating frequencies.

[0064] The experimental dataset includes multiple sets of data, such as microwave amplitude attenuation data measured by a microwave resonant cavity sensor for the experimental material, and the corresponding water content. Depending on the number of training iterations required, different amounts of experimental data can be extracted.

[0065] Considering the varying microwave amplitude attenuation ranges at different operating frequencies, the obtained microwave amplitude attenuation values ​​at each operating frequency can be normalized to avoid instability in gradient updates caused by differences in data scales for different features. In one example, five operating frequencies—1470MHz, 1480MHz, 1490MHz, 1500MHz, and 1510MHz—were selected. Experimental data at these five operating frequencies can then be extracted.

[0066] Normalized microwave amplitude attenuation data can be used as input features, and the corresponding moisture content label can be used as output features.

[0067] The experimental data in the experimental dataset in this application embodiment can be used as training data for training the target moisture content detection model.

[0068] Step 230: Use the microwave amplitude attenuation data in the experimental data as input to the pre-built model, and use the moisture content corresponding to the microwave amplitude attenuation data as a label to train the pre-built model and obtain the target moisture content detection model.

[0069] In this embodiment, the experimental data also includes the physicochemical properties of the experimental substances. For example, these physicochemical properties may include the temperature, salinity, etc., of the experimental substances.

[0070] Step 230 above may include: using microwave amplitude attenuation data and physicochemical properties from the experimental data as input to a pre-built model, using the moisture content corresponding to the microwave amplitude attenuation data as a label, training the pre-built model, and obtaining a target moisture content detection model.

[0071] In this embodiment, the obtained experimental dataset can be divided into a training set and a validation set. The experimental dataset can be randomly shuffled and uniformly divided into N subsets, where the proportion of each moisture content label in each subset remains consistent with the overall original dataset. In one example, the experimental dataset contains 20% experimental data with moisture content in the (0, 1%) range, 40% in the [1%, 2%) range, and 40% in the [2%, 3%] range; therefore, each subset also contains 20% experimental data with moisture content in the (0, 1%) range, 40% in the [1%, 2%) range, and 40% in the [2%, 3%] range. The microwave amplitude attenuation data from the training data in the training set is used as input to the pre-built model, and the moisture content of the training data in the training set is used as the label for training the pre-built model.

[0072] During training, cross-validation can be used, where each subset is used as the validation set and the rest as the training set, repeating this process until each subset has been validated once. N is a positive integer, for example, N can be 5, 10, etc.

[0073] In this embodiment, step 210 may include steps 211 and 212.

[0074] Step 211: Based on the microwave resonant cavity sensor, the experimental materials with different water contents and different mineralization are detected to obtain the microwave amplitude attenuation curves of the experimental materials under different water contents and different mineralization.

[0075] Mineralization can be used to represent the total amount of soluble inorganic minerals contained in water.

[0076] For example, taking a moisture content measurement range of 0-3%, multiple different percentage moisture contents can be selected within this range. The 0-3% range can be divided into multiple equal segments, and the endpoints of each segment can be used as the selected different percentage moisture contents. For instance, the 0-3% range can be divided into six equal segments, and the seven endpoints 0, 0.5%, 1%, 1.5%, 2%, 2.5%, and 3% can be used as the basis for subsequently determining the operating frequency. Of course, this selection is merely an example; in practice, more or fewer different moisture contents can also be selected.

[0077] At least two different mineralization levels can be selected. For example, based on the complexity of the required testing environment, a greater number of mineralization levels can be selected. For instance, tap water, 10,000 ppm, 50,000 ppm, etc., can be selected as the basis for subsequently determining the working frequency.

[0078] For example, different percentages of water content can be combined with different mineralization parameters to obtain experimental materials for determining the working frequency.

[0079] Optionally, to provide richer characterization information, other environmental factors can also be considered. For example, temperature can also be used as a screening criterion. Experimental materials with different water contents, mineralization, and temperatures will be detected using a microwave resonant cavity sensor to obtain microwave amplitude attenuation curves for the experimental materials at different water contents, mineralization, and temperatures.

[0080] Step 212: Based on the microwave amplitude attenuation curves under different water contents and different mineralization, obtain multiple operating frequencies of the microwave resonant cavity sensor.

[0081] In this embodiment, multiple operating frequencies of the microwave resonant cavity sensor can also be determined based on the microwave amplitude attenuation curves of the experimental material at different water contents, different mineralization and different temperatures.

[0082] Taking the above example, based on 21 experimental materials with seven different percentages and three different mineralizations, 21 microwave amplitude attenuation curves were determined, and multiple operating frequencies can be determined based on these 21 microwave amplitude attenuation curves.

[0083] Optionally, step 212 may include steps 2121 and 2122.

[0084] Step 2121: Based on the microwave amplitude attenuation curves, determine the peak coverage range, rising range, and falling range of the microwave amplitude.

[0085] The peak coverage interval represents the interval where the peak values ​​of each microwave amplitude attenuation curve are located; the rising interval represents the interval where all microwave amplitude attenuation curves are rising; and the falling interval represents the interval where all microwave amplitude attenuation curves are falling. The peak coverage interval represents the minimum operating frequency corresponding to the peak value of microwave amplitude attenuation among all microwave amplitude attenuation curves, and the maximum operating frequency corresponding to the peak value of microwave amplitude attenuation among all microwave amplitude attenuation curves; the interval between the minimum and maximum operating frequencies can be defined as the peak coverage interval. Figure 4 For example, the peak coverage range can represent the operating frequency range formed by the peak value of the microwave amplitude attenuation curve with a moisture content of 3% and the operating frequency corresponding to the peak value of the microwave amplitude attenuation curve with a moisture content of 3%.

[0086] Step 2122: Based on the peak coverage range, rising range, and falling range, obtain multiple operating frequencies of the microwave resonant cavity sensor.

[0087] Optionally, multiple operating frequencies can be selected from the peak coverage range, rising range, and falling range, allowing the operating frequencies to be distributed across these ranges. For example, one or more operating frequencies can be selected evenly in each range. Alternatively, a larger number of operating frequencies can be selected in the peak coverage range, while the same number of operating frequencies can be selected in the rising and falling ranges.

[0088] Taking crude oil with a water content of 0-3% and three mineralization levels (tap water, 10000ppm, and 50000ppm) and two temperature conditions (35℃ and 55℃) as an example, the microwave amplitude attenuation curve represents the S21 amplitude attenuation characteristic curve of the microwave resonant cavity. The S21 amplitude attenuation characteristic curves of the microwave resonant cavity for crude oil in the frequency range of 1.45GHz-1.55GHz were measured and statistically analyzed. Figure 4-6 As shown, it displays the amplitude attenuation characteristic curves of the microwave resonant cavity S21 for different crude oils. Taking the curves at 55℃ and three different salinities as examples, Figure 4 A schematic diagram of the S21 amplitude attenuation characteristic curves for tap water at 55℃ and different moisture contents is shown. Figure 5 It shows the amplitude attenuation characteristic curves of microwave resonant cavity S21 at 55℃, mineralization of 10000ppm and different water contents. Figure 6 The amplitude attenuation characteristic curves of microwave resonant cavity S21 at 55℃, mineralization of 50000ppm, and different water contents are shown. Based on Figure 4-6 It can be seen that as the water content increases, the curve shifts to the left, the resonant frequency decreases, the resonant peak value decreases, and the resonant peak value changes more significantly with the water content as the mineralization increases.

[0089] Figure 7 This is a schematic diagram showing the microwave amplitude attenuation curves under different water contents and mineralization degrees. From Figure 7 As can be seen, 1470MHz is in the rising range of the overall schematic diagram, 1480MHz, 1490MHz, and 1500MHz are in the peak coverage range, and 1510MHz is in the falling range of the overall schematic diagram. In one example, five operating frequency points can be selected: 1470MHz, 1480MHz, 1490MHz, 1500MHz, and 1510MHz.

[0090] like Figures 8 to 12 As shown, this diagram illustrates the variation of the amplitude of microwave resonator S21 with water content at five different operating frequencies and for different mineralization levels. Figures 8 to 12It can be seen that the amplitude of the microwave resonant cavity S21 varies with water content at different operating frequencies. Based on these operating frequency selections, the relationship between the amplitude of the microwave resonant cavity S21 and water content can be presented more comprehensively. The experimental and training data determined based on these rich microwave resonant cavity S21 amplitudes enable the subsequent pre-built model to learn more information, thereby enabling the target water content detection model to better adapt to water content detection in more complex scenarios.

[0091] Once the experimental dataset is determined based on the above logic, different models can be trained using various learning methods based on the obtained experimental dataset.

[0092] To enrich the training data for different models and adapt to the needs of moisture content measurement in more scenarios, the flow pattern of multiphase flow can also be considered when selecting training data.

[0093] The following is combined with Figure 13 To determine the electromagnetic field distribution for different flow patterns and different resonant modes. (From...) Figure 13 The diagram shows the frequency sweep curve of the microwave resonant cavity sensor and a schematic diagram of the electric field distribution cloud corresponding to the resonant mode at the resonant peak. Figure 13 The resonant modes shown include TM010, TM110, TM210, and TM310. Figure 14 The diagram shows schematic representations of the electric field distribution clouds obtained under different resonance modes for four flow patterns (no fluid, stratified flow, annular flow, and annular mist flow). Figure 14 The resonant modes shown include TM010 and TM110. Among them, Figure 14 The top layer of four sub-graphs shows schematic diagrams of different flow patterns. Figure 14 The four sub-plots in the middle layer show the electric field distribution cloud diagrams obtained by different flow patterns in the case of TM010 resonance mode; Figure 14 The four sub-plots at the bottom layer show schematic diagrams of the electric field distribution clouds obtained by different flow patterns in the TM110 resonant mode.

[0094] Depend on Figure 13 and Figure 14 As can be seen, the electromagnetic field distribution differs across different resonant modes, meaning the sensitive field distribution varies. Therefore, for different flow patterns, the microwave resonant cavity sensor obtains different measurement information in different resonant modes. Consequently, each resonant mode is suitable for measuring different flow patterns and water content ranges. Taking a gas-water two-phase stratified flow distribution as an example... Figure 15The diagram shows the microwave amplitude attenuation curves as a function of moisture content in the TM010 and TM110 resonant modes. Within the 0-20% moisture content range, the TM010 mode shows an amplitude decrease of 24.4 dB, higher than the 5.1 dB decrease in the TM110 mode. Therefore, in the 0-20% moisture content range, selecting the TM010 mode allows for a more pronounced and accurate measurement of the moisture content. However, within the 20%-100% moisture content range, the TM110 mode shows an amplitude decrease of 32.4 dB, higher than the 14.1 dB decrease in the TM010 mode. Therefore, in the 20%-100% moisture content range, selecting the TM110 mode allows for a more pronounced and accurate measurement of the moisture content.

[0095] Based on the above analysis, when selecting experimental data for model training, the flow pattern of the multiphase flow to be detected and the water content range of the multiphase flow to be detected can also be considered. For example, if the water content of the multiphase flow in the desired scenario is typically in the range of 0-20%, then experimental data obtained in the TM010 resonant mode can be selected as the data used for subsequent model training. Similarly, if the water content of the multiphase flow in the desired scenario is typically in the range of 20%-100%, then experimental data obtained in the TM110 resonant mode can be selected as the data used for subsequent model training.

[0096] In one implementation, the pre-built model includes a Support Vector Machine (SVM) containing a kernel function. The application of SVM in regression problems is called Support Vector Regression (SVR). SVR is suitable for solving small-sample, nonlinear, and high-dimensional regression tasks. SVR defines an insensitive margin and allows the function to have a certain error within the insensitive margin, thus working well even with a small sample size. SVR can use kernel tricks to handle nonlinear relationships, mapping data to a high-dimensional space through the kernel function. This makes complex nonlinear data in the low-dimensional space linearly separable in the high-dimensional space, allowing for the search for a hyperplane in the high-dimensional space to achieve regression. Furthermore, when dealing with high-dimensional problems, SVR does not need to explicitly calculate the dot product in the high-dimensional space; instead, it calculates it directly through the kernel function, reducing computational overhead.

[0097] Step 230 above may include: using microwave amplitude attenuation data and physicochemical properties from the experimental data as input to the support vector machine, and using the water content corresponding to the microwave amplitude attenuation data as a label to train the support vector machine.

[0098] The support vector machine in this embodiment includes a kernel function, which can be used to represent the nonlinear mapping between microwave amplitude attenuation and water content by setting the kernel function.

[0099] To better capture the nonlinear relationship between microwave amplitude attenuation and water content, the kernel function can be a radial basis function (RBF) kernel, as shown in the following formula:

[0100] ;

[0101] Where, x i x j σ represents two training data points; σ represents a hyperparameter; exp() represents an exponential function with the natural constant e as the base.

[0102] During training, the objective function of support vector machine regression can be expressed as:

[0103] ;

[0104] The constraints are as follows:

[0105] ;

[0106] Where ω represents the weight vector of the support vector machine; b represents the bias term, which is a constant; ξ represents the insensitive loss parameter, which defines the width of the "gaps"; C represents the pre-defined hyperparameter, which serves as a penalty factor; Φ represents the kernel function that maps the data to a high-dimensional space; ξ represents the kernel function that maps the data to a high-dimensional space. i Let a slack variable represent the training data. x i The degree of deviation falling below the interval band; Let a slack variable represent the training data. x i The degree of deviation falling above the interval band; y i This represents the true values, which are the training data. x i The corresponding label. The interval band is represented as: ω x i +b± .

[0107] The penalty factor C is used to balance model complexity and error. The hyperparameter σ is used to control the shape of the kernel function in order to define the allowable deviation between the predicted and the true values.

[0108] Using the coefficient of determination (R²) and root mean square error (RMSE) as evaluation metrics, a Bayesian optimizer is employed to select the optimal combination of hyperparameters.

[0109] After obtaining the target moisture content detection model based on support vector machine, the validation set can be input into the model to calculate evaluation indicators such as the coefficient of determination (R2) and root mean square error (RMSE) to verify the generalization ability of data outside the training set.

[0110] like Figure 16 and Figure 17 As shown, Figure 16 The diagram shows the distribution of absolute error obtained from the training set with a moisture content range of 0-3%. Figure 17 The diagram illustrates the distribution of absolute errors obtained from the validation set with a moisture content range of 0-3%. Specifically, the absolute errors of the training set are clustered in the range of -0.2% to 0.2%, while the absolute errors of the validation set are clustered in the range of -0.012% to 0.012%.

[0111] Based on the distribution of absolute errors mentioned above, it can be seen that the prediction error of the model obtained based on support vector machine is relatively low, and it can better identify the moisture content.

[0112] In one implementation, the pre-built model includes a Gaussian process model. Gaussian Process Regression (GPR) is a non-parametric Bayesian regression method that predicts the value of new data points by assuming a relationship (i.e., covariance) between data points. It has significant advantages for small sample sizes, high dimensionality, and nonlinear complex problems.

[0113] Step 230 above may include: using microwave amplitude attenuation data and physicochemical properties from the experimental data as input to the Gaussian process model, and using the water content corresponding to the microwave amplitude attenuation data as a label to train the Gaussian process model.

[0114] In this embodiment, we can first assume that the water content prediction results follow a joint Gaussian distribution, and define the Gaussian process as follows:

[0115] ;

[0116] Where m(X) represents a stochastic process f The mean function of (X); K(X, X') represents a stochastic process. f The covariance function of (X); This represents a Gaussian process; X and X' represent two input data, which are the training data. The method for determining the training data can be found in steps 210 to 220 above, and will not be repeated here.

[0117] In this embodiment, the covariance function can also be an RBF kernel, which can be expressed as:

[0118] ;

[0119] in, This represents the signal variance, used to control the amplitude of the function output. l It serves as a variance scale, controlling the sensitivity of the function to input changes; it also determines the correlation between features. Let be the noise variance, and represent the observation noise. The parameters of the kernel function are optimized using the maximum marginal likelihood estimation method. δ (X, X') represents the Dirac function.

[0120] The logarithmic form of the marginal likelihood estimation function can be expressed as:

[0121] ;

[0122] in, θ This represents the set of parameters of the kernel function; the first term in its formula. The second term in the formula represents the data fit term, used to measure the goodness of fit between the data and the model; This represents a complexity penalty term, used to measure the complexity of the model; Let represent the covariance matrix, which is an n×n square matrix (where n represents the number of training data points); y represents the observation vector, which is a... n A 1×1 column vector containing the labels of all training data.

[0123] In this embodiment, after obtaining the target moisture content detection model determined based on the Gaussian process model, the validation set can be input into the model to calculate evaluation indicators such as the coefficient of determination (R2) and root mean square error (RMSE) to verify the generalization ability of data outside the training set.

[0124] Figure 18 and Figure 19 As shown, Figure 18 The diagram shows the distribution of absolute error obtained from the training set with a moisture content range of 0-3%. Figure 19 The diagram illustrates the distribution of absolute errors obtained from the validation set with a moisture content range of 0-3%. The absolute errors of the training set are clustered in the range of -0.015% to 0.015%; the absolute errors of the validation set are mostly clustered in the range of -0.01% to 0.02%, with only one validation data point having an absolute error exceeding 0.02%.

[0125] Based on the distribution of absolute errors mentioned above, it can be seen that the prediction error of the model obtained based on Gaussian process regression is relatively low, and it can better identify the moisture content.

[0126] In one implementation, the pre-built model includes a back propagation neural network (BP neural network). The BP neural network includes an input layer, hidden layers, and an output layer, wherein the number of nodes in the input layer is the same as the number of selected features, and the selected features include features corresponding to operating frequencies and features corresponding to physicochemical properties. Optionally, each layer can be a fully connected layer, and the neurons in the same layer are independent of each other.

[0127] Step 230 above may include: using microwave amplitude attenuation data and physicochemical properties from the experimental data as input to the BP neural network model, and using the water content corresponding to the microwave amplitude attenuation data as a label to train the BP neural network model.

[0128] Taking the selected operating frequencies as five and the corresponding physicochemical features as temperature and salinity as two, as an example, the input layer has 7 nodes, the hidden layer has 1 layer with 16 nodes, and the output layer has 1 node. The ReLU activation function can be used for the hidden layers, and a linear activation function is chosen for the output layer. Mean squared error is used as the loss function, and gradient descent is used to optimize the weights and biases.

[0129] In this embodiment, the learning rate is set to 10 during parameter tuning. -4 The batch size is set to 32, and the epochs are set to 100, meaning the model iterates through the entire training set 100 times. A regularized weight decay term is added to the loss function to avoid overfitting.

[0130] After obtaining the target moisture content detection model based on the BP neural network model, the validation set can be input into the model to calculate evaluation indicators such as the coefficient of determination (R2) and root mean square error (RMSE) to verify the generalization ability of data outside the training set.

[0131] Figure 20 and Figure 21 As shown, Figure 20 The diagram shows the distribution of absolute error obtained from the training set with a moisture content range of 0-3%. Figure 21 The diagram illustrates the distribution of absolute errors obtained from the validation set with a moisture content range of 0-3%. The absolute errors of the training set are mostly clustered in the range of -0.01% to 0.02%, with only one value falling below -0.01% and another falling above 0.02%. The absolute errors of the validation set are also mostly clustered in the range of -0.01% to 0.02%.

[0132] Based on the distribution of absolute errors mentioned above, it can be seen that the prediction error of the model obtained based on the BP neural network model is relatively low, and it can better identify the moisture content.

[0133] Of course, depending on the specific needs, other models capable of supervised learning can be selected to construct and train the target moisture content prediction model. For example, models such as the LightGradient Boosting Machine (LightGBM) based on decision tree algorithms, the XGBoost tree model family, and Bayesian Neural Networks (BNN) can be used.

[0134] Based on the above implementation methods, it can be seen that the three model construction and training methods provided in this application embodiment can effectively predict moisture content values, and the error comparison is shown in the table below:

[0135]

[0136] Where MAE represents mean absolute error and MSE represents mean absolute error.

[0137] According to the various methods provided in the embodiments of this application, by selecting training data and models, a moisture content detection model that can achieve relatively high accuracy can be determined.

[0138] Please see Figure 22 This is a flowchart of a moisture content detection method provided in an embodiment of this application. The moisture content detection method provided in this embodiment can be applied to an electronic device, which executes the steps in the moisture content detection method. The electronic device executing this moisture content detection method can be the same electronic device as the device executing the aforementioned moisture content detection model construction method, or it can be a different electronic device. For example, if the moisture content detection model construction method requires relatively large computational resources, an electronic device with relatively better computing power can be used. The following will discuss... Figure 22 The specific process shown will be explained in detail.

[0139] Step 310: Use a microwave resonant cavity sensor to test the microwave amplitude attenuation data of the substance under test.

[0140] Step 320: Input the microwave amplitude attenuation data into the target moisture content detection model to obtain the moisture content of the substance to be tested.

[0141] In this embodiment, the target moisture content detection model can be a model determined using the aforementioned moisture content detection model construction method. Other details regarding the target moisture content detection model can be found in the descriptions in the aforementioned embodiments, and will not be repeated here.

[0142] In this embodiment, in order to further improve the detection accuracy, the parameters input to the target moisture content detection model may also include the physicochemical properties of the substance to be tested.

[0143] Therefore, before step 320, the process may also include obtaining the physicochemical properties of the substance to be tested.

[0144] Step 320 may include: inputting microwave amplitude attenuation data and physicochemical properties into the target moisture content detection model to obtain the moisture content of the substance to be tested.

[0145] Furthermore, this application embodiment also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the moisture content detection model construction method and the moisture content detection method described in the above method embodiments.

[0146] The computer program product of the moisture content detection model construction method and the moisture content detection method provided in this application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the moisture content detection model construction method and the moisture content detection method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0147] In the several embodiments provided in this application, it should be understood that the disclosed methods can also be implemented in other ways. The method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0148] In addition, the method steps in the various embodiments of this application can be integrated together to form an independent part for execution, or each method step can be executed by a separate module, or two or more steps can be formed into an independent part for execution.

[0149] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0150] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0151] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A water content detection model construction method characterized by comprising: include: Based on the water content measurement range, multiple operating frequencies of the microwave resonant cavity sensor are determined, including: detecting experimental materials with different water contents and different mineralization using the microwave resonant cavity sensor to obtain microwave amplitude attenuation curves of the experimental materials under different water contents and different mineralization; determining the peak coverage range, rising range, and falling range of the microwave amplitude based on each microwave amplitude attenuation curve; wherein, the peak coverage range represents the range where the peak of each microwave amplitude attenuation curve is located, the rising range represents the range where all microwave amplitude attenuation curves are rising, and the falling range represents the range where all microwave amplitude attenuation curves are falling; and obtaining multiple operating frequencies of the microwave resonant cavity sensor based on the peak coverage range, the rising range, and the falling range. Based on multiple operating frequencies, an experimental dataset is determined; wherein, the experimental dataset includes multiple experimental data, including microwave amplitude attenuation data measured by the microwave resonant cavity sensor for the experimental material and the water content corresponding to the microwave amplitude attenuation data. The microwave amplitude attenuation data in the experimental data is used as the input of the pre-built model, and the water content corresponding to the microwave amplitude attenuation data is used as the label to train the pre-built model to obtain the target water content detection model.

2. The method according to claim 1, characterized in that, The experimental data also include the physicochemical properties of the experimental substances; The microwave amplitude attenuation data and the physicochemical properties in the experimental data are used as inputs to a pre-built model. The moisture content corresponding to the microwave amplitude attenuation data is used as a label to train the pre-built model and obtain a target moisture content detection model.

3. The method according to claim 2, characterized in that, The pre-built model includes a support vector machine containing a kernel function; The step of using the microwave amplitude attenuation data and the physicochemical properties from the experimental data as input to a pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label, to train the pre-built model includes: The microwave amplitude attenuation data and the physicochemical properties in the experimental data are used as inputs to the support vector machine, and the water content corresponding to the microwave amplitude attenuation data is used as a label to train the support vector machine.

4. The method according to claim 2, characterized in that, The pre-built model includes a Gaussian process model; The step of using the microwave amplitude attenuation data and the physicochemical properties from the experimental data as input to a pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label, to train the pre-built model includes: The microwave amplitude attenuation data and the physicochemical properties in the experimental data are used as inputs to the Gaussian process model, and the water content corresponding to the microwave amplitude attenuation data is used as a label to train the Gaussian process model.

5. The method according to claim 2, characterized in that, The pre-built model includes a BP neural network model; the BP neural network includes an input layer, a hidden layer and an output layer, wherein the number of nodes in the input layer is the same as the number of selected features, and the selected features include features corresponding to operating frequency and features corresponding to physicochemical properties; The step of using the microwave amplitude attenuation data and the physicochemical properties from the experimental data as input to a pre-built model, and using the moisture content corresponding to the microwave amplitude attenuation data as a label, to train the pre-built model includes: The microwave amplitude attenuation data and the physicochemical properties in the experimental data are used as inputs to the BP neural network model, and the water content corresponding to the microwave amplitude attenuation data is used as a label to train the BP neural network model.

6. A method for detecting moisture content, characterized in that, include: Microwave amplitude attenuation data of the test substance were tested using a microwave resonant cavity sensor. The microwave amplitude attenuation data is input into the target moisture content detection model to obtain the moisture content of the substance to be tested. The target moisture content detection model is a model constructed using the moisture content detection model construction method described in any one of claims 1-5.

7. The method according to claim 6, characterized in that, Before inputting the microwave amplitude attenuation data into the target moisture content detection model to obtain the moisture content of the substance to be tested, the method further includes: obtaining the physicochemical properties of the substance to be tested; The step of inputting the microwave amplitude attenuation data into the target moisture content detection model to obtain the moisture content of the substance to be tested includes: inputting the microwave amplitude attenuation data and the physicochemical properties into the target moisture content detection model to obtain the moisture content of the substance to be tested.

8. A moisture content detection system, characterized in that, include: Microwave resonant cavity sensors and electronic devices; The microwave resonant cavity sensor is used to output microwave signals; The electronic device is used to determine microwave amplitude attenuation data based on the microwave signal, and to perform the steps of the method according to any one of claims 1 to 7 based on the processing of the microwave amplitude attenuation data.