# Patent

## Title
Embedding multi-modal time series and text data

## Abstract

Methods and systems of training and using a neural network model include training a time series embedding model and a text embedding model with unsupervised clustering to translate time series and text, respectively, to a shared latent space. The time series embedding model and the text embedding model are further trained using semi-supervised clustering that samples training data pairs of time series information and associated text for annotation.

## Background
RELATED APPLICATION INFORMATION
This application claims priority to 63/050,962, filed on Jul. 13, 2020, incorporated herein by reference in its entirety.


BACKGROUND
Technical Field
The present invention relates to machine learning with time series data, and, more particularly, to learning correspondences between time series information and textual descriptions.
Description of the Related Art
Time series information from sensors can be used to identify abnormal behavior in a system. However, this information may be difficult to comprehend for a human operator.
SUMMARY
A method for training a neural network includes training a time series embedding model and a text embedding model with unsupervised clustering to translate time series and text, respectively, to a shared latent space. The time series embedding model and the text embedding model are further trained using semi-supervised clustering that samples training data pairs of time series information and associated text for annotation.
A method for querying a time series database includes transforming a query to an embedded vector in a multi-modal shared latent space that encodes time series information and textual information. A feature vector is identified in the multi-modal shared latent space, stored in a time series dataspace, that matches the embedded vector, and that is associated with a data type complementary to the query. Data associated with the identified feature vector is returned, responsive to the query.
A system for training a neural network includes a hardware processor and a memory that stores a computer program product. When executed by the hardware processor, the computer program product causes the hardware processor to train a time series embedding model and a text embedding model using unsupervised clustering to translate time series and text, respectively, to a multi-modal shared latent space; to train the time series embedding model and the text embedding model further using semi-supervised clustering that samples training data pairs of time series information and associated text for annotation; to transform a query to an embedded vector in the multi-modal shared latent space that encodes time series information and textual information; to identify a feature vector in the multi-modal shared latent space, stored in a time series dataspace, that matches the embedded vector, and that is associated with a data type complementary to the query; and to return data associated with the identified feature vector, responsive to the query.
These and other features and advantages will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.



BRIEF DESCRIPTION OF DRAWINGS
The disclosure will provide details in the following description of preferred embodiments with reference to the following figures wherein:
FIG. 1 is a diagram of a cyber-physical system that includes sensors, generating time series data which can be used to classify the behavior of the cyber-physical system, in accordance with an embodiment of the present invention;
FIG. 2 is a diagram showing the relationship between a time series embedding model, a text embedding model, and a shared latent space, in accordance with an embodiment of the present invention;
FIG. 3 is a block/flow diagram of a method for training, deploying, and using a set of embedding models for a shared latent space, in accordance with an embodiment of the present invention;
FIG. 4 is a block/flow diagram of a method for performing a query task using time series information and associated text information in a shared latent space, in accordance with an embodiment of the present invention;
FIG. 5 is a block/flow diagram of a method for performing a query task using time series information and associated text information in a shared latent space, in accordance with an embodiment of the present invention;
FIG. 6 is a block/flow diagram of a method for training embedding models for a shared latent space, in accordance with an embodiment of the present invention;
FIG. 7 is a block/flow diagram of a method for semi-supervised clustering using adaptive sampling to select training data pairs for annotation, in accordance with an embodiment of the present invention;
FIG. 8 is a block/flow diagram of a method for semi-supervised learning, in accordance with an embodiment of the present invention; and
FIG. 9 is a block diagram of a time series analysis and maintenance system, in accordance with an embodiment of the present invention.



DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS
Time series information can be generated by sensors in a cyber-physical system, and can represent large amounts of data. Using machine learning, this time series information can be used to identify normal and abnormal behavior of the system. However, while time series provides a rich source of information about the functioning of the system, it is not generally directly interpretable by human operators.
In addition to the time series information that can be accumulated, human operators may generate textual descriptions of the operation of the system. For example, when something goes wrong (e.g., during abnormal behavior of the system), a human operator may address the problem and generate textual information that describes the problem and its solution. This textual information may then be associated with the time series information, for example by identifying a correspondence between the two kinds of data in a training dataset.
By training a machine learning model using this multi-modal training dataset, the model may be used to provide a textual description of identified abnormality. In this manner, a system can automatically explain the state of the system, based on measured time series information. In addition, the relationship between text and time series can be used to provide text searches of time series information, with a natural language query being used to identify associated time series segments.
Referring now in detail to the figures in which like numerals represent the same or similar elements and initially to FIG. 1, a time series analysis and maintenance system 106 in the context of a monitored system 102 is shown. The monitored system 102 can be any appropriate system, including physical systems such as manufacturing lines and physical plant operations, electronic systems such as computers or other computerized devices, software systems such as operating systems and applications, and cyber-physical systems that combine physical systems with electronic systems and/or software systems.
One or more sensors 104 record information about the state of the monitored system 102. The sensors 104 can be any appropriate type of sensor including, for example, physical sensors, such as temperature, humidity, vibration, pressure, voltage, current, magnetic field, electrical field, and light sensors, and software sensors, such as logging utilities installed on a computer system to record information regarding the state and behavior of the operating system and applications running on the computer system. The information generated by the sensors 104 can be in any appropriate format and can include sensor log information generated with heterogeneous formats. In some cases, the sensors 104 may be software programs that monitor the state of a computer system and generate logging information.
In particular embodiments, the sensor data 104 can also include a KPI measurement. In some embodiments, the KPI measurement may be the result of an inspection of a physical output of the monitored system 102, or can represent a determination of a quality of the physical output by any appropriate measurement or characteristic.
The sensors 104 may transmit the logged sensor information to an anomaly maintenance system 106 by any appropriate communications medium and protocol, including wireless and wired communications. The maintenance system 106 can, for example, identify abnormal behavior by monitoring the multivariate time series that are generated by the sensors 104. Once anomalous behavior has been detected, the maintenance system 106 communicates with a system control unit to alter one or more parameters of the monitored system 102 to correct the anomalous behavior. Exemplary corrective actions include changing a security setting for an application or hardware component, changing an operational parameter of an application or hardware component (for example, an operating speed), halting and/or restarting an application, halting and/or rebooting a hardware component, changing an environmental condition, changing a network interface's status or settings, etc. The maintenance system 106 thereby automatically corrects or mitigates the anomalous behavior. By identifying the particular sensors 104 that are associated with the anomalous classification, the amount of time needed to isolate a problem can be decreased.
For example, the monitored system 102 may be a power plant, with sensors 104 being deployed at various positions within the facility, each collecting time series data that characterizes the status of the power generation process. The time series data is transmitted to the maintenance system 106, which can identify when the time series data indicates abnormal operation.
Over the course of time, the time series information that is collected by the sensors 104 may be annotated by domain experts. For example, after a system failure, an operator may write notes describing characteristics of the time series signal, causes, solutions, and expected future states. Such information may include references to particular segments of time series data, for example identifying particular sensors 104 during particular periods of time. Large amounts of such information may be accumulated during the normal operation and maintenance of the system. This information may form the basis of a multimodal training dataset that fuses time series information and descriptive text information.
To accomplish this, the time series segments and the text comments may be transformed into points in a common latent space, such that examples of the same class and examples in the same series/text pair are close together in the latent space. Cross-modal retrieval may be performed by finding nearest neighbors of a query in this common space. Concept discovery may be performed by clustering data points in the latent space. In this manner, human-sourced knowledge may guide the learning, while manual labeling can be reduced without sacrificing performance.
Referring now to FIG. 2, a process for embedding multi-modal training data is shown. Two types of data are shown, in this example including time series data 202 and textual data 204. In some examples, the textual data 204 may be entered by a human operator to describe the time series data 202.
A time series embedding model 206 is trained to convert the input time series 202 to a vector in a shared latent space 210. A text embedding model 208 is similarly trained to convert the input textual data 204 to a vector in the same shared latent space 210. By training the respective models to embed associated textual data 204 and time series data 202 similarly, the shared latent space 210 can subsequently be used to identify textual descriptions on the basis of time series information and to identify time series information on the basis of textual descriptions.
To build on the relatively noisy structure that can be obtained from clustering by adjacency in the shared latent space 210, semi-supervised clustering with limited label data can be used, with adaptive sampling of the next most informative examples to query annotators for further input. Based on estimated clustering, the representation may be further improved by supervised techniques, increasing the margins between estimated clusters.
Referring now to FIG. 3, a method for performing a task using time series is shown. Block 302 collects time series data from the sensors 104. This information may or may not include annotations by human operators. Block 304 then trains the embedding models 206 and 208. The training may, as described in greater detail below, include an unsupervised stage and a semi-supervised stage. The unsupervised stage may train a set of encoders to produce reasonable representations of input time series information and textual data without the benefit of class labels. The semi-supervised stage may alternate between querying pair-relations from human operators and semi-supervised representation learning.
Two exemplary adaptive sampling strategies are described below for sampling during the training. A first strategy minimizes a Bayesian risk, while a second strategy maximizes uncertainty. During learning, a combination of a margin-based loss and deep canonical correlation analysis (CCA) regularization is minimized.
Block 306 performs a task using the trained models. For example, such a task may include natural language querying to identify matching time series data segments. Such queries may optionally also use an exemplary time series segment. Another task may include using a time series segment as a query and generating a natural language explanation in response. Queries may be searched within the shared latent space 210 using a nearest neighbor-based retrieval.
Referring now to FIG. 4, additional detail on an exemplary task of block 306 is shown, where a database of stored time series segments is searched. Block 402 receives a query that may include natural text and may also include an example time series segment. For example, an operator may compose a query based on recent operational data from the sensors 104 and may describe the operational state of the system 102, to obtain corresponding historical time series information.
Block 404 embeds the query in the shared latent space 210. For a text-only query, the text embedding model 208 may be used alone. For a combined text/time series query, both the text embedding model 208 and the time series embedding model 206 may be both be used to generate respective vectors within the shared latent space 210. Block 406 identifies one or more matches within the shared latent space, for example by identifying the nearest neighbors to the embedded query vector(s). Block 408 then returns one or more of the matching time series, for example a nearest neighbor.
Referring now to FIG. 5, additional detail on an exemplary task of block 306 is shown, where a database of stored time series segments is searched. Block 502 receives a query that may include an example time series segment. For example, an operator may submit a time series that represents the operation of the system 102, to obtain a textual explanation of the current state of the system 102.
Block 504 embeds the query in the shared latent space 210, for example using the time series embedding model 206, to generate a vector within the shared latent space 210. Block 506 identifies one or more matches within the shared latent space 210, for example by identifying the nearest neighbors to the embedded query vector. Block 508 then returns one or more matching texts, such as a nearest neighbor. These texts are provided to the operator to explain the query time series segment.
Referring now to FIG. 6, additional detail on the training of block 304 is shown, including an unsupervised training stage 602 and a semi-supervised clustering stage 604. Training 304 uses a dataset of paired data, where each pair includes a time series segment and a text comment (e.g., one to three sentences). The number of data pairs is indicated here in as n, and the ith data pair is indicated by (x(i), y(i)), where x(i) is the ith time series segment (alternatively written as xi) and where y(i) is the ith text comment (alternatively written as yi). Each pair may be associated with a class label c(i) ∈[1, . . . , C], which may not be known at the beginning of training. For example, in the context of financial data, the class label may indicate chart patterns such as “ascending triangle” or “descending channel.”
Training 304 determines parameters for the time series embedding model 206 (indicated herein as f) and the text embedding model 208 (indicated herein as g). The time series encoder f takes a time series segment as input and outputs a feature vector, with a feature vector of the ith time series being indicated by h1(i)=f(x(i)). The time series embedding model 206 may be implemented as an encoder, for example trained as a first part of an autoencoder neural network. Another exemplary architecture of the time series embedding model 206 may include dilated convolution layers, or a temporal convolution net. Any appropriate architecture may be selected for the time series embedding model 206 to convert a multivariate time series to a feature vector.
Similarly, the text encoder g takes a tokenized text comment as input and outputs a feature vector. The feature vector of the ith text example is indicated herein as h2(i)=g(y(i)). The text embedding model 208 may be implemented as an encoder, for example trained as a first part of an autoencoder neural network. Another exemplary architecture for the text embedding model 208 may include a series of convolutional layers, followed by a transformer network. The convolutional layers capture local context, such as multi-word phrases, while the transformer network encodes longer-term dependencies in the sequence. The time series feature matrix is indicated herein as HX∈n×d1 and the text feature matrix is indicated herein as HY∈n×d2, where the ith row of each is h1(i) and h2(i), respectively.
During the unsupervised training stage 602, the encoders are trained in an unsupervised manner, for example using deep CCA. After that, the semi-supervised clustering stage 604 may train the encoders further using a semi-supervised loss, based on class equivalence constraints provided by a human operator to a relatively small set of data pairs.
During unsupervised training 602, the weights of the time series embedding model 206 and the text embedding model 208 may be initialized, for example setting all values to zero or setting the values randomly. Time series segments and text comments from the data pairs are then passed through the respective time series embedding model 206 and the text embedding model 208 to obtain feature vectors. Covariance matrices may then be determined as:



 
  
   
    ∑
    XX
   
   
    =
    
     
      
       
        H
        X
        T
       
       ⁢
       
        H
        X
       
      
      
       n
       -
       1
      
     
     +
     
      
       r
       1
      
      ⁢
      I
     
    
   
  
  ⁢
  

  
   
    ∑
    YY
   
   
    =
    
     
      
       
        H
        Y
        T
       
       ⁢
       
        H
        Y
       
      
      
       n
       -
       1
      
     
     +
     
      
       r
       2
      
      ⁢
      I
     
    
   
  
  ⁢
  

  
   
    ∑
    XY
   
   
    =
    
     
      1
      
       n
       -
       1
      
     
     ⁢
     
      H
      X
      T
     
     ⁢
     
      H
      Y
     
    
   
  
 



