As a new type of artificial neural network model, HTM has become the focus of current research and application. The sparse distributed representation is the basis of the HTM model, but the existing spatial pool learning algorithms have high training time overhead and may cause the spatial pool to become unstable. To overcome these disadvantages, we propose a fast spatial pool learning algorithm of HTM based on minicolumn’s nomination, where the minicolumns are selected according to the load-carrying capacity and the synapses are adjusted using compressed encoding. We have implemented the prototype of the algorithm and carried out experiments on three datasets. It is verified that the training time overhead of the proposed algorithm is almost unaffected by the encoding length, and the spatial pool becomes stable after fewer iterations of training. Moreover, the training of the new input does not affect the already trained results.

Neural computing is a hot topic in the field of artificial intelligence and machine learning. Hierarchical temporal memory (HTM) is a kind of machine learning technology that simulates the organization and mechanism of cerebral cortex cells as well as the information processing pipeline of the human brain. HTM is trained with a large number of time-series data and stores a large number of pattern sequences. Through the memory, HTM can predict the future inputs or detect whether the current input is abnormal according to the temporal history information.

HTM works based on sparse distributed representations (SDRs) of the inputs. Spatial pool learning algorithm (SPL) establishes the connection between the input code and the minicolumn’s synapses using the Hebbian learning rule and activates the column set by a significant bit in the input code, thus realizing the SDR of input. In this process, the spatial pool is expected to maintain a certain degree of flexibility like the cerebral cortex, so several overlapping goals determine how the spatial pool operates and learns, which include the following: (1) all columns should learn to represent something useful regardless of how many columns the spatial pool has. (2) A region needs to form a sparse representation of the input, i.e., only a small percentage of the columns in the spatial pool should be “winners” for an input. (3) All columns should represent nontrivial patterns of a certain level of complexity. (4) A column should be avoided to respond strongly to many distinctly unrelated input patterns, i.e., a column should represent a limited number of input patterns, sometimes only one. (5) The spatial pool should have the ability of self-adjusting to cope with various changes, including the damage of the columns and the damage or change of sensory organs. SPL uses the boosting rule, inhibition rule, minimal threshold, large synaptic pool, and Hebbian rule to enable the dynamic configuration of the spatial pool, thus achieving the desired effect after multirounds of training. In the conventional training, the time overhead of the algorithm, the sparsity of the active minicolumns, the stability of the spatial pool, and the utilization rate of the minicolumn are the main factors to evaluate the HTM training. In SPL, a large synaptic pool has a great impact on the training time overhead, and the boosting and inhibition rules lead to the instability of the spatial pool. In this paper, we analyze the characteristics of SPL and propose a fast spatial pool learning algorithm of HTM based on minicolumn’s self-nomination (SPL_SN), which includes the calculation rules of the self-nomination status of the minicolumn, the selection rule of the minicolumn based on the load-carrying capacity and level, and the synapse adjustment rule based on compressed encoding. The prototype of the proposed algorithm is tested on three kinds of datasets, and four criteria are used to evaluate the time overhead, the stability of the spatial pool, the sparsity of active minicolumns, and the utilization rate of all columns. The main contributions are as follows:

SPL_SN reconstructs the structure of the spatial pool and adds the matching input information to each minicolumn. Based on the load-carrying capacity of the minicolumn, i.e., the utilization degree of the minicolumn, the SPL_SN can make the selected minicolumns sparsely distributed in the spatial pool.

Different from SPL that uses overlapping values to select minicolumns, SPL_SN uses the overlapping values to calculate the self-nomination status of the minicolumn. The self-nomination status and the load-carrying capacity of the minicolumn can improve the utilization rate of minicolumns in the spatial pool.

Different from SPL using the Hebbian rule to adjust the link between the input and minicolumn, SPL_SN designs a synaptic adjustment rule based on compressed encoding that can reduce the training time overhead. The learning of new input does not affect the trained information in the minicolumn, ensuring a dynamic adaptability of HTM and improving the efficiency of HTM training and the stability of the spatial pool.

The prototype of SPL_SN is implemented in the HTM open-source framework, and different types of datasets are used for test and analysis. It is verified that the algorithm not only meets the flexibility of the spatial pool but also improves the training efficiency and stability of the spatial pool.

