paint-brush
Lifelong Intelligence Beyond the Edge using Hyperdimensional Computing: LifeDHโ€‚by@computational

Lifelong Intelligence Beyond the Edge using Hyperdimensional Computing: LifeDH

tldt arrow

Too Long; Didn't Read

LifeHD is an on-device lifelong learning system using Hyperdimensional Computing for efficient, unsupervised learning in dynamic IoT environments.
featured image - Lifelong Intelligence Beyond the Edge using Hyperdimensional Computing: LifeDH
Computational Technology for All HackerNoon profile picture

Authors:

(1) Xiaofan Yu, University of California San Diego, La Jolla, California, USA ([email protected]);

(2) Anthony Thomas, University of California San Diego, La Jolla, California, USA ([email protected]);

(3) Ivannia Gomez Moreno, CETYS University, Campus Tijuana, Tijuana, Mexico ([email protected]);

(4) Louis Gutierrez, University of California San Diego, La Jolla, California, USA ([email protected]);

(5) Tajana ล imuniฤ‡ Rosing, University of California San Diego, La Jolla, USA ([email protected]).

Abstract and 1. Introduction

2 Related Work

3 Background on HDC

4 Problem Definition

5 LifeDH

6 Variants of LifeHD

7 Evaluation of LifeHD

8 Evaluation of LifeHD semi and LifeHDa

9 Discussions and Future Works

10 Conclusion, Acknowledgments, and References

5 LIFEHD

In this section, we present the design of LifeHD, the first unsupervised HDC framework for lifelong learning in general edge IoT applications. Compared to operating in the original data space, HDC improves pattern separability through sparsity and high dimensionality, making it more resilient against catastrophic forgetting [52]. LifeHD preserves the advantages of HDC in computational efficiency and lifelong learning, while handling the input of unlabeled streaming data, which has not been achieved in previous work [18, 21, 22, 41, 65].

5.1 LifeHD Overview

Fig. 4 gives an overview of how LifeHD works. The first step is HDC encoding of data into hypervectors as described in Sec. 3. Training samples ๐‘‹ are organized into batches of size ๐‘๐‘†๐‘–๐‘ง๐‘’ and input into an optional fixed NN for feature extraction (e.g. for images and sound) and the encoding module. The encoded hypervectors ๐œ™ (๐‘‹) are input to LifeHDโ€™s two-tier memory design inspired by cognitive science studies [5], consisting of working memory and long-term memory. This memory system intelligently and dynamically manages historical patterns, stored as hypervectors and referred to as cluster HVs. As shown in Fig. 4, the working memory is designed with three components: novelty detection, cluster HV update and cluster HV merge. ๐œ™ (๐‘‹) is first input into novelty detection step (1). An insertion to the cluster HVs is made if a novelty flag is raised, otherwise ๐œ™ (๐‘‹) updates the existing cluster HVs (2). The third component, cluster HV merge (3), retrieves the cluster HVs from long-term memory, and merges similar cluster HVs into a supercluster via a novel spectral clustering-based merging algorithm [59]. The interaction between working and long-term memory happens as commonly encountered cluster HVs are copied to long-term memory, which we call consolidation (4). Finally, when the size


Figure 4: The end-to-end algorithm flow of LifeHD.


Table 1: List of important notations.


limit of either working or long-term memory is reached, the least recently used cluster HVs are forgotten (5).


ecently used cluster HVs are forgotten (โ—‹5 ). All modules in LifeHD work collaboratively, making it adaptive and robust to continuously changing streams without relying on any form of prior knowledge. For example, in scenarios of distribution drift, LifeHD may generate new cluster HVs upon encountering drifted samples initially, which can later be merged into coarse clusters. This approach ensures that LifeHD can efficiently capture and retain historical patterns.


In the following, we discuss more details about the major components of LifeHD: novelty detection (Sec. 5.2), cluster HV update (Sec. 5.3), and cluster HV merging (Sec. 5.4). We summarize the important notations used in this paper in Table 1.

5.2 Novelty Detection

The initial novelty detection step (1 in Fig. 4) is crucial for identifying emerging patterns in the environment. SupposeM = {๐‘š1, ...,๐‘š๐‘€} is the set of cluster HVs stored in the working memory. We gauge the "radius" of each cluster by tracking two scalars for each cluster HV ๐‘–: ๐œ‡๐‘– and ๐œŽห†๐‘– , which represent the mean cosine difference and standard difference between the cluster HV and its assigned inputs. Given ๐œ™ (๐‘‹), we first identify the most similar cluster HV, denoted by ๐‘—. LifeHD marks ๐œ™ (๐‘‹) as โ€œnovel" if it substantially differs from its nearest cluster HV. Specifically, this dissimilarity is measured by comparing cos(๐œ™ (๐‘‹),๐‘š๐‘—) with a threshold based on the historical distance distribution of cluster HV ๐‘—:



The hyperparameter ๐›พ fine-tunes the sensitivity to novelties.


