Gas leakage amount determination method and apparatus, and leakage amount determination model training method and apparatus

WO2026103731A1PCT designated stage Publication Date: 2026-05-21HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
Filing Date
2025-11-12
Publication Date
2026-05-21

Smart Images

  • Figure CN2025134337_21052026_PF_FP_ABST
    Figure CN2025134337_21052026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a gas leakage amount determination method and apparatus, and a leakage amount determination model training method and apparatus. An electronic device may acquire environmental information and a sound signal, and input the sound signal and the environmental information into a leakage amount determination model, such that the leakage amount determination model determines fusion information on the basis of the sound signal and the environmental information, removes a noise feature from the fusion information to obtain a leakage amount feature, and determines a gas leakage amount on the basis of the leakage amount feature and the environmental information. Since two groups of samples comprised in a sample pair are acquired under the same environmental noise, the difference between sample noise features corresponding to the two groups of samples is small. By introducing a noise contrast loss, parameters of an initial leakage amount determination model are adjusted according to a direction in which the noise contrast loss is reduced, such that the trained leakage amount determination model can accurately extract environmental noises and accurately remove noise features contained in the fusion information, thereby improving the accuracy of determining a gas leakage amount.
Need to check novelty before this filing date? Find Prior Art

Description

Methods for determining gas leakage, training methods and apparatus for determining leakage models

[0001] This application claims priority to Chinese Patent Application No. 202411613790.0, filed on November 13, 2024, entitled "Method for Determining Gas Leakage, Training Method and Apparatus for Leakage Determination Model", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of gas detection technology, and in particular to a method for determining gas leakage, a training method for a leakage determination model, and an apparatus. Background Technology

[0003] In industrial production, gas leaks can occur in pipelines used to transport gases, posing safety hazards and causing economic losses. To develop appropriate handling strategies, it is usually necessary to determine the amount of gas leaked. Because the leak opening in a pipeline is often small, a pressure difference exists inside and outside the pipeline, causing turbulence during a gas leak. This turbulence can generate specific sound signals. Therefore, determining the amount of gas leaked through sound signals is theoretically feasible.

[0004] However, low-frequency sound signals contain a lot of noise, so the collected sound signals will contain a lot of noise. Determining the amount of gas leakage based on the collected sound signals will result in a large error and low accuracy. Summary of the Invention

[0005] The purpose of this application is to provide a method for determining gas leakage, a training method and apparatus for determining leakage, and an apparatus for such method, to improve the accuracy of gas leakage determination. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of this application provide a method for determining gas leakage, the method comprising:

[0007] Acquire environmental information about the gas leak location and collect sound signals near the gas leak location;

[0008] The sound signal and the environmental information are input into a pre-trained leakage determination model, so that the leakage determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage features, and determines the gas leakage amount based on the leakage features and the environmental information. The leakage features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information.

[0009] The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

[0010] Optionally, the leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module;

[0011] The step of inputting the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines fused information based on the sound signal and the environmental information, and removes noise features from the fused information to obtain leakage features, includes:

[0012] The sound signal is input into the sound signal encoder so that the sound signal encoder encodes the sound signal to obtain sound coding features, and the sound coding features are input into the fusion module;

[0013] The environmental information is input into the environmental information encoder so that the environmental information encoder encodes the environmental information to obtain environmental coding features, and the environmental coding features are input into the fusion module;

[0014] The fusion module performs a fusion process on the sound coding features and the environment coding features to obtain a fused feature vector;

[0015] The leakage feature is obtained by removing the noise features included in the fused feature vector.

[0016] Optionally, the step of removing noise features from the fused feature vector to obtain leakage features includes:

[0017] The fused feature vector is segmented according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and the second sub-vector is removed. The first sub-vector is related to the leakage feature, and the second sub-vector is related to the noise feature.

[0018] Optionally, the step of determining the gas leakage amount based on the leakage characteristics and the environmental information includes:

[0019] The first sub-vector and the environment coding feature are concatenated to obtain a concatenated vector;

[0020] Based on the splicing vector and the leakage amount, the model determines the correspondence between the sample splicing vector and the leakage amount learned during training, and outputs the gas leakage amount.

[0021] Optionally, the step of obtaining environmental information about the gas leak location includes:

[0022] Acquire the ultrasonic echo signal collected by the ultrasonic sensor; or,

[0023] Acquire the temperature signal collected by the temperature sensor, and / or acquire the humidity signal collected by the humidity sensor.

[0024] Secondly, embodiments of this application provide a training method for a leakage determination model, the method comprising:

[0025] Acquire multiple sample pairs and gas leakage labels corresponding to the samples included in the multiple sample pairs, wherein each sample pair includes two sets of samples collected under the same environmental noise, and each set of samples includes sample sound signal and sample environmental information;

[0026] For each set of samples, the set of samples is input into the initial leakage amount determination model, so that the initial leakage amount determination model determines the sample fusion information based on the sample sound signal and sample environmental information included in the set of samples, and separates the sample noise features and sample leakage amount features from the sample fusion information, and determines the predicted gas leakage amount according to the sample leakage amount features and the sample environmental information, wherein the sample leakage amount features characterize the characteristics of the sample sound signal generated by the gas leakage under the influence of the sample environmental information;

[0027] Based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, the parameters of the initial leakage amount determination model are adjusted until the initial leakage amount determination model meets the convergence condition, thus obtaining the leakage amount determination model.

[0028] Optionally, the step of adjusting the parameters of the initial leakage determination model based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, includes:

[0029] Based on the difference between the sample noise features of the two sets of samples included in each sample pair, determine the noise contrast loss corresponding to each sample pair;

[0030] The parameters of the initial leakage determination model are adjusted to optimize the reduction of the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and to reduce the noise contrast loss corresponding to each sample pair.

[0031] Optionally, the initial leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module;

[0032] The step of inputting the set of samples into an initial leakage determination model, so that the initial leakage determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the set of samples, and separating sample noise features and sample leakage features from the sample fusion information, includes:

[0033] The sample group is input into the initial leakage determination model so that the sound signal encoder encodes the sample sound signals included in the sample group to obtain sample sound coding features, and the sample sound coding features are input into the fusion module. The environmental information encoder encodes the sample environmental information included in the sample group to obtain sample environmental coding features, and the sample environmental coding features are input into the fusion module.

[0034] The fusion module performs fusion processing on the sample sound coding features and sample environment coding features corresponding to the group of samples to obtain the sample fusion feature vector;

[0035] The sample noise features and sample leakage features are separated from the sample fusion feature vector.

[0036] Optionally, the step of separating sample noise features and sample leakage features from the sample fusion feature vector includes:

[0037] The sample fusion feature vector is segmented according to a preset segmentation method to obtain a first sample sub-vector and a second sample sub-vector, wherein the first sample sub-vector is related to the sample leakage feature and the second sample sub-vector is related to the sample noise feature.

[0038] Optionally, the step of determining the predicted gas leakage amount based on the sample leakage characteristics and the sample environmental information includes:

[0039] The first sub-vector of the sample and the environmental encoding feature of the sample are concatenated to obtain the concatenated sample vector.

[0040] Based on the sample splicing vector and the initial leakage amount, the model determines the correspondence between the currently learned sample splicing vector and the leakage amount, and outputs the predicted gas leakage amount.

[0041] Thirdly, embodiments of this application provide a gas leakage determination device, the device comprising:

[0042] The signal acquisition module is used to acquire environmental information about the gas leak location and sound signals collected near the gas leak location;

[0043] The leakage amount determination module is used to input the sound signal and the environmental information into a pre-trained leakage amount determination model, so that the leakage amount determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage amount features, and determines the gas leakage amount according to the leakage amount features and the environmental information. The leakage amount features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information.

[0044] The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

[0045] Optionally, the leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module;

[0046] The leakage determination module includes:

[0047] The audio signal encoding submodule is used to input the audio signal into the audio signal encoder so that the audio signal encoder encodes the audio signal to obtain audio encoding features, and inputs the audio encoding features into the fusion module;

[0048] An environmental signal encoding submodule is used to input the environmental information into the environmental information encoder so that the environmental information encoder encodes the environmental information to obtain environmental encoding features, and inputs the environmental encoding features into the fusion module;

[0049] A feature vector fusion determination submodule is used by the fusion module to fuse the sound coding features and the environment coding features to obtain a fused feature vector.

[0050] The leakage feature determination submodule is used to remove noise features included in the fused feature vector to obtain leakage features.

[0051] Optionally, the leakage characteristic determination submodule includes:

[0052] The vector segmentation module is used to segment the fused feature vector according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and remove the second sub-vector. The first sub-vector is related to the leakage feature, and the second sub-vector is related to the noise feature.

[0053] Optionally, the leakage determination module further includes:

[0054] The vector concatenation submodule is used to concatenate the first subvector and the environment coding feature to obtain a concatenated vector;

[0055] The gas leakage determination submodule is used to output the gas leakage amount based on the splicing vector and the correspondence between the sample splicing vector and the leakage amount learned by the leakage determination model during training.

[0056] Optionally, the signal acquisition module includes:

[0057] The first signal acquisition module is used to acquire the ultrasonic echo signal collected by the ultrasonic sensor;

[0058] The second signal acquisition module is used to acquire the temperature signal collected by the temperature sensor, and / or acquire the humidity signal collected by the humidity sensor.

[0059] Fourthly, embodiments of this application provide a training apparatus for a leakage determination model, the apparatus comprising:

[0060] The sample signal acquisition module is used to acquire multiple sample pairs and the gas leakage amount tags corresponding to the samples included in the multiple sample pairs. Each sample pair includes two sets of samples collected under the same environmental noise. Each set of samples includes sample sound signals and sample environmental information.

