WO2021079425A1 - データ前処理方法、データ前処理装置およびデータ前処理プログラム - Google Patents

データ前処理方法、データ前処理装置およびデータ前処理プログラム Download PDF

Info

Publication number
WO2021079425A1
WO2021079425A1 PCT/JP2019/041466 JP2019041466W WO2021079425A1 WO 2021079425 A1 WO2021079425 A1 WO 2021079425A1 JP 2019041466 W JP2019041466 W JP 2019041466W WO 2021079425 A1 WO2021079425 A1 WO 2021079425A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
model
input
preprocessing
measurement data
Prior art date
Application number
PCT/JP2019/041466
Other languages
English (en)
French (fr)
Inventor
佳寛 大川
井出 勝
Original Assignee
富士通株式会社
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 富士通株式会社 filed Critical 富士通株式会社
Priority to PCT/JP2019/041466 priority Critical patent/WO2021079425A1/ja
Priority to JP2021553199A priority patent/JP7273344B2/ja
Publication of WO2021079425A1 publication Critical patent/WO2021079425A1/ja
Priority to US17/714,555 priority patent/US20220230076A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/022Knowledge engineering; Knowledge acquisition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7203Signal processing specially adapted for physiological signals or for diagnostic purposes for noise prevention, reduction or removal
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7264Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
    • A61B5/7267Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/30ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for calculating health indices; for individual health risk assessment
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/70ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for mining of medical data, e.g. analysing previous cases of other patients
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • A61B5/346Analysis of electrocardiograms