LifeHD recognizes new ๐œ™ (๐‘‹) as prototypes and inserts them into the working memory. When reaching its size limit ๐‘€, the working memory experiences forgetting (โ—‹5 in Fig. 4). The least recently used (LRU) cluster HV, represented by ๐ฟ๐‘…๐‘ˆ = argmin๐‘€ ๐‘–=1 ๐‘๐‘– , is replaced. Here ๐‘ corresponds to the latest batch index where the cluster HV was accessed. A similar forgetting mechanism is configured for the long-term memory, where the last batch accessed is marked with ๐‘ž.

5.3 Cluster HV Update

If novelty is not detected, indicating that ๐œ™ (๐‘‹) closely matches cluster HV ๐‘—, we proceed to update the cluster HV and its associated information (2 in Fig. 4). This update process involves bundling ๐œ™ (๐‘‹) with cluster HV ๐‘š๐‘— , akin to how class hypervectors are updated as described in Sec. 3, and updated ๐œ‡๐‘— and ๐œŽห†๐‘— with their moving average



The hyperparameter ๐›ผ adjusts the balance between historical and recent inputs, where a higher ๐›ผ gives more weight to recent samples. Properly maintaining ๐œ‡๐‘— and ๐œŽห†๐‘— is vital for tracking the โ€œradiusโ€ of each cluster HV, affecting future novelty detection. We also increase the hit frequency โ„Ž๐‘–๐‘ก๐‘— and refresh ๐‘๐‘— with current batch index ๐‘–๐‘‘๐‘ฅ. โ„Ž๐‘–๐‘ก๐‘— is further used to compared with a predetermined threshold โ„Ž๐‘–๐‘ก๐‘กโ„Ž to decide when a working memory cluster HV appears sufficiently frequently to be consolidated to long-term memory (4 in Fig. 4). ๐‘๐‘— determines forgetting as described in the previous section. With this lightweight approach, LifeHD continually records temporal cluster HVs from the environment, while the most prominent cluster HVs are transferred to long-term memory.


Figure 5: An intuitive visualization of cluster HV merging.

5.4 Cluster HV Merging

Cluster HV merge (3 in Fig. 4) has the dual benefit of reducing memory use and of elucidating underlying similarity structure in the data. Intuitively, a group of cluster HVs can be merged if they are similar to each other and dissimilar from other cluster HVs. For instance, one might merge the cluster HVs for Bulldog and Chihuahua into a single โ€œDogโ€ cluster HV, that remains distinct from the cluster HV for โ€œTabby Catโ€.


To merge the cluster HVs, we first construct a similarity graph defined over the cluster HVs from the long-term memory. The cluster HVs correspond to nodes, and a pair of cluster HVs are connected by an edge if they are sufficiently similar. We then merge the cluster HVs by computing a particular type of cut in the graph in a manner similar to spectral clustering [40]. This graph based formalism for clustering is able to capture complex types of cluster geometry and often substantially outperforms simpler approaches like K-Means [59]. We detail the steps of cluster HV merging in LifeHD below, while Fig. 5 offers an illustrative overview.



Step 2: Decomposition. We compute the Laplacian๐‘Š = ๐ท โˆ’๐ด, where ๐ท is the diagonal matrix in which ๐ท๐‘–๐‘– = ร ๐‘— ๐ด๐‘–๐‘— . We then compute the eigenvalues ๐œ†1, .., ๐œ†๐ฟ, sorted in increasing order, and eigenvectors ๐œˆ1, ..., ๐œˆ๐ฟ of ๐‘Š.


Step 3: Grouping. We infer ๐‘˜ = max๐‘–โˆˆ [๐ฟ] ๐œ†๐‘– โ‰ค ๐‘”๐‘ข๐‘, and merge the cluster HVs by running K-Means on ๐œˆ1, ..., ๐œˆ๐‘˜ . The upperbound ๐‘”๐‘ข๐‘ is a hyperparameter that adjusts the granularity of merging, with a smaller ๐‘”๐‘ข๐‘ leading to smaller ๐‘˜ thus encouraging merging more aggressively.


Our merging approach is formally grounded, as discussed in [59]. It is a well-known fact that the eigenvectors of ๐‘Š encode information about the connected components of G. When G has ๐‘˜ connected components, the eigenvalues ๐œ†1 = ๐œ†2 = ... = ๐œ†๐‘˜ = 0. To recover these components, K-Means clustering on ๐œˆ1, ..., ๐œˆ๐‘˜ can be employed, as explained in [59]. However, practical scenarios may have a few inter-component edges that should ideally be distinct. For instance, when the similarity threshold is imprecisely set, erroneous edges may appear in the graph, causing ๐œ†1, ..., ๐œ†๐‘˜ to be only approximately zero. Our merging approach is designed to handle this situation by introducing ๐‘”๐‘ข๐‘. The cluster HV merging is evaluated every ๐‘“๐‘š๐‘’๐‘Ÿ๐‘”๐‘’ batches, where ๐‘“๐‘š๐‘’๐‘Ÿ๐‘”๐‘’ is a hyperparameter that controls the trade-off between merging performance and computational latency. Both ๐‘”๐‘ข๐‘ and ๐‘“๐‘š๐‘’๐‘Ÿ๐‘”๐‘’ are analyzed in Sec. 7.8, along with other key hyperparameters in LifeHD.



This paper is available on arxiv under CC BY-NC-SA 4.0 DEED license.