In order to predict the first out-of-sample datapoint you should take a sequence of the data and pass it to the LSTM model (example in pseudo-code):
pred = model.predict(X[-10:])
For the next predictions you'll have to include the current prediction into the data passed to the model.
X = X + [pred]
next_pred = model.predict(X)
In the definition of the convolutional layer you defined input shape to be (77, 1), but then your actual input has shape (None, 1, 77). As you can see, the dimensionality of the axes are swapped. They should match.
To deal with your problem, it is important to know how LSTM works exactly: when you have two linked variables with a very different pace, the LSTM parameters for forgetting or memorizing will probably have to do a big gap that could alter the predictions.
Like any other physic ML problem, your variables need to be at a "common sense" scale, and ...
In your case, it seems that time has a clear meaning because you have a movement logic between images. As a consequence, I would recommend models adapted to videos like MetNet, ConvLSTM or PredRNN...
You question has two parts 1) how to use LSTM to find anomalies in time series data 2) how to deal with imbalanced data.
Regarding 1) the closest thing comes to my mind is this post from the sister website https://stats.stackexchange.com/questions/127484/cluster-sequences-of-data-with-different-length/440432#440432 - the only difference is you have labeled ...
The metric to the time series forecastability is "the spectral entropy". I learned it from some talk of Rob Hyndman, so here is the description of his implementation for R tsfeatures package, entropy
The spectral entropy is the Shannon entropy −∫π−πf^(λ)logf^(λ)dλ,
where f^(λ) is an estimate of the spectral density of the data. This
measures the “...
Before some days I had the same problem and I found quite useful these sites, https://machinelearningmastery.com/how-to-develop-lstm-models-for-time-series-forecasting/, https://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/ and https://www.tensorflow.org/tutorials/structured_data/time_series.
I don't think you actually need regularization since regularization techniques are needed in an overfitted model but your model works poorly on both train/validation sets, which is evidence of underfitting.
If you want to improve your network, you can consider adding more layers to your network (e.g. stacked LSTM). I don't know what exactly the Haiku is but ...
I had this issue - while training loss was decreasing, the validation loss was not decreasing. I checked and found while I was using LSTM:
I simplified the model - instead of 20 layers, I opted for 8 layers.
Instead of scaling within range (-1,1), I choose (0,1), this right there reduced my validation loss by the magnitude of one order
I reduced the batch ...