[0061] The leakage prediction module is used to input each group of samples into an initial leakage determination model, so that the initial leakage determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the group of samples, and separates the sample noise features and sample leakage features from the sample fusion information, and determines the predicted gas leakage amount according to the sample leakage features and the sample environmental information, wherein the sample leakage features characterize the characteristics of the sample sound signals generated by gas leakage under the influence of the sample environmental information;

[0062] The parameter adjustment module is used to adjust the parameters of the initial leakage determination model based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, until the initial leakage determination model meets the convergence condition, thus obtaining the leakage determination model.

[0063] Optionally, the parameter adjustment module includes:

[0064] The noise contrast loss determination submodule is used to determine the noise contrast loss for each sample pair based on the difference between the sample noise features of the two sets of samples included in each sample pair.

[0065] The parameter adjustment submodule is used to adjust the parameters of the initial leakage determination model with the optimization direction of reducing the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and reducing the noise contrast loss corresponding to each sample.

[0066] The initial leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module.

[0067] Optionally, the leakage prediction module includes:

[0068] The sample signal encoding submodule is used to input the group of samples into the initial leakage determination model so that the sound signal encoder encodes the sample sound signals included in the group of samples to obtain sample sound encoding features, and inputs the sample sound encoding features into the fusion module. The environmental information encoder encodes the sample environmental information included in the group of samples to obtain sample environmental encoding features, and inputs the sample environmental encoding features into the fusion module.

[0069] The sample fusion feature vector determination submodule is used by the fusion module to fuse the sample sound coding features and sample environment coding features corresponding to the group of samples to obtain the sample fusion feature vector.

[0070] The sample leakage feature determination submodule is used to separate sample noise features and sample leakage features from the sample fusion feature vector.

[0071] Optionally, the sample leakage characteristic determination submodule includes:

[0072] The vector segmentation unit is used to segment the sample fusion feature vector according to a preset segmentation method to obtain a first sample sub-vector and a second sample sub-vector, wherein the first sample sub-vector is related to the sample leakage feature and the second sample sub-vector is related to the sample noise feature.

[0073] Optionally, the leakage prediction module further includes:

[0074] The sample vector concatenation submodule is used to concatenate the first subvector of the sample and the sample environment encoding features to obtain the concatenated sample vector;

[0075] The gas leakage prediction submodule is used to determine the correspondence between the sample splicing vector currently learned by the model and the leakage amount based on the sample splicing vector and the initial leakage amount, and output the predicted gas leakage amount.

[0076] Fifthly, embodiments of this application provide a gas leakage determination device, the device comprising an environmental sensor, a microphone array, and a processor, wherein:

[0077] The environmental sensor is used to collect environmental information about the location of the gas leak;

[0078] The microphone array is used to collect sound signals near the gas leak location;

[0079] The processor is configured to acquire the environmental information and the sound signal, and input the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines the gas leakage amount based on the sound signal and the environmental information.

[0080] Optionally, the environmental sensor includes at least one of an ultrasonic sensor, a temperature sensor, and a humidity sensor, wherein:

[0081] The ultrasonic sensor is used to collect ultrasonic echo signals;

[0082] The temperature sensor is used to collect temperature signals;

[0083] The humidity sensor is used to collect humidity signals.

[0084] Optionally, the processor is specifically configured to input the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage features, and determines the gas leakage amount based on the leakage features and the environmental information, wherein the leakage features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information;

[0085] The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

[0086] Optionally, the leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module;

[0087] The processor is specifically configured to input the sound signal into the sound signal encoder, so that the sound signal encoder encodes the sound signal to obtain sound coding features, and input the sound coding features into the fusion module; input the environmental information into the environmental information encoder, so that the environmental information encoder encodes the environmental information to obtain environmental coding features, and input the environmental coding features into the fusion module; the fusion module performs fusion processing on the sound coding features and the environmental coding features to obtain a fused feature vector; and removes the noise features included in the fused feature vector to obtain leakage features.

[0088] Optionally, the processor is specifically configured to segment the fused feature vector according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and remove the second sub-vector, wherein the first sub-vector is related to the leakage feature and the second sub-vector is related to the noise feature.

[0089] Optionally, the processor is specifically configured to concatenate the first sub-vector and the environmental coding features to obtain a concatenated vector; based on the concatenated vector and the leakage amount, determine the correspondence between the sample concatenated vector and the leakage amount learned by the model during training, and output the gas leakage amount.

[0090] Sixthly, embodiments of this application provide an electronic device, including:

[0091] Memory, used to store computer programs;

[0092] When a processor executes a program stored in memory, it implements the method described in either the first aspect or the second aspect described above.

[0093] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first or second aspects above.

[0094] Eighthly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a computer, cause the computer to perform any of the methods described in the first aspect or any of the methods described in the second aspect.

[0095] Beneficial effects of the embodiments in this application:

[0096] In the solution provided in this application embodiment, the electronic device can acquire environmental information of the gas leak location and sound signals collected near the gas leak location; the sound signals and environmental information are input into a pre-trained leak amount determination model, so that the leak amount determination model determines fused information based on the sound signals and environmental information, removes noise features from the fused information to obtain leak amount features, and determines the gas leak amount based on the leak amount features and environmental information. The leak amount features characterize the characteristics of the sound signal generated by the gas leak under the influence of environmental information; wherein, the leak amount determination model is trained at least based on noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information corresponding to the two sets of samples included in the sample pair. The two sets of samples included in the sample pair are collected under the same environmental noise, and each set of samples includes sample sound signals and sample environmental information. Since the two sets of samples included in the sample pair are collected under the same environmental noise, the difference in sample noise features in the sample fusion information corresponding to the two sets of samples is small. By introducing noise contrast loss during the training process and adjusting the parameters of the initial leak amount determination model in the direction that reduces the noise contrast loss, the trained leak amount determination model can accurately extract environmental noise. When applying the leakage determination model, it can determine fused information based on environmental information and sound signals at the gas leak location. This fused information includes both leakage volume characteristics and noise characteristics. The leakage determination model can accurately remove the noise characteristics included in the fused information, obtaining accurate leakage volume characteristics. Thus, the gas leakage volume determined based on the leakage volume characteristics and environmental information is relatively accurate, improving the accuracy of gas leakage volume determination. Of course, implementing any product or method of this application does not necessarily require achieving all the advantages described above simultaneously. Attached Figure Description

[0097] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.

[0098] Figure 1 is a flowchart of a method for determining gas leakage provided in an embodiment of this application;

[0099] Figure 2 is a schematic diagram of turbulence phenomena based on the embodiment shown in Figure 1;

[0100] Figure 3 is a specific flowchart of step S102 in the embodiment shown in Figure 1;

[0101] Figure 4 is another specific flowchart of step S102 in the embodiment shown in Figure 1;

[0102] Figure 5 is a flowchart of a training method for a leakage determination model provided in an embodiment of this application;

[0103] Figure 6 is a specific flowchart of step S503 in the embodiment shown in Figure 5;

[0104] Figure 7 is a specific flowchart of step S502 in the embodiment shown in Figure 5;

[0105] Figure 8 is another specific flowchart of step S502 in the embodiment shown in Figure 5;

[0106] Figure 9 is a schematic diagram of a training method for a leakage determination model based on the embodiment shown in Figure 1;

[0107] Figure 10 is a schematic diagram of a gas leakage determination device provided in an embodiment of this application;

[0108] Figure 11 is a schematic diagram of the structure of a training device for a leakage determination model provided in an embodiment of this application;

[0109] Figure 12 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0110] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this invention are within the scope of protection of this invention.

[0111] To improve the accuracy of gas leakage determination, embodiments of this application provide a gas leakage determination method, a training method for a leakage determination model, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product. The following first describes a gas leakage determination method provided by an embodiment of this application.

[0112] The gas leakage determination method provided in this application can be applied to any electronic device that needs to determine the gas leakage amount, such as a detection device, a testing device, a processing device, etc., without specific limitations. For clarity, it will be referred to as an electronic device herein.

[0113] As shown in Figure 1, a method for determining gas leakage includes:

[0114] S101, acquire environmental information about the gas leak location and sound signals collected near the gas leak location;

[0115] S102, the sound signal and the environmental information are input into a pre-trained leakage determination model, so that the leakage determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage features, and determines the gas leakage amount based on the leakage features and the environmental information.

[0116] The leakage amount feature characterizes the characteristics of the sound signal generated by gas leakage under the influence of the environmental information. The leakage amount determination model is trained based on at least the noise contrast loss. The noise contrast loss is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise. Each group of samples includes the sample sound signal and the sample environmental information.

[0117] As can be seen, in this embodiment, the electronic device can acquire environmental information about the gas leak location and sound signals collected near the gas leak location; the sound signals and environmental information are input into a pre-trained leak determination model, so that the leak determination model determines fusion information based on the sound signals and environmental information, removes noise features from the fusion information to obtain leak quantity features, and determines the gas leak quantity based on the leak quantity features and environmental information. The leak quantity features characterize the characteristics of the sound signals generated by the gas leak under the influence of environmental information. The leak quantity determination model is trained at least based on noise contrast loss, which is determined based on the difference in sample noise features in the fusion information of the two sets of samples in the sample pair. The two sets of samples in the sample pair are collected under the same environmental noise, and each set of samples includes sample sound signals and sample environmental information. Since the two sets of samples in the sample pair are collected under the same environmental noise, the difference in sample noise features in the fusion information of the two sets of samples is small. By introducing noise contrast loss during training and adjusting the parameters of the initial leak quantity determination model in the direction that reduces the noise contrast loss, the trained leak quantity determination model can accurately extract environmental noise. When applying the leakage determination model, it can determine fused information based on environmental information and sound signals from the gas leak location. This fused information includes both leakage volume characteristics and noise characteristics. The leakage determination model can accurately remove the noise characteristics included in the fused information, obtaining accurate leakage volume characteristics. Therefore, the gas leakage volume determined based on the leakage volume characteristics and environmental information is relatively accurate, thus improving the accuracy of gas leakage volume determination.

