CN113009077B - Gas detection method, gas detection device, electronic equipment and storage medium - Google Patents

Gas detection method, gas detection device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113009077B
CN113009077B CN202110187767.XA CN202110187767A CN113009077B CN 113009077 B CN113009077 B CN 113009077B CN 202110187767 A CN202110187767 A CN 202110187767A CN 113009077 B CN113009077 B CN 113009077B
Authority
CN
China
Prior art keywords
gas
neuron
layer
hidden layer
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110187767.XA
Other languages
Chinese (zh)
Other versions
CN113009077A (en
Inventor
陈浩敏
姚森敬
辛文成
席禹
张凡
敖榜
于力
符健
王诗文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Artificial Intelligence Technology Co ltd
Original Assignee
Southern Power Grid Digital Grid Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Southern Power Grid Digital Grid Research Institute Co Ltd
Priority to CN202110187767.XA priority Critical patent/CN113009077B/en
Publication of CN113009077A publication Critical patent/CN113009077A/en
Application granted granted Critical
Publication of CN113009077B publication Critical patent/CN113009077B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N33/00Investigating or analysing materials by specific methods not covered by groups G01N1/00 - G01N31/00
    • G01N33/0004Gaseous mixtures, e.g. polluted air
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N27/00Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N27/00Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
    • G01N27/02Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating impedance
    • G01N27/04Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating impedance by investigating resistance
    • G01N27/12Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating impedance by investigating resistance of a solid body in dependence upon absorption of a fluid; of a solid body in dependence upon reaction with a fluid, for detecting components in the fluid
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N27/00Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
    • G01N27/26Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating electrochemical variables; by using electrolysis or electrophoresis
    • G01N27/416Systems
    • G01N27/4162Systems investigating the composition of gases, by the influence exerted on ionic conductivity in a liquid
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N27/00Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
    • G01N27/26Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating electrochemical variables; by using electrolysis or electrophoresis
    • G01N27/416Systems
    • G01N27/417Systems using cells, i.e. more than one cell and probes with solid electrolytes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A50/00TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE in human health protection, e.g. against extreme weather
    • Y02A50/20Air quality improvement or preservation, e.g. vehicle emission control or emission reduction by using catalytic converters

Landscapes

  • Chemical & Material Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Electrochemistry (AREA)
  • Molecular Biology (AREA)
  • Engineering & Computer Science (AREA)
  • Combustion & Propulsion (AREA)
  • Food Science & Technology (AREA)
  • Medicinal Chemistry (AREA)
  • Investigating Or Analyzing Materials By The Use Of Electric Means (AREA)

Abstract

The application relates to a gas detection method, a gas detection device, an electronic device and a storage medium. The method comprises the following steps: acquiring a detection signal of the gas to be detected, which is acquired by a gas sensor; and detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result. The training process of the gas detection model comprises the following steps: acquiring a training sample set; acquiring preset parameters of each neuron node, and training each gas type detection model corresponding to each neuron node parameter according to a training sample set to acquire each gas type detection result; comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as a gas detection model. By adopting the method to obtain the gas detection model, the gas detection time can be effectively shortened, the detection precision can be improved, the rapid and accurate detection of the leakage of the gas and the decomposition products thereof can be realized, and the safety and stability of the operation of the power system can be improved.

Description

Gas detection method, gas detection device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of power system fault detection technologies, and in particular, to a gas detection method, a device, an electronic apparatus, and a storage medium.
Background
With the rapid increase of power demand, power systems are continually adapting to social development and undergoing tremendous changes. Inert gas sulfur hexafluoride (SF) 6 ) Has been widely used in electric power systems, such as SF, due to its good arc extinguishing and insulating properties 6 Breaker, SF 6 Transformer, SF 6 Insulating substations, etc. SF (sulfur hexafluoride) 6 The gas is nontoxic and not easy to burn under normal conditions, but can be decomposed under the action of strong discharge or high temperature to generate toxic or corrosive stable gas. If SF is 6 The gas decomposition and the leakage of decomposition products thereof seriously weaken the insulation capability, not only lead to the failure of power system equipment, but also influence the life and health of staff, and bring about great potential safety hazard. Thus, for SF 6 The detection of gas decomposition and leakage of its decomposition products is critical to the safe and stable operation of the power system.
For SF as is commonly used in conventional techniques 6 The detection of gas decomposition and leakage of decomposition products mainly comprises gas chromatography, mass spectrometry, infrared spectrometry and the like. However, gas chromatography and mass spectrometry are mainly used for laboratory analysis, are not suitable for on-site detection of a power system, have a cross interference phenomenon of gas absorption peaks in infrared spectrometry, are difficult to realize accurate measurement, and cannot realize rapid and accurate detection of leakage of gas decomposition products, so that the safety and stability of operation of the power system are affected.
Disclosure of Invention
Based on the above, it is necessary to provide a gas detection method, a device, an electronic apparatus, and a storage medium, which can realize rapid and accurate detection of leakage of a gas decomposition product, thereby improving safety and stability of operation of an electric power system.
A method of gas detection, the method comprising:
acquiring a detection signal of the gas to be detected, which is acquired by a gas sensor;
detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result;
the training process of the gas detection model comprises the following steps:
acquiring a training sample set, wherein the training sample in the training sample set comprises detection signals of all target gases acquired by a gas sensor;
acquiring preset parameters of each neuron node, and training each gas type detection model corresponding to each neuron node parameter according to the training sample set to acquire each gas type detection result corresponding to each gas type detection model;
comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as the gas detection model.
In one embodiment, the structure of the gas type detection model includes an input layer, a hidden layer, and an output layer, the hidden layer including a first hidden layer and a second hidden layer; training a gas type detection model corresponding to the neuron node parameters according to the training sample set to obtain a gas type detection result corresponding to the gas type detection model, wherein the training sample set comprises the following steps:
the input layer generates a feature vector group based on the features of the training sample set with a preset number;
the first hidden layer calculates a feature matrix based on a preset neuron node parameter, an activation function of the first hidden layer, a connection weight and a bias vector of the input layer corresponding to the preset neuron node parameter and the first hidden layer, and the feature matrix based on the feature vector group;
the second hidden layer calculates the probability of the gas type corresponding to the training sample set based on the Gaussian connection model of the first hidden layer and the second hidden layer and the feature matrix;
and the output layer takes the gas type corresponding to the maximum probability as the gas type detection result and outputs the gas type.
In one embodiment, the determining manner of the neuron node parameter preset in the hidden layer includes:
Determining the initial value of each neuron node parameter according to the preset quantity relation between the hidden layer and the neuron node of the input layer or the output layer;
setting each value range corresponding to the initial value of each neuron node parameter, and taking each numerical value in each value range as the preset neuron node parameter in the hidden layer.
In one embodiment, the comparing each of the gas type detection results, determining the neuron node parameter based on the comparison results, includes:
acquiring the operation time of each gas type detection result and the detection precision of each gas type detection result by each gas type detection model;
and scoring each gas type detection model based on the running time and the detection precision according to a preset scoring standard, and determining the neuron node parameter of the first hidden layer in the gas type detection model with the highest score as the neuron node parameter.
In one embodiment, the number relationship between the preset hidden layer and the neuron node of the input layer or the output layer includes:
the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer satisfy the number empirical formula of the neuron nodes.
In one embodiment, the number relationship between the preset hidden layer and the neuron node of the input layer or the output layer includes:
the number of neuron nodes of the hidden layer is between the number of neuron nodes of the input layer and the output layer.
In one embodiment, the number relationship between the preset hidden layer and the neuron node of the input layer or the output layer includes:
the number of neuron nodes of the hidden layer is a multiple of the sum of the number of neuron nodes of the input layer and the output layer.
In one embodiment, the number relationship between the preset hidden layer and the neuron node of the input layer or the output layer includes:
the number of neuron nodes of the hidden layer is no more than twice the number of neuron nodes of the input layer.
In one embodiment, after the obtaining of the gas detection result, the method further includes:
and outputting an alarm signal when the gas detection result is one of the target gases.
A gas detection apparatus, the apparatus comprising:
the signal acquisition module is used for acquiring detection signals of the gas to be detected, which are acquired by the gas sensor;
The gas detection module is used for detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result;
the gas detection model acquisition module is used for acquiring the gas detection model, wherein the training process of the gas detection model comprises the following steps: acquiring a training sample set, wherein the training sample in the training sample set comprises detection signals of all target gases acquired by a gas sensor; acquiring preset parameters of each neuron node, and training each gas type detection model corresponding to each neuron node parameter according to the training sample set to acquire each gas type detection result corresponding to each gas type detection model; comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as the gas detection model.
An electronic device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method described above.
A gas detection system, the gas detection system comprising: a gas sensor and an electronic device as described above;
the gas sensor is used for collecting detection signals of the gas to be detected;
the electronic equipment is used for acquiring the detection signal of the gas to be detected acquired by the gas sensor, and detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result.
The gas detection method, the device, the electronic equipment and the storage medium are used for acquiring the detection signal of the gas to be detected, which is acquired by the gas sensor; and detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result. The training process of the gas detection model comprises the following steps: acquiring a training sample set, wherein the training sample in the training sample set comprises detection signals of all target gases acquired by a gas sensor; acquiring preset parameters of each neuron node, and training each gas type detection model corresponding to each neuron node parameter according to a training sample set to acquire each gas type detection result corresponding to each gas type detection model; comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as a gas detection model. By adopting the method of the embodiment, each gas type detection model is trained through the preset neuron node parameters, and the gas type detection results of each gas type detection model are compared to determine the gas detection model, so that the running time of the gas detection model during gas detection can be effectively shortened, the detection precision is improved, the rapid and accurate detection of the leakage of the gas decomposition products in the power system is realized, and the safety and stability of the operation of the power system are improved.
Drawings
FIG. 1 is a diagram of an application environment of a gas detection method in one embodiment;
FIG. 2 is a flow chart of a method of detecting gas in one embodiment;
FIG. 3 is a schematic flow diagram of training a gas detection model in one embodiment;
FIG. 4 is a schematic diagram of a gas detection model in one embodiment;
FIG. 5 is a block diagram of a gas detection apparatus in one embodiment;
FIG. 6 is a block diagram of a gas detection model acquisition module in one embodiment;
FIG. 7 is an internal block diagram of an electronic device in one embodiment;
fig. 8 is an internal structural diagram of an electronic device in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In one embodiment, the gas detection method provided in the present application may be applied to an application environment as shown in fig. 1, where the application environment may involve both a terminal 102 and a server 104, where the terminal 102 communicates with the server 104 through a network. Specifically, the server 104 acquires a detection signal of the gas to be detected acquired by the gas sensor through the terminal 102, and detects a gas type corresponding to the detection signal by adopting a gas detection model, thereby obtaining a gas detection result. Wherein, the gas detection model can be obtained by training of the server 104, and the training process of the gas detection model comprises the following steps: acquiring a training sample set through a terminal 102, wherein the training sample in the training sample set comprises detection signals of all target gases acquired by a gas sensor; acquiring preset parameters of each neuron node, and training each gas type detection model corresponding to each neuron node parameter according to a training sample set to acquire each gas type detection result corresponding to each gas type detection model; comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as a gas detection model.
In one embodiment, the terminal 102 may also obtain the gas detection model from the server 104 after the server 104 has trained to obtain the gas detection model. The terminal 102 acquires a detection signal of the gas to be detected, which is acquired by the gas sensor, and adopts a gas detection model to detect the gas type corresponding to the detection signal, so as to obtain a gas detection result.
In one embodiment, the terminal 102 may also train to obtain a gas detection model, the terminal 102 obtains a detection signal of the gas to be detected, which is collected by the gas sensor, and uses the gas detection model to detect a gas type corresponding to the detection signal, so as to obtain a gas detection result.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a gas detection method is provided, which is illustrated by using the method applied to the terminal 102 or the server 104 for gas detection in fig. 1, and includes the following steps:
step S202, a detection signal of the gas to be detected, which is acquired by the gas sensor, is acquired.
The gas sensor is a converter for converting the performance index of the gas to be detected into a corresponding electric signal, and the types of the gas sensor can comprise a semiconductor gas sensor, an electrochemical gas sensor, a solid electrolyte gas sensor and the like, and the corresponding gas sensor can be selected according to the type of the gas to be detected. The detection signals of the gas to be detected, which are acquired by the gas sensor, can comprise signals of current, voltage, response time, recovery time, responsiveness and the like of the gas to be detected.
In one embodiment, the inert gas sulfur hexafluoride (SF 6 ) Is colorless, odorless, nontoxic, and incombustible gas with high stability, and can decompose under the action of strong discharge or high temperature to generate toxic or corrosive stable gas such as sulfur dioxide (SO) 2 ) Hydrogen Fluoride (HF), hydrogen sulfide (H) 2 S), carbon monoxide (CO), and the like. When applied to a power systemSF of (2) 6 And its decomposition product SO 2 、HF、H 2 When the detection signal of S, CO is collected, a Metal Oxide Semiconductor (MOS) gas sensor which is low in cost and can respond to various gases can be selected. Wherein the number of MOS gas sensors may be one or more.
Specifically, a detection signal of a gas to be detected acquired by a MOS gas sensor is acquired.
Step S204, detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result.
In one embodiment, because the training gas detection model occupies more resources, the gas detection model is a pre-trained gas detection model, and when the training gas detection model is used in actual production, the pre-trained gas detection model can be stored and integrated on a chip for calling, a detection signal of the gas to be detected is led into the chip, and the gas type corresponding to the detection signal is detected by adopting the gas detection model in the chip. The computer programming language used in training the gas detection model may be Python, c++, java, android, or the like. The chip may be an ARM (Advanced RISC Machine, ARM) chip with a 32-bit Reduced Instruction Set (RISC) processor architecture.
In one embodiment, the detection signal of the gas to be detected may be a digital signal or an analog signal. When the detection signal of the gas to be detected is a digital signal, the gas sensor can be directly connected with the ARM chip and is transmitted to the ARM chip through the peripheral interface bus for gas detection. The peripheral interface can be a serial peripheral interface (Serial Peripheral Interface, SPI), and has the advantages of supporting full duplex communication, being simple in communication, high in data transmission rate and the like. When the detection signal of the gas to be detected is an analog signal, the gas sensor can be connected with the ARM chip through the analog-to-digital conversion chip, the analog signal is converted into a digital signal through the analog-to-digital conversion chip, and then the digital signal is transmitted to the ARM chip through the peripheral interface bus for gas detection.
Specifically, a gas detection model is adopted to detect the gas type corresponding to the detection signal, and the gas type corresponding to the detection signal, namely a gas detection result, is obtained.
In one embodiment, as shown in fig. 3, a training process of the gas detection model is provided, and the process is taken as an example for application to a terminal 102 or a server 104 for training the gas detection model, and includes the following steps:
step S302, a training sample set is obtained, wherein the training samples in the training sample set comprise detection signals of target gases acquired by a gas sensor.
In one embodiment, when applied to SF in a power system 6 And its decomposition product SO 2 、HF、H 2 S, CO, etc., the training samples in the training sample set for training the gas detection model include SF acquired by the gas sensor 6 、SO 2 、HF、H 2 S, CO, etc. Wherein the collected SF 6 、SO 2 、HF、H 2 S, CO and the like are called target gas, and a gas detection model is obtained by training a detection signal of the target gas, so that the detection precision of the gas detection model on the target gas is effectively improved.
Specifically, when training the gas detection model, a training sample set is obtained, wherein the training sample in the training sample set comprises each target gas SF acquired by the gas sensor 6 、SO 2 、HF、H 2 S, CO, etc., the detection signals may include signals of current, voltage, response time, recovery time, responsiveness, etc., of each target gas.
Step S304, obtaining preset parameters of each neuron node, training each gas type detection model corresponding to each neuron node parameter according to a training sample set, and obtaining each gas type detection result corresponding to each gas type detection model.
In one embodiment, the gas type detection model adopts a multi-layer feedforward neural network (Back Propagation Neural Network, BP neural network) model trained according to an error back propagation algorithm in machine learning, information of the model flows from front to back, the model has any complex pattern classification capability and excellent multidimensional function mapping capability, the neural structure can be described as an input layer, a hidden layer and an output layer structure, neuron nodes inside separate layers are not connected with each other, and two adjacent layers are generally fully connected, namely each neuron node of one layer is connected with each neuron node of the other layer. Specifically, the number of neuron nodes of the input layer is the same as the number of features of the input, the number of neuron nodes of the output layer is the same as the number of targets of the output, and the number of neuron nodes of the hidden layer is not determined. When the number of the neuron nodes of the hidden layer is too large, the information of the detection signals contained in the training sample set is insufficient to train all the neuron nodes in the hidden layer, which results in over fitting, and even if the information of the detection signals contained in the training sample set is sufficient, the excessive neuron nodes can increase the training time of the model, otherwise, when the number of the neuron nodes of the hidden layer is too small, under fitting can be caused, so that it is important to set appropriate parameters of the neuron nodes of the hidden layer.
In one embodiment, the training gas type detection model employs an Extreme Learning-Bayesian Network (EL-BN) recognition algorithm. Wherein the algorithm converts the random neural network node values, i.e., the random feature values, generated by the extreme learning machine (Extreme Learning Machine, ELM) algorithm into probability values for predicting gas types to further mine the gas type information contained by the random features. Compared with an extreme learning machine ELM algorithm and a Bayesian network BN algorithm, the EL-BN recognition algorithm can enrich the characteristics of a training sample set, so that the detection performance of gas is improved.
In one embodiment, because of the uncertainty of hidden layer neuron node parameters, each neuron node parameter is preset in order to improve training efficiency. Specifically, when the gas detection model is trained, preset parameters of each neuron node need to be obtained, each gas type detection model corresponding to each neuron node parameter is trained according to the training sample set, and each gas type detection result of each target gas in the training sample set corresponding to each gas type detection model is obtained.
And step S306, comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as a gas detection model.
Specifically, after each gas type detection result corresponding to each gas type detection model is obtained, the gas type detection results are compared to obtain a comparison result. And determining the neuron node parameters based on the comparison result, and taking the gas type detection model corresponding to the determined neuron node parameters as a gas detection model obtained by final training.
In the gas detection method, the detection signal of the gas to be detected, which is acquired by the gas sensor, is acquired; and detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result. The training process of the gas detection model comprises the following steps: acquiring a training sample set, wherein the training sample in the training sample set comprises detection signals of all target gases acquired by a gas sensor; acquiring preset parameters of each neuron node, and training each gas type detection model corresponding to each neuron node parameter according to a training sample set to acquire each gas type detection result corresponding to each gas type detection model; comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as a gas detection model. By adopting the method of the embodiment, each gas type detection model is trained through the preset neuron node parameters, and the gas type detection results of each gas type detection model are compared to determine the gas detection model, so that the running time of the gas detection model during gas detection can be effectively shortened, the detection precision is improved, the rapid and accurate detection of the leakage of the gas decomposition products in the power system is realized, and the safety and stability of the operation of the power system are improved.
In one embodiment, in training a gas type detection model, the structure of the gas type detection model includes an input layer, a hidden layer, and an output layer. The hidden layers comprise a first hidden layer and a second hidden layer. Specifically, training a gas type detection model corresponding to the neuron node parameters according to the training sample set to obtain a gas type detection result corresponding to the gas type detection model, including:
in step S402, the input layer generates a feature vector set based on features of a preset number of training sample sets.
In one embodiment, the number of the neuron nodes of the input layer is the same as the number of the features of the training sample set, and the number of the neuron nodes of the input layer is set to be L, and each neuron node represents the feature of the detection signal of each target gas acquired by the gas sensor in the training sample set.
Specifically, the input layer generates a feature vector set based on the features of the L training sample sets, expressed as:
X=[x 1 ,x 2 ,…,x L ] T
wherein x represents the characteristics of the training sample set, x 1 ,x 2 ,...,x L The training sample set is represented as 1, 2.l features, and X represents a set of feature vectors.
In step S404, the first hidden layer calculates the feature matrix based on the preset neuron node parameters, the activation function of the first hidden layer, and the connection weights and bias vectors of the input layer and the first hidden layer corresponding to the preset neuron node parameters.
In one embodiment, the input layer and the first hidden layer are connected through an activation function, which may be a Sigmoid activation function. The Sigmoid activation function is a common S-shaped function, has the properties of monotonic increment, inverse function monotonic increment and the like, and can map variables to between 0 and 1. The number of neuron nodes of the first hidden layer is set to M.
Specifically, the first hidden layer calculates a feature matrix G according to M neuronal nodes, a Sigmoid activation function of the first hidden layer, and connection weights and bias vectors of input layers corresponding to M neuronal node parameters and the first hidden layer, and based on a feature vector group X, the feature matrix G is expressed as:
Figure BDA0002943751670000101
wherein G represents a feature matrix, w and b represent connection weights and bias vectors of the input layer and the first hidden layer, respectively, w 1 ,...w M And b 1 ,...b M Respectively representing connection weights and bias vectors of input layers and first hidden layers corresponding to the M neuron nodes, x represents characteristics of a training sample set, x 1 ,x 2 ,...,x L The training sample set is represented as 1, 2..l features, g (·) represents the Sigmoid activation function.
In step S406, the second hidden layer calculates the probability of the gas type corresponding to the training sample set based on the gaussian connection model of the first hidden layer and the second hidden layer and the feature matrix.
In one embodiment, the connection between the first hidden layer and the second hidden layer may be made by a gaussian model. The gaussian model precisely quantizes things by using a gaussian probability density function, namely a normal distribution curve, and decomposes one thing into a plurality of models formed by the gaussian probability density function, namely the normal distribution curve. The number of neuron nodes of the second hidden layer is set to N. Where N is the total number of types of gases and their decomposition products. If the total number of types of decomposition products of a certain gas is unknown, N is considered to be fixed to 3.
Specifically, the second hidden layer calculates probability P (c|x) that the gas type corresponding to the training sample set is C based on the gaussian connection model of the first hidden layer and the second hidden layer, and the feature matrix, expressed as:
P(X|C)=P(x 1 |C)×P(x 2 |C)×...×P(x L |C)
P(C|X)∝P(X|C)×P(C)
wherein X represents the feature vector group, X represents the feature of the training sample set, X 1 ,x 2 ,...,x L Represents the training sample set 1,2, L features, C represents the gas type, P (x|C) Representing the conditional probability that the gas type corresponding to the training sample set is C, P (x 1 |C),P(x 2 |C),...,P(x L I C) represents the 1, 2-th order of the training sample set, the conditional probability that the gas type corresponding to the L features is C, P (c|x) represents the probability that the gas type corresponding to the training sample set is C, and P (C) represents the probability that the gas type of the target gas collected in the training sample set is C.
In step S408, the output layer takes the gas type corresponding to the maximum probability as the gas type detection result and outputs the gas type.
In one embodiment, the second hidden layer and the output layer are connected by a maximum value independent variable point set function, which may be an argmax function. Wherein the argmax function is a function that maximizes the function. The number of the neuron nodes of the output layer is set to be 1, namely the gas type corresponding to the training sample set.
Specifically, the output layer represents the gas type corresponding to the maximum probability as a gas type detection result as follows:
o=argmax[P(C|X)]
in the formula, o represents a gas type detection result of the training sample set output by the output layer, argmax (·) represents an argmax function, and P (c|x) represents a probability that the gas type corresponding to the training sample set is C.
In one embodiment, since no clear theoretical derivation is currently available to determine the hidden layer's neuron node parameters, the setting and adjustment of parameters is typically performed in practice according to "trial and error" or experience. In order to reduce blind attempts and improve the training efficiency of the gas detection model, a multi-path parameter searching mode is provided to rapidly determine the neuron node parameters of the hidden layer. The multi-path parameter searching mode is to obtain a plurality of corresponding value ranges from a plurality of initial values to determine the neuron node parameters of the hidden layer. Specifically, the determining manner of the neuron node parameter preset in the hidden layer includes:
Step S502, according to the preset number relation between the hidden layer and the neuron nodes of the input layer or the output layer, determining the initial value of each neuron node parameter.
In one embodiment, the number relationship between the preset hidden layer and the neuron nodes of the input layer or the output layer is that the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer satisfy the number empirical formula of the neuron nodes, which is expressed as:
Figure BDA0002943751670000121
wherein N is h1 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, N o Representing the number of neuron nodes of the output layer, N s The number of training samples representing the training sample set, alpha is an arbitrary value variable, and is usually 2-10.
Specifically, according to the above formula, when α has a value of 2, 6, 10, the corresponding 3N are obtained h1 As the initial value of the neuron node parameter.
In one embodiment, the number relationship between the preset hidden layer and the neuron nodes of the input layer or the output layer is that the number of the neuron nodes of the hidden layer is between the number of the neuron nodes of the input layer and the output layer, which is expressed as:
N h2 =min([N i ,N o ])+c 1 ×|N o -N i |
Wherein N is h2 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, N o Representing the number of neuron nodes of the output layer, min ([ N) i ,N o ]) Represents N i And N o Minimum value of c 1 Representing the adjustment factor.
Specifically, according to the above formula, when c 1 When the value is 1/4, 1/2 and 3/4, 3N corresponding to the value are obtained h2 As the initial value of the neuron node parameter.
In one embodiment, the number relationship between the preset hidden layer and the neuron nodes of the input layer or the output layer is that the number of the neuron nodes of the hidden layer is a multiple of the sum of the numbers of the neuron nodes of the input layer and the output layer, which is expressed as:
Figure BDA0002943751670000122
wherein N is h3 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, N o Representing the number of neuron nodes of the output layer.
Specifically, 1N is obtained according to the above formula h3 As the initial value of the neuron node parameter.
In one embodiment, the number relationship between the preset hidden layer and the neuron nodes of the input layer or the output layer is that the number of the neuron nodes of the hidden layer is not more than twice the number of the neuron nodes of the input layer, which is expressed as:
N h4 =c 2 ×N i
Wherein N is h4 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, c 2 Representing the adjustment factor.
Specifically, according to the above formula, when c 2 When the values are 1, 1.5 and 2, 3 corresponding N are obtained h4 As the initial value of the neuron node parameter.
Step S504, each value range corresponding to the initial value of each neuron node parameter is set, and each numerical value in each value range is used as the preset neuron node parameter in the hidden layer.
Specifically, a value range is set near the initial value of each selected neuron node parameter, the value range is set as [ initial value of neuron node parameter-2, initial value of neuron node parameter +2], the value ranges corresponding to the initial values of 10 neuron node parameters are obtained, and each numerical value in each value range is used as the preset neuron node parameter in the hidden layer. Wherein the neuron node parameter is a natural number.
In one embodiment, comparing the gas type detection results, determining the neuron node parameter based on the comparison results, comprises:
step S602, acquiring the operation time of each gas type detection result and the detection accuracy of each gas type detection result obtained by each gas type detection model.
Specifically, according to preset neuron node parameters and a training sample set, training each gas type detection model corresponding to each neuron node parameter. After each gas type detection model is obtained, the running time of each gas type detection model and the detection accuracy of each gas type detection result are obtained.
And step S604, scoring each gas type detection model based on the running time and the detection precision according to a preset scoring standard, and determining the neuron node parameter of the first hidden layer in the gas type detection model with the highest score as the neuron node parameter.
And scoring each gas type detection model based on the running time and the detection precision according to a preset scoring standard. When the running time is less than 1 second(s), the gas type detection model with highest detection precision has high score, and when the running time exceeds 1s, the gas type detection model with shortest running time and detection precision more than 80% -90% has high score.
Specifically, each gas type detection model is scored based on running time and detection accuracy according to a preset scoring standard, the neuron node parameter of a first hidden layer in the gas type detection model with the highest score is determined as the neuron node parameter, and after the neuron node parameter of the first hidden layer is determined, the gas detection model is determined.
In one embodiment, when applied to SF in a power system 6 And its decomposition product SO 2 、HF、H 2 S, CO, etc., when the gas detection result is each target gas SF 6 、SO 2 、HF、H 2 S, CO, etc., then determining SF in the power system 6 Leakage or decomposition, output alarm signal, in time inform electric power operating personnel to improve the security stability of electric power system operation.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and one of the specific embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
FIG. 4 is a schematic diagram of a gas detection model in one embodiment. The structure of the gas detection model comprises an input layer, a hidden layer and an output layer, wherein the hidden layer comprises a first hidden layer and a second hidden layer. When to SF in electric power system 6 When the decomposition products are detected, the specific steps of the gas detection method are as follows:
1. acquiring training sample sets
1.1, acquiring a training sample set, wherein training samples in the training sample set are target gases HF and SO acquired by an MOS gas sensor 2 、H 2 Detection signal of S.
2. Determining parameters of each preset neuron node in hidden layer by using multi-path parameter searching mode
2.1, according to the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer, the number of the neuron nodes is satisfied with an empirical formula, which is expressed as follows:
Figure BDA0002943751670000141
wherein N is h1 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, N o Representing the number of neuron nodes of the output layer, N s The number of training samples representing the training sample set, alpha is an arbitrary value variable, and is usually 2-10. Specifically, according to the above formula, when alpha takes values of 2, 6 and 10, corresponding 3 are obtainedN h1 As the initial value of the neuron node parameter.
2.2, the number of neuron nodes according to the hidden layer is between the number of neuron nodes of the input layer and the output layer, expressed as:
N h2 =min([N i ,N o ])+c 1 ×|N o -N i |
wherein N is h2 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, N o Representing the number of neuron nodes of the output layer, min ([ N) i ,N o ]) Represents N i And N o Minimum value of c 1 Representing the adjustment factor. Specifically, according to the above formula, when c 1 When the value is 1/4, 1/2 and 3/4, 3N corresponding to the value are obtained h2 As the initial value of the neuron node parameter.
2.3, the number of neuron nodes of the hidden layer is a multiple of the sum of the number of neuron nodes of the input layer and the output layer, expressed as:
Figure BDA0002943751670000151
wherein N is h3 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, N o Representing the number of neuron nodes of the output layer. Specifically, 1N is obtained according to the above formula h3 As the initial value of the neuron node parameter.
2.4, the number of neuron nodes according to the hidden layer is not more than twice the number of neuron nodes of the input layer, expressed as:
N h4 =c 2 ×N i
wherein N is h4 Representing the number of neuron nodes of the resulting hidden layer, N i Representing the number of neuron nodes of the input layer, c 2 Representing the adjustment factor. Specifically, according to the above formula,when c 2 When the values are 1, 1.5 and 2, 3 corresponding N are obtained h4 As the initial value of the neuron node parameter.
And 2.5, setting a value range near the initial values of the 10 selected neuron node parameters, setting the value range as [ initial value of the neuron node parameter-2, initial value of the neuron node parameter +2], and taking each numerical value in each value range as a preset neuron node parameter in a hidden layer.
3. Training each gas type detection model corresponding to each neuron node parameter to obtain corresponding each gas type detection result
3.1, input layer: the number of neuron nodes of the input layer is set to L, which is the same as the number of features of the training sample set. The input layer generates a feature vector set based on the features of the L training sample sets, expressed as:
X=[x 1 ,x 2 ,...,x L ] T
wherein x represents the characteristics of the training sample set, x 1 ,x 2 ,...,x L The training sample set is represented as 1, 2.l features, and X represents a set of feature vectors.
3.2, first hidden layer: the input layer and the first hidden layer are connected through a Sigmoid activation function, and the number of the neuron nodes of the first hidden layer is set to be M, which is determined by the step 2.5. The first hidden layer calculates a feature matrix G according to M neuron nodes, a Sigmoid activation function of the first hidden layer, and connection weights and bias vectors of input layers corresponding to M neuron node parameters and the first hidden layer, and based on a feature vector group X, the feature matrix G is expressed as:
Figure BDA0002943751670000161
wherein G represents a feature matrix, w and b represent connection weights and bias vectors of the input layer and the first hidden layer, respectively, w 1 ,...w M And b 1 ,...b M Each of which represents 1 st, the M neuronal nodes correspond to The connection weight and bias vector of the input layer and the first hidden layer, x represents the characteristic of the training sample set, x 1 ,x 2 ,...,x L The training sample set is represented as 1, 2..l features, g (·) represents the Sigmoid activation function.
3.3, second hidden layer: the first hidden layer and the second hidden layer are connected through a Gaussian model, the number of the neuron nodes of the second hidden layer is set to be N, and N is the total number of types of gas and decomposition products thereof, and the number is determined by the step 1.1. The second hidden layer calculates probability P (C|X) of the gas type C corresponding to the training sample set based on the Gaussian connection model of the first hidden layer and the second hidden layer and the feature matrix, and the probability P (C|X) is expressed as:
P(X|C)=P(x 1 |C)×P(x 2 |C)×...×P(x L |C)
P(C|X)∝P(X|C)×P(C)
wherein X represents the feature vector group, X represents the feature of the training sample set, X 1 ,x 2 ,...,x L The 1, 2..th, L features representing the training sample set, C representing the gas type, P (x|c) representing the conditional probability that the gas type corresponding to the training sample set is C, P (X) 1 |C),P(x 2 |C),...,P(x L I C) represents the 1, 2-th order of the training sample set, the conditional probability that the gas type corresponding to the L features is C, P (c|x) represents the probability that the gas type corresponding to the training sample set is C, and P (C) represents the probability that the gas type of the target gas collected in the training sample set is C.
3.4, output layer: the second hidden layer is connected with the output layer through an argmax function, the number of the neuron nodes of the output layer is set to be 1, and the output layer takes the gas type corresponding to the maximum probability as a gas type detection result, and the gas type detection result is expressed as:
o=argmax[P(C|X)]
in the formula, o represents a gas type detection result of the training sample set output by the output layer, argmax (·) represents an argmax function, and P (c|x) represents a probability that the gas type corresponding to the training sample set is C.
4. Determining a gas detection model
And 4.1, after each gas type detection model is obtained, the running time of each gas type detection model and the detection precision of each gas type detection result are obtained.
And 4.2, scoring each gas type detection model based on the running time and the detection precision according to a preset scoring standard. When the running time is less than 1s, the gas type detection model with the highest detection precision has high score, and when the running time exceeds 1s, the gas type detection model with the shortest running time and the detection precision of more than 80% -90% has high score.
And 4.3, determining the neuron node parameter of the first hidden layer in the gas type detection model with the highest score as the neuron node parameter, wherein the gas type detection model is determined as the gas detection model.
5. Integrating a gas detection model in an ARM chip
5.1, installing Ubuntu16.04 system in ARM chip, adding computer programming language C++ construction tool cmake in the system, and cross compiling tool ARM-linux-gcc applicable to ARM chip. Wherein, the cmake can compile the.c and.h files written in C++ into ARM chip executable files.
And 5.2, adopting a computer programming language C++ to write an EL-BN recognition algorithm, and integrating a gas detection model into an ARM chip.
6. Detecting a gas type corresponding to a gas to be detected
And 6.1, acquiring detection signals of the gas to be detected, which are acquired by the MOS gas sensor.
And 6.2, transmitting the detection signal to an ARM chip, and detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result.
6.3 when the gas detection result is the target gas HF, SO 2 、H 2 And outputting an alarm signal when one of the signals is in S.
It should be understood that, although the steps in the flowcharts of fig. 2-3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-3 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 5, there is provided a gas detection apparatus including: a signal acquisition module 710, a gas detection module 720, and a gas detection model acquisition module 730, wherein:
the signal acquisition module 710 is configured to acquire a detection signal of the gas to be detected acquired by the gas sensor.
And the gas detection module 720 is configured to detect a gas type corresponding to the detection signal by using a gas detection model, so as to obtain a gas detection result.
The gas detection model obtaining module 730 is configured to obtain the gas detection model, where a training process of the gas detection model includes: acquiring a training sample set, wherein the training sample in the training sample set comprises detection signals of all target gases acquired by a gas sensor; acquiring preset parameters of each neuron node, and training each gas type detection model corresponding to each neuron node parameter according to the training sample set to acquire each gas type detection result corresponding to each gas type detection model; comparing the gas type detection results, determining the neuron node parameters based on the comparison results, and taking the gas type detection model corresponding to the determined neuron node parameters as the gas detection model.
In one embodiment, a gas detection model acquisition module 730 is used to obtain the gas detection model from a model training device. When the gas detection device is a terminal, the model training device may be a server or other terminal devices for training to obtain the gas detection model.
In one embodiment, the gas detection model acquisition module 730 may be self-training to obtain the gas detection model. At this time, as shown in fig. 6, the gas detection model acquisition module 730 specifically includes: a sample set acquisition module 810, a training module 820, and a model determination module 830, wherein:
the sample set obtaining module 810 is configured to obtain a training sample set, where a training sample in the training sample set includes detection signals of each target gas collected by the gas sensor.
The training module 820 is configured to obtain preset parameters of each neuron node, train each gas type detection model corresponding to each neuron node parameter according to the training sample set, and obtain each gas type detection result corresponding to each gas type detection model.
The model determining module 830 is configured to compare the gas type detection results, determine the neuron node parameter based on the comparison result, and use a gas type detection model corresponding to the determined neuron node parameter as the gas detection model.
In one embodiment, the gas detection model acquisition module 730 further includes:
the model structure determining unit is used for determining that the structure of the gas type detection model comprises an input layer, a hidden layer and an output layer, and the hidden layer comprises a first hidden layer and a second hidden layer.
In one embodiment, training module 820 includes the following elements:
and the input layer training unit is used for enabling the input layer to generate a feature vector group based on the features of the training sample sets with the preset number.
The first hidden layer training unit is used for enabling the first hidden layer to calculate a feature matrix according to preset neuron node parameters, an activation function of the first hidden layer, connection weights and bias vectors of the input layer and the first hidden layer corresponding to the preset neuron node parameters and the feature matrix based on the feature vector group.
And the second hidden layer training unit is used for enabling the second hidden layer to calculate the probability of the gas type corresponding to the training sample set based on the Gaussian connection model of the first hidden layer and the second hidden layer and the feature matrix.
And the output layer training unit is used for enabling the output layer to take the gas type corresponding to the maximum probability as the gas type detection result and outputting the gas type detection result.
In one embodiment, the training module 820 includes a hidden layer neuron node parameter determination unit comprising the following:
and the neuron node parameter initial value determining unit is used for determining the parameter initial value of each neuron node according to the preset quantity relation between the hidden layer and the neuron nodes of the input layer or the output layer.
The preset neuron node parameter unit is used for setting each value range corresponding to the initial value of each neuron node parameter, and taking each numerical value in each value range as the preset neuron node parameter in the hidden layer.
In one embodiment, the model determination module 830 includes the following elements:
and the running time and detection precision acquisition unit is used for acquiring the running time of each gas type detection model to obtain each gas type detection result and the detection precision of each gas type detection result.
And the first hidden layer neuron node parameter determining unit is used for scoring each gas type detection model based on the running time and the detection precision according to a preset scoring standard, and determining the neuron node parameter of the first hidden layer in the gas type detection model with the highest score as the neuron node parameter.
In one embodiment, the preset neuron node parameter unit includes the following units:
the first determining unit is used for limiting the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer to meet the number empirical formula of the neuron nodes.
The second determining unit is used for limiting the number of the neuron nodes of the hidden layer to be between the number of the neuron nodes of the input layer and the output layer.
And a third determining unit for defining the number of the neuron nodes of the hidden layer as a multiple of the sum of the number of the neuron nodes of the input layer and the output layer.
And a fourth determining unit for defining that the number of the neuron nodes of the hidden layer is not more than twice the number of the neuron nodes of the input layer.
In one embodiment, the gas detection apparatus further comprises the following units:
and the alarm unit is used for outputting an alarm signal when the gas detection result is one of the target gases.
For specific limitations of the gas detection device, reference may be made to the above limitations of the gas detection method, and no further description is given here. The various modules in the gas detection apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or independent of a processor in the electronic device, or may be stored in software in a memory in the electronic device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, an electronic device is provided, which may be a server, and the internal structure of which may be as shown in fig. 7. The electronic device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the electronic device is used for storing gas detection data. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a gas detection method.
In one embodiment, an electronic device is provided, which may be a terminal, and an internal structure diagram thereof may be as shown in fig. 8. The electronic device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the electronic device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a gas detection method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structures shown in fig. 7-8 are block diagrams of only some of the structures associated with the present application and are not intended to limit the electronic device to which the present application may be applied, and that a particular electronic device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, an electronic device is provided that includes a memory having a computer program stored therein and a processor that when executing the computer program performs the steps of the gas detection method as described above.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon which, when executed by a processor, implements the steps of the gas detection method as described above.
In one embodiment, a gas detection system is provided, the gas detection system comprising: a gas sensor and an electronic device as described above;
the gas sensor is used for collecting detection signals of the gas to be detected;
the electronic equipment is used for acquiring the detection signal of the gas to be detected acquired by the gas sensor, and detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method of gas detection, the method comprising:
acquiring detection signals of the gas to be detected, which are acquired by a gas sensor, wherein the detection signals comprise signals of current, voltage, response time, recovery time and responsiveness;
detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result;
the training process of the gas detection model comprises the following steps:
acquiring a training sample set, wherein a training sample in the training sample set comprises detection signals of target gases acquired by a gas sensor, and the target gases comprise gases and decomposition products of the gases;
acquiring preset neuron node parameters, and training each gas type detection model corresponding to the neuron node parameters according to the training sample set, wherein the structure of the gas type detection model comprises an input layer, a hidden layer and an output layer, and the hidden layer comprises a first hidden layer and a second hidden layer;
The input layer generates a feature vector group based on the features of a preset number of training sample sets, the number of neuron nodes of the input layer is the same as the number of the features of the training sample sets, and each neuron node represents the feature of detection signals of each target gas acquired by the gas sensor in the training sample sets;
the first hidden layer calculates a feature matrix according to a preset neuron node parameter, an activation function of the first hidden layer, a connection weight and a bias vector of the input layer corresponding to the preset neuron node parameter and the first hidden layer, and based on the feature vector set, the neuron node parameter is determined by obtaining a plurality of corresponding value ranges from a plurality of neuron node parameter initial values, the plurality of neuron node parameter initial values are determined based on a number relation between the preset hidden layer and a neuron node of the input layer or the output layer, and the number relation between the preset hidden layer and the neuron node of the input layer or the output layer at least comprises: the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer meet the empirical formula of the number of the neuron nodes, or the number of the neuron nodes of the hidden layer is between the number of the neuron nodes of the input layer and the output layer;
The second hidden layer calculates the probability of the gas type corresponding to the training sample set based on the Gaussian connection model of the first hidden layer and the second hidden layer and the feature matrix, and the number of the neuron nodes of the second hidden layer is as follows: a total number of types of the gas and the decomposition products of the gas;
the output layer takes the gas type corresponding to the maximum probability as the gas type detection result and outputs the gas type detection result, and the second hidden layer is connected with the output layer through a maximum independent variable point set function;
acquiring the operation time of each gas type detection result and the detection precision of each gas type detection result by each gas type detection model;
according to a preset scoring standard, scoring each gas type detection model based on the running time and the detection precision, determining a neuron node parameter of a first hidden layer in the gas type detection model with the highest score as the neuron node parameter, and taking the gas type detection model corresponding to the determined neuron node parameter as the gas detection model;
wherein, the number empirical formula is specifically:
Figure QLYQS_1
Wherein N is h1 Representing the number of resulting neuron nodes of the hidden layer, N i Representation ofThe number of the neuron nodes of the input layer, N ο Representing the number of neuron nodes of the output layer, N S Representing the training sample number of the training sample set, wherein alpha is an arbitrary value variable; when the alpha is 2, 6 and 10, obtaining 3 corresponding N h1 Is given by the value of 3N h1 As the initial value of the neuron node parameter; />
The number of the neuron nodes of the hidden layer is between the number of the neuron nodes of the input layer and the output layer, and specifically comprises:
Figure QLYQS_2
wherein N is h2 Representing the number of resulting neuron nodes of the hidden layer, N i Representing the number of neuron nodes of the input layer, N ο Representing the number of neuron nodes of the output layer, min ([ N ] i ,N ο ]) Represents the N i And said N ο Minimum value of c 1 Representing the adjustment coefficient; wherein, when said c 1 When the value is 1/4, 1/2 and 3/4, 3N corresponding to the value are obtained h2 Is given by the value of 3N h2 As the initial value of the neuron node parameter.
2. The method according to claim 1, wherein determining the neuron node parameters preset in the hidden layer comprises:
Determining the initial value of each neuron node parameter according to the preset quantity relation between the hidden layer and the neuron node of the input layer or the output layer;
setting each value range corresponding to the initial value of each neuron node parameter, and taking each numerical value in each value range as the preset neuron node parameter in the hidden layer.
3. The method of claim 2, wherein the predetermined number relationship between the hidden layer and the neuron nodes of the input layer or the output layer comprises:
the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer meet the number empirical formula of the neuron nodes;
or (b)
The number of neuron nodes of the hidden layer is between the number of neuron nodes of the input layer and the output layer;
or (b)
The number of the neuron nodes of the hidden layer is a multiple of the sum of the number of the neuron nodes of the input layer and the output layer;
or (b)
The number of neuron nodes of the hidden layer is no more than twice the number of neuron nodes of the input layer.
4. The method of claim 1, further comprising, after the obtaining the gas detection result:
And outputting an alarm signal when the gas detection result is one of the target gases.
5. A gas detection apparatus, the apparatus comprising:
the signal acquisition module is used for acquiring detection signals of the gas to be detected, which are acquired by the gas sensor, wherein the detection signals comprise signals of current, voltage, response time, recovery time and responsiveness;
the gas detection module is used for detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result;
the gas detection model acquisition module is used for acquiring the gas detection model;
the gas detection model acquisition module specifically comprises: the system comprises a sample set acquisition module, a training module, a model determination module and a model structure determination unit;
the sample set acquisition module is used for acquiring a training sample set, wherein a training sample in the training sample set comprises detection signals of target gases acquired by a gas sensor, and the target gases comprise gases and decomposition products of the gases;
the model structure determining unit is used for determining that the structure of the gas type detection model comprises an input layer, a hidden layer and an output layer, wherein the hidden layer comprises a first hidden layer and a second hidden layer;
The training module comprises the following units:
the input layer training unit is used for enabling the input layer to generate a feature vector group based on the features of a preset number of training sample sets, the number of neuron nodes of the input layer is the same as the number of the features of the training sample sets, and each neuron node represents the feature of detection signals of each target gas acquired by the gas sensor in the training sample sets;
the first hidden layer training unit is configured to enable the first hidden layer to calculate a feature matrix according to a preset neuron node parameter, an activation function of the first hidden layer, a connection weight and a bias vector of the input layer corresponding to the preset neuron node parameter and the first hidden layer, and based on the feature vector set, where the neuron node parameter is determined by obtaining a plurality of corresponding value ranges from a plurality of initial neuron node parameter values, the plurality of initial neuron node parameter values are determined based on a number relationship between a preset hidden layer and a neuron node of the input layer or the output layer, and the number relationship between the preset hidden layer and the neuron node of the input layer or the output layer at least includes: the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer meet the empirical formula of the number of the neuron nodes, or the number of the neuron nodes of the hidden layer is between the number of the neuron nodes of the input layer and the output layer;
The second hidden layer training unit is configured to enable the second hidden layer to calculate a probability of a gas type corresponding to the training sample set based on the gaussian connection model of the first hidden layer and the second hidden layer and the feature matrix, where the number of neuron nodes of the second hidden layer is as follows: a total number of types of the gas and the decomposition products of the gas;
the output layer training unit is used for enabling the output layer to take the gas type corresponding to the maximum probability as the gas type detection result and output the gas type detection result, and the second hidden layer is connected with the output layer through a maximum value independent variable point set function;
the model determination module comprises the following units:
the running time and detection precision acquisition unit is used for acquiring the running time of each gas type detection result obtained by each gas type detection model and the detection precision of each gas type detection result;
the first hidden layer neuron node parameter determining unit is used for scoring each gas type detection model according to a preset scoring standard based on the running time and the detection precision, determining the neuron node parameter of the first hidden layer in the gas type detection model with the highest score as the neuron node parameter, and taking the gas type detection model corresponding to the determined neuron node parameter as the gas detection model;
Wherein, the number empirical formula is specifically:
Figure QLYQS_3
wherein N is h1 Representing the number of resulting neuron nodes of the hidden layer, N i Representing the number of neuron nodes of the input layer, N ο Representing the number of neuron nodes of the output layer, N S Representing the training sample number of the training sample set, wherein alpha is an arbitrary value variable; when the alpha is 2, 6 and 10, obtaining 3 corresponding N h1 Is given by the value of 3N h1 As the initial value of the neuron node parameter;
the number of the neuron nodes of the hidden layer is between the number of the neuron nodes of the input layer and the output layer, and specifically comprises:
Figure QLYQS_4
wherein N is h2 Representing the number of resulting neuron nodes of the hidden layer, N i Representing the number of neuron nodes of the input layer, N ο Representing the number of neuron nodes of the output layer, min ([ N ] i ,N ο ]) Represents the N i And said N ο Minimum value of c 1 Representing the adjustment coefficient; wherein, when said c 1 When the value is 1/4, 1/2 and 3/4, 3N corresponding to the value are obtained h2 Is given by the value of 3N h2 As the initial value of the neuron node parameter.
6. The apparatus of claim 5, wherein the training module further comprises a hidden layer neuron node parameter determination unit comprising:
The neuron node parameter initial value determining unit is used for determining the parameter initial value of each neuron node according to the preset quantity relation between the hidden layer and the neuron nodes of the input layer or the output layer;
the preset neuron node parameter unit is used for setting each value range corresponding to the initial value of each neuron node parameter, and taking each numerical value in each value range as the preset neuron node parameter in the hidden layer.
7. The apparatus of claim 6, wherein the preset neuron node parameter unit comprises the following units:
a first determining unit for defining that the number of the neuron nodes of the hidden layer and the number of the neuron nodes of the input layer and the output layer satisfy a number empirical formula of the neuron nodes;
a second determining unit for defining a number of neuron nodes of the hidden layer between the number of neuron nodes of the input layer and the output layer;
a third determining unit for defining the number of neuron nodes of the hidden layer as a multiple of the sum of the number of neuron nodes of the input layer and the output layer;
and a fourth determining unit for defining that the number of the neuron nodes of the hidden layer is not more than twice the number of the neuron nodes of the input layer.
8. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 4 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 4.
10. A gas detection system, the gas detection system comprising: a gas sensor and an electronic device as claimed in claim 8;
the gas sensor is used for collecting detection signals of the gas to be detected;
the electronic equipment is used for acquiring the detection signal of the gas to be detected acquired by the gas sensor, and detecting the gas type corresponding to the detection signal by adopting a gas detection model to obtain a gas detection result.
CN202110187767.XA 2021-02-18 2021-02-18 Gas detection method, gas detection device, electronic equipment and storage medium Active CN113009077B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110187767.XA CN113009077B (en) 2021-02-18 2021-02-18 Gas detection method, gas detection device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110187767.XA CN113009077B (en) 2021-02-18 2021-02-18 Gas detection method, gas detection device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113009077A CN113009077A (en) 2021-06-22
CN113009077B true CN113009077B (en) 2023-05-02