where r1 and r2 are hyperparameters, for example valued at 0.1.

The covariance matrix S may then be determined as:



 
  S
  =
  
   
    ∑
    XX
    
     -
     
      1
      2
     
    
   
   
    
     ∑
     XY
      
    
    
     ∑
     YY
     
      -
      
       1
       2
      
     
    
   
  
 



A singular value decomposition may then be performed on S as:

U,Λ,VT=SVD(S)

where U is a d1×d1 orthogonal matrix, Λ is a d1×d2 diagonal matrix, and VT is the transpose of a d2×d2 orthogonal matrix generated as outputs of the singular value decomposition.

A total correlation may be determined by summing all singular values, which are diagonal elements of Λ:



 
  c
  =
  
   
    ∑
    
     i
     =
     1
    
    
     min
     (
     
      
       d
       1
      
      ,
      
       d
       2
      
     
     )
    
   
   
    Λ
    
     i
     ⁢
     i
    
   
  
 



The gradient of the total correlation may then be determined with respect to parameters of both encoders. The parameters of each encoder may then be updated using stochastic gradient descent.
The parameters generated by unsupervised training 602 may be further improved by querying a human annotator in the semi-supervised clustering 604. This query may ask for, e.g., “must-link” and “cannot-link” constraints between pairs of examples. The query may ask about whether two time series segments, two texts, or one time series segment and one text belong to the same group. This may be distinct from querying which cluster an example should be assigned to. The answer to such a query may be obtained after querying an example against every cluster until a must-link condition is found. The unsupervised training 602 and the semi-supervised clustering 604 may be iteratively repeated until a convergence threshold has been reached.
Referring now to FIG. 7, additional detail on semi-supervised clustering 604 is shown. Block 702 may be performed first, to obtain an initial batch of labeled examples. Blocks 704 and 706 alternate between active sampling and semi-supervised training, until block 705 determines that a maximum number of iterations has been reached. At block 708, final class labels are set.
In neighborhood initialization 702, initial queries are made to an annotator to establish disjoint neighborhoods that cover every cluster as quickly as possible. For example, a farthest-first exploration strategy may be used to identify the queries. Starting from a single neighborhood having a random example, block 702 selects examples that are farthest from any known neighborhoods. The example's relation to each neighborhood is queried in an exemplary order of increasing distance. Once a “must-link” condition is provided by the annotator, the example is added to the respective neighborhood. If no “must-link” condition is discovered after all of the neighborhoods are tested, block 702 may create a new neighborhood with the selected example.
Once a set of minimal neighborhoods is initialized in block 702, blocks 704 and 706 adaptively query unlabeled examples that will be effective for learning the embedding. The sampling of block 706 is interleaved with semi-supervised training 704, which improves an affinity graph, which in turn allows semi-supervised clustering 604 to produce better posterior estimates. Two active sampling strategies are described below, using the estimated posteriors. One strategy prioritizes the most uncertain examples measured through the entropy of the posterior, while the other strategy minimizes an estimated Bayesian risk.
Referring now to FIG. 8, additional detail on the semi-supervised training 704 is shown. Using a set of known must-link and cannot-link constraints between pairs of examples, a matrix of pairwise relations may be denoted as C∈n×n, where Cij=1 if (i, j) is a must-link constraint, Cij=−1 if it is a cannot-link constraint, and 0 if unknown. The number of classes is indicated as m. The matrix Y∈n×m may be determined from the known neighborhoods, where Yic=1 if example i is known to be in class c and Yic=0 if example i is known not to be in class c, or is unlabeled. The embedding of a time series x(i) and a text y(i) may be expressed as ei1=UTf(x(i)) and ei2=VTg(y(i)), respectively.
Block 802 whitens the feature vectors, for example using the covariance matrices ΣXX, ΣYY, U, and V, which are singular value decompositions of S, as described above. These whitened feature vectors are used during testing for cross-modal retrieval, as described below. The whitened time series feature matrix is indicated as Z1, where the ith row is the whitened feature vector f′(x(i)) for the ith training time series example x(i), determined by:



 
  
   
    f
    ′
   
   (
   
    x
    
     (
     i
     )
    
   
   )
  
  =
  
   
    
     f
     ⁡
     (
     
      x
      
       (
       i
       )
      
     
     )
    
    T
   
   ⁢
   
    
     ∑
     XX
     
      -
      
       1
       2
      
     
    
    U
   
  
 