[0118] In industrial production, gas leaks may occur in pipelines used to transport gases. Due to the small diameter of the leaking openings in various pipelines, a pressure difference exists inside and outside the pipeline, causing turbulence during gas leakage and generating specific sound signals. A schematic diagram of turbulence can be shown in Figure 2. Pressure vessel 201 stores compressed gas 202. There are tiny leak holes 203 on the surface of pressure vessel 201. When compressed gas 202 leaks through the tiny leak holes 203, turbulence 204 is generated.

[0119] Because low-frequency sound signals contain a lot of noise, the collected sound signals will contain a significant amount of noise, leading to substantial errors in determining the amount of gas leakage based on the collected sound signals. However, ultrasound has strong directionality and attenuation, allowing for measurement inside pipes without external interference. Furthermore, the noise spectrum of leaking gas is concentrated not only in the audible frequency range but also in the high-frequency range.

[0120] Therefore, once the relationship between the sound pressure level of the sound signal in this frequency band and the amount of gas leakage is determined, the amount of gas leakage can be determined by measuring the sound pressure level of the sound signal. It is evident that it is feasible to determine the amount of gas leakage in a pipeline by acquiring ultrasonic echo signals using an ultrasonic sensor, acquiring sound signals using a microphone array, and then using the ultrasonic echo signals and sound signals together.

[0121] The sound intensity of leaked gas is affected by several factors. First, the ambient temperature at the leak source and along its path affects the sound intensity. As the ambient temperature increases, the kinetic energy of molecules increases, leading to an increase in sound intensity at the leak location. Ambient temperature also affects the density and viscosity of the leaking gas, both of which alter the sound pressure level at the leak location. For example, helium has a lower density than compressed air; assuming the gas flow rate and pressure are the same, the sound pressure level of helium measured at the leak location will be lower than that of compressed air. Second, ambient humidity also affects the sound pressure level of leaked gas.

[0122] There are many ways to achieve environmental sensing. For example, environmental information can be obtained by adding external temperature, humidity, and pressure sensors, or by using ultrasonic echo signals to obtain coupled information in the environment related to determining the amount of gas leakage. When using ultrasonic echo signals to obtain coupled information in the environment related to determining the amount of gas leakage, the propagation characteristics of ultrasound in the atmosphere can be utilized. Specifically, by measuring the propagation time, speed, and scattering characteristics of ultrasonic signals in the atmosphere, meteorological parameters such as air temperature, humidity, wind speed, and wind direction can be calculated.

[0123] This measurement method is based on the fact that the speed of sound propagation in a gaseous medium is a function of the gas composition and absolute temperature. The speed of sound propagation is related to factors such as the gas's adiabatic index, gas constant, molar mass, and absolute temperature. Therefore, by measuring the speed of sound propagation, the gas's temperature, humidity, and composition can be indirectly calculated. Thus, it can be considered that the echo information from ultrasound contains environmental information that influences the estimation of gas leakage.

[0124] In step S101, the electronic device can acquire environmental information about the gas leak location and sound signals collected near the gas leak location. As mentioned earlier, ambient humidity and ambient temperature have a significant impact on the sound intensity of the leaking gas, while the coupling information contained in the ultrasonic echo signal can simultaneously reflect both ambient humidity and ambient temperature. Therefore, the electronic device can acquire environmental information through one of the following four methods:

[0125] In the first method, the electronic device can acquire the ultrasonic echo signal collected by the ultrasonic sensor. In the second method, the electronic device can simultaneously acquire the temperature signal collected by the temperature sensor and the humidity signal collected by the humidity sensor. In the third method, the electronic device can acquire the temperature signal collected by the temperature sensor. In the fourth method, the electronic device can acquire the humidity signal collected by the humidity sensor.

[0126] The environmental information obtained through the first and second methods described above can more comprehensively reflect the ambient temperature and humidity. Since temperature or humidity signals can also reflect environmental characteristics to some extent, the third and fourth methods described above are also feasible in principle.

[0127] The sound signals collected near the aforementioned gas leak location can be high-frequency signals, obtained by filtering the full-frequency sound signals collected by the microphone array. A microphone array, also known as an acoustic camera or acoustic phase-detector, consists of multiple microphones arranged in a specific pattern. Through array signal processing algorithms, it generates a sound pressure level distribution on a plane, visualizing the sound as a color contour map. The sound distribution of the measured object can be displayed as a photograph or video, and can be used for sound source localization, abnormal noise testing, and trajectory tracking. Specifically, the aforementioned array signal processing algorithm can be beamforming.

[0128] In step S102, the electronic device can input the sound signal and environmental information into a pre-trained leakage determination model, which can then determine fused information based on the sound signal and environmental information. Since the sound signal and environmental information simultaneously contain information corresponding to noise and information corresponding to leaked gas, the fused information includes both leakage characteristics and noise characteristics.

[0129] To determine the leakage characteristics from the fused information, the leakage determination model can remove noise features from the fused information to obtain the leakage characteristics. These leakage characteristics can characterize the acoustic signals generated by gas leakage under the influence of environmental information. Therefore, by combining the leakage characteristics and environmental information, the amount of gas leakage reflected by the acoustic signals can be determined.

[0130] To improve the accuracy of the leakage determination model in noise feature extraction, the leakage determination model can be trained based on noise contrast loss training. Specifically, when training the leakage determination model, it can be trained on a sample pair basis. Each sample pair includes two sets of samples collected under the same environmental noise. Each set of samples includes the sample sound signal and sample environmental information.

[0131] When a sample pair, comprising two sets of samples, is input into an initial leakage determination model, the model will output the sample noise features corresponding to each set of samples. Since the two sets of samples in the same sample pair were collected under the same ambient noise conditions, their corresponding sample noise features should be quite similar. Therefore, during parameter tuning, the parameters can be adjusted in a direction that reduces the difference in sample noise features in the fused sample information of the two sets of samples. This enhances the leakage determination model's ability to extract noise features and improves the consistency of identifying identical noise features.

[0132] The difference in sample noise features in the sample fusion information corresponding to the two sets of samples can be calculated by Euclidean distance, cosine distance, Manhattan distance, etc., without specific limitations here.

[0133] As can be seen, in this embodiment, since the two sets of samples included in the sample pair were collected under the same environmental noise, the difference in sample noise features in the sample fusion information corresponding to the two sets of samples is small. By introducing noise contrast loss during training and adjusting the parameters of the initial leakage amount determination model in the direction that reduces the noise contrast loss, the trained leakage amount determination model can accurately extract environmental noise. When applying the leakage amount determination model, the model can determine the fusion information based on the environmental information and sound signal of the gas leak location. The fusion information contains both leakage amount features and noise features. The leakage amount determination model can accurately remove the noise features contained in the fusion information to obtain accurate leakage amount features. Since the leakage amount features are not affected by the noise features, the gas leakage amount determined based on the leakage amount features and environmental information is relatively accurate, which can improve the accuracy of gas leakage amount determination.

[0134] As one embodiment of this application, as shown in FIG3, the above-mentioned leakage determination model may include a sound signal encoder, an environmental information encoder, and a fusion module. In this case, the step of inputting the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines fusion information based on the sound signal and the environmental information, and removes noise features from the fusion information to obtain leakage features, may include:

[0135] S301, the sound signal is input to the sound signal encoder so that the sound signal encoder encodes the sound signal to obtain sound coding features, and the sound coding features are input to the fusion module;

[0136] Since sound coding features can reflect the characteristics of a sound signal, electronic devices can input the sound signal into the sound signal encoder in the leakage determination model. In this way, the sound signal encoder can encode the sound signal to obtain sound coding features. These sound coding features are then input into the fusion module.

[0137] S302, the environmental information is input into the environmental information encoder so that the environmental information encoder encodes the environmental information to obtain environmental coding features, and the environmental coding features are input into the fusion module;

[0138] Since environmental coding features can reflect multiple coupled factors related to the environment, such as temperature, humidity, and gas composition, electronic devices can input environmental information into the environmental information encoder in the leakage determination model. In this way, the environmental information encoder can encode the environmental information to obtain environmental coding features. These environmental coding features are then input into the fusion module.

[0139] The environmental information can specifically include ultrasonic echo signals, humidity signals, and temperature signals, and the environmental information encoder can specifically be an encoder adapted to the environmental information. For example, assuming the environmental information is an ultrasonic echo signal, then the environmental information encoder can be an ultrasonic signal encoder; assuming the environmental information is a humidity signal and a temperature signal, then the environmental information encoder can be a humidity signal encoder and a temperature signal encoder. In this case, it is possible to fuse environmental information collected by multiple sensors, thereby determining the amount of gas leakage.

[0140] S303, the fusion module performs fusion processing on the sound coding features and the environment coding features to obtain a fused feature vector;

[0141] The fusion module can fuse sound coding features and environmental coding features to obtain a fused feature vector, also known as an embedding vector. Since sound coding features and environmental coding features reflect the characteristics of leaked gas and noise, the fused feature vector can simultaneously reflect the leakage amount and noise characteristics.

[0142] S304, remove the noise features included in the fused feature vector to obtain the leakage feature.