Neural networks (NNs) have achieved great success in many fields, e.g., classification [

HTM workflow. It describes that, after the input is encoded, trained in the space pool, and trained in the time pool, the subsequent prediction can be made according to the memory.

With its advantages in time-series data processing, HTM has been used to deal with a variety of learning tasks in the field of time-series data. For example, HTM can be used to identify traffic anomalies in computer networks [

For SPL, Ahmad and Hawkins give the characteristic description of SDR and the expression form of information in the spatial pool [

SPL mainly uses the overlapping value to activate the minicolumn and dynamically adjusts the synaptic value of the minicolumn to strengthen their relationship. By boosting factors, the less-active minicolumn can also win the competition, and each minicolumn in the space pool can participate in representing the input. By the inhibition radius, the activated minicolumns will not concentrate together, which ensures that the winning set of minicolumns is sparsely scattered in the spatial pool. By adjusting the minicolumn’s synapses according to the Hebbian competition rule, the training results of the spatial pool tend to be stable after several iterations.

However, the minicolumn activation rule and minicolumn synaptic adjustment rule make the training results of the spatial pool difficult to stabilize, and the learning efficiency of the algorithm is low. Next, the limitations of these two rules are analyzed in terms of the stability of the spatial pool and the efficiency of the current algorithm.

SPL uses the following equation to calculate the overlap between the minicolumn and the input.

In order to activate fewer minicolumns to participate in the input expression, the algorithm takes the overlapping value multiplied by the minicolumn’s boosting factor as the competition basis. The boosting factor is calculated according to the activation frequency of the minicolumn in the statistical period and the average activation frequency of all minicolumns within the inhibition radius.

Using these two mean values, the boosting factor of the minicolumn can be calculated by the following equation, and

The value of the boosting factor will increase greatly if the minicolumn is not activated for a long time. In this case, the minicolumn with lower activation frequency can be activated by the following equation:

First, the code length determines the number of the minicolumn’s synapses and affects the size of minicolumn’s receptive domain. The long encoding will increase the workload of calculating the overlapping values and adjusting synaptic persistence. The computational efficiency of the current spatial pool learning algorithm is greatly affected by the code length. Secondly this minicolumn activation rule will cause the spatial pool unstable, especially when the input training space is small and the spatial pool capacity is large. This is because the boosting strategy ensures that all minicolumns participate in expressing the input while ignoring the need for individual input to be stably expressed. For example, if only one input _{i} is greater than the _{i} = {_{1}, _{2}, …, _{i}, _{i+1}, …, _{i+m} }, then _{i} will be activated in the previous training. As the training process goes on, other minicolumns are seldom activated, and their boosting factors will become very large. Then, one of them will win in the competition and be activated. This makes the minicolumn set activated by

When a minicolumn set is activated by the input, SPL will adjust the permanence of the proximal synapses on the minicolumns according to the Hebbian rule, which can be described as follows:

Usually, a minicolumn is involved in the expression of multiple inputs. The regulation of minicolumn synapses not only enhances the expression ability of the minicolumn for the current input but also reduces the expression ability for other inputs. If a trained input does not participate in SPL for a long time, it will lose the ability to activate the minicolumns. We can call the process of forgetting. Forgetting has its significance in the biological system, such as reducing the memory of uncommon concepts, reducing energy consumption, and highlighting the cognition of recent learning content. However, in the HTM model, forgetting in the spatial pool will bring great cost to subsequent learning. If the forgotten input enters SPL again, it will activate a new minicolumn set, which leads to an unstable expression of a given input. In this way, what the temporal pool has learned becomes meaningless or unpredictable. Therefore, the forgetting mechanism is not suitable for SPL, but it is very useful for TPL of HTM.

The Hebbian rule adjusts the spatial pool dynamically to a stable state after iterative training. If a new input destroys much information stored in the current HTM, the spatial pool needs many iterations of training to reach a new stable state. It will affect the efficiency and effectiveness of HTM.

In SPL, the minicolumn has two states according to the input stimulus,

The overlapping value between the minicolumn and the input is only used to determine the self-nomination state of the minicolumn, which can be calculated by the following equation:

According to the overlap value, the minicolumn can be given three different self-nomination states by the following equation:

According to

To improve the minicolumn section for the input, we reconstruct the spatial pool’s structure and more information of the minicolumn will be used. The minicolumn not only calculates the degree of willingness to participate in the current input, i.e., the self-nomination state, but also saves the content and the number of different inputs that have been participated in through the previous learning process. This information is called the load-carrying capacity of the minicolumn, which can be used as a measure of the utilization degree of the minicolumn. By fully utilizing the self-nomination status and load-carrying capacity of the minicolumn, the appropriate minicolumn set can be selected to express the current input. Suppose that

The current self-nomination status is calculated according to the input.

For minicolumns with _{1}. If _{2} minicolumns with the lowest load-carrying capacity are randomly selected from the remaining minicolumns for activation, and _{2} takes the maximum value that satisfies the constraint _{2} minicolumns, saves the current input on the minicolumns, and increases the number of inputs that the minicolumn participates in by 1.

For the minicolumns with _{3} minicolumns with the lowest load-carrying capacity are randomly selected to activate, and _{3} takes the maximum value that satisfies the constraint _{2} minicolumns, saves the current input on the minicolumns, and increases the number of inputs that the minicolumn participates in by 1.

For minicolumns with

SPL_SN activates a predetermined number of minicolumns with

There is a mapping between the minicolumn set activated by SPL_SN and the current input. Therefore, it is necessary to add synaptic connections to the input to maintain the mapping. How the active minicolumn increases the synaptic connection is shown in the following equation:

SPL is based on the input distribution code. The rule of the encoding is usually to express the input with a fixed-length binary vector, in which the number of components with value 1 is small and fixed. This encoding rule scatters the input characters to each component with value 1, which can be called 1-component. By encoding similar inputs with a certain number of overlapped components, the influence of noise on the input can be reduced and the robustness of the system can be improved. In the training process of the spatial pool, the number and position of the 1-components are the factors to calculate the overlapping values and adjust the synapse. Therefore, we propose an effective compressed encoding method, which expresses scalars with shorter vectors.

For any scalar

In the input compressed encoding, a longer binary vector can be represented as the position vector of 1-components, and the length of the uncompressed code is hidden. Therefore, no matter what the input value is, the length of the compressed code is fixed and short. This encoding rule can improve the efficiency of calculating the overlapping values. When the input code is superimposed on the minicolumn, it shows that the minicolumn has participated in the expression of the input, so that the spatial pool can express the input with a relatively fixed set of minicolumns through fewer rounds of training. Moreover, when a new input enters the training and modifies the connection of the minicolumn’s synapses, the connection among the existing synapses is not adjusted, so the trained result will not be affected. Although the adjusting rule shown in equation (

The flow of SPL_SN is shown in Table

The flow of SPL_SN.

(1) Encode the input |

SPL_SN modifies the rules of SPL. It calculates the self-nomination states of the minicolumns based on the overlapping values to express the willingness of the minicolumns to represent the input and activates minicolumns based on their self-nomination states and load-carrying capacity. The minicolumn selection rule is dominated by the spatial pool, so it can make full use of the minicolumns and improves the efficiency of spatial pool learning. The compressed encoding algorithm uses the position of 1-components to reconstruct the code which simplifies the expression of the code and improves the efficiency of the query. When learning the new inputs, the synaptic adjustment rule based on compressed encoding does not affect the trained information in the minicolumns, which improves the efficiency of training and the stability of the spatial pool.

Built upon the Numenta’s open-source HTM code, a prototype system of SPL_SN is implemented. Three datasets are used to evaluate the SPL and SPL_SN.

In this paper, three datasets are used to evaluate SPL and SPL_SN. The first two datasets are constructed artificially using the integer number between 1 and

We train SPL and SPL_SN with the three datasets separately and analyze the advantages and disadvantages of the algorithm through the result of each training round. The evaluation criteria are listed below:

Time overhead: for the same input space and different length of code, the computation efficiency of the algorithm is evaluated by the time overhead for one round of training.

Stability of the spatial pool: it includes two meanings. The first is to describe whether the spatial pool can express the input with a fixed set of minicolumns. The second is to describe whether the new input will affect the trained results. The mean stability (MS) is used to evaluate the stability of the spatial pool. Assume that the set of minicolumns corresponding to input

With the stability of each input (

The sparsity of input representation: it describes whether a spatial pool can express the input with a relatively fixed number of minicolumns. After each round of training, we count the number of active minicolumns for each input and calculate their mean (

The utilization of minicolumns: it describes whether the minicolumns can be activated more evenly. The standard deviation of the minicolumn activation frequency is used to describe this indicator. After the

The average activation frequency of all minicolumns (

The standard deviation of minicolumn activation frequency (

The parameters of the spatial pool are shown in Table

Parameter configuration for the spatial pool.

Common parameter | Value |
---|---|

COLUMN_DIMENSIONS | 128 |

GLOBALINHIBITION | True |

NUMACTIVECOLUMNSPERINHAREA | 7.0 |

SYN_PERM_ACTIVE_INC | 0.015 |

SYN_PERM_INACTIVE_DEC | 0.0005 |

DUTY_CYCLE_PERIOD | 1000 |

MAX_BOOST | 10 |

We have implemented the algorithm using Java in the Windows 10 operating system, and the program runs on a PC with an Intel core tm i7-7500u 2.9 GHz CPU processor and 8 GB memory.

The input space is constructed by numbers from 1 to 10. The coding length is set to 5000, 20000, and 40000, respectively. The two algorithms train all inputs for 10 rounds with different code lengths. Then, we collect and compare the results after each round.

Figure

The training time overhead of two algorithms. Each column in the graph represents the training time overhead of the dataset after a round of training with different code lengths. (a) The results trained by SPL. (b) The results trained by SPL_SN.

Figure

Comparison of stability in small input space. Each node in the graph represents the proportion of inputs which SDRs have not changed in the whole dataset compared with the results of the previous round of training. The dataset was trained for 10 rounds using different algorithms.

Figure

Comparison of sparsity in small input space. (a) After each round of TPL training, we calculate the mean and standard deviation of the number of activated minicolumns in each input to express the sparsity of the spatial pool. (b) After each round of TPL_SN training, we also count such indicators. The dataset was trained for 10 rounds using different algorithms.

Figure

Comparison of utilization degree of the minicolumn in small input space. (a) After each round of TPL training, we calculate the mean and standard deviation of the activation frequency of each minicolumn to express the utilization degree of the minicolumn. (b) After each round of TPL_SN training, we also count such indicators. The dataset was trained for 10 rounds using different algorithms.

The input space is constructed by numbers from 1 to 5000. The code length is set to 5000, 20000, and 40000, respectively. The two algorithms train all inputs for 10 rounds with different code lengths. Then, we collect and compare the results after each round.

Figure

The training time overhead of two algorithms. Each column in the graph represents the training time overhead of the dataset after a round of training with different code lengths. (a) The results trained by SPL. (b) The results trained by SPL_SN.

Figure

Comparison of stability in larger input space. Each node in the graph represents the proportion of inputs which SDRs have not changed in the whole dataset compared with the results of the previous round of training. The dataset was trained for 10 rounds using different algorithms.

Figure

Comparison of sparsity in larger input space. (a) After each round of TPL training, we calculate the mean and standard deviation of the number of activated minicolumns in each input to express the sparsity of the spatial pool. (b) After each round of TPL_SN training, we also count such indicators. The dataset was trained for 10 rounds using different algorithms.

Figure

Comparison of the utilization degree of the minicolumn in larger input space. (a) After each round of TPL training, we calculate the mean and standard deviation of the activation frequency of each minicolumn to express the utilization degree of the minicolumn. (b) After each round of TPL_SN training, we also count such indicators. The dataset was trained for 10 rounds using different algorithms.

The input space is constructed by the New York taxi passenger flow with 5000 data. In this dataset, the largest piece of data is 39375. Therefore, we set the code length to 40000 to express the input. This setting can meet the requirements of the input space encoding. The two algorithms train all data for 10 rounds. Then, according to the training results of each round, we evaluate the characteristics of the spatial pool.

Figure

Comparison of training time overhead in the New York taxi passenger flow. Each column in the graph represents the training time overhead of the dataset after a round of training. The dataset was trained for 10 rounds using different algorithms.

Figure

Comparison of stability in the New York taxi passenger flow. Each node in the graph represents the proportion of inputs whose SDRs have not changed in the whole dataset compared with the results of the previous round of training. The dataset was trained for 10 rounds using different algorithms.

Figure

Comparison of sparsity in the New York taxi passenger flow. (a) After each round of TPL training, we calculate the mean and standard deviation of the number of activated minicolumns in each input to express the sparsity of the spatial pool. (b) After each round of TPL_SN training, we also count such indicators. The dataset was trained for 10 rounds using different algorithms.

Figure

Comparison of the utilization degree of the minicolumn in the New York taxi passenger flow. (a) After each round of TPL training, we calculate the mean and standard deviation of the activation frequency of each minicolumn to express the utilization degree of the minicolumn. (b) After each round of TPL_SN training, we also count such indicators. The dataset was trained for 10 rounds using different algorithms.

In this paper, we propose a fast spatial pool learning algorithm called SPL_SN. The spatial pool is reconstructed so that more information and states are provided into the minicolumn. We propose a minicolumn selection strategy based on the load-carrying degree and a synaptic adjustment algorithm based on compressed encoding. These improvements not only ensure the flexibility of the spatial pool but also greatly improve the training efficiency and stability. In the future research, we intend to construct a model based on HTM which can deal with the data with 3D (2D spatial+1D time) feature. Besides, we intend to implement a content-based fast retrieval system that can improve the retrieval speed of such applications.

The artificial data used to support the findings of this study are included within the article. The time-period statistics of New York taxi passengers can be found at

The authors declare that they have no conflicts of interest.

This research work was supported in part by the National Natural Science Foundation of China with grant no. 61806086, in part by the Project of National Key R&D Program of China (2018YFB0804204), and in part by Jiangsu Provincial Doctoral Innovation Fund (CXZZ13_0689).