The whitened text feature matrix is indicated as Z2, where the ith row is the whitened feature vector g′(y(i)) for the ith training text sample y(i), determined by:



 
  
   
    g
    ′
   
   (
   
    y
    
     (
     i
     )
    
   
   )
  
  =
  
   
    
     g
     ⁡
     (
     
      y
      
       (
       i
       )
      
     
     )
    
    T
   
   ⁢
   
    
     ∑
     YY
     
      -
      
       1
       2
      
     
    
    V
   
  
 



The whitened matrices Z1 and Z2 may be determined directly by transforming the feature matrices HX and HY, as:



 
  
   
    Z
    1
   
   =
   
    
     H
     X
    
    ⁢
    
     
      ∑
      XX
      
       -
       
        1
        2
       
      
     
     U
    
   
  
  ⁢
  

  
   
    Z
    2
   
   =
   
    
     H
     Y
    
    ⁢
    
     
      ∑
      XX
      
       -
       
        1
        2
       
      
     
     V
    
   
  
 



The whitened feature vectors for the training time series segments, and those of the training texts, may be stored in a feature vector database, which may be used for cross-modal retrieval.
An affinity or adjacency matrix W∈n×n may be determined by block 804, where Wij measures the affinity between examples i and j. Graph-regularized semi-supervised clustering may be used to infer the cluster assignment of unlabeled instances. The term u indicates a list of indices of all unlabeled examples, and l indicates a list of all labeled examples. The term Fi∈C is a class probability vector of example i. An objective function may then be defined to ensure that a predictor is smooth with respect to the graph, while matching known labels on labeled examples:



 
  
   
    min
    F
   
   
    
     1
     2
    
    ⁢
    
     
      ∑
      
       i
       ,
       
        j
        =
        1
       
      
      n
     
     
      
       
        
        
         
          F
          i
         
         -
         
          F
          j
         
        
        
       
       2
      
      ⁢
      
       W
       
        i
        ⁢
        j
       
      
     
    
   
  
  +
  
   μ
   ⁢
   
    
     ∑
     
      i
      ∈
      l
     
    
    
     
      
      
       
        F
        i
       
       -
       
        Y
        i
       
      
      
     
     2
    
   
  
 



