How can I encode the relations between two entities?

Hi,
I want to use the HTM.JAVA framework to predict what will happen the next step based on the sequence of behaviors, the sequence consists of different behaviors in a time order, such as : A->B->C->A->D…
how can I encode the relations between the behaivors, I have two types of encoding strategies:

  1. decompse the sequence into tuples such as A->B, B->C, C->A…and encode the tuple as a SDR;
  2. encode each separate behavior as a SDR, and the whole sequence is converted to a sequence of SDRs.
    I want to know, which will be better for the prediction accuracy?
    If I use the first strategy, how can I encode the relation into a SDR?
    thanks

I have no practical experience but I think the second one is how you’re supposed to do it.
Just make sure to encode to represent semantic information properly.
(i.e. behaviors with a common feature should have some common bits on)

1 Like

So the entities you’re trying to compare are temporal sequences, not spatial patterns?

Infact, I am not sure about the spatial patterns, I want to model the cyber attacking steps triggered by specified attacker, the sequence is sort of the steps that left by attacker when they infiltrating the networks. So, I want HTM can learn the sequence and forcast the next step attacker mostly do.
but I am not very sure how to define the sematics between the steps, the steps are the evidence of the attacking strategy. I don’t know what is the better way to encode the sequence to leverage the abilities of the HTM in the pattern learning and prediction.
please give me the advices, thank you very much!~~

I found that the behaviors will be always encoded with common bits on as long as the two behaviors are sent to the spatial pooller one after another. In other words, the data with simmiliar semantic should be encoded in a fixed order. Yes? That will conflict with the real order in a specified sequence. The concepts described above are learned by reading the HTM.java example (gym) , maybe misreading, I hope the correct explanations, thanks very much!~~

Do you have a lot of data that represent these hacker actions you can use to train a system on this behavior?

yes, I have downloaded the network intrusion dataset, about serveral GBs of original network traffic data that contains various types of attacks. I have extracted the behaviors from the dataset.
but, the attack actions are extracted into sessions between each pair of hosts. So, there will be many sessions, I want to convert the sessons into bit arrays and learn the patterns using HTM.

Maybe, there is a need to filter out the sessons really belong to a specified attack scenario that can train the system, and the attack scenario should happen many times, so, we can gather enough data about that attack.

In real network environment, the attacker may use many types of attack technologies only once in a intrusion progress, mybe this is what you are concerning, me too.

I have another question: Is HTM technology suitable for the online learning tasks about the intrusion behavior pattern extracting in a real time manner? The behaviors maybe diverting all the time due to the uncertainty of the hacker. but, there will be a pattern definitely that describing the strategy of the intrusion.

do not need retraining is a very good property of the HTM, however, it makes me concern about the “forgetfulness” of the HTM.
donot need retraining, means it can continuously learn a streaming data, at the same time, it is implying that it cannot store the learned patterns forever, because the data will drive the HTM to forget the pattern that not appear in the data any more. If the data patterns change frequently, maybe, the HTM will learn nothing at all.

I want to use the HTM in my studies about the online intrusion predictions, but I just cannot find a appropriate way.

please give me some advices… thanks very much.