Method and apparatus for operating a gas sensor

11543381 · 2023-01-03

Assignee

Inventors

Cpc classification

International classification

Abstract

A method and apparatus for operating a gas sensor are disclosed. In an embodiment a method for operating a gas sensor includes providing, by at least one gas sensor element, a sensing signal and correcting, by a neural network, the sensing signal, wherein the neural network comprises an input layer, an output layer and at least one hidden layer, wherein the input layer comprises a given number k>1 of input neurons for each gas sensor element, and wherein a respective gas sensor element provides its sensing signal to one of the corresponding input neurons dependent on a measurement parameter applied to the at least one gas sensor element.

Claims

1. A method for operating a gas sensor, the method comprising: providing, by at least one gas sensor element, a sensing signal; and correcting, by a neural network, the sensing signal, wherein the neural network comprises an input layer, an output layer and at least one hidden layer, wherein the input layer comprises a given number k>1 of input neurons for each gas sensor element, and wherein a respective gas sensor element provides its sensing signal to one of the corresponding input neurons dependent on a measurement parameter applied to the at least one gas sensor element.

2. The method according to claim 1, wherein the gas sensor is operable in a learning mode using the neural network adjusted with random feedback loops between directly adjacent layers.

3. The method according to claim 2, wherein the random feedback loops comprise different temperature values.

4. The method according to claim 2, wherein the random feedback loops comprise different electrical field strength values.

5. The method according to claim 1, wherein the gas sensor is operable in a normal operation mode using the neural network with a feedforward structure.

6. The method according to claim 1, wherein the at least one gas sensor element comprises a semiconductor substrate with a metal oxide sensing layer.

7. The method according to claim 1, wherein the at least one gas sensor element comprises electrically conductive polymers.

8. The method according to claim 1, wherein the measurement parameter applied to the at least one gas sensor element is representative of a temperature of a sensing layer of the at least one gas sensor element.

9. The method according to claim 1, wherein the measurement parameter applied to the at least one gas sensor element is representative of an electrical field strength.

10. A gas sensor system comprising: at least one gas sensor element configured to provide a sensing signal; and an apparatus configured to receive the sensing signal and comprising a neural network configured to correct the sensing signal, wherein the neural network comprises an input layer, an output layer and at least one hidden layer, wherein the input layer comprises a given number k>1 of input neurons for each gas sensor element, and wherein a respective gas sensor element is configured to provide its sensing signal to one of the corresponding input neurons of the respective gas sensor element dependent on a measurement parameter applied to the respective gas sensor element.

11. The gas sensor system according to claim 10, further comprising an application-specific integrated circuit (ASIC) configured to provide random feedback weights to the neural network.

12. The gas sensor system according to claim 11, wherein the ASIC is configured to execute processing of a trained neural network in a normal operation mode of the gas sensor system.

13. The gas sensor system according to claim 11, wherein the ASIC is configured to: provide learning data; and provide random feedback weights for random feedback loops to the neural network for executing processing of the neural network in a learning mode.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) In the following, the present invention is described in detail with reference to the figures. These are as follows:

(2) FIG. 1 a schematic block diagram of a gas sensor according to the prior art;

(3) FIG. 2 an exemplary embodiment of a neural network;

(4) FIG. 3a an exemplary embodiment of an error feedback back propagation training method of the neural network;

(5) FIG. 3b an exemplary embodiment of a Feedback Alignment training method;

(6) FIG. 3c an exemplary embodiment of a Direct Feedback Alignment training method;

(7) FIG. 3d an exemplary embodiment of an Indirect Feedback Alignment training method;

(8) FIG. 4 a cross section of an exemplary gas sensor element;

(9) FIG. 5 an exemplary block diagram of an embodiment of a gas sensor system; and

(10) FIG. 6 a flow chart of an exemplary program to operate a gas sensor.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

(11) Elements of the same design and function that appear in different figures are identified by the same reference numerals.

(12) FIG. 1 shows a schematic block diagram of an oxygen sensor system 200 according to the prior art. The oxygen sensor 210 provides a sensing signal which depends on a concentration of oxygen, a temperature and a relative air humidity.

(13) A neural network 220 is used for sensing signal correction. The neural network 220 comprises an input neuron for a gas sensing signal, and further input neurons for temperature and relative air humidity. However, such a system 205 requires additional sensors, in particular a temperature sensor and a relative air humidity sensor, which provide the respective sensor signals.