where μ is a weight parameter large enough to ensure class consistency of labeled data.

The objective function may be optimized in a closed form. Block 806 determines a Laplacian matrix L=D−W, where D is the diagonal degree matrix, with Dii=ΣjWij. The optimal Fu for the unlabeled examples can be determined in block 808 as:

Fu=Luu−1WulYl 

where Luu ∈|u|×|u| is the submatrix of L corresponding to the unlabeled examples, and where Wul ∈|u|×|l| is the submatrix of W with rows corresponding to unlabeled examples and columns to labeled examples. Based on the probability vectors, an approximated relation matric Ĉ can be determined as:

Ĉ=2FFT−1

One way to determine the affinity matrix Wij in block 804 is to use radical-basis functions such as a Gaussian kernel:



 
  
   
    (
    
     W
     σ
    
    )
   
   
    i
    ⁢
    j
   
  
  =
  
   
    1
    2
   
   ⁢
   
    
     ∑
     
      
       v
       =
       1
      
      ,
      2
     
    
    
     
      1
      Z
     
     ⁢
     
      exp
      ⁡
      (
      
       -
       
        
         
          
          
           
            e
            i
            v
           
           -
           
            e
            j
            v
           
          
          
         
         2
        
        
         σ
         2
        
       
      
      )
     
    
   
  
 



where σ is a bandwidth parameter that determines the influence radius of each example. 6 Alternatives include using a k-nearest neighbor graph, where Wij=1 if and only if the example j is among the k nearest neighbors of example i, and Wij=0 otherwise.

With the approximate pairwise relation given by Ĉ, the encoders may be trained to enforce margin between different clusters, to improve retrieval accuracy. This may be captured in block 810 using a margin-based loss function:



 
  
   L
   sup
  
  =
  
   
    1
    
     
      ❘
      "\[LeftBracketingBar]"
     
     
      C
      ^
     
     
      ❘
      "\[RightBracketingBar]"
     
    
   
   ⁢
   
    
     ∑
     
      
       v
       =
       1
      
      ,
      2
     
    
    
     
      ∑
      
       i
       ,
       j
      
     
     
      max
      ⁡
      (
      
       
        α
        +
        
         
          
           C
           ^
          
          
           i
           ⁢
           j
          
         
         (
         
          
           
           
            
             e
             i
             v
            
            -
            
             e
             j
             v
            
           
           
          
          -
          
           β
           i
          
         
         )
        
       
       ,
       0
      
      )
     
    
   
  
 



where α and β determine the margin. This loss function sup encourages positive examples to example I to be within a distance of β−α, and all negative examples to be father than β+α. Since different clusters may have different internal diversity, separate values βi may be learned for each example, e.g., using a multi-layer perceptron neural network structure, which may have a similar effect as a triplet loss, in that the margin is example-specific, but provides faster computation, as the summation involves pairs, rather than triplets.

Block 812 determine a CCA loss CCA, with block 814 finding the total loss function: =sup+ηCCA, where η is a weight parameter. Block 816 optimizes the total loss function  using a stochastic gradient descent for a predetermined number of iterations.
As noted above, the semi-supervised training 704 may alternate with adaptive sampling 706. In one sampling strategy, which seeks to minimize cluster assignment uncertainty, the posterior probability of assigning an unlabeled example i to a cluster c is expressed as Fic. The uncertainty of this assignment can be determined as the entropy:



 
  
   ent
   ⁡
   (
   
    x
    i
   
   )
  
  =
  
   -
   
    
     ∑
     c
    
    
     
      F
      
       i
       ⁢
       c
      
     
     ⁢
     
      log
      ⁡
      (
      
       F
       
        i
        ⁢
        c
       
      
      )
     
    
   
  
 