[0143] Since the leakage feature in the fusion feature vector is related to the leaking gas and can be used to determine the gas leakage amount, while the noise feature in the fusion feature vector is related to noise and cannot be used to determine the gas leakage amount, the noise feature included in the fusion feature vector can be removed to obtain the leakage feature.

[0144] As can be seen, in this embodiment, the electronic device can input a sound signal into a sound signal encoder to encode the sound signal, obtain sound coding features, and input the sound coding features into a fusion module; it can also input environmental information into an environmental information encoder to encode the environmental information, obtain environmental coding features, and input the environmental coding features into the fusion module; the fusion module performs fusion processing on the sound coding features and environmental coding features to obtain a fused feature vector; and removes the noise features included in the fused feature vector to obtain the leakage amount features. Since the sound coding features and environmental coding features reflect the characteristics of the leaked gas and the noise features, the fused feature vector can simultaneously reflect the leakage amount features and the noise features. Next, in order to determine the gas leakage amount, the noise features in the fused feature vector can be removed to obtain the leakage amount features, and then the gas leakage amount can be determined based on the leakage amount features and environmental information. Since the leakage amount determination model is trained based on noise contrast loss, the extraction of noise features is relatively accurate; that is, noise features can be accurately removed from the fused feature vector to obtain accurate leakage amount features.

[0145] As one embodiment of this application, the step of removing noise features from the fused feature vector to obtain leakage features may include:

[0146] The fused feature vector is segmented according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and the second sub-vector is removed.

[0147] The fused feature vector contains leakage and noise features. The portions representing leakage and noise features within the fused feature vector have fixed positions. Therefore, the positions corresponding to the leakage and noise features in the fused feature vector can be pre-recorded. In this way, the fused feature vector can be segmented according to the pre-recorded positions of each portion, resulting in a first sub-vector related to the leakage feature and a second sub-vector related to the noise feature.

[0148] For example, assuming the fused feature vector has a dimension of 1024×1, with the upper part related to leakage features and the lower part related to noise features, the fused feature vector can be split in the middle to obtain two vectors with a dimension of 512×1. The vector in the upper part is the first sub-vector, and the vector in the lower part is the second sub-vector.

[0149] As can be seen, in this embodiment, the leakage determination model can segment the fused feature vector according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and then remove the second sub-vector. The first sub-vector is related to the leakage feature, and the second sub-vector is related to the noise feature. Since the parts of the fused feature vector used to characterize the leakage feature and the parts used to characterize the noise feature are fixed, the positions corresponding to the leakage feature and the noise feature in the fused feature vector can be pre-recorded. Then, based on the pre-recorded positions, the fused feature vector can be segmented. In this way, the first sub-vector related to the leakage feature can be obtained quickly and accurately.

[0150] As one embodiment of this application, as shown in FIG4, the step of determining the gas leakage amount based on the leakage amount characteristics and the environmental information may include:

[0151] S401, concatenate the first sub-vector and the environment coding feature to obtain a concatenated vector;

[0152] The environmental coding features include multiple coupled factors related to the environment, such as temperature, humidity, and gas composition. Since the first sub-vector represents the characteristics of the sound signal generated by gas leakage under the influence of environmental information, it is necessary to determine the gas leakage amount based on both the first sub-vector and the environmental coding features. In step S401, the leakage amount determination model can concatenate the first sub-vector and the environmental coding features to obtain a concatenated vector.

[0153] S402, based on the splicing vector and the leakage amount, determine the correspondence between the sample splicing vector and the leakage amount learned by the model during training, and output the gas leakage amount.

[0154] During the training process of the leakage amount determination model, the predicted gas leakage amount is output based on the sample splicing vector. Then, the parameters are tuned based on the difference between the predicted gas leakage amount and the gas leakage amount label. Therefore, the leakage amount determination model has pre-learned the correspondence between the sample splicing vector and the leakage amount. The leakage amount determination model can output the gas leakage amount based on the splicing vector and the pre-learned correspondence.

[0155] As can be seen, in this embodiment, the leakage determination model can concatenate the first sub-vector and the environmental encoding features to obtain a concatenated vector; based on the concatenated vector and the correspondence between the sample concatenated vector and the leakage amount learned by the leakage determination model during training, the gas leakage amount is output. Since the leakage determination model has pre-learned the correspondence between the sample concatenated vector and the leakage amount, it can quickly and accurately output the gas leakage amount based on the concatenated vector and the pre-learned correspondence.

[0156] As one embodiment of this application, the step of obtaining environmental information about the gas leak location described above may include:

[0157] Acquire the ultrasonic echo signal collected by the ultrasonic sensor; or,

[0158] Acquire the temperature signal collected by the temperature sensor, and / or acquire the humidity signal collected by the humidity sensor.

[0159] In the first embodiment, the electronic device can acquire the ultrasonic echo signal collected by the ultrasonic sensor. Since the ultrasonic echo signal contains multiple coupling factors such as environmental information and ambient humidity, it is possible to acquire only the ultrasonic echo signal collected by the ultrasonic sensor.

[0160] In the second embodiment, the electronic device can acquire temperature signals from a temperature sensor and humidity signals from a humidity sensor. Since temperature and humidity are important factors affecting the sound pressure level of leaked gas, both temperature and humidity signals at the gas leak location can be acquired simultaneously. This allows for a more comprehensive reflection of the environmental characteristics.

[0161] In the third embodiment, the electronic device may only acquire the temperature signal collected by the temperature sensor. In the fourth embodiment, the electronic device may only acquire the humidity signal collected by the humidity sensor. Although these two embodiments are less effective, they are feasible in principle.

[0162] As can be seen, in this embodiment of the application, the electronic device can obtain environmental information about the location of the gas leak through one of the above four implementation methods. Since temperature and humidity are important factors affecting the sound pressure level of the leaking gas, and the above four implementation methods can accurately reflect at least one of temperature and humidity, the environmental information about the location of the gas leak can be accurately obtained.

[0163] Corresponding to the above-mentioned method for determining gas leakage, this application also provides a method for training a leakage determination model. The following will introduce the method for training a leakage determination model provided by this application.

[0164] As shown in Figure 5, a training method for a leakage determination model is provided, the method comprising:

[0165] S501, Obtain multiple sample pairs and the gas leakage amount labels corresponding to the samples included in the multiple sample pairs;

[0166] Each sample pair includes two sets of samples collected under the same environmental noise conditions. Each set of samples includes the sample sound signal and sample environmental information.

[0167] S502, for each group of samples, the group of samples is input into the initial leakage amount determination model, so that the initial leakage amount determination model determines the sample fusion information based on the sample sound signal and sample environmental information included in the group of samples, and separates the sample noise features and sample leakage amount features from the sample fusion information, and determines the predicted gas leakage amount according to the sample leakage amount features and the sample environmental information.

[0168] The sample leakage characteristics represent the features of the sample sound signal generated by gas leakage under the influence of the sample environmental information.

[0169] S503, based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, adjust the parameters of the initial leakage amount determination model until the initial leakage amount determination model meets the convergence condition, and obtain the leakage amount determination model.

[0170] As can be seen, in this embodiment, the electronic device can acquire multiple sample pairs and gas leakage amount tags corresponding to the samples included in the sample pairs. Each sample pair includes two sets of samples collected under the same environmental noise conditions. Each set of samples includes sample sound signals and sample environmental information. For each set of samples, the set of samples is input into an initial leakage amount determination model, so that the initial leakage amount determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the set of samples, and separates sample noise features and sample leakage amount features from the sample fusion information. Based on the sample leakage amount features and sample environmental information, the predicted gas leakage amount is determined. The sample leakage amount features characterize the characteristics of the sample sound signals generated by gas leakage under the influence of sample environmental information. Based on the difference between the predicted gas leakage amount and the gas leakage amount tag corresponding to each set of samples, and the difference between the sample noise features corresponding to the two sets of samples included in each sample pair, the parameters of the initial leakage amount determination model are adjusted until the initial leakage amount determination model meets the convergence condition, thus obtaining the leakage amount determination model. Since the two sets of samples included in the sample pair are collected under the same environmental noise conditions, the difference in sample noise features in the sample fusion information corresponding to the two sets of samples is small. By introducing noise contrast loss during training and adjusting the parameters of the initial leakage determination model in the direction that reduces the noise contrast loss, the trained leakage determination model can accurately extract environmental noise.

[0171] In step S501, the electronic device can acquire multiple sample pairs and gas leakage amount tags corresponding to the samples included in the multiple sample pairs. The gas leakage amount tags can be determined by methods currently available in related technologies, such as the pressure decay method, the flow meter method, and the mass conservation method, and are not specifically limited here.

[0172] Each sample pair may include two sets of samples collected under the same ambient noise conditions. Each set of samples may include a sample audio signal and sample environmental information. The methods for acquiring the sample audio signal and sample environmental information are the same as those used in the above embodiments, and will not be repeated here.

[0173] Next, the electronic device can input each set of samples into the initial leakage determination model. The initial leakage determination model can then determine sample fusion information based on the sample sound signals and environmental information included in that set of samples, and separate sample noise features and sample leakage features from the sample fusion information. Furthermore, the predicted gas leakage amount can be determined based on the sample leakage features and environmental information, i.e., step S502 is executed. The sample leakage features characterize the characteristics of the sample sound signals generated by gas leakage under the influence of environmental information.

[0174] Since the leakage determination model needs to be trained based on the differences in noise features between the samples included in the sample pair, it is not necessary to remove noise features from the sample fusion information during training; instead, the noise features should be retained. In other words, to enable the leakage determination model to accurately extract noise features, it can be trained based on noise contrastive loss. Because the noise contrastive loss is determined based on the differences in noise features between the samples included in the sample pair, it is not necessary to remove noise features from the sample fusion information during training.

