# Creating a car anomaly detection with Multiple field

**URL:** <https://discourse.numenta.org/t/creating-a-car-anomaly-detection-with-multiple-field/8544>\
**Category:** NuPIC\
**Tags:** question, multiple-inputs\
**Created:** [May 5, 2021, 10:40pm UTC](https://discourse.numenta.org/t/creating-a-car-anomaly-detection-with-multiple-field/8544 "2021-05-05T22:40:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sheiser1](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/sheiser1/32/766_2.png) [@sheiser1](https://discourse.numenta.org/u/sheiser1)\
**Post date:** [May 6, 2021, 6:51pm UTC](https://discourse.numenta.org/t/creating-a-car-anomaly-detection-with-multiple-field/8544/2 "2021-05-06T18:51:23Z")

</div>

Hi @thos1996, welcome!

> [@thos1996](#):
>
> Q1. Is it better to work with individual models or create a single model with multiple inputs, we are not interested in which field cause the anomaly but would be really great if the model can take advantage of the correlation between the fields.

With just 5 fields plus timestamp either way could work.

The multi-field model has the advantage of potentially finding relationships between the fields, and the single-field model has the advantage of showing different activity for each field.

I generally like the approach of multi single-field models, where an anomaly is raised when a certain % of the fields are being anomalous at the same time. I’d say it’s worth trying both tho.

> [@thos1996](#):
>
> Q2. I want to create anomaly windows, but I can’t figure out the best way to do that?

I’d create a data structure that stores the anomaly scores/likelihoods of each field for all time steps thus far (or the last n time steps). Then craft a sliding window logic which uses that info in some way. A simple baseline could just be: ‘any model is anomalous at all times where its last n anomaly likelihood vales average over 0.9’.

> [@thos1996](#):
>
> I was also not able to find any implementations or guide for the multifield model, so any direction will be helpful

Here are a couple threads about handling multiple input fields:

> [@Can HTM be used on multivarient time series problems?](https://discourse.numenta.org/t/can-htm-be-used-on-multivarient-time-series-problems/3316/24):
>
> Hey @steinroe, so I have my own python module which builds multiple NuPIC anomaly detection models from multivariate time series. It samples the first N rows to calibrate the encoders, then instantiates the models, applies them to the rest of the rows and saves them to disk. This yields a separate anomaly score for each field (csv column) at each time step, which can then be combined, thresholded or otherwise analyzed. I made it for my own research involving n-dimensional movements but general…

> [@Multi-variate data](https://discourse.numenta.org/t/multi-variate-data/8531):
>
> Hi all, I have question-related to multi-variate data. I have to find anomalies in 2000+ sensors of different characteristics, some sensors may have trend in it. Will HTM handles trend and find the anomalies? or do we need to remove trend? Also, do we need to have 2000+ HTM models? and how much time it may take for time series having 200,000 points?

Best of luck!

---

_[View the full topic](https://discourse.numenta.org/t/creating-a-car-anomaly-detection-with-multiple-field/8544)._