(14) In order to be able to do without additional sensors, semiconductor metal oxide sensors with a heating element are introduced, so that the semiconductor gas sensor element GS1, GS2, GS3 can be heated to a certain temperature. The heating element is heated up in a controlled manner, i.e. a certain amount of energy is supplied to the heating element so that it normally heats up to a certain temperature. There is no monitoring of whether the heating element actually heats up the gas sensor element GS1, GS2, GS3 to the desired temperature. Thus, if such sensors are used at very different temperatures or boundary conditions, deviations in the temperature of the gas sensor element GS1, GS2, GS3 can occur, which can lead to errors in the measured gas concentration and/or gas detection.

(15) FIG. 2 shows a gas sensor 2 and an exemplary embodiment of a neural network NN fed by an exemplary gas sensor 2.

(16) The neural network NN comprises a large number of neurons. The neurons have one or more inputs. To calculate their output value, first a sum of all input values x.sub.i multiplied by the weighting factor w.sub.i is calculated. The output value is then calculated by applying an activation function f of the respective neuron to this sum. The activation function performs the important task of enabling nonlinear relationships between input values and output values. As the activation function f different functions can be used, e.g. a linear, Heaviside step function, logistic sigmoid function, fsigmoid, gauss or hyperbolic tangent function.

(17) These artificial neurons are combined into networks consisting of several neurons arranged in layers.

(18) The gas sensor 2 shown in FIG. 2 comprises at least one gas sensor element GS1, GS2, GS3 configured to provide a sensing signal s1, s2, s3. The gas sensor 2 is for example a semiconductor metal oxide gas sensor and the at least one gas sensor element GS1, GS2, GS3 of the gas sensor 2 comprises, for example, a semiconductor metal oxide sensing layer.

(19) Alternatively the gas sensor 2 is for example an organic semiconductor gas sensor and the at least one gas sensor element GS1, GS2, GS3 comprises electrically conductive polymers.

(20) In the example shown in FIG. 2, the gas sensor 2 comprises three gas sensor elements GS1, GS2, GS3. For correcting the sensing signal s1, s2, s3 of the at least one gas sensor element GS1, GS2, GS3, a neural network NN with an input layer, an output layer and at least one hidden layer is used. The neural network NN according to FIG. 2 comprises for example two hidden layers.

(21) The input layer comprises for each gas sensor element GS1, GS2, GS3 a given number k>1 of input neurons, and the respective gas sensor element GS1, GS2, GS3 is configured to provide its sensing signal s1, s2, s3 to one of these corresponding input neurons dependent on a measurement parameter applied to the gas sensor element GS1, GS2, GS3.

(22) For example, the input layer comprises for each gas sensor element GS1, GS2, GS3 a given number of input neurons, wherein each of these input neurons is provided with a sensing signal s1, s2, s3 of the corresponding gas sensor element GS1, GS2, GS3 captured or measured at different temperatures of the gas sensor element GS1, GS2, GS3.

(23) This means that a first input neuron receives a sensing signal s1, s2, s3 provided by the gas sensor element GS1, GS2, GS3 when the provided heating energy corresponds to a first temperature of the gas sensor element GS1, GS2, GS3 or to a temperature of the gas sensor element GS1, GS2, GS3 within a first temperature range. A second input neuron receives a sensing signal s1, s2, s3 provided by the gas sensor element GS1, GS2, GS3 when the provided heating energy corresponds to a second temperature of the gas sensor element GS1, GS2, GS3 or to a temperature of the gas sensor element GS1, GS2, GS3 within a second temperature range.

(24) Alternatively or optionally the measurement parameter is an electrical field strength.

(25) Thus, each gas sensor element GS1, GS2, GS3 can be used as multiple neurons.

(26) Stored temperature tensors generate the various neurons. Already learned temperature tensors and, depending on the result, random temperature tensors are used. Different temperatures are used in time intervals for example from 1 ms to 1 h. Each sensor element can be assigned a new temperature value during feedback or for a new gas.

(27) In a preferred embodiment, the gas sensor 2 is configured to be operated in a basic training mode, a normal operation mode and in a learning mode.

(28) For instance, in a normal operation mode, a trained neural network NN is used to correct the sensing signal s1, s2, s3 of the gas sensor 2. The trained neural network NN of the gas sensor 2 comprises for example a feedforward network structure.