The example with the highest entropy may be selected as



 
  
   k
   =
   
    
     
      argmax
      i
     
    
    ⁢
    
     ent
     (
     
      x
      i
     
     )
    
   
  
  ,
 



and a query can be run against an arbitrary example in each known neighborhood in order of decreasing posterior probability to determine the cluster assignment of the example. The labeled information and the affinity structure may thus be used to compute reasonable posterior probabilities.

Another strategy for sampling in block 706 seeks to minimize an expected Bayesian error. This strategy may pick an example that will make other unlabeled examples more confident about their current prediction. This may include any appropriate number of classes, two or greater.
The current class prediction vectors for unlabeled data may be expressed as Fu∈|u|×C. If an example i is queried and its label yi is obtained, this makes it possible to update the prediction vectors to Fuxi,yi as:



 
  
   F
   y
   
    +
    
     (
     
      
       x
       i
      
      ,
      
       y
       i
      
     
     )
    
   
  
  =
  
   
    F
    u
   
   +
   
    
     (
     
      
       
        (
        
         L
         
          u
          ⁢
          u
         
         
          -
          1
         
        
        )
       
       
        ·
        i
       
      
      
       
        (
        
         L
         uu
         
          -
          1
         
        
        )
       
       
        i
        ⁢
        i
       
      
     
     )
    
    ⁢
    
     
      (
      
       
        Y
        i
       
       -
       
        F
        i
       
      
      )
     
     T
    
   
  
 



where Yi∈C is a one-hot vector with a value of 1 only at the yith position, and with values of 0 in all other locations, and where the subscript·i indicates the ith column vector of the matrix Luu−1.

Since the true value of yk is not known before querying, the expected prediction vectors Fi+xk may be determined by taking the expectation over all possible yk∈[1, . . . , C]. The posterior P(yk|xk) can be estimated using the current Fk:



 
  
   F
   i
   
    +
    
     x
     k
    
   
  
  =
  
   
    
     E
     
      y
      k
     
    
    [
    
     F
     i
     
      +
      
       (
       
        
         x
         k
        
        ,
        
         y
         k
        
       
       )
      
     
    
    ]
   
   =
   
    
     
      ∑
      
       
        y
        k
       
       =
       1
      
      c
     
     
      
       P
       ⁡
       (
       
        
         y
         k
        
        ❘
        
         x
         k
        
       
       )
      
      ⁢
      
       F
       i
       
        +
        
         (
         
          
           x
           k
          
          ,
          
           y
           k
          
         
         )
        
       
      
     
    
    =
    
     
      ∑
      
       
        y
        k
       
       =
       1
      
      C
     
     
      
       F
       
        k
        ⁢
        
         y
         k
        
       
      
      ⁢
      
       F
       i
       
        +
        
         (
         
          
           x
           k
          
          ,
          
           y
           k
          
         
         )
        
       
      
     
    
   
  
 



The Bayes-optimal classifier predicts, for any example, the class with the maximum posterior




 
  
   
    pred
    ⁡
    (
    
     F
     i
    
    )
   
   =
   
    
     
      argmax
      c
     
    
    ⁢
    
     F
     
      i
      ⁢
      c
     
    
   
  
  ,
 



with an associated risk R(Fu) being determined based on the estimated posterior on unlabeled data Fu:




 
  
   R
   ⁡
   (
   
    F
    u
   
   )
  
  =
  
   
    
     ∑
     i
    
    
     
      I
      [
      
       
        pr
        ⁢
        e
        ⁢
        
         d
         ⁡
         (
         
          F
          i
         
         )
        
       
       ≠
       
        y
        i
       
      
      ]
     
     ⁢
     
      P
      ⁡
      (
      
       
        y
        i
       
       ❘
       
        F
        i
       
      
      )
     
    
   
   =
   
    
     
      ∑
      i
     
     1
    
    -
    
     
      max
      c
     
     
      F
      
       i
       ⁢
       c
      
     
    
   
  
 



where I is an indicator function that outputs a value of 1 only if the condition in the brackets is true, and outputs a value of 0 otherwise.

An example may be selected that minimizes R(F+xk), as



 
  k
  =
  
   
    
     argmin
     k
    
   
   ⁢
   
    
     R
     ⁡
     (
     
      F
      
       +
       
        x
        k
       
      
     
     )
    
    .
   
  
 



This example may be queried against every known neighborhood, as described above, to determine its assignment.

