Embodiments of the present invention relate to a time-series data prediction device, a learning device, an estimation device, a method, and a program.
In order to predict (estimate or infer) geographically and spatially dispersed time-series data, for example, a rainfall amount or a traffic amount, with high accuracy, a spatiotemporal model in which a temporal factor and a spatial factor are simultaneously handled is required.
As a spatiotemporal model, for example, as disclosed in Non Patent Literature 1, there is a model that captures a correlation between data in a temporal direction and a spatial direction.
In addition, as a method of enhancing the resolution of social information, for example, as disclosed in Non Patent Literature 2, there is a method of enhancing the resolution of data having a coarse granularity based on social information data having a plurality of different granularities at a time point.
In a method like that disclosed in Non Patent Literature 1, the space in the spatiotemporal model is regarded as a point, and the time-series data aggregated at each point in the space is predicted, and therefore highly accurate prediction of the time-series data in the region is not realized.
In addition, a method like that disclosed in Non Patent Literature 2 cannot be applied to time-series data.
The present invention has been made in view of the above circumstances, and an object thereof is to provide a time-series data prediction device, a learning device, an estimation device, a method, and a program capable of predicting geographically and spatially dispersed time-series data with high accuracy.
The time-series data prediction device according to an aspect of the present invention is a time-series data prediction device including a first input unit that inputs geographically and spatially dispersed first time-series data, a second input unit that inputs first region data indicating a geographical region, the first region data being related to the first time-series data input by the first input unit, an initialization unit that performs initialization processing of a first spatial factor and a first temporal factor by decomposing the first time-series data input by the first input unit into the first spatial factor that is a spatial factor indicating a space related to the first time-series data and the first temporal factor that is a temporal factor indicating a time related to the first time-series data, an acquisition unit that acquires a second spatial factor that is a spatial factor related to an entire space, acquires a parameter of a spatial model that inputs the first spatial factor and the first region data and outputs a second spatial factor obtained by adding the first region data to the first spatial factor, and acquires a parameter of a temporal model that inputs the first temporal factor and outputs a future temporal factor, a first update unit that updates the first spatial factor initialized by the initialization unit, the first temporal factor initialized by the initialization unit, and the second spatial factor acquired by the acquisition unit based on a loss function of the first time-series data, a loss function of the spatial model, and a loss function of the temporal model, updates a parameter of the spatial model based on the loss function of the spatial model, and updates the parameter of the temporal model based on the loss function of the temporal model, a third input unit that inputs geographically and spatially dispersed second time-series data to be estimated for future time-series data, a fourth input unit that inputs second region data indicating a geographical region, the second region data being related to the second time-series data input by the third input unit, a second initialization unit that performs initialization processing of a third spatial factor and a second temporal factor by decomposing the second time-series data input by the third input unit into the third spatial factor that is the spatial factor indicating a space related to the second time-series data and the second temporal factor that is a temporal factor indicating a time related to the second time-series data, a second acquisition unit that acquires a fourth spatial factor related to the second time-series data, the fourth spatial factor being a spatial factor related to an entire space, a second update unit that updates (1) the initialized third spatial factor, (2) the initialized second temporal factor, and (3) the acquired fourth spatial factor based on a loss function of the second time-series data, a loss function of the spatial model based on a parameter of the spatial model updated by the first update unit and the second spatial factor updated by the first update unit, and a loss function of the temporal model based on a parameter of the temporal model updated by the first update unit, and an estimation unit that predicts a future temporal factor based on a result updated by the second update unit and estimates the future time-series data based on the predicted temporal factor and the third spatial factor updated by the second update unit.
The learning device according to an aspect of the present invention is a learning device including a first input unit that inputs geographically and spatially dispersed first time-series data, a second input unit that inputs first region data indicating a geographical region, the first region data being related to the first time-series data input by the first input unit, an initialization unit that performs initialization processing of the first spatial factor and the first temporal factor by decomposing the first time-series data input by the first input unit into a first spatial factor that is a spatial factor indicating a space related to the first time-series data and a first temporal factor that is a temporal factor indicating a time related to the first time-series data, an acquisition unit that acquires a second spatial factor that is a spatial factor related to an entire space, acquires a parameter of a spatial model that inputs the first spatial factor and the first region data and outputs a second spatial factor obtained by adding the first region data to the first spatial factor, and acquires a parameter of a temporal model that inputs the first temporal factor and outputs a future temporal factor, and an update unit that updates the first spatial factor initialized by the initialization unit, the first temporal factor initialized by the initialization unit, and the second spatial factor acquired by the acquisition unit based on a loss function of the first time-series data, a loss function of the spatial model, and a loss function of the temporal model, updates a parameter of the spatial model based on a loss function of the spatial model, and performs learning processing of updating a parameter of the temporal model based on a loss function of the temporal model.
The time-series data prediction method according to an aspect of the present invention is a time-series data prediction method performed by a time-series data prediction device, the time-series data prediction method including inputting geographically and spatially dispersed first time-series data, inputting first region data indicating a geographical region, the first region data being related to the input first time-series data, performing first initialization that is initialization of a first spatial factor and a first temporal factor by decomposing the input first time-series data input into the first spatial factor that is a spatial factor indicating a space related to the first time-series data and the first temporal factor that is a temporal factor indicating a time related to the first time-series data, acquiring a second spatial factor that is a spatial factor related to an entire space, acquiring a parameter of a spatial model that inputs the first spatial factor and the first region data and outputs a second spatial factor obtained by adding the first region data to the first spatial factor, and acquiring a parameter of a temporal model that inputs the first temporal factor and outputs a future temporal factor, updating the initialized first spatial factor, the initialized first temporal factor, and the acquired second spatial factor based on a loss function of the first time-series data, a loss function of the spatial model, and a loss function of the temporal model, updating a parameter of the spatial model based on the loss function of the spatial model, and updating the parameter of the temporal model based on the loss function of the temporal model, inputting geographically and spatially dispersed second time-series data to be estimated for future time-series data, inputting second region data indicating a geographical region, the second region data being related to the second time-series data, performing second initialization that is initialization of a third spatial factor and a second temporal factor by decomposing the second time-series data into the third spatial factor that is the spatial factor indicating a space related to the second time-series data and the second temporal factor that is a temporal factor indicating a time related to the second time-series data, acquiring a fourth spatial factor related to the second time-series data, the fourth spatial factor being a spatial factor related to an entire space, updating (1) the initialized third spatial factor, (2) the initialized second temporal factor, and (3) the acquired fourth spatial factor based on a loss function of the second time-series data, a loss function of the spatial model based on a parameter of the updated spatial model and the updated second spatial factor, and a loss function of the temporal model based on a parameter of the updated temporal model, and predicting a future temporal factor based on a result updated and estimating the future time-series data based on the predicted temporal factor and the updated third spatial factor.
According to the present invention, geographically and spatially dispersed time-series data can be predicted with high accuracy.
An embodiment according to the present invention will be described below with reference to the drawings.
In a time-series data prediction device according to an embodiment of the present invention, a model that performs planar estimation for each designated region is newly introduced into a module that handles a spatial factor in a spatiotemporal model, and time-series data in an arbitrary designated region can be predicted.
As a result, it is possible to predict time-series data having spatially different aggregation granularity with high accuracy. In addition, even if the number, aggregation range, or the like of sensors corresponding to input data is changed due to a change in the system or the like, the trained (learned) model can be reused.
A temporal factor and a spatial factor are obtained as data in which the spatiotemporal data is decomposed into a temporal direction and a spatial direction. In the above planar estimation in the present embodiment, the background spatial factor, which is a spatial factor distributed in the entire space, that is, related to the entire space, is trained without depending on the division of each region.
At the time of inference after training, the time-series data prediction device aggregates the spatial factor of each region by surface-integrating the background spatial factor according to a designated region.
As an application example of the present embodiment, the time-series data prediction device inputs time-series data indicating a transition of the number of passengers of a taxi counted at a specific point in an area having a finer spatial granularity to a model trained from time-series data indicating a transition of the number of passengers of the taxi counted in each area, for example, and predicts the future of the number of passengers of the taxi at this point. As a result, the time-series data in the region on the space is predicted.
In the present embodiment, a mechanism for performing spatial aggregation in a spatial model included in a spatiotemporal model is introduced. In the present embodiment, the background spatial factor distributed on the map is trained instead of the spatial factor corresponding to the point where the time-series data is aggregated. By aggregating the trained background spatial factors in a specified region, time-series prediction according to the region is possible. As a result, it is possible to analyze time-series data in a designated arbitrary region.
In the present embodiment, time-series data of geographically dispersed sensor data or social information is associated on a map, so that time-series prediction with a spatial granularity different from that at the time of training the model can be performed.
As illustrated in
The training unit 10 includes a time-series data storage unit 11, a time-series data input unit 12, a spatial/temporal factor initialization unit 13, a region data storage unit 14, a region data input unit 15, a spatial/temporal factor update unit 16, and a parameter storage unit 17.
The inference unit 20 includes a time-series data storage unit 21, a time-series data input unit 22, a region data storage unit 23, a region data input unit 24, a spatial/temporal factor calculation unit 25, a spatial/temporal factor synthesis unit 26, and a future time-series data storage unit 27. Processing and the like of each unit will be described later. Furthermore, the training unit 10 and the inference unit 20 in the time-series data prediction device 100 may be separate devices, for example, a training device (also referred to as a learning device) and an inference device (also referred to as a prediction device or an estimation device).
Here, the number of passengers per hour of a taxi in each area is shown. In
The time-series data of the number of passengers in a taxi in the area A can indicate that a total value of the number of passengers in a taxi in a predetermined time zone, for example, a total value of the number of passengers in a taxi between 10:00 and 11:00 in the area A, is 10 people.
Here, a spatiotemporal model used at the time of inference of the time-series data is illustrated.
In the spatiotemporal model, time-series data of the past one day for each area is input, and the time-series data is decomposed into a spatial factor and a temporal factor by spatiotemporal decomposition.
The temporal factor is input to a temporal model included in the spatiotemporal model, and a future temporal factor is output from the temporal model.
In addition, the spatial factor is input together with the map data to the spatial model included in the spatiotemporal model, and the spatial factor to which the map information is added is output from the spatial model.
The output result from the temporal model and the output result from the spatial model are converted into the time-series data for the next day in each area by spatiotemporal synthesis and output from the spatiotemporal model.
Next, details of input and output in the spatial model will be described. Here, in order to facilitate understanding of an embodiment of the present invention, input/output in a conventionally used general spatial model and input/output in a spatial model according to an embodiment of the present invention will be described.
First, input/output in a conventionally used general spatial model will be described.
Here, existing Directed autoregressive (DAR) is used. This technique is a technique of performing autoregression on a spatial factor corresponding to an input point.
In the example illustrated in
In
From the autoregressive model of the spatial model, the spatial factor for each point to which the map information is added is output.
Then, in the autoregressive model, the weights related to the distance and the angle are trained by autoregression so that input and output in the autoregressive model become equal.
Here, the above-described DAR is used.
In the example illustrated in
From the autoregressive model, the spatial factor for each point to which the map information is added is output.
Next, input and output in the spatial model according to an embodiment of the present invention will be described.
Here, spatially aggregated autoregressive regularization (SAAR) different from the conventional technique is used. This technique is a technique of calculating a spatial factor for each region by performing autoregression on a background spatial factor of the entire space and aggregating the background spatial factors.
The conventional DAR and the SAAR according to an embodiment of the present invention are different in processing inside the spatial model. In an embodiment of the present invention, a background spatial factor that is independent of region division is introduced to perform inference on any region.
In the example illustrated in
The output result from the autoregressive model of the spatial model is input to the spatial aggregation model of the spatial model together with the map data. In this map data, region information on the map in the region of the map data is indicated.
From the spatial aggregation model of the spatial model, the spatial factor for each region to which the map information is added is output as an output result of the entire spatial model by spatial aggregation, here, aggregation of the spatial factor of each region by the surface integral along the designated region.
Based on the output result, in the above autoregressive model, the weights of the background spatial factors are trained by autoregression so that input and output in the autoregressive model become equal. As a result, the background spatial factor to which the map information is added is output from the autoregressive model and input to the spatial aggregation model. In the above autoregressive model, the background spatial factor is trained such that the position information of the background spatial factor is equal to the position information of each point on the map data.
Here, the above-described SAAR is used.
In the example illustrated in
From the spatial aggregation model of the spatial model, a spatial factor for each designated region to which map information is added is output as an output result of the entire spatial model by spatial aggregation. Here, the designated region does not depend on the division result of the region at the time of training.
Next, comparison between input/output data at the time of training and input/output data at the time of inference in the spatial model will be described.
In
The subdivision refers to, for example, that the division of the area at the time of training is a commercial area, whereas the division of the area at the time of inference is subdivided from, for example, an area around a shopping mall having a finer spatial granularity than the commercial area to a division of the area according to each periphery of a supermarket. Such a correspondence relationship between the area before the change and the area after the change is not obvious.
In the example illustrated in
In an embodiment of the present invention, as described above, even when the area to be aggregated of the time-series data is changed, the future time-series data in the area after the change can be predicted.
Next, an example by the time-series data prediction device according to an embodiment of the present invention will be described.
This set of time-series data is assumed to be taxi passenger count data for each area in the City of New York.
In addition, in this embodiment, the prediction accuracy when each of the evaluation models corresponding to the following (1), (2), and (3) is used is compared.
An evaluation method in this embodiment will be described.
The spatial granularity at the time of training the spatial model, the period from the input of the time-series data to the output of the prediction result, the input date and time, and the output date and time are as follows.
Space particle size: 8 (Borough)
Period from input to output: Jun. 1-Jun. 9, 2019
Input date and time: Jun. 1, 2019-Jun. 8, 2019, Output date and time: Jun. 9, 2019
The spatial granularity, the period from input to output, the input date and time, and the output date and time at the time of inference evaluation by the spatial model are as follows.
Space particle size: 256 (aggregation section)
Period from input to output: Jun. 14-Jun. 22, 2019
Input date and time: Jun. 14, 2019, Output date and time: Jun. 15, 2019 . . . . Input date and time: Jun. 21, 2019, Output date and time: Jun. 22, 2019
Here, seven times of input and output are performed.
In addition, it is assumed that 128 sections randomly selected in the input data are missing.
In the example illustrated in
This normalized deviation (ND) is an evaluation index of prediction of time-series data, and the lower this value, the better the prediction accuracy. In addition, here, the standard deviation (SD) is a standard deviation of the normalized deviation (ND) in the seven times of input/output.
The example illustrated in
Normalized deviation (ND) is expressed by Equation (1) below.
The expression
ŷ
i [Math. 2]
in Equation (1) is the predicted value of the time-series data, and yi is the observed value (input value) of the time-series data.
In addition, the Standard deviation (SD) is expressed by Equation (2) below.
d in this Equation (2) is a variable from the first time to the seventh time of the seven times.
Next, an example of a processing algorithm by the training unit 10 of the time-series data prediction device 100 will be described.
Various input data in the training unit 10 are the following (a) to (f). The initial values of the rank, the background spatial factor, and the parameters of the various models, which are (b) and (d) to (f) below, may be given from the outside, or may be stored in advance in the parameter storage unit 17 in the time-series data prediction device 100 or another storage device (not illustrated) in the device.
Y∈
L×T [Math. 4]
R∈
[Math. 5]
A∈
L×W×H [Math. 6]
X∈
R×W×H [Math. 7]
L in the notation of the time-series data and the like means the above region, for example, an area where the number of passengers in a taxi is counted, and T in the notation of the time-series data and the like means time. The right side of the notation of the time-series data is a set of real numbers over the above region and time.
W of the region data or the like means the width of the region, and H of the region data or the like means the height of the region. The right side of the notation of the region data is a set of real numbers over the region, width, and height.
The time-series data is stored in the time-series data storage unit 11 and acquired by the time-series data input unit 12. The region data is stored in the region data storage unit 14 and acquired by the region data input unit 15.
In addition, various output data, which are data after training for the input data in the training unit 10, are the parameter θS of the spatial model, the parameter θT of the temporal model, and a background spatial factor X. Here, the spatial model is a model that inputs a spatial factor and region data and outputs a background spatial factor to which the region data is added, and the temporal model is a model that inputs a temporal factor and outputs a future temporal factor.
The training unit 10 performs the following processing of (1) to (4) so that the output data can be obtained for the input data. However, the processing of (2) to (4) is repeated by a predetermined number of epoch.
Y=U
1
·U
2 Equation (3)
F [Math. 8]
of the matrix decomposition of the time-series data, the loss function of
S [Math. 9]
of the spatial model, and the loss function of
T [Math. 10]
of the temporal model.
The left side of Equation (4) corresponds to the entire loss function, the first term of the right side of Equation (4) corresponds to the loss function of the matrix decomposition of the time-series data, the second term of the right side of Equation (4) corresponds to the loss function of the spatial model, and the third term of the right side of Equation (4) corresponds to the loss function of the temporal model.
The below expression of the first term on the right side of Equation (4) corresponds to future time-series data:
Ŷ [Math. 12]
In addition, τS of the second term on the right side of Equation (4) corresponds to the autoregressive model in the spatial model, and τT of the third term on the right side of Equation (4) corresponds to the autoregressive model in the temporal model.
The spatial model “τS (X, A, ΘS)” of the above Equation (7) can be expressed by Equation (8) below. τ's in Equation (8) is an autoregressive model in the spatial model, and may be the same model as the above τS. Further, [Math. 14] in Equation (8) is the future background spatial factor.
{circumflex over (X)} [Math. 14]
In addition, l, w, h, and r in Equation (8) correspond to L, W, H, and R described above.
Next, an example of a processing algorithm by the inference unit 20 of the time-series data prediction device 100 will be described.
The various input data in the inference unit 20 are (a) geographically and spatially dispersed time-series data that is an estimation target of future time-series data, (b) a rank of a tensor in a natural number, (c) region data indicating a region on a map related to the corresponding time-series data, (d) an initial value of a background spatial factor that is a spatial factor related to the entire space related to the corresponding time-series data, (e) a parameter of a spatial model, and (f) a parameter of a temporal model. The initial value of the background spatial factor, the parameter of the spatial model, and the initial value of the parameter of the temporal model are parameters trained by the training unit 10 and stored in the parameter storage unit 17.
The time-series data is stored in the time-series data storage unit 21 and acquired by the time-series data input unit 22. The region data is stored in the region data storage unit 23 and acquired by the region data input unit 24.
Further, the output data in the inference unit 20 is future time-series data.
Ŷ∈
L′×T′ [Math. 17]
The above expression is established. This L′ means a region different from that at the time of processing by the training unit 10, and T′ means a time different from that at the time of processing by the training unit 10.
The inference unit 20 performs the following processing of (1) to (5) so that the output data can be obtained for the input data. The processing of (3) by the inference unit 20 is repeated for a predetermined number of epochs.
(1) The spatial/temporal factor calculation unit 25 of the inference unit 20 performs initialization processing of the spatial factor U1 and the temporal factor U2 by CP decomposing the time-series data Y acquired by the time-series data input unit 22 into the spatial factor U1 and the temporal factor U2 as in Equation (3) above.
(2) Upon receiving the result of the CP decomposition in the above (1), the spatial/temporal factor calculation unit 25 performs the following process (3) to perform tensor decomposition on the time-series data Y to calculate the spatial factor U1 and the temporal factor U2. By the processing of (2), the spatial factor for each region to which the region data is added can be calculated.
(3) Similarly to the above (2) of the processing by the training unit 10, the spatial/temporal factor calculation unit 25 updates the spatial factor U1, the temporal factor U2, and the background spatial factor X, respectively, based on the loss function of the matrix decomposition, the loss function of the spatial model, and the loss function of the temporal model, according to Equation (4), (5), and (6) above.
The loss function of the spatial model used in the above (3) in the inference unit 20 is a loss function using the parameters of the spatial model and the background spatial factor stored in the parameter storage unit 17 of the training unit 10, and the loss function of the temporal model used in the above (3) in the inference unit 20 is a loss function using the parameters of the temporal model stored in the parameter storage unit 17 of the training unit 10.
(4) After the update by the above (3) is completed, the spatial/temporal factor calculation unit 25 predicts a future temporal factor from the temporal model “τT(X,A,ΘT)” according to Equation (10) below. The future temporal factor corresponds to the left side of Equation (10).
[Math. 18]
Û
2=τT(U2,ΘT) Equation (10)
(5) The spatial/temporal factor synthesis unit 26 calculates future time-series data according to Equation (11) below from the spatial factor U1 updated up to the above (3) in the inference unit 20 and the future temporal factor U2 calculated in the above (4) in the inference unit 20, and stores the calculated time-series data in the future time-series data storage unit 27. The future time-series data corresponds to the left side of Equation (11). As described above, the processing by the Inference unit 20 of the time-series data prediction device 100 ends.
[Math. 19]
Ŷ=U
1
·Û
2 Equation (11)
In the example illustrated in
The communication interface 114 includes, for example, one or more wireless communication interface units, and enables transmission and reception of information to and from the communication network NW. As the wireless interface, for example, an interface employing a low-power wireless data communication standard such as a wireless local area network (LAN) is used.
An input device 200 (device) and an output device 300 for an operator attached to the time-series data prediction device 100 are connected to the input/output interface 113.
The input/output interface 113 performs processing of fetching operation data input by an operator through the input device 200 such as a keyboard, a touch panel, a touchpad, or a mouse, and outputting output data to the output device 300 including a display device using liquid crystal, organic electro-luminescence (EL), or the like to display the output data. Note that, as the input device 200 and the output device 300, a device built in the time-series data prediction device 100 may be used, and an input device and an output device of another information terminal that can communicate with the time-series data prediction device 100 via a network NW may be used.
A program memory 111B is used as a non-transitory tangible storage medium, for example, in a combination of non-volatile memory enabling writing and reading at any time, such as a hard disk drive (HDD) or a solid state drive (SSD), and non-volatile memory such as read only memory (ROM), and stores programs necessary for executing various control processing according to an embodiment.
The data memory 112 is used as a tangible storage medium, for example, in a combination of the non-volatile memory described above and volatile memory such as random access memory (RAM), and is used to store various types of data acquired and created in the process of performing various types of processing.
The time-series data prediction device 100 according to an embodiment of the present invention can be configured as a data processing device including, as processing function units by software, the time-series data input unit 12, the spatial/temporal factor initialization unit 13, the region data input unit 15, and the spatial/temporal factor update unit 16 in the training unit 10 illustrated in
The time-series data storage unit 11, the region data storage unit 14, and the parameter storage unit 17 in the training unit 10, and the time-series data storage unit 21, the region data storage unit 23, and the future time-series data storage unit 27 in the inference unit 20 can be configured by using the data memory 112 illustrated in
All of the processing function units in the time-series data input unit 12, the spatial/temporal factor initialization unit 13, the region data input unit 15, and the spatial/temporal factor update unit 16 in the training unit 10, and the time-series data input unit 22, the region data input unit 24, the spatial/temporal factor calculation unit 25, and the spatial/temporal factor synthesis unit 26 in the inference unit 20 can be realized by causing the hardware processor 111A to read and execute the program stored in the program memory 111B. Note that some or all of these processing function units may be implemented in other various forms including an integrated circuit such as an application specific integrated circuit (ASIC) or a field-programmable gate array (FPGA).
In addition, the method described in each embodiment can be stored in a recording medium such as a magnetic disk (Floppy (registered trademark) disk, hard disk, and the like), an optical disc (CD-ROM, DVD, MO, and the like), or a semiconductor memory (ROM, RAM, flash memory, and the like) as a program (software means) that can be executed by a computer, and can be distributed by being transmitted through a communication medium. Note that the programs stored on the medium side also include a setting program for configuring, in the computer, a software means (including not only an execution program but also tables and data structures) to be executed by the computer. The computer that realizes the present device executes the above-described processing by reading the programs recorded in the recording medium, constructing the software means by the setting program as needed, and controlling the operation by the software means. Note that the recording medium described in the present specification is not limited to a recording medium for distribution, but includes a storage medium such as a magnetic disk or a semiconductor memory provided in the computer or in a device connected via a network.
Note that the present invention is not limited to the foregoing embodiments and various modifications can be made in the implementation stage without departing from the gist of the invention. In addition, each embodiment may be implemented in appropriate combination, and in that case, combined effects can be obtained. Furthermore, the embodiment described above includes various inventions, and various inventions can be extracted by a combination selected from a plurality of disclosed components. For example, even if some components are deleted from all the components described in the embodiment, in a case where the problem can be solved and the effects can be obtained, a configuration from which the components are deleted can be extracted as an invention.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2021/000034 | 1/4/2021 | WO |