This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2019-64972, filed on Mar. 28, 2019, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to a method for extracting features, a storage medium, and an apparatus for extracting features.
An analysis method using topological data analysis (TDA) is known as a technology for detecting changes corresponding to anomaly in data by analyzing time series data such as brain waves data or acceleration data. For example, time series data is input and sectioned into subsets, the subsets of time series data are in turn converted into figures referred to as quasi-attractors that are a finite number of attractors. When a feature of a figure is extracted by performing persistent homology conversion (PH conversion), a persistence diagram on which the generation (appearance) and the disappearance of a hole serving as a feature are plotted is generated, bar code data is generated from the persistence diagram, and consequently, Betti numbers are calculated.
Betti sequences are created from the Betti numbers generated in this manner, and by using the Betti sequences as a feature vector, machine learning is performed and a learning model is created. By using the trained learning model, anomaly in time series data is detected. As the related art, for example, International Publication Pamphlet No. WO 2006/137142, Japanese Laid-open Patent Publication Nos. 11-142425, 2018-92349, and 2017-97643 are disclosed.
According to an aspect of the embodiments, A method for extracting features, the method being implemented by a computer, the method includes generating attractors from time series data having a cyclic characteristic; generating a persistence diagram by performing persistent homology conversion for the attractors; changing a degree of influence with respect to individual items of data in the persistence diagram in accordance with a time of existence or an appearance time of a hole generated by performing the persistent homology conversion; and extracting features of the time series data from the changed persistence diagram in which the degree of influence has been changed.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
Incidentally, when a Betti sequence is generated by using entire data of the persistence diagram, information about noise in which the timing of generation and the timing of disappearance are close to each other, that is, noise in which the time of existence is short is included. It is thus considered to improve accuracy in extracting features in time series data by removing information in which the time of existence is relatively short from the persistence diagram and accordingly generating a Betti sequence.
However, if information in which the time of existence is relatively short is completely removed, when multiple items of time series data fulfil criteria for removal, it is impossible to distinguish the multiple items of time series data from each other. In the case of time series data of relatively small amplitude, a noise component in some cases appears in a range in which the time of existence is not short and this may adversely affect feature extraction. In consideration of the above circumstances, it is desired to extract features with good accuracy.
Hereinafter, embodiments of a method for extracting features, a program for extracting features, and an apparatus for extracting features disclosed in the present application are described in detail with reference to the drawings. The embodiments do not limit the present disclosure. The embodiments may be combined with each other as appropriate when there is no contradiction.
[Description of Apparatus for Extracting Features]
The feature extraction apparatus 10 changes importance by setting weight for the time of existence and the appearance time and then generates bar code data and a Betti sequence. The Betti sequence generated in this manner is used as a feature of input data for, for example, learning processing of learning a feature of each data item, inference processing performed by using a learned model, and analysis processing performed for, for example, detecting anomaly by using features.
Here, an example in which the feature extraction apparatus 10 is applied to learning processing and inference processing.
As illustrated in
In an inference phase, the feature extraction apparatus 10 performs attractor generation, PH conversion, diagram generation, weight setting, and Betti-sequence generation for unlabeled input data such as “time series data per unit time” assigned “label A” that is measurement data. The feature extraction apparatus 10 generates a Betti sequence (a feature) corresponding to unlabeled input data, inputs the Betti sequence to the learned model, and obtains an output result of the learned model. The feature extraction apparatus 10 then identifies a label of the input data in accordance with the output result of the learned model.
While the example in which the feature extraction apparatus 10 performs learning processing and inference processing is described here, this is a mere example and feature extraction processing, learning processing, and inference processing may be performed separately by different apparatuses.
[Functional Configuration]
The communication unit 11 is a processing unit that controls communications with another device and implemented as, for example, a communication interface. For example, the communication unit 11 receives time series data, such as brain wave data measured by an electroencephalograph or acceleration data obtained by a wearable sensor or the like, as input data from the corresponding measuring device.
The storage unit 12 is an example of a storage device that stores, for example, data and a program to be run by the control unit 20 and implemented as, for example, a memory or a hard disk. The storage unit 12 stores an input data database (DB) 13, a PH information DB 14, a weight setting DB 15, and a feature DB 16.
The input data DB 13 is a database that stores time series data targeted for feature extraction. This embodiment is described by using, as input data, time series data having a cyclic characteristic such as time series data indicating changes in heart rate.
While the time series data of heart rate is used as an instance of continuous data in this example, time series data is not limited to this kind of data. The time series data may be, for example, biometric data except for heart rate (time series data indicating brain waves, pulse, body temperature, or the like) or wearable sensor data (time series data obtained by a gyro sensor, an acceleration sensor, a geomagnetic sensor, or the like). The time series data may also be, for example, financial data (time series data indicating interest rates, commodity prices, balance of international payments, stock prices, or the like), natural environment data (time series data indicating temperature, humidity, carbon dioxide levels, or the like), or social data (labor statistics data, demographic statistics data, or the like).
The PH information DB 14 is a database that stores information generated by performing, for example, attractor generation and PH conversion. For example, the PH information DB 14 stores, for example, coordinates of each point of a set of points of a quasi-attractor, the appearance time and the disappearance time of each hole generated by PH conversion, and the time of existence of each hole.
The weight setting DB 15 is a database that stores information about weight given for the persistence diagram. For example, the weight setting DB 15 stores set weights in association with, for example, the appearance time (an existence value) at which a hole is generated or the time of existence that is a difference between the appearance time and the disappearance time of the hole.
The feature DB 16 is a database that stores features generated by the control unit 20. For example, the feature DB 16 stores information about bar code data in which weights are set and information about a Betti sequence used as features in learning processing and inference processing.
The control unit 20 is a processing unit that controls entire processing of the feature extraction apparatus 10 and implemented as, for example, a processor. The control unit 20 includes a PH processing unit 21, a diagram generation unit 22, a weight setting unit 23, a feature extraction unit 24, and a feature processing unit 25. The PH processing unit 21, the diagram generation unit 22, the weight setting unit 23, the feature extraction unit 24, and the feature processing unit 25 are an example of electronic circuits included in a processor or the like or processes that are executed by a processor or the like.
The PH processing unit 21 is a processing unit that performs attractor generation and PH conversion for input data. Specifically, the PH processing unit 21 reads input data stored in the input data DB 13 and generates quasi-attractors from the input data. The PH processing unit 21 extracts the appearance time and the disappearance time of each hole by performing persistent homology conversion for the quasi-attractors and stores the appearance time and the disappearance time of each hole in the PH information DB 14.
With reference to
Quasi-attractor={(f(1),f(2),f(3)),(f(2),f(3),f(4)),(f(3),f(4),f(5)), . . . ,(f(T−2),f(T−1),f(T))}
Subsequently, the PH processing unit 21 generates a quasi-attractor, extracts appearance and disappearance of each hole by employing persistent homology conversion, and consequently performs conversion to a Betti sequence. The attractor generated here is referred to as a “quasi-attractor” because the attractor is a finite set of points.
“Homology” is a method of expressing features of an object by using the numbers of holes in m (m≥0) dimensions. The “hole” mentioned here is an element of a homology group. A zero-dimensional hole is a coupled component, a one-dimensional hole is a hole (a tunnel), and a two-dimensional hole is a void. The number of holes in each dimension is referred to as a Betti number. “Persistent homology” is a method for characterizing transitions of holes in m dimensions with respect to an object (a set of points (a point cloud) in this description) and enables defining features of the positions of points. In this method, each point in the object is gradually expanded to form a spherical shape, and during this process, the time at which a particular hole appears (the time is represented by the radius of the corresponding sphere at the time of appearance) and the time at which a particular hole disappears (the time is represented by the radius of the sphere at the time of disappearance) are specified.
The persistent homology is more specifically described with reference to
In the computation process of persistent homology, the radius of appearance and the radius of disappearance of an element (a hole) of a homology group are computed. By using the radius of appearance and the radius of disappearance of a hole, bar code data is generated. An item of bar code data is generated for each dimension of a particular hole and a set of bar code data is generated by combining together multiple items of bar code data corresponding to respective dimensions of holes. Continuous data represents correspondence between a radius (a time) of a sphere in persistent homology and a Betti number.
Here, generation of usual bar code data is simply explained.
Referring back to
Here, the persistence diagram is described. The persistence diagram is a diagram generated in accordance with the radius of appearance and the radius of disappearance that are obtained by performing computation of persistent homology.
When such a persistence diagram is applied to this embodiment, each point (in this embodiment referred to as data or hole data in some cases) in the persistence diagram indicates a hole extracted by performing persistent homology conversion; a feature of time series data is extracted by setting an appearance axis indicating a parameter of appearance of a hole at one axis and an disappearance axis indicating a parameter of disappearance of a hole at another axis. Specifically, in the persistence diagram, it is possible to view a time interval between generation and disappearance of a hole; the diagonal line at the center of the diagram indicates that the time interval between appearance and disappearance of a hole is zero, and when the time interval between appearance and disappearance of a hole is relatively short, a diagram is generated close to the diagonal line and a corresponding hole is regarded as a noise. For example, in the case of electrocardiograms, which are formed of a waveform of large amplitude, the time interval between appearance and disappearance of a hole is relatively large, and as a result, a corresponding diagram is generated at a position apart from the diagonal line. In the case of brain waves in which amplitude is smaller than the waveform of electrocardiogram, the time interval between appearance and disappearance of a hole is relatively large, and as a result, a corresponding diagram is generated at a position close to the diagonal line.
The weight setting unit 23 is a processing unit that sets weight in the persistence diagram generated by the diagram generation unit 22. Specifically, the weight setting unit 23 determines that data in which the time of existence is equal to or shorter than a threshold and data in which the time of generation (the appearance time) is earlier than a threshold are likely to be noises and decreases the importance by lightening corresponding weights.
(Problems of General Denoising)
As general denoising, a method of removing any data in which the time of existence is relatively short is known. This is because, when there is an influence of noise components, such as micro-vibrations or high-frequency components, the noise components exist as isolated points in the attractor and the time of existence thereof is relatively short in many cases.
However, data in which the time of existence is relatively short is significant in some cases, disadvantages may occur when any data in which the time of existence is relatively short is assigned a zero degree of influence. FIG. is a diagram for explaining a problem of the general denoising.
This is because, when many high-frequency components exist in input data, data in which the time of existence is relatively short increases.
Since data in which amplitude is relatively small is easy to be influenced by noise, it is difficult to remove noise by employing the general denoising described above.
Here, a reason that a component that appears early serves as a noise is described.
(Example of Weight Setting)
In consideration of circumstances described above, the weight setting unit 23 performs weighting for the persistence diagram to suppress influences of data in which the time of existence is relatively short and also to suppress influences of portions in which the appearance time is early.
In the example in
In accordance with the information about weight setting indicated in
Referring back to
In the case of the general manner, as indicated in
On the other hand, as illustrated in
For example, the feature extraction unit 24 computes a Betti number “0.5” for t1 because a hole assigned a weight “0.5” appears at t1, a Betti number “1.5” for t2 because a hole assigned a weight “1” additionally appears at t2, and a Betti number “2.5” for t3 because a hole assigned a weight “1” additionally appears at t3. The feature extraction unit 24 also computes a Betti number “2.0” for t4 because the hole of the weight “0.5” disappears at t4, a Betti number “3.0” for t5 because a hole of a weight “1” additionally appears, and a Betti number “2.75” for t6 because a hole of a weight “0.5” and a hole of a weight “0.25” appear and the hole of the weight “1” disappears. Since the feature extraction unit 24 computes a Betti sequence in such a manner, in consideration of weight, the feature extraction unit 24 is able to generate a Betti sequence in a form different from that of
Referring back to
[Processing Flow]
Subsequently, the diagram generation unit 22 generates a persistence diagram by performing TDA processing with the use of the quasi-attractors (S104). The weight setting unit 23 sets weight in accordance with the time of existence of each hole (S105) and also sets weight in accordance with the appearance time of each hole (S106). S105 and S106 are interchangeable in order.
Subsequently, the feature extraction unit 24 generates bar code data from the weighted persistence diagram (S107) and generates a Betti sequence based on the bar code data (S108).
[Effects]
As described above, the feature extraction apparatus 10 generates quasi-attractors from time series data; and when generating a persistence diagram from the generated quasi-attractors, weight for data in which the time of existence is equal to or shorter than a threshold and weight for data in which the appearance time is earlier than a threshold are lightened in the persistence diagram. The feature extraction apparatus 10 consequently extracts features time series data by using the weighted persistence diagram. As a result, when the feature extraction apparatus 10 extracts features by employing TDA, it is possible to extract features while influence of data in which the time of existence is relatively short is maintained, and thus, comparison between items of data having weak features may be performed. Furthermore, since the feature extraction apparatus 10 is able to suppress the influence of noise components in which the appearance time is early, it is possible to achieve feature extraction with improved accuracy.
Next, an example of applying the method according to the embodiment 1 to classification of person's motion is described.
Here, time waveforms as an example of time series data measured by a wearable sensor worn by a user when the user moves are collected and labels indicating person's motion are set for the respective time waveforms. For example, a time waveform corresponding to a label “walk”, a time waveform corresponding to a label “run”, a time waveform corresponding to a label “conveyance”, and a time waveform corresponding to a label “sit” are generated in pairs as learning data. As illustrated in
In this regard, by using the feature extraction apparatus 10 according to the embodiment 1, when a Betti sequence is generated from items of learning data, it is possible to generate a Betti sequence by setting weight with respect to the time of existence and the appearance time, and as a result, it is possible to perform learning while the items of learning data are accurately distinguished from each other and thus improve the accuracy of learning a learning model.
Afterwards, by inputting a time waveform obtained from a wearable sensor of a user to the learned model, it is possible to predict the user's motion. For example, a time waveform that is from morning to a time to sleep and that is obtained by a wearable sensor is divided by predetermined intervals and inputted to a learned model. As a result, the feature extraction apparatus 10 displays results obtained by predicting the user's motions of the day and a graph at a display. The user or an administrator is able to accordingly grasp proportions of respective motions to utilize the information for health examinations and eliminating physical inactivity. Furthermore, by inputting, whenever desired, a time waveform obtained by a wearable sensor to a learned model, it is possible to predict the present motion of a user, and accordingly, it is possible to manage working conditions of the user.
Incidentally, while the embodiment 1 described the example in which bar code data is generated from a weighted persistence diagram, a Betti sequence is accordingly generated, and features of time series data are consequently extracted, but this is not construed in a limiting sense. For example, it is possible to perform scoring directly by using the total of the time of existence obtained from the weighted persistence diagram.
Next, an example of anomaly detection performed by employing a method in
For example, noise caused by, for example, a measuring device is added to acceleration data measured in a normal state, but this does not considerably affect a waveform. In acceleration data measure a deteriorating state before the occurrence of failure such as cracks, a small waveform at an amplitude indicating small anomaly that seems like a noise, the number of items of data that appear in a range targeted for removal in the persistence diagram increases. In acceleration data measured at the time of failure such as cracks, a waveform that is apparently different from a waveform in a normal state and in which relatively short distance between peaks appears, and thus, the number of items of data that appears in a range targeted for removal in the persistence diagram is a considerably great number and data that corresponds to a high-frequency component and in which the time of existence is relatively long frequently appears.
As illustrated in
As a result, the feature extraction apparatus 10 is able to precisely remove noise in a normal state, and thus, it is possible to accurately determine as normal a state (a) in which the score slightly increases due to noise in a normal state. The feature extraction apparatus 10 determines, at a time (b) at which data in denoising range increase, a normal state when any noise is deleted; but by performing scoring after weighting, the feature extraction apparatus 10 is able to determine a state in which anomaly is about to occur. In addition, since an administrator or the like is able to check changes in the score whenever desired, it is possible to detect, by setting a threshold or the like, an abnormal state before serious anomaly such as a partial defect appears.
While the embodiments of the present disclosure have been described, the present disclosure may be implemented in various different forms other than the embodiments described above.
[Use of Feature]
While in the embodiments described above the example in which the feature extraction apparatus 10 employs learning or the like by using features is described, this is not construed in a limiting sense and the feature extraction apparatus 10 may extract and store features or provide features to another apparatus. Additionally, it is possible to perform anomaly detection in
[Weight Setting]
While in the embodiments described above the example of performing both weight setting based on the length of the time of existence and weight setting based on the appearance time is described, this is not construed in a limiting sense and only either one may be performed. Furthermore, the values of weight are an example and weight may be changed to any values when the values cause the importance of data belonging to the areas (a) or (b) Illustrated in
[Numerical Values or the Like]
The numerical values, set values of weight, the number of dimensions relating to quasi-attractors used in the embodiments are mere examples and may be changed in any manner. The input data and the learning method are also mere examples and may be changed in any manner. The features are also an example and other information may be used when the information indicates the feature of a Betti sequence. Various method such as neural networks may be employed for the learning model.
[System]
Processing procedures, control procedures, specific names, and Information containing various kinds of data and parameters indicated in the specification and the drawings may be changed in any manner unless otherwise specified.
The constituent elements of the devices illustrated in the drawings are functional conceptual ones and not necessarily configured physically as illustrated in the drawings. Specific forms of distribution and integration of the devices are not limited to those illustrated in the drawings. All or some of the devices may be functionally or physically distributed or integrated in any unit based on various loads, usage statuses, or the like.
All or some of the processing functions performed by the devices may be implemented by a central processing unit (CPU) and a program analyzed and run by the CPU or may be implemented by a hardware device using wired logic coupling.
[Hardware]
The communication device 10a is, for example, a network interface card and communicates with a server. The HDD 10b stores a program and DBs that implement functions illustrated in
The processor 10d executes processes that implement the functions illustrated in, for example,
As described above, the feature extraction apparatus 10 functions as an information processing apparatus that implements a method for extracting features by reading and running the program. The feature extraction apparatus may also implement the same functions as those of the embodiments described above by reading the program from a recording medium with the use of a medium reading device and running the read program. The program described in other embodiments is not limited to a program that is run by the feature extraction apparatus 10. For example, the disclosure is applicable to the case in which another computer or a server runs the program or the case in which the other computer and the server cooperate to run the program.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2019-064972 | Mar 2019 | JP | national |