(29) FIGS. 3a to 3d show different neural network topologies. In FIGS. 3a to 3d, the dotted arrows describe the forward propagation, while the black arrows describe the backward propagation and the learning process, respectively. For normal operation only the forward path is used.

(30) For the neural networks NN shown in FIGS. 3a to 3d, for the forward path the behaviour of such a network can be mathematically described by the following equations Eq. (1) to (3), wherein the weights are determined during a preceding training phase.
a.sub.1=W.sub.1x+b.sub.1,h.sub.1=f(a.sub.1)  Eq. (1)
a.sub.2=W.sub.2h.sub.1+b.sub.2,h.sub.2=f(a.sub.2)  Eq. (2)
a.sub.y=W.sub.yh.sub.2+b.sub.2,ŷ=f.sub.y(a.sub.y)  Eq. (3)

(31) wherein x is the input to the network, y is the output of the network, h.sub.1, h.sub.2 are hidden activity vectors, W.sub.1 is the matrix of synaptic weights from x to h.sub.1, W.sub.2 is the matrix of synaptic weights from h.sub.1 to h.sub.2, and W.sub.3 is the matrix of synaptic weights from h.sub.2 to y, f( ) are activation functions.

(32) Before such a network can be used for prediction or correction, it must be trained. This means that the weightings wij from neuron i to neuron j must be set on the basis of a reference data set, also named training data set, so that the desired results are obtained at the initial neurons of the neural network NN.

(33) Different learning algorithms can be used to train the networks. FIG. 3a shows an error backpropagation algorithm.

(34) With the error backpropagation algorithm, the weightings are initially set randomly. The input values of the training data are then presented to the network, the output values of the neural network NN are calculated and compared with the target output values of the training data. An error is then minimized backwards (from the output neurons to the input neurons) by adjusting the weightings. This process is repeated until, for example, a mean square error (MSE) on the entire training data set or an independent test data set is smaller, or a certain number of training data passes has been reached. The “knowledge” or the calibration information is thus given by the topology of the network and the weightings w.

(35) FIG. 3a shows a neural network NN with backpropagation (black row).

(36) If a logistic activation function in the output layer and a binary cross-entropy loss function is chosen, the loss for a mini-batch with size N and the gradient at the output layer e are calculated as

(37) J = - 1 N .Math. m , n y mn log y ^ mn + ( 1 - y mn ) log ( 1 - y ^ mn ) Eq . ( 4 ) e = δ a y = J a y = y ^ - y Eq . ( 5 )
where m and n are output unit und mini-batch indexes. For the backpropagation (BP), the gradients for hidden layers are calculated as

(38) δ a 2 = J δ a 2 = ( W 3 T e ) f ( a 2 ) , δ a 1 = J δ a 1 = ( W 2 T δ a 2 ) f ( a 1 ) Eq . ( 6 )

(39) Where ⊙ is an element-wise multiplication operator and f′( ) is the derivative of the non-linearity f( ). This gradient is also called steepest descent, because it directly minimizes the loss function given the linearized version of the network.

(40) It can be learned that backpropagation multiplies error signals by the transposed weighting matrix W.sup.T. This implies that the feedback is computed using the knowledge of all the synaptic weights in the forward path. Thus the computational effort is very high.

(41) Therefore, preferably the gas sensor 2 is configured to be operated in the basic training mode, a normal operation mode and in the learning mode.

(42) During the basic training mode, in particular the error backpropagation algorithm is used.

(43) For example, prior to shipment of the gas sensor 2 or after a basic reset of the gas sensor 2, the neural network NN of the gas sensor 2 is operated in the basic training mode, where it is operated with an error backpropagation algorithm.

(44) FIG. 4 show a cross section of an exemplary multi-gas sensor 2. The multi-gas sensor 2 comprises multiple gas sensor elements GS1, GS2, GS3. The multi-gas sensor 2 shown in FIG. 4, for example, comprises three gas sensor elements GS1, GS2, GS3. The multi-gas sensor 2 is for example a semiconductor gas sensor.

(45) Semiconductor gas sensors rely on a gas coming into contact with a metal oxide surface and then undergo either oxidation or reduction. Absorption or desorption of the gas on the metal oxide changes either the conductivity or resistivity from a known baseline value. This change in conductivity or resistivity can be measured with electronic circuitry.