Between these two strategies, minimizing the cluster assignment uncertainty tends to select an example at the border of the estimated clusters which is the most uncertain about its class assignment, while minimizing the risk selects an example at the outskirts of a relatively dense cluster. A total of m pairwise relationships may be selected using one of these two strategies, and an annotator may be queried to provide an appropriate constraint.
After a certain number of iterations, block 708 determines the final class labels for the training data. At this point, every example has been assigned either a ground-truth label by being actively selected and queried, or has been assigned an estimated label Fu by adopting the class with the largest probability. With these class labels, the dataset can be partitioned into different groups, each representing a distinct semantic concept.
During testing, cross-modal retrieval may be performed using the results of the training phase. These results may include the trained encoders f and g, the training dataset . . . (x(i), y(i)), . . . , and the feature vector database { . . . , (f′(x(i)), g′(y(i))), . . . }. A noted above, different cross-modal tasks may be performed, differing by the modality of the queries and the retrieval targets. At a high level, the tasks may each perform a nearest-neighbor search in the whitened feature space.
For example, following FIG. 5, the query may include a time series segment x. The whitened feature vector



 
  
   
    f
    ′
   
   (
   x
   )
  
  =
  
   
    
     f
     ⁡
     (
     x
     )
    
    T
   
   ⁢
   
    
     ∑
     XX
     
      -
      
       1
       2
      
     
    
    U
   
  
 



may be determined. Then, from the feature vector database, the k text comment examples having whitened features with the smallest Euclidean distances from the vector may be determined, where k may be the number of desired retrieval results, and may be selected by the user. The returned text comment examples are provided to the user as results, indicating relevant textual explanations for the query time series segment.

Following FIG. 6, the query may include a text description y, or both a text description y and a time series segment x. In the first case, the whitened feature vector



 
  
   
    g
    ′
   
   (
   y
   )
  
  =
  
   
    
     g
     ⁡
     (
     y
     )
    
    T
   
   ⁢
   
    
     ∑
     YY
     
      -
      
       1
       2
      
     
    
    V
   
  
 



may be determined. Then, from the feature database, k time-series segments may be identified, having the whitened feature vectors with the smallest Euclidean distance to y. These time series segments are returned to the user as retrieval results, and are semantically close and relevant to the provided description.

If both a text description y and a time series segment x are provided, then whitened feature vectors f′(x) and f′(y) may be determined, as described above. From the feature vector database, n time series segments may be identified having the whitened features that are the nearest neighbors to x, and n time series segments may be identified having the whitened features that are the nearest neighbors to y. The intersection of these two sets of time series segments may be determined. Starting at n=k, if the number of instances in the intersection is smaller than k, then n may be incremented, and new sets may be identified. This iterative process may be repeated until at least k time series segments have been identified, and these k time series segments may be returned as retrieval results, being semantically similar and relevant to both the query time series and the query text description.
Embodiments described herein may be entirely hardware, entirely software or including both hardware and software elements. In a preferred embodiment, the present invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Embodiments may include a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. A computer-usable or computer readable medium may include any apparatus that stores, communicates, propagates, or transports the program for use by or in connection with the instruction execution system, apparatus, or device. The medium can be magnetic, optical, electronic, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. The medium may include a computer-readable storage medium such as a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk, etc.
Each computer program may be tangibly stored in a machine-readable storage media or device (e.g., program memory or magnetic disk) readable by a general or special purpose programmable computer, for configuring and controlling operation of a computer when the storage media or device is read by the computer to perform the procedures described herein. The inventive system may also be considered to be embodied in a computer-readable storage medium, configured with a computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner to perform the functions described herein.
A data processing system suitable for storing and/or executing program code may include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code to reduce the number of times code is retrieved from bulk storage during execution. Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) may be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
As employed herein, the term “hardware processor subsystem” or “hardware processor” can refer to a processor, memory, software or combinations thereof that cooperate to perform one or more specific tasks. In useful embodiments, the hardware processor subsystem can include one or more data processing elements (e.g., logic circuits, processing circuits, instruction execution devices, etc.). The one or more data processing elements can be included in a central processing unit, a graphics processing unit, and/or a separate processor- or computing element-based controller (e.g., logic gates, etc.). The hardware processor subsystem can include one or more on-board memories (e.g., caches, dedicated memory arrays, read only memory, etc.). In some embodiments, the hardware processor subsystem can include one or more memories that can be on or off board or that can be dedicated for use by the hardware processor subsystem (e.g., ROM, RAM, basic input/output system (BIOS), etc.).
In some embodiments, the hardware processor subsystem can include and execute one or more software elements. The one or more software elements can include an operating system and/or one or more applications and/or specific code to achieve a specified result.
In other embodiments, the hardware processor subsystem can include dedicated, specialized circuitry that performs one or more electronic processing functions to achieve a specified result. Such circuitry can include one or more application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and/or programmable logic arrays (PLAs).
These and other variations of a hardware processor subsystem are also contemplated in accordance with embodiments of the present invention.
Referring now to FIG. 9, additional detail on the time series analysis and maintenance system 106 is shown. The system 106 includes a hardware processor 902 and a memory 904. The system 106 also includes one or more functional modules, which may be implemented as software, stored in the memory 904 and executed by the hardware processor. The functional modules may also be implemented as discrete hardware components, for example in the form of ASICs or FPGAs. A sensor interface 906 communicates with the sensors 104, for example by a dedicated connection or by a general purpose network connection. For example, the sensor interface 906 may communicate with the sensors by any appropriate wired or wireless communications medium or protocol.
The sensor data received from the sensor interface 906 may include time series information, which forms a part of the training data 907. In addition, textual descriptions of such time series information may be received from a human operator via a user interface 912. This multi-modal information, including the time series data and the textual descriptions, may be used by a model trainer 908 to train encoders 910, which may include a time series embedding model 206 and a text embedding model 208.
When a user enters a query at the user interface 912, the encoders 910 translate the query into a vector or vectors in the shared latent space 210. The embedded vectors may be compared to a vector feature database 914 to identify matches, which may then be presented to the user via the user interface 912.
Reference in the specification to “one embodiment” or “an embodiment” of the present invention, as well as other variations thereof, means that a particular feature, structure, characteristic, and so forth described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrase “in one embodiment” or “in an embodiment”, as well any other variations, appearing in various places throughout the specification are not necessarily all referring to the same embodiment. However, it is to be appreciated that features of one or more embodiments can be combined given the teachings of the present invention provided herein.
It is to be appreciated that the use of any of the following “/”, “and/or”, and “at least one of”, for example, in the cases of “A/B”, “A and/or B” and “at least one of A and B”, is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of both options (A and B). As a further example, in the cases of “A, B, and/or C” and “at least one of A, B, and C”, such phrasing is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of the third listed option (C) only, or the selection of the first and the second listed options (A and B) only, or the selection of the first and third listed options (A and C) only, or the selection of the second and third listed options (B and C) only, or the selection of all three options (A and B and C). This may be extended for as many items listed.
The foregoing is to be understood as being in every respect illustrative and exemplary, but not restrictive, and the scope of the invention disclosed herein is not to be determined from the Detailed Description, but rather from the claims as interpreted according to the full breadth permitted by the patent laws. It is to be understood that the embodiments shown and described herein are only illustrative of the present invention and that those skilled in the art may implement various modifications without departing from the scope and spirit of the invention. Those skilled in the art could implement various other feature combinations without departing from the scope and spirit of the invention. Having thus described aspects of the invention, with the details and particularity required by the patent laws, what is claimed and desired protected by Letters Patent is set forth in the appended claims.

