SELF-TUNING EVENT DETECTION
20210172921 · 2021-06-10
Assignee
Inventors
Cpc classification
G01N33/0062
PHYSICS
International classification
Abstract
A method is provided for processing environmental sensor data comprising the following steps. One or more raw data values are received from an environmental sensor, an average value and a measure of dispersion are determined over a defined time period only from raw data values between a lower threshold and an upper threshold, and the lower threshold and the upper threshold are redefined depending on the average value and the measure of dispersion. The method may be used in an environmental sensor, e.g. a MOX sensor or a VOC sensor, and implemented as a computer program.
Claims
1. Method for processing environmental sensor data, comprising the steps of receiving from an environmental sensor one or more raw data values, determining an average value and a measure of dispersion over a defined time period only from raw data values between a lower threshold and an upper threshold, redefining the lower threshold and the upper threshold depending on the average value and the measure of dispersion, in response to a gating adaptation event determining the average value and the measure of dispersion dependent on the raw data value received for the corresponding time step even if not between the lower threshold and the upper threshold.
2. Method according to claim 1, wherein one of the raw data values is received per discrete time step, wherein the average value and the measure of dispersion are determined anew per time step dependent on the raw data value received at the corresponding time step, wherein the lower threshold and the upper threshold are redefined anew per time step dependent on the average value and the measure of dispersion determined for the corresponding time step,
3. Method according to claim 2, wherein the lower threshold is the average value minus the measure of dispersion, wherein the upper threshold is the average value plus the measure of dispersion, wherein the measure of dispersion corresponds to one or two times a standard deviation of the raw data values, and/or wherein the average value corresponds to an arithmetic mean of the raw data values, and/or wherein the defined time period is at least one hour.
4. Method according to claim 1, additionally comprising the steps of determining normalized data values from the raw data values depending on the average value and/or the measure of dispersion, and outputting the normalized data values, determining the normalized data value anew per time step from the corresponding raw data value depending on the average value and/or the measure of dispersion determined for the corresponding time step.
5. Method according to claim 1, wherein the average value and the measure of dispersion are determined recursively each.
6. Method according to claim 5, wherein the average value is determined by av.sub.t=α*av.sub.t−1+(1−α)*rdv.sub.t with av.sub.t as average value at time t, av.sub.t−1 as average value at time t−1, α as smoothing factor, and rdv.sub.t as raw data value received at time t, wherein the measure of dispersion is determined by σ.sub.t=√{square root over (α*σ.sup.2.sub.t−1+(1−α)(rdv.sub.t−av.sub.t−1).sup.2))} with σ.sub.t as standard deviation at discrete time step t, σ.sub.t−1 as standard deviation at discrete time step t−1, av.sub.t−1 as average value at discrete time step t−1, α as smoothing factor, and rdv.sub.t as raw data value received at discrete time step t.
7. Method according to claim 1, wherein in response to the gating adaptation event (36), between the gating adaptation event and a gating adaptation disengagement event and as long as the defined time period exceeds an interval between the gating adaptation event and the gating adaptation disengagement event, the average value and the measure of dispersion are determined dependent on all raw data values even if not between the lower threshold and the upper threshold received on or after the gating adaptation event and dependent on the last average value and the last measure of dispersion determined prior to the gating adaptation event.
8. Method according to claim 1, determining for a monitoring time period a ratio between a number of raw data values that are not between the lower threshold and the upper threshold and a total number of raw data values, and setting the gating adaptation event if the ratio is larger than a maximum ratio.
9. Method according to claim 1, setting the gating adaptation event if for a monitoring time period no raw data value is between the lower threshold and the upper threshold.
10. Method according to claim 7, setting the gating adaptation disengagement event after a predefined period in time since the gating adaptation event, in response to the gating adaptation disengagement event determining the average value and the measure of dispersion dependent on the raw data value received for the corresponding time step only if between the lower threshold and the upper threshold,
11. Method according to claim 10, after the gating adaptation disengagement event, determining the average value and the measure of dispersion per time step dependent only from the raw data values between the lower threshold and the upper threshold and received after the gating adaptation disengagement event and the last average value and the last measure of dispersion determined prior to the gating adaptation disengagement event.
12. Method according to claim 1, additionally comprising the steps of determining weights of a weighting function for the raw data values depending on the average value and the measure of dispersion, applying the weights to the raw data values when determining the average value and the measure of dispersion.
13. Method according to claim 12, wherein the weights are largest at or around the average value.
14. Method according to claim 13, wherein the weights increase monotonically for raw data values between zero and the average value and/or wherein the weights decrease monotonically for raw data values between the average value and infinity.
15. Method according to claim 1, comprising the steps of at the beginning, receiving initial values for the lower threshold and the upper threshold, iterating the steps of the method according to claim 1.
16. Method according to claim 1, comprising the steps of at the beginning, receiving from the environmental sensor initial raw data values, determining an average value and a measure of dispersion from the initial raw data values, defining a lower threshold and an upper threshold depending on the average value and the measure of dispersion, iterating the steps of the method according to claim 1.
17. Method according to claim 1, comprising the steps of in response to the receiving of the raw data value, determining if the received raw data value is between the lower threshold and the upper threshold, in response to determining if the received raw data value is between the lower threshold and the upper threshold determining the average value and the measure of dispersion over the defined time period only from raw data values between the lower threshold and the upper threshold thereby including the received raw data value only if between the lower threshold and the upper threshold, thereby excluding the received raw data value from the determination of the average value and the measure of dispersion if not between the lower threshold and the upper threshold, in response to determining the average value and the measure of dispersion redefining the lower threshold and the upper threshold depending on the determined average value and the determined measure of dispersion.
18. A computer program product comprising instructions which, when the program is executed by a processor, cause the processor to execute the steps of the method according to claim 1.
19. An environmental sensor comprising a sensor and a processor adapted to execute the steps of the method according to claim 1.
20. The environmental sensor of claim 19, wherein the sensor comprises a MOX sensor, and/or wherein the sensor comprises a VOC sensor.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The invention will be better understood and objects other than those set forth above will become apparent from the following detailed description thereof. Such description makes reference to the annexed drawings, wherein:
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
MODES FOR CARRYING OUT THE INVENTION
[0067]
[0068] Further,
[0069] It is proposed to apply a gating algorithm when determining the threshold, the result of which is shown as lower threshold and upper threshold 13 in
[0070]
[0071] In step S2, the arithmetic mean av and the standard deviation σ of the raw data values that fulfil condition C1 are determined. In the example of
av=α*av.sub.−1+(1−α)*rdv
[0072] in case of the raw data value rdv.sub.t is equal to or within the upper and the lower threshold ut and lt, i.e. “C1=yes”. In case the raw data value is outside the upper and the lower threshold ut and lt, i.e. “C1=no”, the updated average value av.sub.t is set to the previous average value: av=av.sub.−1
[0073] In general, the mean may be replaced by any average value, e.g. a median which typically is a more robust measure of average than the arithmetic mean, and the standard deviation may be replaced by any measure of dispersion, e.g. an interquartile range. In a specific embodiment, the average value and the measure of dispersion may be calculated recursively, e.g. by exponential smoothing functions as described above, which saves computing power and storage space.
[0074] In step S3, the lower threshold lt and the upper threshold ut are redefined depending on the average value and the measure of dispersion determined in step S2. This may be done by the relations lt=av−nσ and ut=av+nσ, wherein n is a constant factor which is typically in the range between 1 and 3, e.g. 2. Alternatively, the lower threshold lt may be chosen to be a percentile, e.g. the 10.sup.th or 25.sup.th percentile, of the raw data, and the upper threshold ut to be a higher percentile, e.g. the 90.sup.th or 75.sup.th percentile.
[0075] The lower threshold lt and the upper threshold ut redefined in step S3 replace their former values. Thus they are taken into account in the gate condition C1 in the next iteration of the loop depicted in
[0076] In a variant, the method of
[0077] Accordingly, the normalized data value ndv is output in optional step S5. The output may be implemented as numerical value which is stored or transferred to a remote system via an interface. Or the normalized data value ndv may be output by means of a display, e.g. as graph showing the normalized data values over time.
[0078]
[0079] Further,
[0080] Such behaviour is undesired, especially if the later raw data values represent a new environmental state which is stable at least for some time, e.g. 1 min, 10 min or 1 h. In the case of normalized data values and an output according to steps S4 and S5, such situation leads to useless results. Either the normalization as described above works insufficiently and yields unreasonable results or, even worse, the outliers may even not be displayed at all.
[0081] As a remedy for such situation, a “robust gating” is proposed which leads to the lower and upper thresholds 34 in
[0082] One way of implementing the gating adaptation event 36 is looking at the time period for which no raw data value rdv fulfilled the gating criterion C1. If this time period exceeds a monitoring time period 37, e.g. 1 min, 10 min or an hour, then the gating adaptation event 36 is triggered.
[0083] An embodiment of a method for processing environmental sensor data applying robust gating is shown in the flow chart of
[0084] On the other hand, if the gating adaptation is not enabled, it is checked whether the raw data value rdv falls within the interval between the lower threshold and the upper threshold in criterion C1. If yes, rdv is directly passed to step S2 and contributes to the re-determination of av and σ. If no, it is checked with criterion C3 whether the conditions for a gating adaptation event are fulfilled. If the conditions for the gating adaptation event are fulfilled in C3, the gating adaptation event is triggered in step S6. This means that in step S6 the gating adaptation is enabled. If the conditions for the gating adaptation event are not fulfilled in C3, the raw data value rdv is not taken into account in the re-determination of av and σ, and the processing starts again with step S1, i.e. receiving a new raw data value.
[0085] As shown in the embodiment of
[0086] As it is not reasonable to take into account all raw data values for an infinite time after one gating adaptation event is triggered in step S6, it is useful to define a gating adaptation disengagement event 38 as shown in
[0087] In terms of the method depicted in
[0088] If the outcome of the check of criterion C4 is positive, the gating adaptation disengagement event 38 is triggered, the gating adaptation is disabled in step S7, and the processing restarts with step S1. If the outcome of the check of criterion C4 is negative, the present received raw data value is taken into account in the re-determination of av and σ in step S2 and in the redefinition of the lower and upper thresholds in step S3. Details for steps S2 and S3 have been described earlier.
[0089] In general, the method of
[0090]
[0091] In case one or more raw data values of raw signal 51a are above the upper threshold 53, i.e. they do not pass the gating criterion C1, they do not contribute to the re-determination of av, σ and the thresholds. Hence the threshold 53 for sensor A is not adapted. Raw data values measured by sensor B at the same time may, however, fall below the threshold 53 and hence pass the gating criterion C1. Thus av, σ and the threshold for sensor B will be adapted on the basis of these raw data values. In that case, the average values av, the measures of dispersion σ and the thresholds for sensor A and sensor B will begin to differ, and they will also continue to differ as long as no reset is performed.
[0092] Since the determination of the output signals 52a, 52b may depend on the present average value av and measure of dispersion σ, see above in the context of normalized data, also the output signals 52a, 52b of the sensors A and B will differ. Such situation leads to non-intuitive readings of the two sensors and to a suboptimal user experience.
[0093] As a solution to such issue, a method for processing environmental sensor data with gating is proposed wherein the gating comprises a “soft” instead of a “hard” threshold.
[0094] As shown in
[0095] In general, the soft threshold with a weighting function has the effect that neighbouring raw data values, i.e. differing by 0 to 5%, get similar weights, i.e. differing by 0 to 5%. Hence in