Definitions

  • the present invention relates to a data preprocessing method, a data preprocessing device, and a data preprocessing program.
  • Machine learning may be performed as one of the data analysis using a computer.
  • training data showing known cases is input to a computer.
  • the computer analyzes the training data and learns a model that generalizes the relationship between factors (sometimes called explanatory variables or independent variables) and outcomes (sometimes called objective or dependent variables). ..
  • factors sometimes called explanatory variables or independent variables
  • outcomes sometimes called objective or dependent variables.
  • the flow of data analysis using machine learning can be divided into a learning phase that collects past data and learns the model, and an operation phase that inputs the data generated after learning into the model and predicts the result. it can.
  • the tendency of the data input to the model in the operation phase may change from the data used in the learning phase.
  • the prediction accuracy of the model may decrease after the fact.
  • re-learning the model can be considered as one method of recovering the prediction accuracy.
  • a wind power generation prediction method for predicting future wind power generation from past wind power generation and weather forecasts has been proposed.
  • the model is trained by machine learning, and the model is retrained on a regular basis using the latest data.
  • a continuous machine learning method that continuously updates the model so as to adapt to the changing trend of the input data has been proposed.
  • the timing for updating the model is determined by considering the trade-off between the delay until the latest data is reflected in the model and the machine learning cost.
  • the data used for machine learning may be measurement data measured by a measurement device, such as time-series signal data and image data.
  • the measurement data may include noise due to the characteristics of the measurement device and its usage environment. Therefore, as one of the changes in the data tendency, a change in the noise tendency may occur. For example, due to aged deterioration of the measurement device or changes in the usage environment, noise of a pattern that did not exist in the learning phase may be included in the measurement data.
  • retraining the model each time such a change in the data tendency occurs has a problem that the cost is high from the viewpoint of the amount of calculation and the learning time.
  • an object of the present invention is to provide a data preprocessing method, a data preprocessing apparatus, and a data preprocessing program that suppress model retraining against changes in data trends.
  • a data preprocessing method executed by a computer is provided. Preprocessing according to the parameters is executed on the first measurement data to generate training data. Train the model using the training data. Preprocessing is performed on the second measurement data to generate input data. The input data is input to the model to generate a prediction result, and the prediction accuracy is calculated from the teacher label associated with the second measurement data and the prediction result. If the prediction accuracy is less than the threshold, the preprocessing parameters are changed based on the comparison between the training data and the input data generated from the second measurement data.
  • a data preprocessing device having a storage unit and a processing unit is provided. Further, in one aspect, a data preprocessing program to be executed by a computer is provided.
  • model retraining can be suppressed against changes in data trends.
  • FIG. 1 is a diagram illustrating an example of a data preprocessing device according to the first embodiment.
  • the data preprocessing device 10 of the first embodiment learns a model by machine learning, and predicts the result corresponding to the input data using the learned model. Preprocessing is performed on the training data used for learning the model and the input data input to the model.
  • the data preprocessing device 10 may be a client device or a server device.
  • the data preprocessing device 10 can also be referred to as a computer, an information processing device, a machine learning device, or the like.
  • the data preprocessing device 10 executes both the learning phase for learning the model and the operation phase for using the model, but different devices may execute both. ..
  • the data preprocessing device 10 has a storage unit 11 and a processing unit 12.
  • the storage unit 11 may be a volatile semiconductor memory such as a RAM (RandomAccessMemory) or a non-volatile storage such as an HDD (HardDiskDrive) or a flash memory.
  • the processing unit 12 is, for example, a processor such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), or a DSP (Digital Signal Processor). However, the processing unit 12 may include an electronic circuit for a specific purpose such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array).
  • the processor executes a program stored in a memory (may be a storage unit 11) such as a RAM.
  • a set of multiple processors is sometimes referred to as a "multiprocessor" or simply a "processor.”
  • the storage unit 11 includes a parameter 13a, a model 14, measurement data 15 (first measurement data), measurement data 16 (second measurement data), a teacher label 16a associated with the measurement data 16, training data 17, and input. Data 18 and prediction result 19 are stored.
  • Parameter 13a is a control parameter that controls the behavior of the preprocessing 13.
  • the preprocessing 13 converts the measurement data 15 into training data 17 when learning the model 14. Further, the preprocessing 13 converts the measurement data 16 into the input data 18 when the model 14 is used.
  • the preprocessing 13 operates as, for example, a noise filter that removes noise contained in the measurement data 15 and 16.
  • the preprocessing 13 may operate as a low-pass filter that cuts high-frequency components, may operate as a high-pass filter that cuts low-frequency components, or may operate as a band-pass filter that cuts frequency components other than a predetermined frequency. It may work.
  • the parameter 13a may specify a cutoff frequency indicating a boundary of frequencies to be cut. Further, the parameter 13a may specify a coefficient that realizes a filter such as a finite impulse response (FIR) filter or an infinite impulse response (IIR) filter.
  • FIR finite impulse response
  • IIR infinite impulse response
  • Model 14 is a machine learning model that generalizes the relationship between explanatory variables and objective variables.
  • the model 14 is generated by a predetermined machine learning algorithm using the training data 17.
  • the trained model 14 accepts the input of the input data 18 corresponding to the explanatory variable and outputs the prediction result 19 corresponding to the objective variable.
  • various machine learning algorithms can be used.
  • the model 14 may be a neural network (NN: Neural Network), a support vector machine (SVM: Support Vector Machine), a regression analysis model, a random forest, or the like.
  • the model 14 may be a k-nearest neighbor model that determines the classification of the input data 18 by the k-nearest neighbor method.
  • the measurement data 15 is data measured by the measurement device.
  • the measurement data 15 may include noise according to the characteristics of the measurement device and the usage environment of the measurement device.
  • the measurement data 15 is collected when learning the model 14.
  • the data preprocessing device 10 may directly receive the measurement data 15 from the measurement device connected to the data preprocessing device 10. Further, the data preprocessing device 10 may receive the measurement data 15 from the storage device or another information processing device via the network. Further, the data preprocessing device 10 may read the measurement data 15 from the recording medium connected to the data preprocessing device 10.
  • the measurement data 15 may be time-series signal data indicating time-series amplitude fluctuations, such as acceleration data measured by an accelerometer, electrocardiogram data measured by an electrocardiograph, and voice data measured by a microphone. Further, the measurement data 15 may be image data measured by an image sensor. The measurement data 15 may correspond to the value of a specific objective variable. For example, when the model 14 is subjected to binary classification of normal / abnormal, the measurement data 15 may be measurement data representing normality. Further, the measurement data 15 may be associated with a teacher label which is a correct answer value of the objective variable.
  • the measurement data 16 is data measured by the measurement device and is the same type of data as the measurement data 15. However, the measurement data 16 is collected after learning the model 14.
  • the measurement data 16 may be collected by the same method as the measurement data 15, or may be collected by a different method.
  • the measurement data 16 may include noise having a tendency different from that of the measurement data 15.
  • the tendency of noise may change due to various factors such as aged deterioration of the measuring device, replacement of the measuring device, change of the installation location of the measuring device, and change of electronic devices and structures existing around the measuring device.
  • a change in the tendency of noise for example, a change in the frequency of noise can be mentioned.
  • the teacher label 16a represents the correct answer value of the objective variable corresponding to the measurement data 16.
  • the teacher label 16a represents normal or abnormal.
  • the teacher label 16a is given to the measurement data 16 by a person, for example, by confirming the measurement data 16 measured by the measurement device.
  • the teacher label 16a may be fed back each time the measurement data 16 is measured, or may be one in which the measurement data 16 is accumulated and fed back collectively at a later date.
  • the training data 17 is used for learning the model 14.
  • the training data 17 is generated by executing the preprocessing 13 on the measurement data 15.
  • the training data 17 is obtained by removing high frequency noise from the measurement data 15 by, for example, a low-pass filter.
  • the parameter 13a used when learning the model 14 may be determined by trial and error by a person so that the training data 17 is suitable for learning the model 14, and the prediction accuracy of the model 14 is high. It may be automatically searched through machine learning so that it becomes. For example, the parameter 13a is adjusted so that the noise contained in the measurement data 15 is sufficiently removed and the essential features of the measurement data 15 remain in the training data 17.
  • the input data 18 is generated by executing the preprocessing 13 on the measurement data 16.
  • the input data 18 is obtained by removing high frequency noise from the measurement data 16 by, for example, a low-pass filter.
  • the same parameters 13a as those at the time of learning the model 14 are used in the preprocessing 13 for converting the measurement data 16 into the input data 18.
  • the noise of the measurement data 16 may not be sufficiently removed with the same parameter 13a as at the time of learning. Therefore, as will be described later, the data preprocessing device 10 may change the parameter 13a.
  • the prediction result 19 is output from the model 14 by inputting the input data 18 into the model 14.
  • the input data 18 corresponds to the explanatory variable
  • the prediction result 19 corresponds to the objective variable.
  • the teacher label 16a which is the correct answer value of the objective variable
  • the prediction accuracy of the model 14 can be evaluated by comparing the teacher label 16a with the prediction result 19.
  • the correct answer rate (Accuracy) is used as the evaluation value of the prediction accuracy.
  • the correct answer rate is, for example, the ratio of samples in which the teacher label 16a and the prediction result 19 match with respect to the total number of samples.
  • the data preprocessing device 10 takes measures to restore the prediction accuracy when the prediction accuracy deteriorates.
  • the processing unit 12 executes the learning phase and the operation phase. As a learning phase, the processing unit 12 executes preprocessing 13 according to the parameter 13a on the measurement data 15 to generate training data 17. The training data 17 is saved because it may be used in the operation phase as described later.
  • the processing unit 12 learns the model 14 using the training data 17.
  • the model 14 is a k-nearest neighbor model that performs binary classification, for example, the model 14 calculates the distance between the received input data and the training data 17, and determines that the distance is normal when the distance is equal to or less than the threshold value. , When the distance exceeds the threshold value, it is determined to be abnormal.
  • the processing unit 12 executes the preprocessing 13 according to the same parameter 13a as the learning phase on the measurement data 16 to generate the input data 18.
  • the processing unit 12 inputs the input data 18 into the model 14 and generates the prediction result 19.
  • the prediction result 19 indicates, for example, whether the measurement data 16 is normal or abnormal.
  • the processing unit 12 compares the teacher label 16a associated with the measurement data 16 with the prediction result 19 to calculate the prediction accuracy of the model 14. For example, the processing unit 12 determines that the answer is correct when the teacher label 16a and the prediction result 19 match each of the plurality of samples as the measurement data 16, and the teacher label 16a and the prediction result 19 match. If there is none, it is judged as an incorrect answer.
  • the processing unit 12 calculates the ratio of the samples for which the prediction result 19 is correct among all the samples as the prediction accuracy.
  • the processing unit 12 compares the calculated prediction accuracy with the threshold value.
  • the threshold value is set in advance such as 90%.
  • the processing unit 12 does not execute the recovery processing of the prediction accuracy and maintains the parameter 13a of the preprocessing 13.
  • the processing unit 12 executes the recovery processing of the prediction accuracy.
  • the processing unit 12 compares the training data 17 saved in the learning phase with the input data generated from the measurement data 16, and based on the comparison result, the parameter 13a of the preprocessing 13 To change.
  • the processing unit 12 executes the preprocessing 13 on the measurement data 16 while changing the parameter 13a, and adjusts the parameter 13a so that the generated input data approaches the training data 17. For example, the processing unit 12 calculates the distance between the generated input data and the training data 17, and adopts the parameter 13a that minimizes the distance.
  • the processing unit 12 may search for the optimum parameter 13a by using an optimization algorithm such as the steepest descent method. Further, the processing unit 12 may try the candidate values of some parameters 13a and adopt the candidate values capable of generating the input data closest to the training data 17 from among the candidate values.
  • the processing unit 12 executes the preprocessing 13 using the changed parameter 13a in the subsequent operation phase. For example, the processing unit 12 executes preprocessing 13 according to the changed parameter 13a on the new measurement data to generate input data, inputs the generated input data to the model 14, and measures the data. Generate prediction results corresponding to the data.
  • the preprocessing 13 in the learning phase, is executed for the measurement data 15 to generate the training data 17, and the model 14 is trained using the training data 17. Will be done.
  • the preprocessing 13 is executed for the measurement data 16 to generate the input data 18, the input data 18 is input to the model 14, and the prediction result 19 is generated.
  • the prediction accuracy of the prediction result 19 is lowered, the parameter 13a is changed based on the comparison between the saved training data 17 and the input data 18.
  • the model 14 can be continued to be used as it is without re-learning the model 14, and the cost such as the calculation amount of machine learning and the learning time can be suppressed.
  • the machine learning device of the second embodiment learns a model by machine learning, and uses the learned model to predict the result corresponding to the input data.
  • the machine learning device of the second embodiment may be a client device or a server device.
  • a machine learning device can also be called a computer, an information processing device, or the like.
  • FIG. 2 is a diagram showing a hardware example of the machine learning device according to the second embodiment.
  • the machine learning device 100 includes a CPU 101, a RAM 102, an HDD 103, an image interface 104, an input interface 105, a medium reader 106, and a communication interface 107. These units included in the machine learning device 100 are connected to the bus.
  • the machine learning device 100 corresponds to the data preprocessing device 10 of the first embodiment.
  • the CPU 101 corresponds to the processing unit 12 of the first embodiment.
  • the RAM 102 or the HDD 103 corresponds to the storage unit 11 of the first embodiment.
  • the CPU 101 is a processor that executes program instructions.
  • the CPU 101 loads at least a part of the programs and data stored in the HDD 103 into the RAM 102 and executes the program.
  • the CPU 101 may include a plurality of processor cores, and the machine learning device 100 may include a plurality of processors.
  • a collection of multiple processors is sometimes referred to as a "multiprocessor” or simply a "processor.”
  • the RAM 102 is a volatile semiconductor memory that temporarily stores a program executed by the CPU 101 and data used by the CPU 101 for calculation.
  • the machine learning device 100 may include a type of memory other than RAM, or may include a plurality of memories.
  • HDD 103 is a non-volatile storage that stores software programs such as OS (Operating System), middleware, and application software, and data.
  • the machine learning device 100 may include other types of storage such as a flash memory and an SSD (Solid State Drive), or may include a plurality of storages.
  • the image interface 104 outputs an image to the display device 111 connected to the machine learning device 100 in accordance with a command from the CPU 101.
  • the display device 111 any kind of display device such as a CRT (Cathode Ray Tube) display, a liquid crystal display (LCD: Liquid Crystal Display), an organic EL (OEL: Organic Electro-Luminescence) display, and a projector can be used. ..
  • An output device other than the display device 111 such as a printer may be connected to the machine learning device 100.
  • the input interface 105 receives an input signal from the input device 112 connected to the machine learning device 100.
  • the input device 112 any kind of input device such as a mouse, a touch panel, a touch pad, and a keyboard can be used.
  • a plurality of types of input devices may be connected to the machine learning device 100.
  • the medium reader 106 is a reading device that reads programs and data recorded on the recording medium 113.
  • the recording medium 113 any kind of recording medium such as a magnetic disk such as a flexible disk (FD) or HDD, an optical disk such as a CD (Compact Disc) or a DVD (Digital Versatile Disc), or a semiconductor memory is used. Can be done.
  • the medium reader 106 copies, for example, a program or data read from the recording medium 113 to another recording medium such as the RAM 102 or the HDD 103.
  • the read program is executed by, for example, the CPU 101.
  • the recording medium 113 may be a portable recording medium and may be used for distribution of programs and data. Further, the recording medium 113 and the HDD 103 may be referred to as a computer-readable recording medium.
  • the communication interface 107 is connected to the network 114 and communicates with other information processing devices via the network 114.
  • the communication interface 107 may be a wired communication interface connected to a wired communication device such as a switch or a router, or may be a wireless communication interface connected to a wireless communication device such as a base station or an access point.
  • FIG. 3 is a diagram showing an example of the flow of learning and operation of the model.
  • the machine learning device 100 collects measurement data 151.
  • the measurement data 151 has been measured by a measurement device in the past.
  • the measurement data 151 includes noise according to the characteristics of the measurement device and the usage environment of the measurement device. Noise may be generated due to the structure of the measuring device itself, or may be generated due to electromagnetic waves of electronic devices existing in the vicinity.
  • As the measurement data 151 a plurality of samples measured from different objects are collected.
  • the electrocardiogram data measured by the electrocardiograph is mainly assumed as the measurement data 151. Multiple ECG samples measured from different patients in the past are collected.
  • the electrocardiogram sample collected as the measurement data 151 is a normal sample judged to be a normal electrocardiogram by a person.
  • the machine learning device 100 inputs the measurement data 151 into the preprocessing filter 141 to generate the training data 152.
  • the preprocessing filter 141 is intended to remove noise contained in the measurement data 151.
  • a low-pass filter that mainly removes high-frequency noise is assumed as the pretreatment filter 141.
  • the behavior of the low-pass filter depends on the cutoff frequency, which indicates the upper limit of the frequency to be passed. The cutoff frequency is adjusted by the operator by trial and error during learning.
  • As the training data 152 a plurality of electrocardiogram samples from which high-frequency noise has been removed are mainly assumed.
  • Model 142 is a classifier that classifies input data into a plurality of classes.
  • the model 142 may be a neural network, a support vector machine, a regression analysis model, a random forest, or the like.
  • a k-nearest neighbor model that classifies input data normally or abnormally based on the k-nearest neighbor method is assumed.
  • This k-nearest neighbor model calculates the distance between the input electrocardiogram sample and the normal sample which is the training data 152, determines that the electrocardiogram sample whose distance is less than or equal to the threshold value is normal, and determines the electrocardiogram sample whose distance exceeds the threshold value. Judge as abnormal.
  • Such a model 142 can be used in the medical field. Whether the electrocardiogram is normal or abnormal is referred to in diagnosing the patient's illness.
  • the machine learning device 100 acquires the measurement data 153.
  • the measurement data 153 is measured by the measurement device after learning the model 142.
  • the measurement data 153 includes noise according to the characteristics of the measurement device and the usage environment of the measurement device.
  • the machine learning device 100 acquires the teacher label fed back to the measurement data 153 after the measurement data 153 is measured.
  • the teacher label indicates the correct answer for the class to which the measurement data 153 belongs.
  • the electrocardiogram data measured by the electrocardiograph is mainly assumed as the measurement data 153.
  • the teacher label indicates the result of a person's judgment as to whether the electrocardiogram is normal or abnormal.
  • the machine learning device 100 inputs the measurement data 153 into the preprocessing filter 141 to generate the input data 154.
  • the preprocessing filter 141 is intended to remove noise contained in the measurement data 153.
  • the preprocessing filter 141 used here is the same as during learning, and is, for example, a low-pass filter having the same cutoff frequency as during learning.
  • As the input data 154 an electrocardiogram sample in which high frequency noise is removed is mainly assumed.
  • the machine learning device 100 inputs the input data 154 to the model 142 and outputs the prediction result of the class to which the input data 154 belongs.
  • the model 142 calculates the distance between the electrocardiogram sample which is the input data 154 and the normal sample which is the training data 152, determines that the distance is normal when the distance is less than or equal to the threshold value, and is abnormal when the distance exceeds the threshold value. Is determined. By comparing the prediction result with the teacher label, the prediction accuracy of the model 142 can be evaluated.
  • the noise distribution may change.
  • the characteristics of the input data after the preprocessing may change, and the prediction accuracy of the model may decrease.
  • FIG. 4 is a diagram showing an example of a flow of deterioration and recovery of prediction accuracy due to noise.
  • the machine learning device 100 acquires the measurement data 155.
  • the measurement data 155 includes noise according to the characteristics of the measurement device and the usage environment of the measurement device.
  • the tendency of noise included in the measurement data 155 is different from the measurement data 151 used at the time of learning. For example, the frequency of noise contained in the electrocardiogram data is changing.
  • the input data 156 generated from the measurement data 155 through the preprocessing filter 141 may not match the distribution of the training data 152 used for training the model 142. For example, there may be a large amount of noise remaining in the input data 156 due to improper cutoff frequency setting, or the signal waveform of the input data 156 may be excessively leveled.
  • the prediction accuracy of the prediction result output from the model 142 may be lower than the prediction accuracy at the beginning of learning of the model 142.
  • the prediction accuracy may be lower than the prediction accuracy at the beginning of learning of the model 142.
  • a large amount of noise remains in the input data 156, there is a high risk that normal electrocardiogram data will be erroneously determined to be abnormal.
  • a method of recovering the prediction accuracy a method of collecting measurement data newer than the measurement data 151 and learning a new model to replace the model 142 by using the new measurement data can be considered.
  • retraining the model is costly in terms of computational complexity and learning time.
  • the machine learning device 100 copes with the change in the tendency of noise by changing the preprocessing filter instead of retraining the model.
  • the machine learning device 100 stores the preprocessed training data 152 used for learning the model 142.
  • the machine learning device 100 changes the parameters of the preprocessing filter so that the input data converted from the measurement data 155 approaches the stored training data 152.
  • the machine learning device 100 calculates the distance between the input data that has passed through the preprocessing filter and the training data 152, and optimizes the parameters of the preprocessing filter so that the distance is minimized.
  • the pretreatment filter 141 is changed to the pretreatment filter 143 having parameters different from those of the pretreatment filter 141.
  • the cutoff frequency of the low-pass filter is changed.
  • the machine learning device 100 acquires the measurement data 157.
  • the measurement data 157 includes noise having the same tendency as the measurement data 155.
  • the machine learning device 100 inputs the measurement data 157 to the preprocessing filter 143 and converts the measurement data 157 into the input data 158.
  • the input data 158 is expected to be noise removed from the measurement data 157.
  • the features of the input data 158 are consistent with the features of the training data 152.
  • the machine learning device 100 inputs the input data 158 into the model 142 and acquires the prediction result. As a result, it is expected that the prediction accuracy of the model 142 will be restored to the same level as at the beginning of learning the model 142. This is because the characteristics of the input data 158 input to the model 142 are sufficiently close to the training data 152 used for learning the model 142.
  • the machine learning device 100 may output a warning to recommend re-learning of the model. For example, the machine learning device 100 calculates the distance between the input data that has passed through the optimized preprocessing filter 143 and the training data 152, and outputs a warning when the calculated distance exceeds a predetermined threshold value. Can be considered.
  • FIG. 5 is a diagram showing an example of searching for parameters of the preprocessing filter.
  • the machine learning device 100 may use an optimization algorithm such as the steepest descent method. Further, the machine learning device 100 may try some parameters and adopt the parameter having the smallest distance among the parameters. Here, the latter method will be described.
  • the machine learning device 100 generates preprocessing filters 143-1, 143-2, 143-3 with different parameters.
  • the pretreatment filter 143-1 has a parameter a
  • the pretreatment filter 143-2 has a parameter b
  • the pretreatment filter 143-3 has a parameter c.
  • the preprocessing filters 143-1, 143-2, 143-3 are low-pass filters having different cutoff frequencies.
  • the pretreatment filter 143-1 is a strong filter with a low cutoff frequency
  • the pretreatment filter 143-2 is a medium filter with a medium cutoff frequency
  • the pretreatment filter 143-3 has a high cutoff frequency. It is a weak filter.
  • the machine learning device 100 may select three from predetermined cutoff frequencies such as 25 Hz, 35 Hz, 75 Hz, 100 Hz, and 150 Hz.
  • the machine learning device 100 inputs the measurement data 155 into the preprocessing filter 143-1 to generate the input data 156-1. Further, the machine learning device 100 inputs the measurement data 155 into the preprocessing filter 143-2 to generate the input data 156-2. Further, the machine learning device 100 inputs the measurement data 155 into the preprocessing filter 143-3 to generate the input data 156-3. Then, the machine learning device 100 calculates the distance from the training data 152 for each of the input data 156-1, 156-2, and 156-3. When there are a plurality of samples as the training data 152, the distance between the input data 156-1 and the training data 152 is defined as the distance between the sample having the closest to the input data 156-1 among the plurality of samples. You may. Similarly, the distance between the input data 156-2 and the training data 152 may be defined as the distance between the sample closest to the input data 156-2.
  • the machine learning device 100 identifies the input data having the smallest distance from the training data 152 among the input data 156-1, 156-2, and 156-3. Here, it is assumed that the distance of the input data 156-2 is the smallest. Then, the machine learning device 100 adopts the preprocessing filter 143-2 used for generating the input data 156-2. That is, the machine learning device 100 changes the parameter of the preprocessing filter to the parameter b. For the measurement data input thereafter, the preprocessing filter 143-2 having the parameter b is used.
  • FIG. 6 is a diagram showing an example of generating training data.
  • the machine learning device 100 acquires the electrocardiogram data 161 measured in the past when learning the model.
  • the electrocardiogram data 161 represents a normal electrocardiogram.
  • a waveform of a predetermined pattern indicating the heartbeat is repeated.
  • the machine learning device 100 extracts waveforms of a predetermined cycle such as two cycles from the electrocardiogram data 161 and generates normal samples 161-1, 161-2, 1613, ... Showing the extracted waveforms. These multiple normal samples are used as training data for training the model.
  • the training data preferably contains a mixture of normal samples measured from different patients.
  • the time width and amplitude are normalized in generating normal samples 161-1, 161-2, 1613, ... From the electrocardiogram data 161.
  • the machine learning device 100 expands and contracts the waveform of a predetermined period extracted from the electrocardiogram data 161 in the time direction to unify the time widths of the normal samples 161-1, 161-2, 1613, ....
  • the machine learning device 100 expands and contracts the extracted waveform of a predetermined period in the amplitude direction to unify the fluctuation range of the signal level of the normal samples 161-1, 161-2, 1613, ....
  • Time width and amplitude normalization is done during preprocessing.
  • the time width and amplitude are normalized when the training data is generated. It does not have to be.
  • high-frequency noise is removed by using a low-pass filter.
  • the removal of high frequency noise is done in the pretreatment.
  • the cutoff frequency of the low-pass filter is determined by trial and error by the model training operator. However, in the following, for the sake of simplicity, it is assumed that the noise of the electrocardiogram data 161 is sufficiently small, and the training data is generated without removing the high-frequency noise using a low-pass filter. Omitting the removal of high-frequency noise corresponds to setting the cutoff frequency sufficiently high.
  • FIG. 7 is a diagram showing an example of abnormality detection by the k-nearest neighbor model.
  • the machine learning device 100 uses the training data, normal samples 161-1, 161-2, 1613, ..., To generate a k-nearest neighbor model that classifies input samples as normal or abnormal by the k-nearest neighbor method.
  • the k-nearest neighbor model of the second embodiment is the nearest neighbor for determining the classification of the input sample by the nearest neighbor method. It can also be called a model.
  • the machine learning device 100 forms a feature space 162 in which normal samples 161-1, 161-2, 1613, ..., Which are training data, are arranged.
  • the k-nearest neighbor model given an input sample, searches for a normal sample whose distance from the input sample is less than or equal to a predetermined threshold (eg, 0.3). If at least one normal sample is present within a predetermined distance from the input sample, the k-nearest neighbor model determines that the input sample is normal. If no normal sample exists within a predetermined distance from the input sample, the k-nearest neighbor model determines that the input sample is abnormal.
  • a predetermined threshold eg, 0.3
  • the input sample 162-1 of FIG. 7 is determined to be normal because one or more normal samples exist within a predetermined distance.
  • the input sample 162-2 of FIG. 7 is determined to be abnormal because there is no normal sample within a predetermined distance.
  • the k-nearest neighbor model calculates, for example, the distance between each of a plurality of normal samples with respect to the input sample, and determines whether the calculated distance is equal to or less than the threshold value.
  • the k-nearest neighbor model determines that the input sample is normal when the shortest distance is equal to or less than the threshold value, and determines that the input sample is abnormal when the shortest distance exceeds the threshold value.
  • the machine learning device 100 generates an index so that the distance to the input sample can be estimated so that the normal sample in which the distance to the input sample may be equal to or less than the threshold value can be efficiently narrowed down. May be good.
  • the k-nearest neighbor model does not have to calculate the distance for all normal samples.
  • the input sample and the normal sample are time-series data showing signal waveforms, respectively.
  • the distance between one input sample and one normal sample represents the similarity of their signal waveforms. The smaller the distance, the more similar the two signal waveforms, and the larger the distance, the different the two signal waveforms.
  • the k-nearest neighbor model calculates the absolute value of the difference in signal level at each time between two signal waveforms along the time axis, and defines the average value as the distance. Further, for example, in the k-neighborhood model, the square of the difference in signal level at each time is calculated between two signal waveforms along the time axis, and the square root of the average value (root mean square) is defined as the distance. To do.
  • the k-nearest neighbor model uses a dynamic programming method such as Dynamic Time Warping (DTW) to calculate the distance between the two while correcting the time lag between the two signal waveforms. You may try to do it.
  • DTW Dynamic Time Warping
  • FIG. 8 is a diagram showing an example of false detection for an input sample containing noise.
  • the machine learning device 100 acquires the electrocardiogram data 163 measured after learning the k-nearest neighbor model.
  • the electrocardiogram data 163 may represent a normal electrocardiogram or an abnormal electrocardiogram. Further, the electrocardiogram data 163 may contain noise having a frequency different from that of the electrocardiogram data 161 used for learning the k-nearest neighbor model. Changes in noise tendencies can be caused by factors such as replacement of the electrocardiograph, aging of the electrocardiograph, changes in the location of the electrocardiograph, and changes in the surrounding environment of the electrocardiograph.
  • the machine learning device 100 extracts a waveform having a predetermined cycle such as two cycles from the electrocardiogram data 163, performs preprocessing on the extracted waveform in the same manner as at the time of learning, and inputs the input sample 163-1,163-2,163. Generates 3, ... The time width and amplitude of the input samples 163-1,163-2,163-3, ... Are normalized. For example, the machine learning device 100 expands and contracts the extracted waveform of a predetermined period in the time direction to make the time width the same as that of the normal sample 161-1, 161-2, 1613, ....
  • the machine learning device 100 expands and contracts the extracted waveform of a predetermined period in the amplitude direction to make the fluctuation range of the signal level the same as that of the normal sample 161-1, 161-2, 1613, ...
  • high frequency noise is removed from the input samples 163-1,163-2,163, ... Using a low-pass filter.
  • the cutoff frequency of the low-pass filter used during model training.
  • the high-frequency noise is not removed by the low-pass filter at the time of model learning, and the high-frequency noise is not removed by the low-pass filter here either. Omitting the removal of high-frequency noise corresponds to setting the cutoff frequency sufficiently high.
  • the machine learning device 100 determines whether it is normal or abnormal by inputting each of the generated input samples 163-1,163-2,163-3, ... In the k-nearest neighbor model. The machine learning device 100 determines that the input sample 163-1 is normal, determines that the input sample 163-2 is abnormal, and determines that the input sample 163-3 is abnormal. The machine learning device 100 outputs these prediction results for the input samples 163-1,163-2,163-3, .... For example, the machine learning device 100 displays the prediction result on the display device 111.
  • the input sample 163-1 is correct, the input sample 163-2 is abnormal, and the input sample 163-3 is normal. Since the input sample 163-1 does not include noise that is not expected during model learning, the k-nearest neighbor model correctly determines that the normal electrocardiographic waveform is normal. Similarly, since the input sample 163-2 does not include noise that is not expected during model learning, the k-nearest neighbor model correctly determines an abnormal electrocardiographic waveform as abnormal. On the other hand, since the input sample 163-3 contains high-frequency noise that is not expected at the time of model learning, the k-nearest neighbor model erroneously determines that the normal electrocardiographic waveform is abnormal.
  • the correct answer rate of the k-nearest neighbor model becomes low, and the prediction accuracy decreases.
  • the correct answer rate is the ratio of the number of input samples for which the normal / abnormal prediction result was correct to the number of input samples input to the k-nearest neighbor model.
  • the latest prediction accuracy is evaluated, for example, by calculating the correct answer rate in the latest predetermined input sample.
  • the machine learning device 100 attempts to recover the prediction accuracy by changing the parameters of the low-pass filter.
  • FIG. 9 is a diagram showing an example of searching for parameters of the low-pass filter.
  • the machine learning device 100 selects one or more input samples that have caused a decrease in prediction accuracy from the input samples input to the k-nearest neighbor model.
  • the input sample that caused the decrease in prediction accuracy was an input sample with a teacher label indicating normality, as in the above-mentioned input sample 163-3, which was determined to be abnormal by the k-nearest neighbor model. is there. This is because such an input sample is likely to be correctly determined to be normal by appropriately removing high-frequency noise by a low-pass filter.
  • the input sample that caused the deterioration of the prediction accuracy is judged based on the comparison between the input sample after passing through the low-pass filter and the normal sample which is the training data after passing through the low-pass filter. If the distance between the normal sample after passing through the low-pass filter and the normal input sample after passing through the low-pass filter exceeds the threshold value, it can be considered that the input sample is the cause of the decrease in prediction accuracy. it can.
  • the machine learning device 100 may select any one of the input samples.
  • One input sample may be randomly selected or may be selected according to a predetermined criterion.
  • the machine learning device 100 may select an input sample having the maximum distance from the training data calculated in the k-nearest neighbor model, that is, the shortest distance from the most similar normal sample. It can be said that such an input sample contains the largest noise. Further, the machine learning device 100 may select all of the corresponding two or more input samples.
  • the machine learning device 100 generates a plurality of low-pass filters having different cutoff frequencies.
  • the machine learning device 100 generates several low-pass filters such as low-pass filters 164-1, 164-2, 164-3.
  • the low-pass filter 164-1 is a strong filter having a low cutoff frequency and a small number of passable frequency components.
  • the low-pass filter 164-2 is a medium filter having a medium cutoff frequency and a medium passable frequency component.
  • the low-pass filter 164-3 is a weak filter having a high cutoff frequency and a large number of passable frequency components.
  • the cutoff frequency is set to 25 Hz, 35 Hz, 75 Hz, 100 Hz, 150 Hz, and the like.
  • the low-pass filter for time-series signal data may be implemented as an FIR filter or IIR filter.
  • the FIR filter holds the latest predetermined input signals, and outputs the latest input signal and the past predetermined input signals multiplied by the filter coefficient and summed up as the latest output signal.
  • the number of input signals to be held, that is, the storage time can be specified as the filter order.
  • the IIR filter holds a predetermined number of past output signals in addition to a predetermined number of past input signals.
  • the IIR filter outputs the latest input signal, a predetermined number of input signals in the past, and a predetermined number of output signals in the past multiplied by a filter coefficient and summed up as the latest output signal.
  • the machine learning device 100 can also generate an FIR filter or an IIR filter that operates as a low-pass filter by using a computer algebra library.
  • a computer algebra library may automatically generate FIR or IIR filters with appropriate filter coefficients by accepting specifications for filter order and cutoff frequency.
  • the amplitude at frequencies around the cutoff frequency may be specified as information indicating the amplitude damping characteristics.
  • the machine learning device 100 inputs the ones before passing through the low-pass filter corresponding to the selected input sample to the low-pass filters 164-1, 164-2, 164-3, respectively.
  • the input sample 163-3 is used as it is as the low-pass filter 164-1,164-2,164-3. Is entered in.
  • the machine learning device 100 inputs the input sample 163-3 to the low-pass filter 164-1 to generate the sample 165-1. Further, the machine learning device 100 inputs the input sample 163-3 to the low-pass filter 164-2 to generate the sample 165-2. Further, the machine learning device 100 inputs the input sample 163-3 to the low-pass filter 164-3 to generate the sample 165-3.
  • the machine learning device 100 is the distance between the generated samples 165-1, 165-2, 165-3, respectively, and the training data including the normal samples 161-1, 161-2, 163-1, .... Is calculated.
  • the distance calculated here corresponds to the distance calculated in the k-nearest neighbor model, assuming that each of the samples 165-1, 165-2, 165-3 is an input sample for the k-nearest neighbor model. That is, the distance calculated for a certain sample is the shortest distance calculated between the normal sample 161-1, 161-2, 1613, ..., And the most similar normal sample.
  • the machine learning device 100 determines the sample having the smallest distance from the training data among the samples 165-1, 165-2, 165-3. Then, the machine learning device 100 adopts the low-pass filter used for generating the determined sample as the low-pass filter applied to the subsequent electrocardiogram data. Here, it is assumed that the sample 165-2 out of the samples 165-1,165-2,165-3 has the smallest distance from the training data. Therefore, the machine learning device 100 selects the low-pass filter 164-2 from the low-pass filters 164-1, 164-2, 164-3. This means selecting parameters such as the cutoff frequency and filter order of the lowpass filter 164-2.
  • the machine learning device 100 When two or more input samples that cause a decrease in prediction accuracy are selected, the machine learning device 100 has the minimum average (average distance) of two or more distances calculated for those two or more input samples.
  • the low-pass filter may be selected so that it can be used. Further, the machine learning device 100 may select a low-pass filter so that the worst value (longest distance) of two or more distances calculated for those two or more input samples is minimized. Further, the machine learning device 100 uses an optimization algorithm such as the steepest descent method to repeatedly calculate the distance between the sample and the training data after passing through the filter while changing the parameters of the low-pass filter, and searches for the parameter that minimizes the distance. You may try to do it.
  • FIG. 10 is a diagram showing an application example of the first low-pass filter.
  • the machine learning device 100 employs a low-pass filter 164-2.
  • the prediction accuracy for the electrocardiogram data 163 is improved without re-learning the k-nearest neighbor model.
  • the machine learning device 100 inputs the input sample 163-1 to which the low-pass filter has not been applied to the low-pass filter 164-2 and converts it into the input sample 166-1. Further, the machine learning device 100 inputs the input sample 163-2 to which the low-pass filter has not been applied to the low-pass filter 164-2 and converts it into the input sample 166-2. Further, the machine learning device 100 inputs the input sample 163-3 to which the low-pass filter has not been applied to the low-pass filter 164-2 and converts it into the input sample 166-3. The machine learning device 100 inputs the input samples 166-1, 166-2, and 166-3 into the k-nearest neighbor model, and determines whether the input samples 166-1, 166-2, and 166-3 are normal or abnormal, respectively. To do.
  • the input sample 163-1 does not contain high frequency noise, and the input sample 166-1 also does not contain high frequency noise.
  • the input sample 166-1 shows a normal electrocardiographic waveform, the characteristics of which are consistent with the training data. Therefore, the machine learning device 100 can correctly determine that the normal input sample 166-1 is normal. Further, the input sample 163-2 does not contain high frequency noise, and the input sample 166-2 also does not contain high frequency noise. Input sample 166-2 shows an abnormal electrocardiographic waveform. Therefore, the machine learning device 100 can correctly determine the abnormal input sample 166-2 as abnormal.
  • Input sample 166-3 shows a normal electrocardiographic waveform, the characteristics of which are consistent with the training data. Therefore, the machine learning device 100 can correctly determine that the normal input sample 166-3 is normal. In this way, the prediction accuracy of the k-nearest neighbor model can be recovered by adjusting the parameters so that the input sample after passing through the low-pass filter approaches the training data used for learning the k-nearest neighbor model.
  • FIG. 11 is a diagram showing an application example of the second low-pass filter.
  • a case where a low-pass filter 164-1 is adopted is considered. Since the cutoff frequency of the low-pass filter 164-1 is excessively small, the characteristics of the input sample that has passed through the low-pass filter 164-1 are significantly different from the training data. Therefore, the prediction accuracy of the k-nearest neighbor model is not sufficiently restored.
  • the machine learning device 100 inputs the input sample 163-1 to which the low-pass filter has not been applied to the low-pass filter 164-1 and converts it into the input sample 167-1. Further, the machine learning device 100 inputs the input sample 163-2 to which the low-pass filter has not been applied to the low-pass filter 164-1 and converts it into the input sample 167-2. Further, the machine learning device 100 inputs the input sample 163-3 to which the low-pass filter has not been applied to the low-pass filter 164-1 and converts it into the input sample 167-3. The machine learning device 100 inputs the input samples 167-1, 167-2, and 167-3 into the k-nearest neighbor model, and determines whether the input samples 167-1, 167-2, and 167-3 are normal or abnormal, respectively. To do.
  • the input sample 167-1 does not contain high frequency noise, and the machine learning device 100 correctly determines that the normal input sample 167-1 is normal. Further, the input sample 167-3 has high frequency noise removed, and the machine learning device 100 correctly determines that the normal input sample 167-3 is normal.
  • the input sample 167-2 does not contain high frequency noise, it loses the characteristics of the abnormal electrocardiographic waveform due to excessive filtering. Therefore, the machine learning device 100 erroneously determines that the abnormal input sample 167-2 is normal. As described above, the prediction accuracy is not sufficiently restored depending on the adjustment of the parameters of the low-pass filter.
  • FIG. 12 is a diagram showing an application example of the third low-pass filter.
  • a case where a low-pass filter 164-3 is adopted is considered. Since the cutoff frequency of the low-pass filter 164-3 is excessively large, high-frequency noise remains in the input sample that has passed through the low-pass filter 164-3.
  • the machine learning device 100 inputs the input sample 163-1 to which the low-pass filter has not been applied to the low-pass filter 164-3 and converts it into the input sample 168-1. Further, the machine learning device 100 inputs the input sample 163-2 to which the low-pass filter has not been applied to the low-pass filter 164-3 and converts it into the input sample 168-2. Further, the machine learning device 100 inputs the input sample 163-3 to which the low-pass filter is not applied to the low-pass filter 164-3 and converts it into the input sample 168-3. The machine learning device 100 inputs the input samples 168-1, 168-2, 168-3 into the k-nearest neighbor model, and determines whether the input samples 168-1, 168-2, and 168-3 are normal or abnormal, respectively. To do.
  • the input sample 168-1 does not contain high frequency noise, and the machine learning device 100 correctly determines that the normal input sample 168-1 is normal. Further, the input sample 168-2 does not contain high frequency noise and maintains the characteristics of the abnormal electrocardiographic waveform, and the machine learning device 100 correctly determines that the abnormal input sample 168-2 is abnormal. On the other hand, high frequency noise remains in the input sample 168-3, and the machine learning device 100 erroneously determines that the normal input sample 168-3 is abnormal. As described above, the prediction accuracy is not sufficiently restored depending on the adjustment of the parameters of the low-pass filter.
  • FIG. 13 is a block diagram showing a functional example of the machine learning device.
  • the machine learning device 100 includes measurement data storage units 121 and 122, filter storage units 123, training data storage units 124, model storage units 125, and prediction result storage units 126. These storage units are implemented using, for example, the storage area of the RAM 102 or the HDD 103. Further, the machine learning device 100 has preprocessing units 131 and 133, a model learning unit 132, a prediction unit 134, and a filter updating unit 135. These processing units are implemented using, for example, a program executed by the CPU 101.
  • the measurement data storage unit 121 stores the measurement data used for learning the model.
  • the measurement data is measured by the measurement device and may include noise depending on the hardware characteristics of the measurement device and the usage environment.
  • the measurement data may be time series data or spatial data at a temporary point.
  • the measurement data includes image data captured by an imaging device, audio data recorded by a microphone, walking data measured by an accelerometer, electrocardiogram data measured by an electrocardiograph, and the like. Is.
  • the measurement data may be given a teacher label indicating the correct classification. However, if only the measurement data belonging to a predetermined class is used as the training data, the teacher label may be omitted.
  • the measurement data storage unit 122 stores the measurement data measured after the measurement data of the measurement data storage unit 121.
  • the measurement data of the measurement data storage unit 122 is the same type of data as the measurement data storage unit 121, and is measured after the start of operation of the model. However, the measurement data of the measurement data storage unit 122 may include noise that tends to be different from the measurement data for learning due to changes in the hardware characteristics of the measurement device and changes in the usage environment.
  • the measurement data is given a teacher label indicating the correct classification. This teacher label is feedback for the measurement data during model operation.
  • the measurement device may be connected to the machine learning device 100 so that the machine learning device 100 directly receives the measurement data from the measurement device. Further, the measurement device and the machine learning device 100 may be connected via a local network or a wide area network so that the machine learning device 100 receives measurement data via the network. Further, the measurement data may be once transferred from the measurement device to another information processing device, and the machine learning device 100 may collect the measurement data from the other information processing device. Further, the measurement data may be stored in the recording medium, and the machine learning device 100 may read the measurement data from the recording medium. Further, the teacher label for the measurement data may be input to the machine learning device 100 by the user. Further, the teacher label may be received from another information processing device together with the measurement data, or may be read out from the recording medium together with the measurement data.
  • the filter storage unit 123 stores the filter used for preprocessing on the measurement data.
  • the filter may be a low-pass filter that removes high frequency noise.
  • the filter storage unit 123 may store the cutoff frequency and the filter order, and may store the filter coefficient of the FIR filter or the IIR filter. Further, a plurality of filters may be defined in advance in the filter storage unit 123, and the preprocessing units 131 and 133 may select one of the plurality of filters. Further, the filter update unit 135 may generate a new filter and add it to the filter storage unit 123.
  • the training data storage unit 124 stores the training data used for learning the model.
  • the training data is obtained by preprocessing the measurement data stored in the measurement data storage unit 121. Pretreatment may include noise removal using a low-pass filter. In addition, the preprocessing may include adjustment of the time width of the time series signal and adjustment of the amplitude. However, the measurement data itself may be used as training data by substantially not performing preprocessing.
  • the model storage unit 125 stores the model learned using the training data.
  • a model is a classifier that classifies input data into multiple classes. For example, the model determines whether the input data is normal or abnormal.
  • the model is, for example, a neural network, a support vector machine, a regression analysis model, a random forest, a k-nearest neighbor model, and the like.
  • the prediction result storage unit 126 stores the prediction result predicted by the model stored in the model storage unit 125 with respect to the measurement data stored in the measurement data storage unit 122.
  • the prediction result indicates, for example, whether the measurement data is normal or abnormal. If the prediction result matches the teacher label, the answer is correct, and if it does not match the teacher label, the answer is incorrect.
  • the prediction accuracy can be calculated as an evaluation value.
  • the prediction accuracy is expressed by, for example, the percentage of correct answers indicating the ratio of the input samples whose prediction results are correct among the most recent predetermined input samples. However, an index other than the correct answer rate may be used as the prediction accuracy.
  • the preprocessing unit 131 performs preprocessing on the learning measurement data stored in the measurement data storage unit 121, and generates preprocessed training data.
  • the preprocessing unit 131 stores the training data in the training data storage unit 124 and provides the training data to the model learning unit 132.
  • the preprocessing unit 131 may use the filter stored in the filter storage unit 123.
  • the preprocessing unit 131 uses a low-pass filter to remove high-frequency noise contained in the measurement data.
  • the filter used by the preprocessing unit 131 is determined by the user by trial and error so as to improve the prediction accuracy of the model. However, the search for an appropriate preprocessing filter may be performed in machine learning. Further, as preprocessing, the preprocessing unit 131 may adjust the time width and amplitude of the time series signal.
  • the model learning unit 132 generates a model by machine learning using the training data that has passed through the preprocessing unit 131, and stores the generated model in the model storage unit 125.
  • the model learning unit 132 generates a k-nearest neighbor model including a plurality of normal samples that are training data.
  • the distance shortest distance between a normal sample most similar to the input sample and the input sample is calculated, and if the distance is less than or equal to the threshold value, it is determined to be normal, and the distance exceeds the threshold value. If the case is abnormal, it is learned as a model for determining an abnormality.
  • the preprocessing unit 133 When new measurement data arrives at the measurement data storage unit 122, the preprocessing unit 133 performs preprocessing on the new measurement data and generates preprocessed input data.
  • the pre-processing unit 133 provides the input data to the prediction unit 134.
  • the preprocessing unit 133 may use the filter stored in the filter storage unit 123.
  • the filter used by the preprocessing unit 133 is the same as the filter used by the preprocessing unit 131 during model learning.
  • the filter update unit 135 may change the filter to a filter different from that at the time of model learning.
  • the pre-processing unit 133 may adjust the time width and the amplitude of the time-series signal.
  • the method of adjusting the time width and amplitude is the same as during model learning. Further, the preprocessing unit 133 provides the input data after passing through the filter and the input data before passing through the filter to the filter updating unit 135 in response to the request from the filter updating unit 135.
  • the prediction unit 134 inputs the input data that has passed through the preprocessing unit 133 into the model stored in the model storage unit 125, and predicts the class to which the input data belongs. For example, the prediction unit 134 predicts whether the input data is normal or abnormal. The prediction unit 134 generates a prediction result indicating the class to which the input data belongs and stores it in the prediction result storage unit 126. Further, the prediction unit 134 may display the prediction result on the display device 111 or may transmit the prediction result to another information processing device.
  • the filter update unit 135 updates the filter used by the preprocessing unit 133 when the prediction accuracy of the model deteriorates after the start of operation. Specifically, the filter updating unit 135 reads the prediction result output by the prediction unit 134 from the prediction result storage unit 126, and compares the teacher label added to the measurement data with the prediction result. The filter update unit 135 determines that the answer is correct when the teacher label and the prediction result indicate the same classification, and determines that the answer is incorrect when the teacher label and the prediction result indicate different classifications. The filter update unit 135 calculates the prediction accuracy such as the correct answer rate from the comparison result with respect to the latest predetermined input sample. When the latest prediction accuracy drops below the threshold value, the filter update unit 135 determines to update the preprocessing filter.
  • the threshold value of the prediction accuracy may be fixedly determined in advance, or may be determined based on the initial prediction accuracy in which the model is trained.
  • the filter updating unit 135 acquires the input data after passing the recent filter from the preprocessing unit 133, and identifies the input data that caused the deterioration of the prediction accuracy from the input data.
  • the input data that causes the deterioration of the prediction accuracy is, for example, the input data whose distance from the training data exceeds the threshold value.
  • the filter update unit 135 may identify the cause of the decrease in the prediction accuracy by referring to the training data stored in the training data storage unit 124. Further, the filter update unit 135 may identify an input sample that is erroneously determined to be abnormal among the input samples associated with the teacher label indicating normality as the cause of the decrease in prediction accuracy.
  • the filter update unit 135 acquires the input data before passing through the filter corresponding to the cause from the preprocessing unit 133.
  • the filter update unit 135 generates a filter with changed parameters, inputs the input data to the generated filter, and calculates the distance between the input data and the training data after passing through the filter.
  • the filter update unit 135 generates a low-pass filter in which the cutoff frequency and the filter order are changed, and inputs the input data to the generated low-pass filter.
  • the filter update unit 135 adjusts the parameters of the filter so that the distance becomes small. As a result, the filter used by the preprocessing unit 133 is updated.
  • the filter update unit 135 may save the generated filter in the filter storage unit 123.
  • the filter update unit 135 determines whether the distance between the input data and the training data after the filter optimization is equal to or less than a predetermined threshold value, and if the distance exceeds the threshold value, the filter optimization fails. You may judge. This is because if the tendency of noise contained in the measurement data is significantly different from that at the time of model learning, the prediction accuracy of the model may not be sufficiently recovered only by filter optimization. In this case, it is preferable to retrain the model using the latest measurement data. Therefore, for example, the filter update unit 135 may output a warning prompting re-learning of the model when the distance between the input data after the filter optimization and the training data exceeds the threshold value.
  • This threshold value may be the same as the threshold value used for normal / abnormal classification in the k-nearest neighbor model. The warning may be displayed on the display device 111 or may be transmitted to another information processing device.
  • FIG. 14 is a diagram showing an example of a measurement data table.
  • the measurement data table 127 is stored in the measurement data storage unit 122. A table similar to the measurement data table 127 may be stored in the measurement data storage unit 121.
  • the measurement data table 127 includes ID, time series data and teacher label items.
  • the ID identifies a sample of time series data.
  • Time-series data is one-dimensional data such as electrocardiogram data and walking data whose signal level fluctuates along the time axis.
  • the signal level of the time series data is measured at a predetermined sampling rate.
  • the teacher label indicates the correct answer for the classification class to which the time series data belongs. For example, the teacher label represents normal or abnormal.
  • FIG. 15 is a diagram showing an example of a filter table.
  • the filter table 128 is stored in the filter storage unit 123.
  • the filter table 128 includes items of ID, cutoff frequency, and FIR filter.
  • the ID identifies the low-pass filter.
  • the cutoff frequency indicates the boundary between the passing frequency and the cutting frequency.
  • An FIR filter that operates as a low-pass filter is represented by a linear form that includes a filter coefficient that multiplies each of the latest input signal and a predetermined number of past input signals.
  • the low-pass filter may be implemented in another filter format such as an IIR filter.
  • the cutoff frequency is a kind of low-pass filter parameter.
  • the parameters of the low-pass filter may include the filter order.
  • the parameters of the low-pass filter may include an amplitude indicating an attenuation factor around the cutoff frequency.
  • the filter coefficient may be adjusted as a kind of parameter of the low-pass filter.
  • FIG. 16 is a flowchart showing an example of a procedure for processing during learning.
  • the preprocessing unit 131 acquires normal measurement data. Abnormal measurement data does not have to be acquired, and the teacher label does not have to be explicitly added to the measurement data. (S11) The preprocessing unit 131 extracts a plurality of normal samples having a predetermined cycle from the measurement data, and normalizes the time width and amplitude of each normal sample.
  • the pretreatment unit 131 passes each of a plurality of normal samples through a low-pass filter. Parameters such as the cutoff frequency and filter order set for the low-pass filter are specified by the user. However, the normal sample may not be passed through the low-pass filter. Further, the low-pass filter may be substantially disabled by adjusting the parameters of the low-pass filter such as by increasing the cutoff frequency sufficiently.
  • the preprocessing unit 131 generates a set of normal samples after performing the preprocessing including steps S11 and S12 as training data, and stores the set in the training data storage unit 124.
  • the model learning unit 132 learns the k-nearest neighbor model from the training data.
  • the k-nearest neighbor model learned here finds the shortest distance among the distances between the input sample and each of the plurality of normal samples, and if the shortest distance is less than or equal to the threshold value, it is judged to be normal, and the shortest distance exceeds the threshold value. This is the nearest neighbor method model that is judged to be abnormal.
  • the threshold may be specified by the user.
  • the model learning unit 132 stores the k-nearest neighbor model in the model storage unit 125.
  • FIG. 17 is a flowchart showing an example of a procedure for processing during operation.
  • the preprocessing unit 133 acquires the measurement data measured after the model learning. A teacher label indicating normal or abnormal is attached to this measurement data. The teacher label is feedback from the measurement data by a specialist such as a medical professional.
  • the preprocessing unit 133 extracts a plurality of input samples having a predetermined cycle from the measurement data, and normalizes the time width and amplitude of each input sample.
  • the preprocessing unit 133 passes each of the plurality of input samples through a low-pass filter.
  • the parameters such as the cutoff frequency and filter order set for the low-pass filter are the same as those used for model learning. However, if the parameters are changed after model training as described later, the latest changed parameters are used.
  • the prediction unit 134 reads out the k-nearest neighbor model stored in the model storage unit 125.
  • the prediction unit 134 inputs the input sample after the preprocessing including steps S21 and S22 to the k-nearest neighbor model, and predicts the normality / abnormality of the input sample.
  • the prediction unit 134 stores a prediction result indicating normality or abnormality in the prediction result storage unit 126.
  • the prediction unit 134 may display the prediction result on the display device 111, or may transmit the prediction result to another information processing device.
  • the filter update unit 135 calculates the latest prediction accuracy of the k-nearest neighbor model. For example, the filter update unit 135 compares the prediction result and the teacher label for each of the latest plurality of input samples, and calculates the correct answer rate indicating the ratio of the input samples in which the prediction result and the teacher label match. For example, the correct answer rate is used as an index of prediction accuracy.
  • the filter update unit 135 determines whether the prediction accuracy is less than the threshold value.
  • the threshold value may be specified by the user at the time of model learning or after the start of operation. Further, the threshold value may be automatically determined from the prediction accuracy of the k-nearest neighbor model at the beginning of learning. If the prediction accuracy is less than the threshold value, the process proceeds to step S26, and in other cases, the processing of the acquired measurement data is terminated.
  • the filter update unit 135 selects an input sample associated with a teacher label indicating normality, which is erroneously determined to be abnormal by the k-nearest neighbor model, as a cause of deterioration in prediction accuracy.
  • the input sample to be selected is a normal input sample, and the distance to the training data (the shortest distance among the distances to each of the plurality of normal samples) exceeds the threshold value. This distance is calculated between the input sample after passing through the low-pass filter and the training data.
  • a threshold value different from the threshold value of the k-nearest neighbor model may be used to select a normal input sample whose distance from the training data exceeds the threshold value.
  • the filter update unit 135 searches for the parameters of the low-pass filter by using the input sample before passing through the low-pass filter corresponding to the input sample selected in step S26.
  • the filter update unit 135 inputs the input sample to the low-pass filter in which parameters such as the cutoff frequency and the filter order are changed, and calculates the distance between the input sample and the training data after passing through the low-pass filter.
  • the filter update unit 135 adjusts the parameters of the low-pass filter so that this distance is minimized.
  • a simple search method that tries several parameters may be used, or an optimization algorithm such as the steepest descent method may be used.
  • the filter update unit 135 updates the parameters of the low-pass filter.
  • the updated parameter is the parameter that minimizes the distance in step S27.
  • the updated parameters are applied to the measurement data acquired thereafter.
  • the model is learned using the preprocessed training data at the time of model learning, and the preprocessed input data is input to the model at the time of model operation.
  • a model with high prediction accuracy can be learned from the measurement data including noise, and the prediction accuracy can be maintained even when the model is operated. Therefore, for example, it is possible to classify the input data such as normal / abnormal classification with high accuracy.
  • the preprocessing parameters are updated. Therefore, it is expected that the influence on the preprocessed input data will be suppressed and the prediction accuracy will be restored to the same level as during model learning without retraining the model. Moreover, since the model is not retrained, it is possible to suppress costs such as the amount of calculation for machine learning and the learning time. In addition, training data is saved during model learning, and preprocessing parameters are automatically adjusted so that the tendency of the preprocessed input data approaches the training data during model learning. Therefore, it is highly possible that the prediction accuracy is improved by suppressing excessive filtering and insufficient noise removal and performing appropriate filtering.

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Public Health (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Pathology (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Animal Behavior & Ethology (AREA)
  • Molecular Biology (AREA)
  • Veterinary Medicine (AREA)
  • Surgery (AREA)
  • Databases & Information Systems (AREA)
  • Epidemiology (AREA)
  • Primary Health Care (AREA)
  • Physiology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Biophysics (AREA)
  • Psychiatry (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
  • Testing And Monitoring For Control Systems (AREA)

Abstract

データ傾向の変化に対してモデルの再学習を抑制する。 計測データ(15)に、パラメータ(13a)に応じた前処理(13)を実行して訓練データ(17)を生成する。訓練データ(17)を用いてモデル(14)を学習する。計測データ(16)に前処理(13)を実行して入力データ(18)を生成する。入力データ(18)をモデル(14)に入力して予測結果(19)を生成し、計測データ(16)に対応付けられた教師ラベル(16a)と予測結果(19)とから予測精度を算出する。予測精度が閾値未満である場合、訓練データ(17)と計測データ(16)から生成される入力データ(18)との比較に基づいて、前処理(13)のパラメータ(13a)を変更する。

Description

データ前処理方法、データ前処理装置およびデータ前処理プログラム
 本発明はデータ前処理方法、データ前処理装置およびデータ前処理プログラムに関する。
 コンピュータを利用したデータ分析の1つとして、機械学習が行われることがある。機械学習では、既知の事例を示す訓練データをコンピュータに入力する。コンピュータは、訓練データを分析して、要因(説明変数や独立変数と言うことがある)と結果(目的変数や従属変数と言うことがある)との間の関係を一般化したモデルを学習する。学習されたモデルを用いることで、未知の事例についての結果を予測することができる。
 機械学習を利用したデータ分析の一連の流れは、過去のデータを収集してモデルを学習する学習フェーズと、学習後に発生したデータをモデルに入力して結果を予測する運用フェーズとに分けることができる。ただし、時の経過に伴い、運用フェーズにおいてモデルに入力されるデータの傾向が、学習フェーズで使用したデータから変化してしまうことがある。これにより、モデルの予測精度が事後的に低下することがある。その場合、予測精度を回復する1つの方法として、モデルを再学習することが考えられる。
 例えば、過去の風力発電量と気象予報から今後の風力発電量を予測する風力発電予測方法が提案されている。提案の風力発電予測方法では、機械学習によってモデルを学習し、最新のデータを利用して定期的にモデルを再学習する。また、入力データのトレンドの変化に適合できるように継続的にモデルを更新する継続的機械学習方法が提案されている。提案の継続的機械学習方法では、最新のデータがモデルに反映されるまでの遅延と機械学習コストとのトレードオフを考慮して、モデルを更新するタイミングを決定する。
Mariam Barque, Simon Martin, Jeremie Etienne Norbert Vianin, Dominique Genoud and David Wannier, "Improving wind power prediction with retraining machine learning algorithms", Proc. of the 2018 International Workshop on Big Data and Information Security (IWBIS 2018), pp. 43-48, 2018-05-12 Huangshi Tian, Minchen Yu and Wei Wang, "Continuum: A Platform for Cost-Aware, Low-Latency Continual Learning", Proc. of the ACM Symposium on Cloud Computing 2018 (SoCC'18), pp. 26-40, 2018-10-11
 機械学習に利用されるデータが、時系列信号データや画像データなど、計測デバイスによって計測された計測データであることもある。計測データは、計測デバイスの特性やその使用環境に起因するノイズを含むことがある。そのため、データ傾向の変化の1つとして、ノイズ傾向の変化が生じることがある。例えば、計測デバイスの経年劣化や使用環境の変化によって、学習フェーズでは存在していなかったパターンのノイズが計測データに含まれるようになることがある。しかし、そのようなデータ傾向の変化が生じる毎にモデルを再学習することは、計算量や学習時間の観点からコストが高いという問題がある。
 1つの側面では、本発明は、データ傾向の変化に対してモデルの再学習を抑制するデータ前処理方法、データ前処理装置およびデータ前処理プログラムを提供することを目的とする。
 1つの態様では、コンピュータが実行するデータ前処理方法が提供される。第1の計測データに、パラメータに応じた前処理を実行して訓練データを生成する。訓練データを用いてモデルを学習する。第2の計測データに前処理を実行して入力データを生成する。入力データをモデルに入力して予測結果を生成し、第2の計測データに対応付けられた教師ラベルと予測結果とから予測精度を算出する。予測精度が閾値未満である場合、訓練データと第2の計測データから生成される入力データとの比較に基づいて、前処理のパラメータを変更する。
 また、1つの態様では、記憶部と処理部とを有するデータ前処理装置が提供される。また、1つの態様では、コンピュータに実行させるデータ前処理プログラムが提供される。
 1つの側面では、データ傾向の変化に対してモデルの再学習を抑制できる。
 本発明の上記および他の目的、特徴および利点は本発明の例として好ましい実施の形態を表す添付の図面と関連した以下の説明により明らかになるであろう。
第1の実施の形態のデータ前処理装置の例を説明する図である。 第2の実施の形態の機械学習装置のハードウェア例を示す図である。 モデルの学習および運用の流れの例を示す図である。 ノイズによる予測精度の低下および回復の流れの例を示す図である。 前処理フィルタのパラメータの探索例を示す図である。 訓練データの生成例を示す図である。 k近傍法モデルによる異常検出の例を示す図である。 ノイズを含む入力サンプルに対する誤検出の例を示す図である。 ローパスフィルタのパラメータの探索例を示す図である。 第1のローパスフィルタの適用例を示す図である。 第2のローパスフィルタの適用例を示す図である。 第3のローパスフィルタの適用例を示す図である。 機械学習装置の機能例を示すブロック図である。 計測データテーブルの例を示す図である。 フィルタテーブルの例を示す図である。 学習時処理の手順例を示すフローチャートである。 運用時処理の手順例を示すフローチャートである。
 以下、本実施の形態を図面を参照して説明する。
 [第1の実施の形態]
 第1の実施の形態を説明する。
 図1は、第1の実施の形態のデータ前処理装置の例を説明する図である。
 第1の実施の形態のデータ前処理装置10は、機械学習によりモデルを学習し、学習したモデルを用いて入力データに対応する結果を予測する。モデルの学習に用いる訓練データやモデルに入力する入力データに対しては、前処理が行われる。データ前処理装置10は、クライアント装置でもよいしサーバ装置でもよい。データ前処理装置10を、コンピュータ、情報処理装置、機械学習装置などと言うこともできる。また、第1の実施の形態では、モデルを学習する学習フェーズとモデルを使用する運用フェーズの両方をデータ前処理装置10が実行しているが、両者を異なる装置が実行するようにしてもよい。
 データ前処理装置10は、記憶部11および処理部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性ストレージでもよい。処理部12は、例えば、CPU(Central Processing Unit)、GPU(Graphics Processing Unit)、DSP(Digital Signal Processor)などのプロセッサである。ただし、処理部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。プロセッサは、RAMなどのメモリ(記憶部11でもよい)に記憶されたプログラムを実行する。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うこともある。
 記憶部11は、パラメータ13a、モデル14、計測データ15(第1の計測データ)、計測データ16(第2の計測データ)、計測データ16に対応付けられた教師ラベル16a、訓練データ17、入力データ18および予測結果19を記憶する。
 パラメータ13aは、前処理13の挙動を制御する制御パラメータである。前処理13は、モデル14を学習する際に計測データ15を訓練データ17に変換する。また、前処理13は、モデル14を使用する際に計測データ16を入力データ18に変換する。
 前処理13は、例えば、計測データ15,16に含まれるノイズを除去するノイズフィルタとして動作する。前処理13は、高周波数成分をカットするローパスフィルタとして動作してもよいし、低周波数成分をカットするハイパスフィルタとして動作してもよいし、所定周波数以外の周波数成分をカットするバンドパスフィルタとして動作してもよい。パラメータ13aは、カットする周波数の境界を示すカットオフ周波数を指定するものであってもよい。また、パラメータ13aは、有限インパルス応答(FIR:Finite Impulse Response)フィルタや無限インパルス応答(IIR:Infinite Impulse Response)フィルタなどのフィルタを実現する係数を指定するものであってもよい。
 モデル14は、説明変数と目的変数との間の関係を一般化した機械学習モデルである。モデル14は、訓練データ17を用いて所定の機械学習アルゴリズムによって生成される。学習されたモデル14は、説明変数に相当する入力データ18の入力を受け付け、目的変数に相当する予測結果19を出力する。第1の実施の形態では、機械学習アルゴリズムとして様々なものを使用することができる。例えば、モデル14は、ニューラルネットワーク(NN:Neural Network)、サポートベクタマシン(SVM:Support Vector Machine)、回帰分析モデル、ランダムフォレストなどであってもよい。また、モデル14は、k近傍法によって入力データ18の分類を判定するk近傍法モデルでもよい。
 計測データ15は、計測デバイスによって計測されたデータである。計測データ15は、計測デバイスの特性や計測デバイスの使用環境に応じたノイズを含むことがある。計測データ15は、モデル14の学習にあたって収集される。データ前処理装置10は、データ前処理装置10に接続された計測デバイスから計測データ15を直接受信してもよい。また、データ前処理装置10は、ストレージ装置や他の情報処理装置からネットワーク経由で計測データ15を受信してもよい。また、データ前処理装置10は、データ前処理装置10に接続された記録媒体から計測データ15を読み出してもよい。
 計測データ15は、加速度計によって計測された加速度データ、心電計によって計測された心電図データ、マイクロフォンによって計測された音声データなど、時系列の振幅変動を示す時系列信号データであってもよい。また、計測データ15は、イメージセンサによって計測された画像データであってもよい。計測データ15は、特定の目的変数の値に対応するものであってもよい。例えば、モデル14に正常/異常の二値分類を行わせる場合、計測データ15は正常を表す計測データであってもよい。また、計測データ15に、目的変数の正解値である教師ラベルが対応付けられていてもよい。
 計測データ16は、計測デバイスによって計測されたデータであって、計測データ15と同じ種類のデータである。ただし、計測データ16は、モデル14の学習後に収集される。計測データ16は、計測データ15と同様の方法で収集されてもよいし、異なる方法で収集されてもよい。計測データ16は、計測データ15とは異なる傾向のノイズを含むことがある。例えば、計測デバイスの経年劣化、計測デバイスの交換、計測デバイスの設置場所の変更、計測デバイスの周辺に存在する電子機器や構築物の変化などの各種要因によって、ノイズの傾向が変化することがある。ノイズの傾向の変化として、例えば、ノイズの周波数が変化することが挙げられる。
 教師ラベル16aは、計測データ16に対応する目的変数の正解値を表す。モデル14に正常/異常の二値分類を行わせる場合、教師ラベル16aは正常または異常を表す。教師ラベル16aは、例えば、計測デバイスによって計測された計測データ16を人が確認することで、計測データ16に対して人によって付与される。教師ラベル16aは、計測データ16が計測される毎にフィードバックされるものであってもよいし、計測データ16が蓄積されて後日纏めてフィードバックされるものであってもよい。
 訓練データ17は、モデル14の学習に使用される。訓練データ17は、計測データ15に対して前処理13を実行することで生成される。訓練データ17は、例えば、ローパスフィルタによって計測データ15から高周波ノイズが除去されたものである。ただし、パラメータ13aを調整することで、実質的に前処理13がノイズ除去を行わないようにすることもでき、計測データ15と訓練データ17とを一致させることも可能である。モデル14を学習する際に使用するパラメータ13aは、訓練データ17がモデル14の学習に適したものとなるように、人によって試行錯誤的に決定されてもよいし、モデル14の予測精度が高くなるように機械学習を通じて自動的に探索されてもよい。例えば、計測データ15に含まれるノイズが十分に除去され、計測データ15がもつ本質的特徴が訓練データ17に残るように、パラメータ13aが調整される。
 入力データ18は、計測データ16に対して前処理13を実行することで生成される。入力データ18は、例えば、ローパスフィルタによって計測データ16から高周波ノイズが除去されたものである。計測データ16を入力データ18に変換する前処理13には、原則として、モデル14の学習時と同じパラメータ13aが使用される。ただし、計測データ16のノイズの傾向が計測データ15から変化することで、学習時と同じパラメータ13aでは計測データ16のノイズが十分に除去されないことがある。そこで、後述するように、データ前処理装置10はパラメータ13aを変更することがある。
 予測結果19は、入力データ18をモデル14に入力することでモデル14から出力される。入力データ18が説明変数に相当し、予測結果19が目的変数に相当する。目的変数の正解値である教師ラベル16aが与えられていることから、教師ラベル16aと予測結果19とを比較することで、モデル14の予測精度を評価することができる。予測精度の評価値として、例えば、正答率(Accuracy)が用いられる。正答率は、例えば、サンプル総数に対する、教師ラベル16aと予測結果19とが一致したサンプルの割合である。データ前処理装置10は、予測精度が低下した場合に予測精度を回復する措置を行う。
 処理部12は、学習フェーズおよび運用フェーズを実行する。学習フェーズとして、処理部12は、計測データ15に対してパラメータ13aに応じた前処理13を実行して訓練データ17を生成する。訓練データ17は、後述するように運用フェーズでも使用する可能性があるため、保存しておく。処理部12は、訓練データ17を用いてモデル14を学習する。モデル14が二値分類を行うk近傍法モデルである場合、例えば、モデル14は、受け付けた入力データと訓練データ17との間の距離を算出し、距離が閾値以下の場合に正常と判定し、距離が閾値を超える場合に異常と判定するものである。
 運用フェーズとして、処理部12は、計測データ16に対して、学習フェーズと同じパラメータ13aに応じた前処理13を実行して入力データ18を生成する。処理部12は、入力データ18をモデル14に入力して予測結果19を生成する。予測結果19は、例えば、計測データ16が正常か異常かを示す。処理部12は、計測データ16に対応付けられた教師ラベル16aと予測結果19とを比較して、モデル14の予測精度を算出する。例えば、処理部12は、計測データ16としての複数のサンプルそれぞれについて、教師ラベル16aと予測結果19とが一致している場合に正解と判定し、教師ラベル16aと予測結果19とが一致していない場合に不正解と判定する。処理部12は、全てのサンプルのうち予測結果19が正解であったサンプルの割合を予測精度として算出する。
 処理部12は、算出した予測精度と閾値とを比較する。閾値は90%など予め決めておく。予測精度が閾値以上である場合、処理部12は、予測精度の回復処理を実行せず、前処理13のパラメータ13aを維持する。一方、予測精度が閾値未満となった場合、処理部12は、予測精度の回復処理を実行する。予測精度の回復処理では、処理部12は、学習フェーズで保存しておいた訓練データ17と、計測データ16から生成される入力データとを比較し、比較結果に基づいて前処理13のパラメータ13aを変更する。
 例えば、処理部12は、パラメータ13aを変えながら計測データ16に対して前処理13を実行し、生成された入力データが訓練データ17に近付くようにパラメータ13aを調整する。例えば、処理部12は、生成された入力データと訓練データ17との間の距離を算出し、距離が最小になるパラメータ13aを採用する。処理部12は、最急降下法などの最適化アルゴリズムを用いて最適なパラメータ13aを探索してもよい。また、処理部12は、幾つかのパラメータ13aの候補値を試して、それら候補値の中から、訓練データ17に最も近い入力データを生成できる候補値を採用してもよい。
 パラメータ13aを変更することで、ノイズの傾向の変化を吸収することができる。例えば、カットオフ周波数を変更することで、学習フェーズとは異なる周波数のノイズを除去することができる。このとき、処理部12は、モデル14を再学習しなくてよい。処理部12は、以降の運用フェーズにおいて、変更されたパラメータ13aを用いて前処理13を実行する。例えば、処理部12は、新たな計測データに対して、変更後のパラメータ13aに応じた前処理13を実行して入力データを生成し、生成した入力データをモデル14に入力して、その計測データに対応する予測結果を生成する。
 第1の実施の形態のデータ前処理装置10によれば、学習フェーズにおいて、計測データ15に対して前処理13が実行されて訓練データ17が生成され、訓練データ17を用いてモデル14が学習される。運用フェーズにおいて、計測データ16に対して前処理13が実行されて入力データ18が生成され、入力データ18がモデル14に入力されて予測結果19が生成される。予測結果19の予測精度が低下した場合、保存しておいた訓練データ17と入力データ18との比較に基づいて、パラメータ13aが変更される。
 これにより、計測デバイスの特性の変化や使用環境の変化などの要因によって計測データ16の傾向が学習フェーズから変化した場合であっても、モデル14に入力される入力データ18への影響を抑制することができる。よって、モデル14の予測精度を回復することが可能となる。また、モデル14を再学習せずモデル14をそのまま使用し続けることが可能となり、機械学習の計算量や学習時間などのコストを抑制することができる。
 [第2の実施の形態]
 次に、第2の実施の形態を説明する。
 第2の実施の形態の機械学習装置は、機械学習によってモデルを学習し、学習したモデルを利用して入力データに対応する結果を予測する。第2の実施の形態の機械学習装置は、クライアント装置でもよいしサーバ装置でもよい。機械学習装置を、コンピュータや情報処理装置などと言うこともできる。
 図2は、第2の実施の形態の機械学習装置のハードウェア例を示す図である。
 機械学習装置100は、CPU101、RAM102、HDD103、画像インタフェース104、入力インタフェース105、媒体リーダ106および通信インタフェース107を有する。機械学習装置100が有するこれらのユニットは、バスに接続されている。機械学習装置100は、第1の実施の形態のデータ前処理装置10に対応する。CPU101は、第1の実施の形態の処理部12に対応する。RAM102またはHDD103は、第1の実施の形態の記憶部11に対応する。
 CPU101は、プログラムの命令を実行するプロセッサである。CPU101は、HDD103に記憶されたプログラムやデータの少なくとも一部をRAM102にロードし、プログラムを実行する。CPU101は複数のプロセッサコアを備えてもよく、機械学習装置100は複数のプロセッサを備えてもよい。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うことがある。
 RAM102は、CPU101が実行するプログラムやCPU101が演算に使用するデータを一時的に記憶する揮発性半導体メモリである。機械学習装置100は、RAM以外の種類のメモリを備えてもよく、複数のメモリを備えてもよい。
 HDD103は、OS(Operating System)やミドルウェアやアプリケーションソフトウェアなどのソフトウェアのプログラム、および、データを記憶する不揮発性ストレージである。機械学習装置100は、フラッシュメモリやSSD(Solid State Drive)など他の種類のストレージを備えてもよく、複数のストレージを備えてもよい。
 画像インタフェース104は、CPU101からの命令に従って、機械学習装置100に接続された表示装置111に画像を出力する。表示装置111として、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ(LCD:Liquid Crystal Display)、有機EL(OEL:Organic Electro-Luminescence)ディスプレイ、プロジェクタなど、任意の種類の表示装置を使用することができる。機械学習装置100に、プリンタなど表示装置111以外の出力デバイスが接続されてもよい。
 入力インタフェース105は、機械学習装置100に接続された入力デバイス112から入力信号を受け付ける。入力デバイス112として、マウス、タッチパネル、タッチパッド、キーボードなど、任意の種類の入力デバイスを使用することができる。機械学習装置100に複数種類の入力デバイスが接続されてもよい。
 媒体リーダ106は、記録媒体113に記録されたプログラムやデータを読み取る読み取り装置である。記録媒体113として、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、半導体メモリなど、任意の種類の記録媒体を使用することができる。媒体リーダ106は、例えば、記録媒体113から読み取ったプログラムやデータを、RAM102やHDD103などの他の記録媒体にコピーする。読み取られたプログラムは、例えば、CPU101によって実行される。なお、記録媒体113は可搬型記録媒体であってもよく、プログラムやデータの配布に用いられることがある。また、記録媒体113やHDD103を、コンピュータ読み取り可能な記録媒体と言うことがある。
 通信インタフェース107は、ネットワーク114に接続され、ネットワーク114を介して他の情報処理装置と通信する。通信インタフェース107は、スイッチやルータなどの有線通信装置に接続される有線通信インタフェースでもよいし、基地局やアクセスポイントなどの無線通信装置に接続される無線通信インタフェースでもよい。
 次に、モデルの学習および運用の流れを説明する。
 図3は、モデルの学習および運用の流れの例を示す図である。
 機械学習装置100は、計測データ151を収集する。計測データ151は、過去に計測デバイスによって計測されたものである。計測データ151は、計測デバイスの特性や計測デバイスの使用環境に応じたノイズを含んでいる。ノイズは、計測デバイス自体の構造に起因して発生することもあるし、周辺に存在する電子機器の電磁波に起因して発生することもある。計測データ151として、異なる対象から計測された複数のサンプルが収集される。後述するように第2の実施の形態では、計測データ151として主に、心電計によって計測された心電図データを想定する。過去に異なる患者から計測された複数の心電図サンプルが収集される。計測データ151として収集される心電図サンプルは、人によって正常な心電図と判断された正常サンプルである。
 機械学習装置100は、計測データ151を前処理フィルタ141に入力して、訓練データ152を生成する。前処理フィルタ141は、計測データ151に含まれるノイズを除去することを意図する。後述するように第2の実施の形態では、前処理フィルタ141として主に、高周波ノイズを除去するローパスフィルタを想定する。ローパスフィルタの挙動は、通過させる周波数の上限を示すカットオフ周波数によって変わる。カットオフ周波数は、学習時に作業者によって試行錯誤的に調整される。訓練データ152として主に、高周波ノイズが除去された複数の心電図サンプルが想定される。
 機械学習装置100は、訓練データ152を用いてモデル142を学習する。モデル142は、入力データを複数のクラスに分類する分類器である。モデル142は、ニューラルネットワーク、サポートベクタマシン、回帰分析モデル、ランダムフォレストなどであってもよい。後述するように第2の実施の形態では、モデル142として主に、k近傍法に基づいて入力データを正常または異常に分類するk近傍法モデルを想定する。このk近傍法モデルは、入力された心電図サンプルと訓練データ152である正常サンプルとの間の距離を算出し、距離が閾値以下の心電図サンプルを正常と判定し、距離が閾値を超える心電図サンプルを異常と判定する。このようなモデル142は、医療現場で使用され得る。心電図が正常か異常かは、患者の病気の診断において参照される。
 モデル142が学習されると、機械学習装置100は、計測データ153を取得する。計測データ153は、モデル142の学習後に計測デバイスによって計測されたものである。計測データ153は、計測デバイスの特性や計測デバイスの使用環境に応じたノイズを含んでいる。また、機械学習装置100は、計測データ153の計測後に、計測データ153に対してフィードバックされた教師ラベルを取得する。教師ラベルは、計測データ153が属するクラスの正解を示す。計測データ151と同様に、計測データ153として主に、心電計によって計測された心電図データを想定する。教師ラベルは、心電図が正常か異常かを人によって判断した結果を示す。
 機械学習装置100は、計測データ153を前処理フィルタ141に入力して、入力データ154を生成する。前処理フィルタ141は、計測データ153に含まれるノイズを除去することを意図する。ここで使用する前処理フィルタ141は、学習時と同じものであり、例えば、学習時と同じカットオフ周波数をもつローパスフィルタである。入力データ154として主に、高周波ノイズが除去された心電図サンプルが想定される。機械学習装置100は、入力データ154をモデル142に入力し、入力データ154が属するクラスの予測結果を出力する。例えば、モデル142は、入力データ154である心電図サンプルと訓練データ152である正常サンプルとの間の距離を算出し、距離が閾値以下の場合は正常と判定し、距離が閾値を超える場合は異常と判定する。予測結果と教師ラベルを比較することで、モデル142の予測精度を評価できる。
 ここで、第2の実施の形態では、学習時と運用時とで、ノイズを含まない理想的な計測データがもつ特徴の分布が変化しない、すなわち、「コンセプトドリフト」が生じないことを想定する。または、コンセプトドリフトが生じるとしても、その変化が十分に緩やかで変化傾向が既知であることを想定する。例えば、ノイズを含まない心電図の波形と正常/異常の分類との間の関係が、学習時と運用時とで変化しないことを想定する。
 ただし、計測デバイスの交換、計測デバイスの経年劣化、計測デバイスの設置位置の変更、計測デバイスの周辺に存在する電子機器の変化などの要因により、学習時と運用時とで、計測データに含まれるノイズの分布が変化してしまうことがある。その場合、前処理後の入力データの特徴が変化し、モデルの予測精度が低下することがある。
 図4は、ノイズによる予測精度の低下および回復の流れの例を示す図である。
 モデル142が学習された後、機械学習装置100は、計測データ155を取得する。計測データ155は、計測デバイスの特性や計測デバイスの使用環境に応じたノイズを含んでいる。計測データ155が含むノイズの傾向は、学習時に使用された計測データ151から変化している。例えば、心電図データに含まれるノイズの周波数が変化している。
 すると、学習時と同じ前処理フィルタ141に計測データ155を入力しても、計測データ155に含まれるノイズが適切に除去されない可能性がある。そのため、計測データ155から前処理フィルタ141を通して生成された入力データ156は、モデル142の学習に使用された訓練データ152の分布に適合しない可能性がある。例えば、カットオフ周波数の設定が不適切であるために、入力データ156に大きいノイズが残っているか、または、入力データ156の信号波形が過剰に平準化されている可能性がある。
 その結果、入力データ156をモデル142に入力することでモデル142から出力される予測結果の予測精度が、モデル142の学習当初の予測精度よりも低下する可能性がある。例えば、入力データ156に大きいノイズが残っていることで、正常な心電図データを誤って異常と判定してしまうリスクが高くなる。ここで、予測精度を回復する1つの方法として、計測データ151よりも新しい計測データを収集し、新しい計測データを用いてモデル142に代わる新しいモデルを学習する方法が考えられる。しかし、モデルの再学習は、計算量や学習時間の観点からコストが高い。
 そこで、機械学習装置100は、モデルを再学習する代わりに、前処理フィルタを変更することでノイズの傾向の変化に対処する。具体的には、機械学習装置100は、モデル142の学習に使用した前処理後の訓練データ152を保存しておく。機械学習装置100は、計測データ155から変換される入力データが、保存しておいた訓練データ152に近付くように前処理フィルタのパラメータを変更する。例えば、機械学習装置100は、前処理フィルタを通過した入力データと訓練データ152との間の距離を算出し、距離が最小になるように前処理フィルタのパラメータを最適化する。
 これにより、前処理フィルタ141が、前処理フィルタ141と異なるパラメータをもつ前処理フィルタ143に変更される。例えば、ローパスフィルタのカットオフ周波数が変更される。その後、機械学習装置100は、計測データ157を取得する。計測データ157は、計測データ155と同じ傾向のノイズを含む。機械学習装置100は、計測データ157を前処理フィルタ143に入力して、計測データ157を入力データ158に変換する。入力データ158は、計測データ157からノイズを除去したものであると期待される。入力データ158の特徴は、訓練データ152の特徴と整合する。
 機械学習装置100は、入力データ158をモデル142に入力して予測結果を取得する。これにより、モデル142の予測精度がモデル142の学習当初と同程度まで回復することが期待される。これは、モデル142に入力される入力データ158の特徴が、モデル142の学習に使用した訓練データ152に十分近いためである。
 なお、ノイズの傾向の変化が大きい場合、前処理フィルタのパラメータをどの様に調整しても、計測データ155から変換される入力データが訓練データ152に十分近付かない可能性がある。その場合、機械学習装置100は、モデルの再学習を推奨する旨の警告を出力するようにしてもよい。例えば、機械学習装置100は、最適化後の前処理フィルタ143を通過した入力データと訓練データ152との間の距離を算出し、算出した距離が所定の閾値を超える場合に警告を出力することが考えられる。
 図5は、前処理フィルタのパラメータの探索例を示す図である。
 前処理フィルタのパラメータを探索するにあたり、機械学習装置100は、最急降下法などの最適化アルゴリズムを使用してもよい。また、機械学習装置100は、幾つかのパラメータを試行し、それらパラメータの中から距離が最も小さくなるパラメータを採用してもよい。ここでは、後者の方法について説明する。
 機械学習装置100は、パラメータの異なる前処理フィルタ143-1,143-2,143-3を生成する。前処理フィルタ143-1はパラメータaをもち、前処理フィルタ143-2はパラメータbをもち、前処理フィルタ143-3はパラメータcをもつ。例えば、前処理フィルタ143-1,143-2,143-3は、カットオフ周波数の異なるローパスフィルタである。例えば、前処理フィルタ143-1はカットオフ周波数が低い強フィルタであり、前処理フィルタ143-2はカットオフ周波数が中程度の中フィルタであり、前処理フィルタ143-3はカットオフ周波数が高い弱フィルタである。機械学習装置100は、25Hz,35Hz,75Hz,100Hz,150Hzなどの所定のカットオフ周波数の中から3つを選択するようにしてもよい。
 機械学習装置100は、計測データ155を前処理フィルタ143-1に入力して入力データ156-1を生成する。また、機械学習装置100は、計測データ155を前処理フィルタ143-2に入力して入力データ156-2を生成する。また、機械学習装置100は、計測データ155を前処理フィルタ143-3に入力して入力データ156-3を生成する。そして、機械学習装置100は、入力データ156-1,156-2,156-3それぞれに対して、訓練データ152との距離を算出する。訓練データ152として複数のサンプルがある場合、入力データ156-1と訓練データ152との間の距離を、それら複数のサンプルのうち入力データ156-1に最も近いサンプルとの間の距離と定義してもよい。同様に、入力データ156-2と訓練データ152との間の距離を、入力データ156-2に最も近いサンプルとの間の距離と定義してもよい。
 機械学習装置100は、入力データ156-1,156-2,156-3のうち、訓練データ152との間の距離が最も小さい入力データを特定する。ここでは、入力データ156-2の距離が最も小さいとする。すると、機械学習装置100は、入力データ156-2の生成に用いられた前処理フィルタ143-2を採用する。すなわち、機械学習装置100は、前処理フィルタのパラメータをパラメータbに変更する。以降に入力される計測データに対しては、パラメータbをもつ前処理フィルタ143-2が使用される。
 次に、計測データとして心電図データを使用する例について説明する。
 図6は、訓練データの生成例を示す図である。
 機械学習装置100は、モデルの学習にあたり、過去に計測された心電図データ161を取得する。心電図データ161は、正常な心電図を表している。心電図データ161では、心臓の鼓動を示す所定パターンの波形が繰り返されている。機械学習装置100は、2周期など所定周期の波形を心電図データ161から抽出し、抽出した波形を示す正常サンプル161-1,161-2,161-3,…を生成する。これら複数の正常サンプルが、モデルを学習するための訓練データとして使用される。訓練データには、異なる患者から計測された正常サンプルが混在していることが好ましい。
 心電図データ161から正常サンプル161-1,161-2,161-3,…を生成するにあたり、時間幅と振幅が正規化される。例えば、機械学習装置100は、心電図データ161から抽出した所定周期の波形を時間方向に伸縮して、正常サンプル161-1,161-2,161-3,…の時間幅を統一する。また、例えば、機械学習装置100は、抽出した所定周期の波形を振幅方向に伸縮し、正常サンプル161-1,161-2,161-3,…の信号レベルの変動幅を統一する。時間幅および振幅の正規化は、前処理の中で行われる。ただし、正常サンプルと入力サンプルとの間の距離を、時間幅や振幅の差異を自動的に調整しながら算出することができるモデルを学習する場合、訓練データの生成時に時間幅および振幅を正規化しなくてもよい。
 また、心電図データ161から正常サンプル161-1,161-2,161-3,…を生成するにあたり、ローパスフィルタを用いて高周波ノイズが除去される。高周波ノイズの除去は、前処理の中で行われる。ローパスフィルタのカットオフ周波数は、モデル学習の作業者によって試行錯誤的に決定される。ただし、以下では説明を簡単にするため、心電図データ161のノイズが十分に小さい場合を想定し、ローパスフィルタを用いた高周波ノイズの除去を行わずに訓練データを生成するとする。高周波ノイズの除去を省略することは、カットオフ周波数を十分に大きく設定することに相当する。
 図7は、k近傍法モデルによる異常検出の例を示す図である。
 機械学習装置100は、訓練データである正常サンプル161-1,161-2,161-3,…を用いて、k近傍法によって入力サンプルを正常または異常に分類するk近傍法モデルを生成する。第2の実施の形態では入力サンプルに最も近い正常サンプルのみが判定結果に影響することから、第2の実施の形態のk近傍法モデルを、最近傍法によって入力サンプルの分類を判定する最近傍モデルと言うこともできる。
 具体的には、機械学習装置100は、訓練データである正常サンプル161-1,161-2,161-3,…を配置した特徴空間162を形成する。特徴空間162においてk近傍法モデルは、ある入力サンプルが与えられると、その入力サンプルからの距離が所定の閾値(例えば、0.3)以下である正常サンプルを検索する。入力サンプルから所定の距離以内に少なくとも1つの正常サンプルが存在する場合、k近傍法モデルは、その入力サンプルを正常と判定する。入力サンプルから所定の距離以内に正常サンプルが存在しない場合、k近傍法モデルは、その入力サンプルを異常と判定する。
 例えば、図7の入力サンプル162-1は、所定の距離以内に1以上の正常サンプルが存在するため、正常と判定される。一方、図7の入力サンプル162-2は、所定の距離以内に正常サンプルが存在しないため、異常と判定される。k近傍法モデルは、例えば、入力サンプルに対して、複数の正常サンプルそれぞれとの間の距離を算出し、算出した距離が閾値以下であるか判断する。k近傍法モデルは、最短距離が閾値以下である場合に入力サンプルを正常と判定し、最短距離が閾値を超える場合に入力サンプルを異常と判定する。ただし、機械学習装置100は、入力サンプルとの距離を概算できるようなインデックスを生成しておき、入力サンプルとの距離が閾値以下である可能性がある正常サンプルを効率的に絞り込めるようにしてもよい。これにより、k近傍法モデルは、全ての正常サンプルに対して距離を算出しなくてもよい。
 入力サンプルおよび正常サンプルはそれぞれ、信号波形を示す時系列データである。1つの入力サンプルと1つの正常サンプルとの間の距離は、両者の信号波形の類似度を表す。距離が小さいほど2つの信号波形が類似しており、距離が大きいほど2つの信号波形が異なる。例えば、k近傍法モデルは、時間軸に沿って、2つの信号波形の間で各時刻の信号レベルの差の絶対値を算出し、その平均値を距離と定義する。また、例えば、k近傍法モデルは、時間軸に沿って、2つの信号波形の間で各時刻の信号レベルの差の二乗を算出し、その平均値の平方根(二乗平均平方根)を距離と定義する。また、k近傍法モデルは、動的時間伸縮法(DTW:Dynamic Time Warping)などの動的計画法を用いて、2つの信号波形の間の時間方向のずれを修正しながら両者の距離を算出するようにしてもよい。
 図8は、ノイズを含む入力サンプルに対する誤検出の例を示す図である。
 k近傍法モデルを学習すると、機械学習装置100は、k近傍法モデルの学習後に計測された心電図データ163を取得する。心電図データ163は、正常な心電図を表していることもあるし、異常な心電図を表していることもある。また、心電図データ163は、k近傍法モデルの学習に使用した心電図データ161とは異なる周波数のノイズを含んでいる可能性がある。ノイズの傾向の変化は、心電計の交換、心電計の経年劣化、心電計の設置場所の変更、心電計の周辺環境の変化などの要因によって生じ得る。
 機械学習装置100は、2周期など所定周期の波形を心電図データ163から抽出し、抽出した波形に対して学習時と同様の前処理を行って、入力サンプル163-1,163-2,163-3,…を生成する。入力サンプル163-1,163-2,163-3,…は、時間幅と振幅が正規化される。例えば、機械学習装置100は、抽出した所定周期の波形を時間方向に伸縮して、時間幅を正常サンプル161-1,161-2,161-3,…と同一にする。また、例えば、機械学習装置100は、抽出した所定周期の波形を振幅方向に伸縮し、信号レベルの変動幅を正常サンプル161-1,161-2,161-3,…と同一にする。ただし、使用するモデルによっては、入力サンプル163-1,163-2,163-3,…の時間幅や振幅を正規化しなくてもよい。
 また、入力サンプル163-1,163-2,163-3,…は、ローパスフィルタを用いて高周波ノイズが除去される。ローパスフィルタのカットオフ周波数は、モデル学習時のものが使用される。ただし、前述のように説明を簡単にするため、モデル学習時においてローパスフィルタによる高周波ノイズの除去を行っておらず、ここでもローパスフィルタによる高周波ノイズの除去を行わない。高周波ノイズの除去を省略することは、カットオフ周波数を十分に大きく設定することに相当する。
 機械学習装置100は、生成した入力サンプル163-1,163-2,163-3,…それぞれを、k近傍法モデルに入力することで正常か異常かを判定する。機械学習装置100は、入力サンプル163-1を正常と判定し、入力サンプル163-2を異常と判定し、入力サンプル163-3を異常と判定する。機械学習装置100は、入力サンプル163-1,163-2,163-3,…に対するこれらの予測結果を出力する。例えば、機械学習装置100は、予測結果を表示装置111に表示する。
 これに対して、入力サンプル163-1は正常が正解であり、入力サンプル163-2は異常が正解であり、入力サンプル163-3は正常が正解である。入力サンプル163-1はモデル学習時に想定されていないノイズを含まないため、k近傍法モデルは正常な心電波形を正常と正しく判定している。同様に、入力サンプル163-2はモデル学習時に想定されていないノイズを含まないため、k近傍法モデルは異常な心電波形を異常と正しく判定している。一方、入力サンプル163-3はモデル学習時に想定されていない高周波ノイズを含むため、k近傍法モデルは正常な心電波形を異常と誤って判定している。
 入力サンプル163-3の判定を誤ることで、k近傍法モデルの正答率が低くなり、予測精度が低下する。正答率は、k近傍法モデルに入力した入力サンプルの個数に対する、正常/異常の予測結果が正しかった入力サンプルの個数の割合である。最新の予測精度は、例えば、直近の所定個の入力サンプルの中で正答率を算出することで評価する。k近傍法モデルの予測精度が閾値(例えば、90%)未満に低下すると、機械学習装置100は、ローパスフィルタのパラメータを変更することで予測精度を回復することを試みる。
 図9は、ローパスフィルタのパラメータの探索例を示す図である。
 機械学習装置100は、k近傍法モデルに入力した入力サンプルの中から、予測精度の低下の原因となった1以上の入力サンプルを選択する。予測精度の低下の原因となった入力サンプルは、前述の入力サンプル163-3のように、正常を示す教師ラベルが付与された入力サンプルのうち、k近傍法モデルによって異常と判定されたものである。このような入力サンプルは、ローパスフィルタによって高周波ノイズが適切に除去されることで、正常であると正しく判定されるようになる可能性が高いためである。
 予測精度の低下の原因となった入力サンプルは、ローパスフィルタ通過後の入力サンプルとローパスフィルタ通過後の訓練データである正常サンプルとの間の比較に基づいて判定されると言うこともできる。ローパスフィルタ通過後の正常サンプルとローパスフィルタ通過後の入力サンプルであって正常なものとの間の距離が閾値を超える場合、その入力サンプルが予測精度の低下の原因となっているとみなすことができる。
 直近の所定個の入力サンプルの中に、誤って異常と判定された入力サンプルが2以上ある場合、機械学習装置100は、何れか1つの入力サンプルを選択してもよい。1つの入力サンプルは、ランダムに選択してもよいし、所定の基準で選択するようにしてもよい。例えば、機械学習装置100は、k近傍法モデルにおいて算出される訓練データとの距離、すなわち、最も類似する正常サンプルとの間の最短距離が最大である入力サンプルを選択してもよい。このような入力サンプルは、最も大きいノイズを含んでいると言える。また、機械学習装置100は、該当する2以上の入力サンプルの全てを選択してもよい。
 また、機械学習装置100は、カットオフ周波数の異なる複数のローパスフィルタを生成する。例えば、機械学習装置100は、ローパスフィルタ164-1,164-2,164-3のような数個のローパスフィルタを生成する。ローパスフィルタ164-1は、カットオフ周波数が低く通過可能な周波数成分が少ない強フィルタである。ローパスフィルタ164-2は、カットオフ周波数が中程度であり通過可能な周波数成分が中程度である中フィルタである。ローパスフィルタ164-3は、カットオフ周波数が高く通過可能な周波数成分が多い弱フィルタである。カットオフ周波数は、25Hz,35Hz,75Hz,100Hz,150Hzなどのように設定される。
 時系列信号データに対するローパスフィルタは、FIRフィルタまたはIIRフィルタとして実装されることがある。FIRフィルタは、直近の所定個の入力信号を保持しておき、最新の入力信号と過去の所定個の入力信号にそれぞれフィルタ係数を乗じて合算したものを、最新の出力信号として出力する。保持する入力信号の個数、すなわち、記憶時間を、フィルタ次数として指定することができる。フィルタ次数やフィルタ係数を調整することで、異なる周波数特性をもつローパスフィルタを生成することができる。IIRフィルタは、過去の所定個の入力信号に加えて、過去の所定個の出力信号を保持する。IIRフィルタは、最新の入力信号と過去の所定個の入力信号と過去の所定個の出力信号にそれぞれフィルタ係数を乗じて合算したものを、最新の出力信号として出力する。
 機械学習装置100は、数式処理ライブラリを利用して、ローパスフィルタとして動作するFIRフィルタまたはIIRフィルタを生成することもできる。例えば、数式処理ライブラリは、フィルタ次数とカットオフ周波数の指定を受け付けることで、適切なフィルタ係数をもつFIRフィルタまたはIIRフィルタを自動的に生成することがある。フィルタ次数やカットオフ周波数に加えて、カットオフ周波数の周辺の周波数における振幅が、振幅減衰特性を示す情報として指定されることもある。
 機械学習装置100は、選択した入力サンプルに対応するローパスフィルタ通過前のものを、ローパスフィルタ164-1,164-2,164-3にそれぞれ入力する。ここでは予測精度が低下した時点で、ローパスフィルタ未適用の入力サンプルがk近傍法モデルに入力されていることから、入力サンプル163-3がそのままローパスフィルタ164-1,164-2,164-3に入力される。機械学習装置100は、入力サンプル163-3をローパスフィルタ164-1に入力して、サンプル165-1を生成する。また、機械学習装置100は、入力サンプル163-3をローパスフィルタ164-2に入力して、サンプル165-2を生成する。また、機械学習装置100は、入力サンプル163-3をローパスフィルタ164-3に入力して、サンプル165-3を生成する。
 機械学習装置100は、生成されたサンプル165-1,165-2,165-3それぞれに対して、正常サンプル161-1,161-2,161-3,…を含む訓練データとの間の距離を算出する。ここで算出される距離は、サンプル165-1,165-2,165-3それぞれをk近傍法モデルに対する入力サンプルとみなして、k近傍法モデルにおいて算出される距離に相当する。すなわち、あるサンプルに対して算出される距離は、正常サンプル161-1,161-2,161-3,…のうち当該サンプルと最も類似する正常サンプルとの間で算出される最短距離である。
 機械学習装置100は、サンプル165-1,165-2,165-3のうち訓練データとの距離が最小のサンプルを判定する。そして、機械学習装置100は、判定したサンプルの生成に使用したローパスフィルタを、それ以降の心電図データに対して適用するローパスフィルタとして採用する。ここでは、サンプル165-1,165-2,165-3のうちサンプル165-2が、訓練データとの距離が最小であるとする。そこで、機械学習装置100は、ローパスフィルタ164-1,164-2,164-3のうちローパスフィルタ164-2を選択する。これは、ローパスフィルタ164-2のカットオフ周波数やフィルタ次数などのパラメータを選択することを意味する。
 なお、予測精度の低下の原因となった入力サンプルを2以上選択した場合、機械学習装置100は、それら2以上の入力サンプルに対して算出される2以上の距離の平均(平均距離)が最小化されるように、ローパスフィルタを選択するようにしてもよい。また、機械学習装置100は、それら2以上の入力サンプルに対して算出される2以上の距離の最悪値(最長距離)が最小化されるように、ローパスフィルタを選択するようにしてもよい。また、機械学習装置100は、最急降下法などの最適化アルゴリズムを用いて、ローパスフィルタのパラメータを変えながらフィルタ通過後サンプルと訓練データとの距離の算出を繰り返し、距離が最小になるパラメータを探索するようにしてもよい。
 図10は、第1のローパスフィルタの適用例を示す図である。
 前述のように、機械学習装置100は、ローパスフィルタ164-2を採用する。ここでは、ローパスフィルタ164-2を採用することで、k近傍法モデルを再学習せずに、心電図データ163に対する予測精度が改善することを説明する。
 機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-1をローパスフィルタ164-2に入力して、入力サンプル166-1に変換する。また、機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-2をローパスフィルタ164-2に入力して、入力サンプル166-2に変換する。また、機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-3をローパスフィルタ164-2に入力して、入力サンプル166-3に変換する。機械学習装置100は、入力サンプル166-1,166-2,166-3をk近傍法モデルに入力することで、入力サンプル166-1,166-2,166-3それぞれが正常か異常か判定する。
 入力サンプル163-1は高周波ノイズを含んでおらず、入力サンプル166-1も高周波ノイズを含んでいない。入力サンプル166-1は正常な心電波形を示しており、その特徴は訓練データと整合する。よって、機械学習装置100は、正常な入力サンプル166-1を正しく正常と判定することができる。また、入力サンプル163-2は高周波ノイズを含んでおらず、入力サンプル166-2も高周波ノイズを含んでいない。入力サンプル166-2は異常な心電波形を示している。よって、機械学習装置100は、異常な入力サンプル166-2を正しく異常と判定することができる。
 また、入力サンプル163-3は高周波ノイズを含んでいるものの、ローパスフィルタ164-2によって高周波ノイズが適切に除去され、入力サンプル166-3は高周波ノイズを含んでいない。入力サンプル166-3は正常な心電波形を示しており、その特徴は訓練データと整合する。よって、機械学習装置100は、正常な入力サンプル166-3を正しく正常と判定することができる。このように、ローパスフィルタ通過後の入力サンプルが、k近傍法モデルの学習に使用した訓練データに近付くようにパラメータを調整することで、k近傍法モデルの予測精度を回復することができる。
 図11は、第2のローパスフィルタの適用例を示す図である。
 ここでは仮に、ローパスフィルタ164-1を採用した場合を考える。ローパスフィルタ164-1はカットオフ周波数が過度に小さいため、ローパスフィルタ164-1を通過した入力サンプルの特徴が訓練データとは大きく変わってしまう。このため、k近傍法モデルの予測精度が十分に回復されない。
 機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-1をローパスフィルタ164-1に入力して、入力サンプル167-1に変換する。また、機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-2をローパスフィルタ164-1に入力して、入力サンプル167-2に変換する。また、機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-3をローパスフィルタ164-1に入力して、入力サンプル167-3に変換する。機械学習装置100は、入力サンプル167-1,167-2,167-3をk近傍法モデルに入力することで、入力サンプル167-1,167-2,167-3それぞれが正常か異常か判定する。
 入力サンプル167-1は高周波ノイズを含んでおらず、機械学習装置100は正常な入力サンプル167-1を正しく正常と判定している。また、入力サンプル167-3は高周波ノイズが除去されており、機械学習装置100は正常な入力サンプル167-3を正しく正常と判定している。一方、入力サンプル167-2は高周波ノイズを含んでいないものの、過剰なフィルタリングによって異常な心電波形の特徴を失っている。よって、機械学習装置100は、異常な入力サンプル167-2を誤って正常と判定している。このように、ローパスフィルタのパラメータの調整次第では予測精度が十分に回復しない。
 図12は、第3のローパスフィルタの適用例を示す図である。
 ここでは仮に、ローパスフィルタ164-3を採用した場合を考える。ローパスフィルタ164-3はカットオフ周波数が過度に大きいため、ローパスフィルタ164-3を通過した入力サンプルに高周波ノイズが残ってしまう。
 機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-1をローパスフィルタ164-3に入力して、入力サンプル168-1に変換する。また、機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-2をローパスフィルタ164-3に入力して、入力サンプル168-2に変換する。また、機械学習装置100は、ローパスフィルタ未適用の入力サンプル163-3をローパスフィルタ164-3に入力して、入力サンプル168-3に変換する。機械学習装置100は、入力サンプル168-1,168-2,168-3をk近傍法モデルに入力することで、入力サンプル168-1,168-2,168-3それぞれが正常か異常か判定する。
 入力サンプル168-1は高周波ノイズを含んでおらず、機械学習装置100は正常な入力サンプル168-1を正しく正常と判定している。また、入力サンプル168-2は高周波ノイズを含んでいないと共に異常な心電波形の特徴を維持しており、機械学習装置100は異常な入力サンプル168-2を正しく異常と判定している。一方、入力サンプル168-3には高周波ノイズが残っており、機械学習装置100は正常な入力サンプル168-3を誤って異常と判定している。このように、ローパスフィルタのパラメータの調整次第では予測精度が十分に回復しない。
 次に、機械学習装置100の機能について説明する。
 図13は、機械学習装置の機能例を示すブロック図である。
 機械学習装置100は、計測データ記憶部121,122、フィルタ記憶部123、訓練データ記憶部124、モデル記憶部125および予測結果記憶部126を有する。これらの記憶部は、例えば、RAM102またはHDD103の記憶領域を用いて実装される。また、機械学習装置100は、前処理部131,133、モデル学習部132、予測部134およびフィルタ更新部135を有する。これらの処理部は、例えば、CPU101が実行するプログラムを用いて実装される。
 計測データ記憶部121は、モデルの学習に使用する計測データを記憶する。計測データは、計測デバイスによって計測され、計測デバイスのハードウェア特性や使用環境に応じたノイズを含むことがある。計測データは、時系列データであることもあるし一時点の空間データであることもある。例えば、計測データは、撮像デバイスを用いて撮像された画像データ、マイクロフォンを用いて録音された音声データ、加速度計を用いて計測された歩行データ、心電計を用いて計測された心電図データなどである。計測データには、正解のクラス分類を示す教師ラベルが付与されていることがある。ただし、所定のクラスに属する計測データのみが訓練データとして使用される場合、教師ラベルが無くてもよい。
 計測データ記憶部122は、計測データ記憶部121の計測データよりも後に計測された計測データを記憶する。計測データ記憶部122の計測データは、計測データ記憶部121と同種のデータであって、モデルの運用開始後に計測されたものである。ただし、計測データ記憶部122の計測データは、計測デバイスのハードウェア特性の変化や使用環境の変化によって、学習用の計測データとは異なる傾向のノイズを含むことがある。計測データには、正解のクラス分類を示す教師ラベルが付与される。この教師ラベルは、モデル運用時の計測データに対するフィードバックである。
 なお、計測デバイスを機械学習装置100に接続し、機械学習装置100が計測デバイスから計測データを直接受信するようにしてもよい。また、計測デバイスと機械学習装置100とをローカルネットワークまたは広域ネットワークを介して接続し、機械学習装置100がネットワーク経由で計測データを受信するようにしてもよい。また、計測デバイスから他の情報処理装置に計測データを一旦転送し、機械学習装置100が他の情報処理装置から計測データを収集するようにしてもよい。また、計測データを記録媒体に保存し、機械学習装置100が記録媒体から計測データを読み出すようにしてもよい。また、計測データに対する教師ラベルは、ユーザによって機械学習装置100に入力されてもよい。また、教師ラベルは、他の情報処理装置から計測データと併せて受信してもよいし、記録媒体から計測データと併せて読み出されてもよい。
 フィルタ記憶部123は、計測データに対する前処理に使用されるフィルタを記憶する。フィルタは、高周波ノイズを除去するローパスフィルタであることがある。フィルタ記憶部123は、カットオフ周波数やフィルタ次数を記憶してもよく、FIRフィルタまたはIIRフィルタのフィルタ係数を記憶してもよい。また、フィルタ記憶部123に予め複数のフィルタを定義しておき、前処理部131,133がそれら複数のフィルタの中から1つを選択するようにしてもよい。また、フィルタ更新部135が新たなフィルタを生成してフィルタ記憶部123に追加するようにしてもよい。
 訓練データ記憶部124は、モデルの学習に使用した訓練データを記憶する。訓練データは、計測データ記憶部121に記憶された計測データに対して前処理を行ったものである。前処理には、ローパスフィルタを用いたノイズ除去が含まれることがある。また、前処理には、時系列信号の時間幅の調整や振幅の調整が含まれることがある。ただし、前処理を実質的に行わないことで、計測データそのものを訓練データとしてもよい。
 モデル記憶部125は、訓練データを用いて学習されたモデルを記憶する。モデルは、入力データを複数のクラスに分類する分類器である。例えば、モデルは、入力データが正常か異常かを判定する。モデルは、例えば、ニューラルネットワーク、サポートベクタマシン、回帰分析モデル、ランダムフォレスト、k近傍法モデルなどである。
 予測結果記憶部126は、計測データ記憶部122に記憶された計測データに対して、モデル記憶部125に記憶されたモデルが予測した予測結果を記憶する。予測結果は、例えば、計測データが正常か異常かを示す。予測結果は、教師ラベルと一致した場合に正解となり、教師ラベルと一致しない場合に不正解となる。予測結果に対しては、評価値として予測精度を算出することができる。予測精度は、例えば、直近の所定個の入力サンプルのうち予測結果が正解であった入力サンプルの割合を示す正答率によって表現される。ただし、正答率以外の指標を予測精度として用いてもよい。
 前処理部131は、計測データ記憶部121に記憶された学習用の計測データに対して前処理を行い、前処理された訓練データを生成する。前処理部131は、訓練データを訓練データ記憶部124に保存すると共に、訓練データをモデル学習部132に提供する。前処理として、前処理部131は、フィルタ記憶部123に記憶されたフィルタを使用することがある。例えば、前処理部131は、ローパスフィルタを用いて計測データに含まれる高周波ノイズを除去する。前処理部131が使用するフィルタは、モデルの予測精度が上がるようにユーザによって試行錯誤的に決定される。ただし、適切な前処理フィルタの探索を機械学習の中で行うようにしてもよい。また、前処理として、前処理部131は、時系列信号の時間幅の調整や振幅の調整を行うことがある。
 モデル学習部132は、前処理部131を通過した訓練データを用いて機械学習によりモデルを生成し、生成したモデルをモデル記憶部125に保存する。例えば、モデル学習部132は、訓練データである複数の正常サンプルを含むk近傍法モデルを生成する。k近傍法モデルは、例えば、入力サンプルに最も類似する正常サンプルと当該入力サンプルとの間の距離(最短距離)を算出し、距離が閾値以下の場合は正常と判定し、距離が閾値を超える場合は異常と判定するモデルとして学習される。
 前処理部133は、計測データ記憶部122に新しい計測データが到着すると、新しい計測データに対して前処理を行い、前処理された入力データを生成する。前処理部133は、入力データを予測部134に提供する。前処理として、前処理部133は、フィルタ記憶部123に記憶されたフィルタを使用することがある。前処理部133が使用するフィルタは、原則として、前処理部131がモデル学習時に使用したフィルタと同一である。ただし、フィルタ更新部135によって、モデル学習時と異なるフィルタに変更されることがある。また、前処理として、前処理部133は、時系列信号の時間幅の調整や振幅の調整を行うことがある。時間幅や振幅の調整方法は、モデル学習時と同じである。また、前処理部133は、フィルタ更新部135からの要求に応じて、フィルタ通過後の入力データおよびフィルタ通過前の入力データをフィルタ更新部135に提供する。
 予測部134は、前処理部133を通過した入力データを、モデル記憶部125に記憶されたモデルに入力して、入力データの属するクラスを予測する。例えば、予測部134は、入力データが正常か異常かを予測する。予測部134は、入力データの属するクラスを示す予測結果を生成して予測結果記憶部126に保存する。更に、予測部134は、予測結果を表示装置111に表示してもよいし、他の情報処理装置に送信してもよい。
 フィルタ更新部135は、運用開始後にモデルの予測精度が低下した場合に、前処理部133が使用するフィルタを更新する。具体的には、フィルタ更新部135は、予測部134が出力した予測結果を予測結果記憶部126から読み出し、計測データに付加されている教師ラベルと予測結果とを比較する。フィルタ更新部135は、教師ラベルと予測結果とが同一のクラス分類を示している場合は正解と判断し、教師ラベルと予測結果とが異なるクラス分類を示している場合は不正解と判断する。フィルタ更新部135は、直近の所定個の入力サンプルに対する比較結果から、正答率などの予測精度を算出する。最新の予測精度が閾値未満に低下した場合、フィルタ更新部135は、前処理フィルタを更新すると決定する。予測精度の閾値は、予め固定的に決めておいてもよいし、モデルが学習された当初の予測精度を基準にして決めるようにしてもよい。
 フィルタを更新する場合、フィルタ更新部135は、最近のフィルタ通過後の入力データを前処理部133から取得し、その中から予測精度の低下の原因となった入力データを特定する。予測精度の低下の原因となった入力データは、例えば、訓練データとの距離が閾値を超える入力データである。フィルタ更新部135は、訓練データ記憶部124に記憶された訓練データを参照して、予測精度の低下の原因を特定してもよい。また、フィルタ更新部135は、正常を示す教師ラベルが対応付けられた入力サンプルのうち、誤って異常と判定された入力サンプルを、予測精度の低下の原因として特定してもよい。
 予測精度の低下の原因となった入力データが特定されると、フィルタ更新部135は、当該原因に対応するフィルタ通過前の入力データを前処理部133から取得する。フィルタ更新部135は、パラメータを変更したフィルタを生成し、生成したフィルタに当該入力データを入力し、フィルタ通過後の入力データと訓練データとの間の距離を算出する。例えば、フィルタ更新部135は、カットオフ周波数やフィルタ次数を変更したローパスフィルタを生成し、生成したローパスフィルタに当該入力データを入力する。フィルタ更新部135は、距離が小さくなるようにフィルタのパラメータを調整する。これにより、前処理部133が使用するフィルタが更新される。フィルタ更新部135は、生成したフィルタをフィルタ記憶部123に保存してもよい。
 なお、フィルタ更新部135は、フィルタ最適化後の入力データと訓練データとの間の距離が、所定の閾値以下であるか判断し、距離が閾値を超える場合にはフィルタ最適化が失敗したと判断してもよい。計測データに含まれるノイズの傾向がモデル学習時と大きく異なる場合、フィルタ最適化のみではモデルの予測精度が十分に回復されない可能性があるためである。この場合、最新の計測データを用いてモデルを再学習することが好ましい。そこで、例えば、フィルタ更新部135は、フィルタ最適化後の入力データと訓練データとの間の距離が閾値を超える場合、モデルの再学習を促す警告を出力してもよい。この閾値は、k近傍法モデルで正常/異常の分類に使用する閾値と同一でもよい。警告は、表示装置111に表示してもよいし、他の情報処理装置に送信してもよい。
 図14は、計測データテーブルの例を示す図である。
 計測データテーブル127は、計測データ記憶部122に記憶される。計測データ記憶部121に、計測データテーブル127と同様のテーブルが記憶されてもよい。計測データテーブル127は、ID、時系列データおよび教師ラベルの項目を含む。IDは、時系列データのサンプルを識別する。時系列データは、心電図データや歩行データなど、時間軸に沿って信号レベルが変動する一次元データである。時系列データの信号レベルは、所定のサンプリングレートで計測される。教師ラベルは、時系列データが属する分類クラスの正解を示す。例えば、教師ラベルは、正常または異常を表す。
 図15は、フィルタテーブルの例を示す図である。
 フィルタテーブル128は、フィルタ記憶部123に記憶される。フィルタテーブル128は、ID、カットオフ周波数、FIRフィルタの項目を含む。IDは、ローパスフィルタを識別する。カットオフ周波数は、通過させる周波数と遮断する周波数との境界を示す。ローパスフィルタとして動作するFIRフィルタは、最新の入力信号および過去の所定個の入力信号それぞれに乗ずるフィルタ係数を含む線形式によって表現される。ただし、ローパスフィルタをIIRフィルタなど他のフィルタ形式で実装してもよい。カットオフ周波数は、ローパスフィルタのパラメータの一種である。ローパスフィルタのパラメータに、フィルタ次数が含まれてもよい。また、ローパスフィルタにパラメータに、カットオフ周波数の周辺の減衰率を示す振幅が含まれてもよい。また、フィルタ係数を、ローパスフィルタのパラメータの一種として調整できるようにしてもよい。
 次に、機械学習装置100の処理手順について説明する。以下の説明では、k近傍法に基づいて心電図データの正常/異常を判定する場合を想定する。
 図16は、学習時処理の手順例を示すフローチャートである。
 (S10)前処理部131は、正常な計測データを取得する。異常な計測データは取得しなくてよく、計測データに教師ラベルが明示的に付加されていなくてもよい。
 (S11)前処理部131は、計測データから所定周期の複数の正常サンプルを抽出し、各正常サンプルの時間幅および振幅を正規化する。
 (S12)前処理部131は、複数の正常サンプルそれぞれをローパスフィルタに通す。ローパスフィルタに対して設定されるカットオフ周波数やフィルタ次数などのパラメータは、ユーザから指定される。ただし、正常サンプルをローパスフィルタに通さないようにしてもよい。また、カットオフ周波数を十分に大きくするなどローパスフィルタのパラメータを調整することで、ローパスフィルタを実質的に無効化してもよい。
 (S13)前処理部131は、ステップS11,S12を含む前処理を行った後の正常サンプルの集合を訓練データとして生成し、訓練データ記憶部124に保存する。
 (S14)モデル学習部132は、訓練データからk近傍法モデルを学習する。ここで学習されるk近傍法モデルは、入力サンプルと複数の正常サンプルそれぞれとの間の距離のうち最短距離を求め、最短距離が閾値以下であれば正常と判定し、最短距離が閾値を超えれば異常と判定する最近傍法モデルである。閾値はユーザから指定されてもよい。モデル学習部132は、k近傍法モデルをモデル記憶部125に保存する。
 図17は、運用時処理の手順例を示すフローチャートである。
 (S20)前処理部133は、モデル学習後に計測された計測データを取得する。この計測データには、正常または異常を示す教師ラベルが付加される。教師ラベルは、例えば、医療関係者などの専門家が計測データに対してフィードバックしたものである。
 (S21)前処理部133は、計測データから所定周期の複数の入力サンプルを抽出し、各入力サンプルの時間幅および振幅を正規化する。
 (S22)前処理部133は、複数の入力サンプルそれぞれをローパスフィルタに通す。ローパスフィルタに対して設定されるカットオフ周波数やフィルタ次数などのパラメータは、原則としてモデル学習に用いたものと同一である。ただし、後述するようにモデル学習後にパラメータを変更した場合、直近の変更後のパラメータが使用される。
 (S23)予測部134は、モデル記憶部125に保存されたk近傍法モデルを読み出す。予測部134は、ステップS21,S22を含む前処理を行った後の入力サンプルをk近傍法モデルに入力し、その入力サンプルの正常/異常を予測する。予測部134は、正常または異常を示す予測結果を予測結果記憶部126に保存する。予測部134は、予測結果を表示装置111に表示してもよいし、他の情報処理装置に送信してもよい。
 (S24)フィルタ更新部135は、k近傍法モデルの最新の予測精度を算出する。例えば、フィルタ更新部135は、直近の複数の入力サンプルそれぞれについて予測結果と教師ラベルとを比較し、予測結果と教師ラベルとが一致する入力サンプルの割合を示す正答率を算出する。例えば、正答率が予測精度の指標として使用される。
 (S25)フィルタ更新部135は、予測精度が閾値未満であるか判断する。閾値は、モデル学習時または運用開始後にユーザから指定されてもよい。また、閾値は、学習当初のk近傍法モデルの予測精度から自動的に決定されてもよい。予測精度が閾値未満の場合はステップS26に進み、それ以外の場合は取得した計測データの処理を終了する。
 (S26)フィルタ更新部135は、正常を示す教師ラベルが対応付けられた入力サンプルのうち、k近傍法モデルによって誤って異常と判定されたものを、予測精度の低下の原因として選択する。選択する入力サンプルは、正常な入力サンプルであって、かつ、訓練データとの距離(複数の正常サンプルそれぞれとの距離のうちの最短距離)が閾値を超えるものである。この距離は、ローパスフィルタ通過後の入力サンプルと訓練データとの間で算出されるものである。ただし、k近傍法モデルの閾値とは異なる閾値を用いて、正常な入力サンプルのうち訓練データとの距離が閾値を超えるものを選択してもよい。
 (S27)フィルタ更新部135は、ステップS26で選択した入力サンプルに対応するローパスフィルタ通過前の入力サンプルを使用して、ローパスフィルタのパラメータを探索する。フィルタ更新部135は、カットオフ周波数やフィルタ次数などのパラメータを変更したローパスフィルタに入力サンプルを入力し、ローパスフィルタ通過後の入力サンプルと訓練データとの距離を算出する。フィルタ更新部135は、この距離が最小になるようにローパスフィルタのパラメータを調整する。なお、距離が最小になるパラメータの探索には、幾つかのパラメータを試行する簡易的な探索方法を用いてもよいし、最急降下法などの最適化アルゴリズムを用いてもよい。
 (S28)フィルタ更新部135は、ローパスフィルタのパラメータを更新する。更新後のパラメータは、ステップS27において距離が最小になるパラメータである。更新後のパラメータは、以降に取得される計測データに対して適用される。
 第2の実施の形態の機械学習装置100によれば、モデル学習時には前処理された訓練データを用いてモデルが学習され、モデル運用時には前処理された入力データがモデルに入力される。これにより、ノイズを含む計測データから予測精度の高いモデルを学習することができ、モデル運用時にもその予測精度を維持することができる。よって、例えば、正常/異常の分類など入力データのクラス分類を高精度に行うことが可能となる。
 また、計測デバイスのハードウェア特性の変化や使用環境の変化によってノイズの傾向が事後的に変化した場合、前処理のパラメータが更新される。よって、前処理された入力データへの影響が抑制され、モデルを再学習しなくても予測精度がモデル学習時と同程度に回復することが期待される。また、モデルを再学習しないため、機械学習の計算量や学習時間などのコストを抑制することが可能となる。また、モデル学習時に訓練データが保存され、前処理された入力データの傾向がモデル学習時の訓練データに近付くように前処理のパラメータが自動的に調整される。よって、過剰なフィルタリングやノイズ除去不足を抑制して適度なフィルタリングが行われ、予測精度が改善する可能性が高くなる。
 上記については単に本発明の原理を示すものである。更に、多数の変形や変更が当業者にとって可能であり、本発明は上記に示し、説明した正確な構成および応用例に限定されるものではなく、対応する全ての変形例および均等物は、添付の請求項およびその均等物による本発明の範囲とみなされる。
 10 データ前処理装置
 11 記憶部
 12 処理部
 13 前処理
 13a パラメータ
 14 モデル
 15,16 計測データ
 16a 教師ラベル
 17 訓練データ
 18 入力データ
 19 予測結果

Claims (7)

  1.  コンピュータが、
     第1の計測データに、パラメータに応じた前処理を実行して訓練データを生成し、
     前記訓練データを用いてモデルを学習し、
     第2の計測データに前記前処理を実行して入力データを生成し、
     前記入力データを前記モデルに入力して予測結果を生成し、前記第2の計測データに対応付けられた教師ラベルと前記予測結果とから予測精度を算出し、
     前記予測精度が閾値未満である場合、前記訓練データと前記第2の計測データから生成される前記入力データとの比較に基づいて、前記前処理の前記パラメータを変更する、
     データ前処理方法。
  2.  前記コンピュータが更に、
     第3の計測データに、変更後の前記パラメータに応じた前記前処理を実行して他の入力データを生成し、前記他の入力データを前記モデルに入力して他の予測結果を生成する、
     請求項1記載のデータ前処理方法。
  3.  前記パラメータは、カットオフ周波数を含み、前記前処理は、前記カットオフ周波数より高い周波数の成分を減少させる低域通過処理を含む、
     請求項1記載のデータ前処理方法。
  4.  前記モデルは、入力された前記入力データと前記訓練データとの間の距離を算出し、前記距離に基づいて前記入力データを正常または異常に分類する分類モデルである、
     請求項1記載のデータ前処理方法。
  5.  前記パラメータの変更では、前記訓練データと前記入力データとの間の距離を算出し、前記距離が小さくなるように前記パラメータを探索する、
     請求項1記載のデータ前処理方法。
  6.  第1の計測データと、訓練データと、モデルと、第2の計測データと、前記第2の計測データに対応付けられた教師ラベルとを記憶する記憶部と、
     前記第1の計測データに、パラメータに応じた前処理を実行して前記訓練データを生成し、前記訓練データを用いて前記モデルを学習し、前記第2の計測データに前記前処理を実行して入力データを生成し、前記入力データを前記モデルに入力して予測結果を生成し、前記教師ラベルと前記予測結果とから予測精度を算出し、前記予測精度が閾値未満である場合、前記訓練データと前記第2の計測データから生成される前記入力データとの比較に基づいて、前記前処理の前記パラメータを変更する処理部と、
     を有するデータ前処理装置。
  7.  コンピュータに、
     第1の計測データに、パラメータに応じた前処理を実行して訓練データを生成し、
     前記訓練データを用いてモデルを学習し、
     第2の計測データに前記前処理を実行して入力データを生成し、
     前記入力データを前記モデルに入力して予測結果を生成し、前記第2の計測データに対応付けられた教師ラベルと前記予測結果とから予測精度を算出し、
     前記予測精度が閾値未満である場合、前記訓練データと前記第2の計測データから生成される前記入力データとの比較に基づいて、前記前処理の前記パラメータを変更する、
     処理を実行させるデータ前処理プログラム。
PCT/JP2019/041466 2019-10-23 2019-10-23 データ前処理方法、データ前処理装置およびデータ前処理プログラム WO2021079425A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2019/041466 WO2021079425A1 (ja) 2019-10-23 2019-10-23 データ前処理方法、データ前処理装置およびデータ前処理プログラム
JP2021553199A JP7273344B2 (ja) 2019-10-23 2019-10-23 データ前処理方法、データ前処理装置およびデータ前処理プログラム
US17/714,555 US20220230076A1 (en) 2019-10-23 2022-04-06 Data processing method and apparatus for machine learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2019/041466 WO2021079425A1 (ja) 2019-10-23 2019-10-23 データ前処理方法、データ前処理装置およびデータ前処理プログラム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/714,555 Continuation US20220230076A1 (en) 2019-10-23 2022-04-06 Data processing method and apparatus for machine learning

Publications (1)

Publication Number Publication Date
WO2021079425A1 true WO2021079425A1 (ja) 2021-04-29

Family

ID=75619979

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/041466 WO2021079425A1 (ja) 2019-10-23 2019-10-23 データ前処理方法、データ前処理装置およびデータ前処理プログラム

Country Status (3)

Country Link
US (1) US20220230076A1 (ja)
JP (1) JP7273344B2 (ja)
WO (1) WO2021079425A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7400856B2 (ja) 2022-03-23 2023-12-19 いすゞ自動車株式会社 モデル作成装置、データ生成装置、モデル作成方法及びデータ生成方法
JP7400855B2 (ja) 2022-03-23 2023-12-19 いすゞ自動車株式会社 モデル作成装置、データ生成装置、モデル作成方法及びデータ生成方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113505805B (zh) * 2021-05-25 2023-10-13 平安银行股份有限公司 样本数据闭环生成方法、装置、设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05342189A (ja) * 1992-06-10 1993-12-24 Adoin Kenkyusho:Kk ネットワーク型情報処理装置の学習システム
JPH10307805A (ja) * 1997-05-09 1998-11-17 Mitsubishi Heavy Ind Ltd 自律進化型システム

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6942472B2 (ja) * 2017-01-13 2021-09-29 キヤノン株式会社 映像認識装置、映像認識方法及びプログラム
JP7182059B2 (ja) * 2018-01-17 2022-12-02 横河電機株式会社 測定値予測モジュール、測定値予測プログラム及び測定値予測方法
JP7059695B2 (ja) * 2018-03-01 2022-04-26 コニカミノルタ株式会社 学習方法および学習装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05342189A (ja) * 1992-06-10 1993-12-24 Adoin Kenkyusho:Kk ネットワーク型情報処理装置の学習システム
JPH10307805A (ja) * 1997-05-09 1998-11-17 Mitsubishi Heavy Ind Ltd 自律進化型システム

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7400856B2 (ja) 2022-03-23 2023-12-19 いすゞ自動車株式会社 モデル作成装置、データ生成装置、モデル作成方法及びデータ生成方法
JP7400855B2 (ja) 2022-03-23 2023-12-19 いすゞ自動車株式会社 モデル作成装置、データ生成装置、モデル作成方法及びデータ生成方法

Also Published As

Publication number Publication date
US20220230076A1 (en) 2022-07-21
JPWO2021079425A1 (ja) 2021-04-29
JP7273344B2 (ja) 2023-05-15

Similar Documents

Publication Publication Date Title
WO2021079425A1 (ja) データ前処理方法、データ前処理装置およびデータ前処理プログラム
US10914608B2 (en) Data analytic engine towards the self-management of complex physical systems
Li et al. Epileptic seizure classification of EEGs using time–frequency analysis based multiscale radial basis functions
JP6697159B2 (ja) 機械学習管理プログラム、機械学習管理装置および機械学習管理方法
US10832698B2 (en) Abnormal sound detection device and abnormal sound detection method
Übeyli ECG beats classification using multiclass support vector machines with error correcting output codes
US20190122078A1 (en) Search method and apparatus
US20170193395A1 (en) Optimizing performance of event detection by sensor data analytics
JP6828807B2 (ja) データ解析装置、データ解析方法およびデータ解析プログラム
US20210272704A1 (en) Condition monitoring device and method
JP2020052740A (ja) 異常検知装置、異常検知方法及びプログラム
Praveena et al. Retracted article: automatic epileptic seizure recognition using relieff feature selection and long short term memory classifier
JP2016128971A (ja) 予兆診断システム及び予兆診断方法
JP7481902B2 (ja) 管理計算機、管理プログラム、及び管理方法
JP2016128973A (ja) 予兆診断システム及び予兆診断方法
CN114563150A (zh) 桥梁健康在线检测模块生成方法、检测方法、工具箱及装置
Buchaca et al. Proactive container auto-scaling for cloud native machine learning services
CN116380445A (zh) 基于振动波形的设备状态诊断方法及相关装置
JP2008146157A (ja) ネットワーク異常判定装置
JP7459924B2 (ja) 画像処理装置、画像認識システム、画像処理方法および画像処理プログラム
CN112016800A (zh) 一种基于有效性指标的特征选择方法与系统
JP2007164346A (ja) 決定木変更方法、異常性判定方法およびプログラム
US20090099821A1 (en) Model-diversity technique for improved proactive fault monitoring
JP5771318B1 (ja) 異常診断装置及び異常診断方法
KR20230096392A (ko) 심장 박동 분류 방법 및 장치, 그리고 심장 박동 분류 모델의 학습 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19949900

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021553199

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19949900

Country of ref document: EP

Kind code of ref document: A1