## Claims

1. A method of querying a time series database, comprising:
transforming a query to an embedded vector in a multi-modal shared latent space that encodes time series info, illation and textual information;
identifying a feature vector in the multi-modal shared latent space, stored in a time series dataspace, that matches the embedded vector, and that is associated with a data type complementary to the query; and
returning data associated with the identified feature vector, responsive to the query.

2. The method of claim 1, wherein the query includes a text information, and the feature vector is associated with time series information.

3. The method of claim 2, wherein the associated text describes circumstances relating to the time series segment.

4. The method of claim 2, wherein the query further includes a time series segment.

5. The method of claim 1, wherein the query includes time series information, and the feature vector is associated with text information.

6. The method of claim 1, wherein identifying the feature vector that matches the embedded vector includes identifying a nearest neighbor according to Euclidean distance within in the multi-modal shared latent space.

7. A system for training a neural network, comprising:
a hardware processor; and
a memory that stores a computer program product, which, when executed by the hardware processor, causes the hardware processor to:
train a time series embedding model and a text embedding model using unsupervised clustering to translate time series and text, respectively, to a multi-modal shared latent space;
train the time series embedding model and the text embedding model further using semi-supervised clustering that samples training data pairs of time series information and associated text for annotation;
transform a query to an embedded vector in the multi-modal shared latent space that encodes time series information and textual information;
identifying a feature vector in the multi-modal shared latent space, stored in a time series dataspace, that matches the embedded vector, and that is associated with a data type complementary to the query; and
returning data associated with the identified feature vector, responsive to the query.

8. The system of claim 7, wherein the training data pairs each include a time series segment and an associated text.

9. The system of claim 8, wherein the associated text of each pair describes circumstances relating to the respective time series segment.

10. The system of claim 8, wherein the computer program product further causes the hardware processor to annotate the sampled pairs to indicate constraints during semi-supervised clustering.

11. The system of claim 10, wherein the constraints are selected from the group consisting of a “must-link” constraint and a “cannot-link” constraint.

12. The system of claim 7, wherein the query includes a text information, and the feature vector is associated with time series information.

13. The system of claim 11, wherein the query further includes a time series segment.

14. The system of claim 7, wherein the query includes time series information, and the feature vector is associated with text information.

15. The system of claim 7, wherein the computer program product further causes the hardware processor to identify a nearest neighbor of the embedded vector according to Euclidean distance within in the multi-modal shared latent space.