(46) The metal oxide surface is usually a thin film of a transition or heavy metal. The exact metal that is used will depend on the application; examples of metals include tin dioxide (SnO2) or tungsten oxide (WO3). The film overlies a layer of silicon and is heated to a temperature between 200 and 400° C., again depending on the application. In this way, the chemical process is accelerated and the effects of fluctuating external temperatures are minimised.

(47) The respective gas sensor element GS1, GS2, GS3 shown in FIG. 4 comprises for example a sensing layer 11 of metal oxide. The gas sensor elements GS1, GS2, GS3 comprise a metal oxide layer or a metal oxide meander. The gas sensor elements GS1, GS2, GS3 are, for instance, integrated with a CMOS circuitry (not shown) on a single chip. A stack of layers 13 is arranged on a semiconductor substrate 14 required for the CMOS circuitry. The respective gas sensor element GS1, GS2, GS3 comprises a membrane. A portion of the semiconductor substrate 14 is, for instance, etched away to form a cavity 12 at the location of the sensing layer 11. Remaining layers 13 and possibly a remaining portion of the substrate 14 form a thin membrane to support the layer 11.

(48) The respective gas sensor element GS1, GS2, GS3 comprises a heating element 15. The heating element 15 is embedded within the layer 13 and comprises conducting elements. The heating element 15 is configured to provide a local source of heat to heat the metal oxide layer 11 e.g. during operation of the gas sensor element GS1, GS2, GS3. The temperature can rise rapidly around the metal oxide layer 11 on the membrane, while a thicker part of the gas sensor chip, i.e. the portion where the substrate 14 is not removed, reacts with a slower temperature rise due to its thermal inertia. By controlling the heating element 15 accordingly, the metal oxide layer 11 can be activated for a measurement and be regenerated afterwards.

(49) Each of the metal oxide layers 11 is contacted by two conductive electrodes and hence acts as a resistor. In the presence of a compound its resistance changes, thereby providing a measure of a concentration of the compound in the immediate vicinity of the metal oxide sensing layer 11.

(50) Both the conductive electrodes and the heating element 15 are preferably connected to a control unit, which can be implemented as a part of the CMOS circuitry arranged on the same substrate 14.

(51) Gas sensors have to be calibrated. The output signals of the gas sensor elements GS1, GS2, GS3 are generally in the form of a voltage value. Calibration is needed to implement a relation between the gas sensor element GS1, GS2, GS3 signal and the concentration level of the corresponding gas.

(52) Because of manufacturing tolerances it is not possible to produce exact copies of a gas sensor 2 in a production process. There are always small fluctuations in the provided output signals. This is the reason why nearly all gas sensor products need to be calibrated after assembly. This means that calibration data is determined and used during operation of the gas sensor 2 to adjust the sensor signals of the gas sensor elements GS1, GS2, GS3 to provide accurate measurement output signals.

(53) As the gas sensors 2 are used differently, in particular in different environments, in particular in different kind of smart phones or in kitchen or medicine equipment, the neural network NN has to be implemented and/or trained and/or further trained by the user of the gas sensor 2 himself. However, such training often relies on inexact temperature data and a full powered CPU is required.

(54) Therefore, it is proposed to provide a gas sensor system 1 in which the gas sensor 2 is, besides the normal operation mode, operable in the learning mode. The learning mode can be used to basically train the neural network NN of the gas sensor 2 and/or the learning mode can be used to further train the already trained neural network NN of the gas sensor 2.

(55) The trained neural network NN can be a basically trained neural network or a neural network NN which has been basically trained and further trained once or several times by applying the learning mode.

(56) In the learning mode the neural network NN uses random feedback loops, wherein the neural network NN can be untrained or basically trained or further trained. In this way the neural network NN can learn to extract useful information from signals sent through these random feedback connections. In essence, the network learns to learn. Such a mechanism works as quickly and accurately as backpropagation.

(57) In the learning mode each gas sensor element GS1, GS2, GS3 is used as multiple neurons. Each gas sensor element GS1, GS2, GS3 is assigned for example a new temperature for its operation by the neural network NN. In this way the detection of the desired gases or scents can be improved. A final weighting Gv or a result gas A, B, C is fed back to the input as additional neuron as feedback. This allows to detect gas mixtures easier.

(58) FIGS. 3b to 3c show different random feedback loop structures of the neural network NN.

(59) FIG. 3b: Feedback Alignment (FA)

(60) FIG. 3c: Direct Feedback Alignment (DFA)

