# What kind of neural network is the best for classifying a series of vectors

I am currently working on a project where I decided that it might be useful to use machine learning. I have a good understanding of pytorch and I know how to build my neural network within this framework.

However, currently I am struggling to find the perfect kind of neural network to solve my problem.

Let me describe the problem:

You have a game which you have developed and you want to develop an anti cheat for all sorts of cases. Now just for an example i will choose "fly-hacking". What i am trying to do is record all of a players data over a period of time. Let's say within 1 second i will take n "snapshots" of a current players state over e.g. 5 seconds. This data includes the position vector in a 3-dimensional space (x,y,z), and some data of his surroundings which will be just split up in small areas (e.g. 3x3x3 matrix), now if i know there are solid objects in his surroundings they will be represented by 1 and if an area is empty it is 0.

Now my input data could be looking like this for a standing person: (4.2, 10.2, 3.2, 0, 0, 0, 0, [....], 0, 1, 1, 1) which would just be representing a player who is standing on a plane with nothing else arround him. And if i collect this data over 5 seconds with e.g. 3 snapshots per second i would end up with an array of 15 elements.

I can collect a fair amount of these vectors and labels them with "flying" and "not-flying" categories. I just need a fitting neural network model which would fit my problem best.

In the end I think it is just a classification problem between "flying" and "not flying" but I am struggling with the idea of which model would learn the fastest and easiest from this data.

Maybe you can help me out here and give some advice where to start :)

## 1 Answer

First, let me point that knowing how to use PyTorch is not enough to work with neural networks.

Second, your data points have about 450 elements from which 405 are binary (solid object or not), neural networks will require you to place then as real elements for training, dealing with floating points where you could make a faster processing using models that can deal with this kind of data. After training you can speed up predictions by changing the implementation of your layers to avoid the trivial multiplications with 1 and 0.

Third, neural networks are not a silver bullet, you should try simpler models first, just to check it you actually need the power of a neural network and it's non-linearity. Check some alternatives and guides for time-series analysis. I woul go with a Random Forest or a decision tree, you should be able to make them fairly simple and then do an analysis of what's relevant for solving your problem.

That said:

### First Step:

Your data is composed of vectors that can be flattened to $$R^{450}$$ ($$15 \times (3 \times 3 \times 3 + 3)$$) which is a fairly small vector, few fully connected layers (two or three should be enough) may solve your problem, that should be your first try (in neural network).

### Second Step

If that doesn't suffice, you can try more complex models:

Your data has the following format:

$$P = (x,y,z,t)$$, which is the position of a player in time.

$$D_{geo}(P) \in R^{3 \times 3 \times 3}$$, which is a tensor describing their surroundings.

Since, $$P$$ resembles a time-series, LSMTs are usually indicated for this kind of analysis. Since you plan on using fixed time-steps, a CNN could be used, keeping data format as a tensor ($$T \in R^{3 \times 3 \times 3 \times t}$$) and using few CNN layers to extract information from the geographical information and only then joining the positions with it (assuming you want a fast processing model).

The actual shape of your CNN layers could will have to be tunned with a grid search.

• Thank you for the answer, basically thats the conclusion to which we got on this reddit post reddit.com/r/MachineLearning/comments/i8vqwh/… I'll go with a simple CNN first and maybe try out an LSTM or working with InceptionTime but i'll check that out later – Fabian Schmidt Aug 17 '20 at 9:17
• Upvote or accept questions you find useful. – Pedro Henrique Monforte Aug 17 '20 at 9:57
• I like how the reply to "choose a simple model first" is "good idea, I'll do a CNN" :-) – cag51 Sep 15 '20 at 3:22