Family

ID=76402675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110187767.XA Active CN113009077B (en) 2021-02-18 2021-02-18 Gas detection method, gas detection device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113009077B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113657220A (en) * 2021-08-03 2021-11-16 南方电网数字电网研究院有限公司 Training method and device for classification model of power quality disturbance signal
CN114038513B (en) * 2021-11-05 2024-09-24 国网河北能源技术服务有限公司 Method, device and terminal for predicting mass concentration of hydrogen sulfide in coal-fired boiler
CN115096968B (en) * 2022-06-16 2024-06-18 中国科学院深圳先进技术研究院 Biological substance detection system, method, device, equipment and storage medium
CN116049640B (en) * 2023-04-03 2023-07-07 河北工业大学 Probability mapping identification method for judging thermal behaviors of liquid-liquid heterogeneous reaction

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105487526B (en) * 2016-01-04 2019-04-09 华南理工大学 A kind of Fast RVM sewage treatment method for diagnosing faults
CN106355269A (en) * 2016-08-24 2017-01-25 华南理工大学 Method for forecasting the commodity barcode registration quantity
CN106709917B (en) * 2017-01-03 2020-09-11 青岛海信医疗设备股份有限公司 Neural network model training method, device and system
CN107122860B (en) * 2017-04-28 2020-01-07 辽宁工程技术大学 Rock burst danger level prediction method based on grid search and extreme learning machine
CN107506938A (en) * 2017-09-05 2017-12-22 江苏电力信息技术有限公司 A kind of quality of material appraisal procedure based on machine learning
CN109946424A (en) * 2019-03-08 2019-06-28 杭州麦乐克科技股份有限公司 Demarcate Gas classification method and system based on artificial bee colony and neural network
US10783433B1 (en) * 2019-04-22 2020-09-22 Bell Integrator Inc. Method for training and self-organization of a neural network
CN110163263A (en) * 2019-04-30 2019-08-23 首钢京唐钢铁联合有限责任公司 Fault identification method and device
CN110185939B (en) * 2019-05-16 2021-04-02 西北工业大学 Gas pipeline leakage identification method based on convolutional neural network
CN110288141A (en) * 2019-06-18 2019-09-27 国网上海市电力公司 A kind of construction investment neural network based turns tariff prediction technique
CN110610209A (en) * 2019-09-16 2019-12-24 北京邮电大学 Air quality prediction method and system based on data mining
CN111144055B (en) * 2019-12-27 2024-02-02 苏州大学 Method, device and medium for determining concentration distribution of toxic heavy gas leakage in urban environment
CN111695288B (en) * 2020-05-06 2023-08-08 内蒙古电力(集团)有限责任公司电力调度控制分公司 Transformer fault diagnosis method based on Apriori-BP algorithm
CN112083047A (en) * 2020-08-11 2020-12-15 西安交通大学 Portable gas detection device and detection method
CN112116962A (en) * 2020-09-21 2020-12-22 河北工业大学 Air composition identification method and system

