# Multiple Keras Layers for Sensor Model

**URL:** <https://discuss.tinyml.seas.harvard.edu/t/multiple-keras-layers-for-sensor-model/1117>\
**Category:** General Discussions\
**Created:** [July 5, 2022, 4:22am UTC](https://discuss.tinyml.seas.harvard.edu/t/multiple-keras-layers-for-sensor-model/1117 "2022-07-05T04:22:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rocksetta](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@Rocksetta](https://discuss.tinyml.seas.harvard.edu/u/Rocksetta)\
**Post date:** [July 5, 2022, 4:22am UTC](https://discuss.tinyml.seas.harvard.edu/t/multiple-keras-layers-for-sensor-model/1117/1 "2022-07-05T04:22:30Z")

</div>

@brian_plancher  
@marcozennaro

Perhaps someone here can make a suggestion, for something I have posted on the EdgeImpulse forum to: [generic-sensor-raw-data-to-keras-classification](https://forum.edgeimpulse.com/t/generic-sensor-raw-data-to-keras-classification/4902/2?u=rocksetta)

My high school students would never add a different layer to a Keras model, but they would duplicate or delete a layer to improve an already working model. So I want to make a Keras model with lots of different layers for the students to optimise.

Can anyone think of a model that uses lots of Keras layers that is reasonably sensible for multiple sensor inputs and classification outputs.

My students sensor data might range from

1. 5 flexible sensors.
2. Pixy2 Camera `https://pixycam.com/pixy2/` with data: shade, x, y, width, height and a few other data points.
3. temperature, humidity, light, wind speed…
4. 2-4 various air quality sensors such as CO2, VOC, Ozone
5. motion (x, y only) with several touch sensors
6. GPS with Acceleration

Here is a possible suggestion from `https://machinelearningmastery.com/cnn-models-for-human-activity-recognition-time-series-classification/`

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/tinyml1/original/1X/c1e7275d565f256d30e5ee447eb63e5a747e4d2b.png)

Anyone got any other ideas? I am presently testing the above without the MaxPooling. Any suggestions for how to fit in a 2D Convolution layer for regular sensor data?

---

<div class="post-metadata">

**Author:** ![brian\_plancher](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.tinyml.seas.harvard.edu/brian_plancher/32/85_2.png) [@brian\_plancher](https://discuss.tinyml.seas.harvard.edu/u/brian_plancher)\
**Post date:** [July 16, 2023, 7:09pm UTC](https://discuss.tinyml.seas.harvard.edu/t/multiple-keras-layers-for-sensor-model/1117/2 "2023-07-16T19:09:40Z")

</div>

Two thoughts:

1. If you know good model architectures for each sensor independently – you could consider having effectively separate model heads that combine into a unified tail – then you can use the model heads that you know work well – I haven’t done this but know its possible.
2. To fit a Conv2D you could reduce the number of filters because that is effectively the size of another dimension in terms of the number of parameters

---

<div class="post-metadata">

**Author:** ![brian\_plancher](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.tinyml.seas.harvard.edu/brian_plancher/32/85_2.png) [@brian\_plancher](https://discuss.tinyml.seas.harvard.edu/u/brian_plancher)\
**Post date:** [July 16, 2023, 7:10pm UTC](https://discuss.tinyml.seas.harvard.edu/t/multiple-keras-layers-for-sensor-model/1117/3 "2023-07-16T19:10:28Z")

</div>

And I recognize this is like a year later but for some reason the UI just gave me the notification lol – sooo what did you do to fix this? Curious what worked!