[0175] Because the gas leak label represents the actual gas leak, while the predicted gas leak is the amount estimated by the initial leak determination model, which may be inaccurate, the parameters of the initial leak determination model can be adjusted based on the difference between the predicted gas leak and the gas leak label for each sample group. The difference between the predicted gas leak and the gas leak label for each sample group can be calculated using methods such as Euclidean distance, cosine distance, and Manhattan distance; no specific method is specified here.

[0176] Since the two sets of samples in the sample pair were collected under the same environmental noise conditions, the noise features of the two sets of samples output by the initial leakage determination model should be relatively similar. If the noise features of the two sets of samples output by the initial leakage determination model are significantly different, it indicates that the initial leakage determination model has poor noise feature extraction capabilities.

[0177] To improve the ability of the initial leakage determination model to extract noise features, the electronic device can also adjust the parameters of the initial leakage determination model according to the difference between the noise features of the two sets of samples included in each sample pair, until the initial leakage determination model meets the convergence condition, and then the trained leakage determination model can be obtained.

[0178] For example, assuming sample pair 1 includes sample 1 and sample 2, and sample pair 2 includes sample 3 and sample 4, then the electronic device can obtain the gas leakage amount label 1-gas leakage amount label 4 corresponding to sample 1-sample 4. Next, sample 1-sample 4 can be input into the initial leakage amount determination model to obtain the sample noise feature 1-sample noise feature 4 and the predicted gas leakage amount 1-predicted gas leakage amount 4 corresponding to sample 1-sample 4 output by the initial leakage amount determination model.

[0179] The parameter tuning process is illustrated below using sample pair 1 as an example: The electronic device can adjust the initial leakage amount to determine the model parameters based on the differences between gas leakage amount label 1 and predicted gas leakage amount 1, gas leakage amount label 2 and predicted gas leakage amount 2, and sample noise feature 1 and sample noise feature 2. The parameter tuning process for sample pair 2 is the same as that for sample pair 1, and will not be repeated here.

[0180] As can be seen, in this embodiment, during the training process of the initial leakage determination model, parameters are adjusted based on the difference between the predicted gas leakage amount and the gas leakage amount label, as well as the difference between the sample noise features corresponding to the two sets of samples included in the same sample pair, thus achieving multi-loss joint training. This enhances the leakage determination model's ability to extract noise features, thereby improving the accuracy of gas leakage determination.

[0181] As one embodiment of this application, as shown in FIG6, the step of adjusting the parameters of the initial leakage determination model based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, may include:

[0182] S601, Based on the difference between the sample noise features of the two sets of samples included in each sample pair, determine the noise contrast loss corresponding to each sample pair;

[0183] Since the two sets of samples included in each sample pair were collected under the same environmental noise, the noise characteristics of the samples corresponding to these two sets of samples should be relatively similar. The electronic device can determine the noise contrast loss corresponding to each sample pair based on the difference between the noise characteristics of the samples corresponding to the two sets of samples included in each sample pair.

[0184] For example, sample pair 1 includes sample 1 and sample 2, and sample pair 2 includes sample 3 and sample 4. By inputting sample 1 to sample 4 into the initial leakage determination model, sample noise features 1 to 4 can be obtained. Furthermore, based on the difference between sample noise feature 1 and sample noise feature 2, the noise contrast loss corresponding to sample pair 1 can be determined, and based on the difference between sample noise feature 3 and sample noise feature 4, the noise contrast loss corresponding to sample pair 2 can be determined.

[0185] The noise contrast loss mentioned above can be determined directly based on the difference between the noise features of the two sets of samples included in the sample pair, or it can be determined first based on a preset noise classification method to determine the noise classification of the noise features of the two sets of samples, and then determined based on the difference between the noise classifications of the two sets of samples. Both of these are reasonable.

[0186] S602, with the optimization direction of reducing the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and reducing the noise contrast loss corresponding to each sample pair, the parameters of the initial leakage amount determination model are adjusted.

[0187] Since the predicted gas leakage amount is estimated by the initial leakage amount determination model, while the gas leakage amount label is the actual gas leakage amount, in order to make the predicted gas leakage amount estimated by the initial leakage amount determination model close to the actual gas leakage amount, the optimization direction can be to reduce the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each sample, and the parameters of the initial leakage amount determination model can be adjusted.

[0188] If the noise contrast loss is large, it indicates that the initial leakage determination model has poor consistency in extracting noise features for the same environmental noise, and the accuracy of noise feature extraction is poor. Therefore, in order to improve the accuracy of noise feature extraction by the initial leakage determination model, the optimization direction can be to reduce the corresponding noise contrast loss for each sample, and the parameters of the initial leakage determination model can be adjusted.

[0189] For example, sample pair 1 includes sample 1 and sample 2. Inputting sample 1 and sample 2 into the initial leakage amount determination model yields sample noise feature 1 - sample noise feature 2 and predicted gas leakage amount 1 - predicted gas leakage amount 2. Based on the difference between sample noise feature 1 and sample noise feature 2, the noise contrast loss 1 corresponding to sample pair 1 can be determined. Therefore, the parameters of the initial leakage amount determination model can be adjusted with the optimization direction of reducing the difference between predicted gas leakage amount 1 and gas leakage amount label 1, reducing the difference between predicted gas leakage amount 2 and gas leakage amount label 2, and reducing noise contrast loss 1.

[0190] As can be seen, in this embodiment, the electronic device can determine the noise contrast loss corresponding to each sample pair based on the difference between the sample noise features corresponding to the two sets of samples included in each sample pair. The optimization direction is to reduce the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each set of samples, and to reduce the noise contrast loss corresponding to each sample pair, thereby adjusting the parameters of the initial leakage amount determination model. Adding noise contrast loss at the model training level can constrain the representation of sample noise features in the sample fusion feature vector, mapping similar sample noise features to close positions and dissimilar sample noise features to distant positions. This improves the accuracy of the initial leakage amount determination model in determining the gas leakage amount and also improves the accuracy of the initial leakage amount determination model in determining noise features.

[0191] As one embodiment of this application, the initial leakage determination model may include a sound signal encoder, an environmental information encoder, and a fusion module. In this case, as shown in FIG7, the step of inputting the set of samples into the initial leakage determination model so that the initial leakage determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the set of samples, and separating sample noise features and sample leakage features from the sample fusion information may include:

[0192] S701, the sample group is input into the initial leakage determination model so that the sound signal encoder encodes the sample sound signals included in the sample group to obtain sample sound coding features, and the sample sound coding features are input into the fusion module. The environmental information encoder encodes the sample environmental information included in the sample group to obtain sample environmental coding features, and the sample environmental coding features are input into the fusion module.

[0193] Step S701 is essentially the same as steps S301-S302 above. The difference is that step S701 is the process of training the model, while steps S301-S302 are the process of applying the model. Therefore, step S701 will not be explained in detail.

[0194] S702, the fusion module performs fusion processing on the sample sound coding features and sample environment coding features corresponding to the group of samples to obtain a sample fusion feature vector;

[0195] Step S702 is essentially the same as step S303 above. The difference is that step S702 is the process of training the model, while step S303 is the process of applying the model. Therefore, step S702 will not be described in detail.

[0196] S703, Separate the sample noise features and sample leakage features from the sample fusion feature vector.

[0197] Since the sample fusion feature is obtained by fusing the sample sound coding feature and the sample environment coding feature, the sample fusion feature can simultaneously reflect the noise information and the leaked gas information. The sample noise feature and the sample leakage amount feature can be separated from the sample fusion feature vector.

[0198] As can be seen, in this embodiment, the electronic device can input the set of samples into the initial leakage determination model, so that the sound signal encoder encodes the sample sound signals included in the set of samples to obtain sample sound coding features, and inputs the sample sound coding features into the fusion module. The environmental information encoder encodes the sample environmental information included in the set of samples to obtain sample environmental coding features, and inputs the sample environmental coding features into the fusion module. The fusion module fuses the sample sound coding features and sample environmental coding features corresponding to the set of samples to obtain a sample fusion feature vector. The sample noise features and sample leakage features are separated from the sample fusion feature vector. Since the sample fusion features are obtained by fusing the sample sound coding features and sample environmental coding features, the sample fusion features can simultaneously reflect noise information and leaked gas information, and the sample noise features and sample leakage features can be separated from the sample fusion feature vector. In this way, the noise contrast loss can be calculated using the sample noise features, and the predicted gas leakage can be determined using the sample leakage features.

[0199] As one embodiment of this application, the step of separating sample noise features and sample leakage features from the sample fusion feature vector may include:

[0200] The sample fusion feature vector is segmented according to a preset segmentation method to obtain the first sample sub-vector and the second sample sub-vector.

[0201] The sample fusion feature vector contains sample leakage features and sample noise features. The parts of the sample fusion feature vector that represent sample leakage features and the parts that represent sample noise features have fixed positions. Therefore, the positions corresponding to sample leakage features and sample noise features in the sample fusion feature vector can be pre-recorded.

[0202] In this way, the sample fusion feature vector can be segmented according to the pre-recorded positions of each part, thereby obtaining the first sample sub-vector related to the sample leakage feature and the second sample sub-vector related to the sample noise feature.

[0203] As can be seen, in this embodiment, the initial leakage determination model can segment the sample fusion feature vector according to a preset segmentation method to obtain a first sample sub-vector and a second sample sub-vector. The first sample sub-vector is related to the sample leakage feature, and the second sample sub-vector is related to the sample noise feature. Since the positions corresponding to the sample leakage feature and the sample noise feature in the sample fusion feature vector can be pre-recorded, the sample fusion feature vector can be segmented according to the pre-recorded positions of each part, thereby obtaining the first sample sub-vector related to the sample leakage feature and the second sample sub-vector related to the sample noise feature. In this way, the first sample sub-vector and the second sample sub-vector can be determined quickly and accurately.