Also Published As

Publication number Publication date
CN113009077A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
CN113009077B (en) Gas detection method, gas detection device, electronic equipment and storage medium
US20180336436A1 (en) Anomaly detection in streaming networks
CN113657661A (en) Enterprise carbon emission prediction method and device, computer equipment and storage medium
CN109685246A (en) Environmental data predictor method, device and storage medium, server
Liu et al. Lithium-ion battery remaining useful life prediction with long short-term memory recurrent neural network
CN116572747B (en) Battery fault detection method, device, computer equipment and storage medium
CN116522594A (en) Time self-adaptive transient stability prediction method and device based on convolutional neural network
Li et al. A framework for predicting network security situation based on the improved LSTM
Liu et al. State of health estimation of lithium-ion batteries based on multi-feature extraction and temporal convolutional network
Lin et al. Forecasting thermal parameters for ultra‐high voltage transformers using long‐and short‐term time‐series network with conditional mutual information
CN117791856B (en) Power grid fault early warning method and device based on inspection robot
JPWO2016084326A1 (en) Information processing system, information processing method, and program
Weng et al. Physics-informed few-shot learning for wind pressure prediction of low-rise buildings
CN117525690A (en) Lithium battery thermal runaway early warning method, device, computer equipment and storage medium
Wang et al. Building degradation index with variable selection for multivariate sensory data
CN112825157B (en) Gasification gas production prediction method, device, equipment and storage medium
Wang et al. Assessing the Performance Degradation of Lithium‐Ion Batteries Using an Approach Based on Fusion of Multiple Feature Parameters
Yu et al. IRFLMDNN: hybrid model for PMU data anomaly detection and re-filling with improved random forest and Levenberg Marquardt algorithm optimized dynamic neural network
CN113177659A (en) Single variable time sequence change point detection method
Zheng et al. The bidirectional information fusion using an improved LSTM model
CN118330472B (en) Battery operation data enhancement method, device, medium and product
CN109436980A (en) The condition detection method and system of elevator components
CN117267702B (en) Boiler operation equipment control method and device, electronic equipment and readable medium
Yang et al. Predicting atmospheric corrosion of low-alloy steels based on environmental features extracted by improved autoencoder
CN116203435A (en) Battery parameter acquisition method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230807

Address after: Room 822, Room 406, No. 1, Yichang Street, Zhongxin Ciudad del Saber, Huangpu District, Guangzhou, Guangdong 510000

Patentee after: China Southern Power Grid Artificial Intelligence Technology Co.,Ltd.

Address before: Room 86, room 406, No.1, Yichuang street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province

Patentee before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

TR01 Transfer of patent right