(61) FIG. 3d: Indirect Feedback Alignment (IFA)

(62) For the different algorithms the hidden layer update directions are determined as:

(63) For FA, the hidden layer update directions are calculated as
δa.sub.2=(B.sub.2e)⊙f′(a.sub.2),δa.sub.1=(B.sub.1δa.sub.2)⊙f′(a.sub.1)  Eq. (7)

(64) where B.sub.1 is a fixed random weight matrix with appropriate dimension. For DFA, the hidden layer update directions are calculated as
δa.sub.2=(B.sub.2e)⊙f′(a.sub.2),δa.sub.1=(B.sub.1e)⊙f′(a.sub.1)  Eq. (8)

(65) where B.sub.1 is a fixed random weight matrix with appropriate dimension. If all hidden layers have the same number of neurons, B.sub.1 can be chosen identical for all hidden layers. For IFA, the hidden layer update directions are calculated as
δa.sub.2=(W.sub.2δa.sub.1)⊙f′(a.sub.2),δa.sub.1=(B.sub.1e)⊙f′(a.sub.1)  Eq. (9)

(66) where B.sub.1 is a fixed random weight matrix with appropriate dimension. Ignoring the learning rate, the weight updates for all methods are calculated as
δW.sub.1=−δa.sub.1x.sup.T,δW.sub.2=−δa.sub.2h.sub.1.sup.TδW.sub.3=−eh.sub.2.sup.T  Eq. (10)

(67) While feedback alignment implementation looks almost similar to backpropagation, it uses a random matrix. It shows that neural networks NN can learn just fine using random matrices, without using the weight matrices.

(68) With Direct Feedback Alignment, one can just use the gradient from the last layer to train all layers in neural networks NN. The individual layers do not necessarily depend on the gradient from their respective preceding layers. So, the training process does not have to progress layer by layer anymore.

(69) Indirect Feedback Alignment is also an interesting option. Training a layer by means of a feedback from a layer in front of it is possible.

(70) For the fixed-random matrix B.sub.i in particular temperature tensors or electrical field strength tensors are used.

(71) FIG. 5 shows a block diagram of a gas sensor system 1. The gas sensor system 1 comprises a gas sensor 2 and a hardware unit, for example an application-specific integrated circuit (ASIC).

(72) The gas sensor 2 comprises at least one gas sensor element GS1, GS2, GS3. For example the gas sensor 2 is a multi-gas sensor as shown in FIG. 4.

(73) The hardware unit (FIG. 5) is for example configured to power the gas sensor 2 and/or to measure the sensing signal s1, s2, s3 of the gas sensor elements GS1, GS2, GS3 of the gas sensor 2, in particular to measure the voltages of the gas sensor elements GS1, GS2, GS3. Furthermore, the ASIC is configured to randomly feedback the different temperature tensors to the neural network NN of the gas sensor system 1.

(74) The hardware unit optionally comprises a memory unit that is configured to perform the processing of the trained neural network NN and to train the neural network NN based on at least one feedback alignment algorithm already mentioned with regard to FIG. 3.

(75) Alternatively or additionally the gas sensor system 1 comprises an additional processing unit.

(76) FIG. 6 shows a flow chart of an exemplary program to operate a gas sensor 2.

(77) In a step S10 the program is started. During starting the program variables and/or objects may be initialized.

(78) In a step S20 a first temperature matrix is selected and the heating of the senor element is controlled according to the temperature matrix. For instance, the first temperature matrix is stored on the Application Specific Integrated Circuit (ASIC).

(79) In a step S30 measurement data of the gas sensor elements GS1, GS2, GS3 of the gas sensor 2 is captured. For example, the gas sensor elements GS1, GS2, GS3 provide resistance values or voltage values, which can be transformed to resistance values.

(80) In a step S40 a weighting of the respective neuron is determined and based on the neural network NN the linkage of the respective neuron is determined.

(81) In a Step S50 the respective gas is identified with a certain probability.

(82) In a step S60 depending on the probability, temperature changes are applied (random temperature matrix etc.) improve the probability and/or to detect gas mixtures by means of the temperature changes (random temperature matrix etc.) and providing a feedback into the input layer of the neural network NN.

(83) In a step S70 program ends.

(84) The program described above uses for example a calibrated gas sensor, thus corresponding reference values are available. Alternatively or additionally reference values can be downloaded from the Cloud.