[0204] As one embodiment of this application, as shown in FIG8, the step of determining the predicted gas leakage amount based on the sample leakage amount characteristics and the sample environment information may include:

[0205] S801, the first sub-vector of the sample and the environmental coding feature of the sample are concatenated to obtain the concatenated sample vector;

[0206] The first sub-vector of the sample is related to the sample leakage feature, and the sample environment encoding feature can reflect the sample environment information. The leakage determination model can concatenate the first sub-vector of the sample with the sample environment encoding feature, and the resulting concatenated vector can simultaneously reflect the sample leakage feature and the sample environment information.

[0207] S802, based on the sample splicing vector and the initial leakage amount, determine the correspondence between the sample splicing vector currently learned by the model and the leakage amount, and output the predicted gas leakage amount.

[0208] During the training of the initial leakage determination model, the model's parameters continuously learn the correspondence between the sample splicing vector and the leakage amount. Based on the sample splicing vector and the currently learned correspondence between the sample splicing vector and the leakage amount, the initial leakage determination model can output the gas leakage amount.

[0209] As can be seen, in this embodiment, the initial leakage determination model can concatenate the first sub-vector of the sample and the encoded features of the sample environment to obtain a concatenated sample vector. Based on the concatenated sample vector and the correspondence between the concatenated sample vector and the leakage amount learned by the initial leakage determination model during training, the predicted gas leakage amount is output. In this way, the initial leakage determination model can quickly and accurately determine the predicted gas leakage amount based on the currently learned correspondence between the concatenated sample vector and the leakage amount.

[0210] As one embodiment of this application, a schematic diagram of the training method for the leakage determination model can be shown in Figure 9. The sample pair includes sample A and sample B. Sample A includes sample ultrasonic echo signal A and sample sound signal A, and sample B includes sample ultrasonic echo signal B and sample sound signal B. The upper and lower halves of Figure 9 represent the same process, and the upper half will be used as an example for explanation here.

[0211] The electronic device can input a sample ultrasound echo signal A into an ultrasound signal encoder. The ultrasound signal encoder extracts the sample ultrasound signal encoding feature A from the sample ultrasound echo signal A, and then inputs the sample ultrasound signal encoding feature A into the fusion module. Similarly, the electronic device can input a sample sound signal A into a sound signal encoder. The sound signal encoder extracts the sample sound signal encoding feature A from the sample sound signal A, and then inputs the sample sound signal encoding feature A into the fusion module.

[0212] The fusion module fuses the sample ultrasound signal coding feature A and the sample sound coding feature A to obtain fused information A. Fusion information A can be the white part and the shaded part in the sample fusion feature vector 901. The white part is the first sub-vector of the sample, and the shaded part is the second sub-vector of the sample. The black part is the sample ultrasound signal coding feature A, which does not belong to the sample fusion feature vector 901.

[0213] The leakage determination model concatenates the coded feature A of the sample ultrasonic signal with the first sub-vector of the sample to obtain a concatenated sample vector, and then determines the predicted gas leakage amount based on the concatenated sample vector. The leakage determination model can determine the noise classification based on the second sub-vector of the sample; the noise classification is used to characterize the category of the sample noise features.

[0214] Similarly, for sample B, the leakage determination model will output the predicted gas leakage amount and noise classification corresponding to sample B. Electronic devices can determine the noise contrast loss based on the difference between the sample noise feature B corresponding to sample B and the sample noise feature A corresponding to sample A, and then adjust the parameters in the leakage determination model in a direction that reduces the noise contrast loss.

[0215] In the technical solution of this application, the operations of obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.

[0216] Corresponding to the above-described method for determining gas leakage, this application also provides a device for determining gas leakage. The following describes the device for determining gas leakage provided in this application.

[0217] As shown in Figure 10, a gas leakage determination device includes:

[0218] Signal acquisition module 1001 is used to acquire environmental information of the gas leak location and sound signals collected near the gas leak location;

[0219] The leakage amount determination module 1002 is used to input the sound signal and the environmental information into a pre-trained leakage amount determination model, so that the leakage amount determination model determines fused information based on the sound signal and the environmental information, removes noise features from the fused information to obtain leakage amount features, and determines the gas leakage amount according to the leakage amount features and the environmental information. The leakage amount features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information.

[0220] The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

[0221] As can be seen, in this embodiment, the electronic device can acquire environmental information about the gas leak location and sound signals collected near the gas leak location; the sound signals and environmental information are input into a pre-trained leak determination model, so that the leak determination model determines fusion information based on the sound signals and environmental information, removes noise features from the fusion information to obtain leak quantity features, and determines the gas leak quantity based on the leak quantity features and environmental information. The leak quantity features characterize the characteristics of the sound signals generated by the gas leak under the influence of environmental information. The leak quantity determination model is trained at least based on noise contrast loss, which is determined based on the difference in sample noise features in the fusion information of the two sets of samples in the sample pair. The two sets of samples in the sample pair are collected under the same environmental noise, and each set of samples includes sample sound signals and sample environmental information. Since the two sets of samples in the sample pair are collected under the same environmental noise, the difference in sample noise features in the fusion information of the two sets of samples is small. By introducing noise contrast loss during training and adjusting the parameters of the initial leak quantity determination model in the direction that reduces the noise contrast loss, the trained leak quantity determination model can accurately extract environmental noise. When applying the leakage determination model, it can determine fused information based on environmental information and sound signals from the gas leak location. This fused information includes both leakage volume characteristics and noise characteristics. The leakage determination model can accurately remove the noise characteristics included in the fused information, obtaining accurate leakage volume characteristics. Therefore, the gas leakage volume determined based on the leakage volume characteristics and environmental information is relatively accurate, thus improving the accuracy of gas leakage volume determination.

[0222] As one embodiment of this application, the above-mentioned leakage determination model may include a sound signal encoder, an environmental information encoder, and a fusion module. In this case, the above-mentioned leakage determination module 1002 may include:

[0223] The audio signal encoding submodule is used to input the audio signal into the audio signal encoder so that the audio signal encoder encodes the audio signal to obtain audio encoding features, and inputs the audio encoding features into the fusion module;

[0224] An environmental signal encoding submodule is used to input the environmental information into the environmental information encoder so that the environmental information encoder encodes the environmental information to obtain environmental encoding features, and inputs the environmental encoding features into the fusion module;

[0225] A feature vector fusion determination submodule is used by the fusion module to fuse the sound coding features and the environment coding features to obtain a fused feature vector.

[0226] The leakage feature determination submodule is used to remove noise features included in the fused feature vector to obtain leakage features.

[0227] As one embodiment of this application, the above-mentioned leakage characteristic determination submodule may include:

[0228] The vector segmentation module is used to segment the fused feature vector according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and remove the second sub-vector. The first sub-vector is related to the leakage feature, and the second sub-vector is related to the noise feature.

[0229] As one embodiment of this application, the leakage determination module 1002 may further include:

[0230] The vector concatenation submodule is used to concatenate the first subvector and the environment coding feature to obtain a concatenated vector;

[0231] The gas leakage determination submodule is used to output the gas leakage amount based on the splicing vector and the correspondence between the sample splicing vector and the leakage amount learned by the leakage determination model during training.

[0232] As one embodiment of this application, the signal acquisition module 1001 described above may include:

[0233] The first signal acquisition module is used to acquire the ultrasonic echo signal collected by the ultrasonic sensor;

[0234] The second signal acquisition module is used to acquire the temperature signal collected by the temperature sensor, and / or acquire the humidity signal collected by the humidity sensor.

[0235] Corresponding to the above-described training method for a leakage determination model, this application also provides a training apparatus for a leakage determination model. The following describes the training apparatus for a leakage determination model provided in this application.

[0236] As shown in Figure 11, a training device for a leakage determination model is provided, the device comprising:

[0237] The sample signal acquisition module 1101 is used to acquire multiple sample pairs and gas leakage amount tags corresponding to the samples included in the multiple sample pairs. Each sample pair includes two sets of samples collected under the same environmental noise. Each set of samples includes sample sound signal and sample environmental information.

[0238] The leakage prediction module 1102 is used to input each group of samples into an initial leakage determination model, so that the initial leakage determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the group of samples, and separates the sample noise features and sample leakage features from the sample fusion information, and determines the predicted gas leakage amount according to the sample leakage features and the sample environmental information, wherein the sample leakage features characterize the characteristics of the sample sound signals generated by gas leakage under the influence of the sample environmental information;

[0239] The parameter adjustment module 1103 is used to adjust the parameters of the initial leakage determination model based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, until the initial leakage determination model meets the convergence condition, thereby obtaining the leakage determination model.

[0240] As can be seen, in this embodiment, the electronic device can acquire multiple sample pairs and gas leakage amount tags corresponding to the samples included in the sample pairs. Each sample pair includes two sets of samples collected under the same environmental noise conditions. Each set of samples includes sample sound signals and sample environmental information. For each set of samples, the set of samples is input into an initial leakage amount determination model, so that the initial leakage amount determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the set of samples, and separates sample noise features and sample leakage amount features from the sample fusion information. Based on the sample leakage amount features and sample environmental information, the predicted gas leakage amount is determined. The sample leakage amount features characterize the characteristics of the sample sound signals generated by gas leakage under the influence of sample environmental information. Based on the difference between the predicted gas leakage amount and the gas leakage amount tag corresponding to each set of samples, and the difference between the sample noise features corresponding to the two sets of samples included in each sample pair, the parameters of the initial leakage amount determination model are adjusted until the initial leakage amount determination model meets the convergence condition, thus obtaining the leakage amount determination model. Since the two sets of samples included in the sample pair are collected under the same environmental noise conditions, the difference in sample noise features in the sample fusion information corresponding to the two sets of samples is small. By introducing noise contrast loss during training and adjusting the parameters of the initial leakage determination model in the direction that reduces the noise contrast loss, the trained leakage determination model can accurately extract environmental noise.

[0241] As one embodiment of this application, the parameter adjustment module 1103 described above may include:

[0242] The noise contrast loss determination submodule is used to determine the noise contrast loss for each sample pair based on the difference between the sample noise features of the two sets of samples included in each sample pair.

[0243] The parameter adjustment submodule is used to adjust the parameters of the initial leakage determination model with the optimization direction of reducing the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and reducing the noise contrast loss corresponding to each sample pair.

[0244] As one embodiment of this application, the initial leakage determination model may include a sound signal encoder, an environmental information encoder, and a fusion module. In this case, the leakage prediction module 1102 may include:

[0245] The sample signal encoding submodule is used to input the group of samples into the initial leakage determination model so that the sound signal encoder encodes the sample sound signals included in the group of samples to obtain sample sound encoding features, and inputs the sample sound encoding features into the fusion module. The environmental information encoder encodes the sample environmental information included in the group of samples to obtain sample environmental encoding features, and inputs the sample environmental encoding features into the fusion module.

[0246] The sample fusion feature vector determination submodule is used by the fusion module to fuse the sample sound coding features and sample environment coding features corresponding to the group of samples to obtain the sample fusion feature vector.

[0247] The sample leakage feature determination submodule is used to separate sample noise features and sample leakage features from the sample fusion feature vector.

[0248] As one embodiment of this application, the above-mentioned sample leakage characteristic determination submodule may include:

[0249] The vector segmentation unit is used to segment the sample fusion feature vector according to a preset segmentation method to obtain a first sample sub-vector and a second sample sub-vector, wherein the first sample sub-vector is related to the sample leakage feature and the second sample sub-vector is related to the sample noise feature.

[0250] As one embodiment of this application, the leakage prediction module 1102 may further include:

[0251] The sample vector concatenation submodule is used to concatenate the first subvector of the sample and the sample environment encoding features to obtain the concatenated sample vector;

[0252] The gas leakage prediction submodule is used to determine the correspondence between the sample splicing vector currently learned by the model and the leakage amount based on the sample splicing vector and the initial leakage amount, and output the predicted gas leakage amount.

[0253] Corresponding to the above-described method for determining gas leakage, this application also provides another device for determining gas leakage. The following describes the other device for determining gas leakage provided in this application.

[0254] A gas leak determination device, the device comprising an environmental sensor, a microphone array, and a processor, wherein:

[0255] The environmental sensor is used to collect environmental information about the location of the gas leak;

[0256] The microphone array is used to collect sound signals near the gas leak location;

[0257] The processor is configured to acquire the environmental information and the sound signal, and input the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines the gas leakage amount based on the sound signal and the environmental information.

[0258] As can be seen, in this embodiment, an environmental sensor can be used to collect environmental information about the gas leak location; a microphone array can be used to collect sound signals near the gas leak location; and a processor can be used to acquire environmental information and sound signals, and input the sound signals and environmental information into a pre-trained leak determination model, so that the leak determination model can determine the gas leak amount based on the sound signals and environmental information. Since the strength of the sound signal can reflect the amount of gas leak, and the environmental information can reflect the acquisition conditions of the sound signal, the leak determination model can determine the gas leak amount reflected by the sound signal collected by the microphone array near the gas leak location under the acquisition conditions represented by the environmental information, based on the sound signal and environmental information.

[0259] When a gas pipeline leaks, the leak opening is typically small. Due to the pressure difference between the inside and outside of the pipeline, turbulence occurs, generating specific sound signals. The intensity of these sound signals usually varies depending on the amount of gas leaked. Therefore, to determine the amount of gas leak, a processor can acquire sound signals collected by a microphone array near the leak location.

[0260] Since environmental information significantly affects the sound intensity of gas leaks (e.g., higher ambient temperature results in higher sound intensity), electronic devices can acquire environmental information collected by environmental sensors when determining the amount of gas leakage. The electronic devices can then input the sound signal and environmental information into a pre-trained leakage determination model. Because the strength of the sound signal reflects the amount of gas leakage, and the environmental information reflects the acquisition conditions of the sound signal, the leakage determination model can, based on the sound signal and environmental information, determine the amount of gas leakage reflected by the sound signal collected by the microphone array near the gas leak location under the acquisition conditions represented by the environmental information.

[0261] As one embodiment of this application, the above-mentioned environmental sensor may include at least one of an ultrasonic sensor, a temperature sensor, and a humidity sensor, wherein: the ultrasonic sensor is used to collect ultrasonic echo signals; the temperature sensor is used to collect temperature signals; and the humidity sensor is used to collect humidity signals.

[0262] In other words, environmental sensors can include one or more of ultrasonic sensors, temperature sensors, and humidity sensors. For example, assuming the environmental sensor is an ultrasonic sensor, the environmental information can be ultrasonic echo signals. Assuming the environmental sensor is both a temperature sensor and a humidity sensor, the environmental information can be temperature signals and humidity signals.

[0263] As one embodiment of this application, the processor described above can be specifically used to input the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage features, and determines the gas leakage amount based on the leakage features and the environmental information, wherein the leakage features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information;

[0264] The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

[0265] As one embodiment of this application, the leakage determination model may include a sound signal encoder, an environmental information encoder, and a fusion module. In this case, the processor may specifically be used to input the sound signal into the sound signal encoder, so that the sound signal encoder encodes the sound signal to obtain sound coding features, and input the sound coding features into the fusion module; input the environmental information into the environmental information encoder, so that the environmental information encoder encodes the environmental information to obtain environmental coding features, and input the environmental coding features into the fusion module; the fusion module performs fusion processing on the sound coding features and the environmental coding features to obtain a fused feature vector; and removes the noise features included in the fused feature vector to obtain the leakage feature.

[0266] As one embodiment of this application, the processor described above can be used to segment the fused feature vector according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and remove the second sub-vector, wherein the first sub-vector is related to the leakage feature and the second sub-vector is related to the noise feature.

[0267] As one embodiment of this application, the processor described above can be used to concatenate the first sub-vector and the environmental coding features to obtain a concatenated vector; based on the concatenated vector and the leakage amount, determine the correspondence between the sample concatenated vector and the leakage amount learned by the model during training, and output the gas leakage amount.

[0268] This application also provides an electronic device, as shown in FIG12, including:

[0269] Memory 1201 is used to store computer programs;

[0270] When the processor 1202 executes the program stored in the memory 1201, it implements the gas leakage determination method and the leakage determination model training method described in any of the above embodiments.

[0271] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 1202, the communication interface, and the memory 1201 communicating with each other via the communication bus.

[0272] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0273] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0274] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0275] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0276] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described gas leakage determination methods or the steps of any leakage determination model training method.

[0277] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the gas leakage determination methods or any leakage determination model training methods in the above embodiments.

[0278] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.

[0279] 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, 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 limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0280] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0281] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A gas leakage amount determination method characterized by comprising: The method includes: Acquire environmental information about the gas leak location and collect sound signals near the gas leak location; The sound signal and the environmental information are input into a pre-trained leakage determination model, so that the leakage determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage features, and determines the gas leakage amount based on the leakage features and the environmental information. The leakage features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information. The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

2. The method of claim 1, wherein, The leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module; The step of inputting the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines fused information based on the sound signal and the environmental information, and removes noise features from the fused information to obtain leakage features, includes: The sound signal is input into the sound signal encoder so that the sound signal encoder encodes the sound signal to obtain sound coding features, and the sound coding features are input into the fusion module; The environmental information is input into the environmental information encoder so that the environmental information encoder encodes the environmental information to obtain environmental coding features, and the environmental coding features are input into the fusion module; The fusion module performs a fusion process on the sound coding features and the environment coding features to obtain a fused feature vector; The leakage feature is obtained by removing the noise features included in the fused feature vector.

3. The method of claim 2, wherein, The step of removing noise features from the fused feature vector to obtain leakage features includes: The fused feature vector is segmented according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and the second sub-vector is removed. The first sub-vector is related to the leakage feature, and the second sub-vector is related to the noise feature.

4. The method of claim 3, wherein, The step of determining the gas leakage amount based on the leakage characteristics and the environmental information includes: The first sub-vector and the environment coding feature are concatenated to obtain a concatenated vector; Based on the splicing vector and the leakage amount, the model determines the correspondence between the sample splicing vector and the leakage amount learned during training, and outputs the gas leakage amount.

5. The method according to any one of claims 1 to 4, characterized in that, The step of obtaining environmental information about the gas leak location includes: Acquire the ultrasonic echo signal collected by the ultrasonic sensor; or, Acquire the temperature signal collected by the temperature sensor, and / or acquire the humidity signal collected by the humidity sensor.

6. A method of training a leak amount determination model, characterized by, The method includes: Acquire multiple sample pairs and gas leakage labels corresponding to the samples included in the multiple sample pairs, wherein each sample pair includes two sets of samples collected under the same environmental noise, and each set of samples includes sample sound signal and sample environmental information; For each set of samples, the set of samples is input into the initial leakage amount determination model, so that the initial leakage amount determination model determines the sample fusion information based on the sample sound signal and sample environmental information included in the set of samples, and separates the sample noise features and sample leakage amount features from the sample fusion information, and determines the predicted gas leakage amount according to the sample leakage amount features and the sample environmental information, wherein the sample leakage amount features characterize the characteristics of the sample sound signal generated by the gas leakage under the influence of the sample environmental information; Based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, the parameters of the initial leakage amount determination model are adjusted until the initial leakage amount determination model meets the convergence condition, thus obtaining the leakage amount determination model.

7. The method of claim 6, wherein, The step of adjusting the parameters of the initial leakage determination model based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, includes: Based on the difference between the sample noise features of the two sets of samples included in each sample pair, determine the noise contrast loss corresponding to each sample pair; The parameters of the initial leakage determination model are adjusted to optimize the reduction of the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and to reduce the noise contrast loss corresponding to each sample pair.

8. The method of claim 6, wherein, The initial leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module; The step of inputting the set of samples into an initial leakage determination model, so that the initial leakage determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the set of samples, and separating sample noise features and sample leakage features from the sample fusion information, includes: The sample group is input into the initial leakage determination model so that the sound signal encoder encodes the sample sound signals included in the sample group to obtain sample sound coding features, and the sample sound coding features are input into the fusion module. The environmental information encoder encodes the sample environmental information included in the sample group to obtain sample environmental coding features, and the sample environmental coding features are input into the fusion module. The fusion module performs fusion processing on the sample sound coding features and sample environment coding features corresponding to the group of samples to obtain the sample fusion feature vector; The sample noise features and sample leakage features are separated from the sample fusion feature vector.

9. The method of claim 8, wherein, The step of separating sample noise features and sample leakage features from the sample fusion feature vector includes: The sample fusion feature vector is segmented according to a preset segmentation method to obtain a first sample sub-vector and a second sample sub-vector, wherein the first sample sub-vector is related to the sample leakage feature and the second sample sub-vector is related to the sample noise feature.

10. The method of claim 9, wherein, The step of determining the predicted gas leakage amount based on the leakage characteristics of the sample and the sample environmental information includes: The first sub-vector of the sample and the environmental encoding feature of the sample are concatenated to obtain the concatenated sample vector. Based on the sample splicing vector and the initial leakage amount, the model determines the correspondence between the currently learned sample splicing vector and the leakage amount, and outputs the predicted gas leakage amount.

11. A gas leakage amount determining apparatus characterized by comprising: The device includes: The signal acquisition module is used to acquire environmental information about the gas leak location and sound signals collected near the gas leak location; The leakage amount determination module is used to input the sound signal and the environmental information into a pre-trained leakage amount determination model, so that the leakage amount determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage amount features, and determines the gas leakage amount according to the leakage amount features and the environmental information. The leakage amount features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information. The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

12. The apparatus of claim 11, wherein, The leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module; The leakage determination module includes: The audio signal encoding submodule is used to input the audio signal into the audio signal encoder so that the audio signal encoder encodes the audio signal to obtain audio encoding features, and inputs the audio encoding features into the fusion module; An environmental signal encoding submodule is used to input the environmental information into the environmental information encoder so that the environmental information encoder encodes the environmental information to obtain environmental encoding features, and inputs the environmental encoding features into the fusion module; A feature vector fusion determination submodule is used by the fusion module to fuse the sound coding features and the environment coding features to obtain a fused feature vector. The leakage feature determination submodule is used to remove noise features included in the fused feature vector to obtain leakage features; The leakage characteristic determination submodule includes: The vector segmentation module is used to segment the fused feature vector according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and remove the second sub-vector, wherein the first sub-vector is related to the leakage feature and the second sub-vector is related to the noise feature; The leakage determination module further includes: The vector concatenation submodule is used to concatenate the first subvector and the environment coding feature to obtain a concatenated vector; The gas leakage determination submodule is used to output the gas leakage amount based on the splicing vector and the correspondence between the sample splicing vector and the leakage amount learned by the leakage determination model during training. The signal acquisition module includes: The first signal acquisition module is used to acquire the ultrasonic echo signal collected by the ultrasonic sensor; The second signal acquisition module is used to acquire the temperature signal collected by the temperature sensor, and / or acquire the humidity signal collected by the humidity sensor.

13. A device for training a leak amount determination model, characterized by, The device includes: The sample signal acquisition module is used to acquire multiple sample pairs and the gas leakage amount tags corresponding to the samples included in the multiple sample pairs. Each sample pair includes two sets of samples collected under the same environmental noise. Each set of samples includes sample sound signals and sample environmental information. The leakage prediction module is used to input each group of samples into an initial leakage determination model, so that the initial leakage determination model determines sample fusion information based on the sample sound signals and sample environmental information included in the group of samples, separates the sample noise features and sample leakage features from the sample fusion information, and determines the predicted gas leakage amount based on the sample leakage features and the sample environmental information, wherein the sample leakage features characterize the characteristics of the sample sound signals generated by gas leakage under the influence of the sample environmental information; The parameter adjustment module is used to adjust the parameters of the initial leakage determination model based on the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and the difference between the sample noise features corresponding to the two groups of samples included in each sample pair, until the initial leakage determination model meets the convergence condition, thus obtaining the leakage determination model.

14. The apparatus of claim 13, wherein, The parameter adjustment module includes: The noise contrast loss determination submodule is used to determine the noise contrast loss for each sample pair based on the difference between the sample noise features of the two sets of samples included in each sample pair. The parameter adjustment submodule is used to adjust the parameters of the initial leakage determination model with the optimization direction of reducing the difference between the predicted gas leakage amount and the gas leakage amount label corresponding to each group of samples, and reducing the noise contrast loss corresponding to each sample. The initial leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module; The leakage prediction module includes: The sample signal encoding submodule is used to input the group of samples into the initial leakage determination model so that the sound signal encoder encodes the sample sound signals included in the group of samples to obtain sample sound encoding features, and inputs the sample sound encoding features into the fusion module. The environmental information encoder encodes the sample environmental information included in the group of samples to obtain sample environmental encoding features, and inputs the sample environmental encoding features into the fusion module. The sample fusion feature vector determination submodule is used by the fusion module to fuse the sample sound coding features and sample environment coding features corresponding to the group of samples to obtain the sample fusion feature vector. The sample leakage feature determination submodule is used to separate sample noise features and sample leakage features from the sample fusion feature vector; The sample leakage characteristic determination submodule includes: The vector segmentation unit is used to segment the sample fusion feature vector according to a preset segmentation method to obtain a first sample sub-vector and a second sample sub-vector, wherein the first sample sub-vector is related to the sample leakage feature and the second sample sub-vector is related to the sample noise feature. The leakage prediction module also includes: The sample vector concatenation submodule is used to concatenate the first subvector of the sample and the sample environment encoding features to obtain the concatenated sample vector; The gas leakage prediction submodule is used to determine the correspondence between the sample splicing vector currently learned by the model and the leakage amount based on the sample splicing vector and the initial leakage amount, and output the predicted gas leakage amount.

15. A gas leakage amount determining apparatus characterized by comprising: The device includes an environmental sensor, a microphone array, and a processor, wherein: The environmental sensor is used to collect environmental information about the location of the gas leak; The microphone array is used to collect sound signals near the gas leak location; The processor is configured to acquire the environmental information and the sound signal, and input the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines the gas leakage amount based on the sound signal and the environmental information.

16. The apparatus of claim 15, wherein, The environmental sensor includes at least one of an ultrasonic sensor, a temperature sensor, and a humidity sensor, wherein: The ultrasonic sensor is used to collect ultrasonic echo signals; The temperature sensor is used to collect temperature signals; The humidity sensor is used to collect humidity signals.

17. The apparatus according to claim 15 or 16, characterized in that, The processor is specifically configured to input the sound signal and the environmental information into a pre-trained leakage determination model, so that the leakage determination model determines fusion information based on the sound signal and the environmental information, removes noise features from the fusion information to obtain leakage features, and determines the gas leakage amount based on the leakage features and the environmental information. The leakage features characterize the characteristics of the sound signal generated by the gas leakage under the influence of the environmental information. The leakage determination model is trained based on at least the noise contrast loss, which is determined based on the difference in sample noise features in the sample fusion information of the two groups of samples included in the sample pair. The two groups of samples included in the sample pair are collected under the same environmental noise, and each group of samples includes sample sound signals and sample environmental information.

18. The apparatus of claim 17, wherein, The leakage determination model includes a sound signal encoder, an environmental information encoder, and a fusion module; The processor is specifically configured to input the sound signal into the sound signal encoder, so that the sound signal encoder encodes the sound signal to obtain sound coding features, and input the sound coding features into the fusion module; The environmental information is input into the environmental information encoder so that the environmental information encoder encodes the environmental information to obtain environmental coding features, and the environmental coding features are input into the fusion module; the fusion module performs fusion processing on the sound coding features and the environmental coding features to obtain a fusion feature vector; the noise features included in the fusion feature vector are removed to obtain the leakage feature.

19. The apparatus according to claim 18, characterized in that, The processor is specifically used to segment the fused feature vector according to a preset segmentation method to obtain a first sub-vector and a second sub-vector, and remove the second sub-vector, wherein the first sub-vector is related to the leakage feature and the second sub-vector is related to the noise feature.

20. The apparatus according to claim 19, characterized in that, The processor is specifically used to concatenate the first sub-vector and the environmental coding features to obtain a concatenated vector; based on the concatenated vector and the leakage amount, it determines the correspondence between the sample concatenated vector and the leakage amount learned by the model during training, and outputs the gas leakage amount.

21. An electronic device, comprising: include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method according to any one of claims 1-5 or any one of claims 6-10.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-5 or any one of claims 6-10.

23. A computer program product comprising instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method according to any one of claims 1-5 or any one of claims 6-10.