180 - LSTM Autoencoder for anomaly detection

180 - LSTM Autoencoder for anomaly detection

DigitalSreeni

3 года назад

84,491 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@yueyangu
@yueyangu - 23.11.2023 19:47

Thanks! But I don't understand why the model is trained to predict y, while the anomaly score is given based on MSE between y_pred and X. Shouldn't it be between y_pred and y?

Ответить
@traveler6062
@traveler6062 - 24.10.2023 13:35

I believe it should be model.fit(trainX, trainX) instead of model.fit(trainX, trainY)

Ответить
@imeddrioua2500
@imeddrioua2500 - 15.09.2023 00:36

Thank you for sharing !
What i can't understand here, is the part where we create the anoamly_df.
we know that for each sequence of 30 observations, we have a single MAE.
so how can i detecte which observation of these 30 is the anomaly within a sequence ?

Ответить
@maaleem90
@maaleem90 - 23.07.2023 12:40

that's a great video sir. although i got two things to say one is sir , it we be a great pleasure to vide only on time distributes and the other thing sir a query .
here we set return sequences as false and then used a repeat vector so that we can stack a LSTM layers again .
but cant we just use repeatvector as True in first layer so that we can eliminate that repeatvector layer .
the thing using repeat vector is it a thing particular to autoencoder using LSTM or it is just an experimental thing tried for for better accuracy, i mean we can also try setting return sequences as true and remove repeat vector layer?

Ответить
@9Manzar9
@9Manzar9 - 06.07.2023 14:06

Isn’t this trained on next value regression and not reconstruction? Seems like you just mix the architectures and do next value prediction and then evaluate based on the regression error

Ответить
@gabrifroja5186
@gabrifroja5186 - 27.06.2023 20:43

I have a multivariate dataset with 86 dimensions, instead of 1 like in the video.
How do I compute the MAE in this case?

Ответить
@studyhub3950
@studyhub3950 - 07.04.2023 15:54

Firstly thanks. My question is that when input is 30*1 means 30 then how can be output 128 while in autoencoder we compress data then decode for example 30 to 15 to 10 then decode

Ответить
@yonadabjaredguzmanmendoza1576
@yonadabjaredguzmanmendoza1576 - 03.04.2023 20:38

Your content is awesome, it's really helping me to understand more concepts about ML because you don't only stand with the theory but you moving through the practice (that's pure gold for me). Thanks for sharing all of those knowledge with us !

Ответить
@whenmathsmeetcoding1836
@whenmathsmeetcoding1836 - 30.03.2023 13:17

Hi Sreeni seems like you are feeding the neural network incorretly for autoencoder input and output should be same I traied with this code and got better results for the same

es = EarlyStopping(monitor='val_loss',patience=5)
history = model.fit(trainx,trainx,epochs=100,batch_size=32,validation_split=.1,callbacks=[es])

Epoch 16/100
235/235 [==============================] - 10s 43ms/step - loss: 0.0287 - val_loss: 0.1243

Ответить
@mcfrenzyo2645
@mcfrenzyo2645 - 29.03.2023 20:35

Hi, thanks for your video. Please, is there a way I can pull out the encoder compressed data with the original number of rows for supervised learning? I have actually tried it and the size I got was just the sample size instead of the size of the original number of rows.

Ответить
@mukhtarayusuf4787
@mukhtarayusuf4787 - 26.02.2023 17:13

So inspiring! Well done. How do we get the codes please?

Ответить
@InformatikInsider
@InformatikInsider - 18.02.2023 00:35

Well done! Thanks for this nice video! Greetings from Germany

Ответить
@priyal_001
@priyal_001 - 04.02.2023 09:34

The best video i have ever seen, great

Ответить
@naasvanrooyen2894
@naasvanrooyen2894 - 29.12.2022 23:10

Thanks alot for these videos. Just a question, should trainMAE not be calculated with trainY instead of trainX? Im a bit confused.

Ответить
@olivierlourme9521
@olivierlourme9521 - 14.10.2022 12:04

Thank you for this valuable video!
Is it necessary to perform a standardization (via StandardScaler methods) as there is only one feature ?

Ответить
@alessandroaquino5027
@alessandroaquino5027 - 12.10.2022 17:53

if I wanted to use the lstm autoencoder having in input a dataset containing some text and not a temporal sequence, can it be done?
for example with a dataset containing fake news

Ответить
@malavvibhakar9001
@malavvibhakar9001 - 23.08.2022 20:48

I have got error in the end
y = scaler.inverse_transform(test[timesteps:].Open),
Expected 2D array, got 1D array instead

I also tried to reshape but still got a same error
so could you help me with this

Ответить
@Arcziisk8
@Arcziisk8 - 14.08.2022 21:34

How can we compare different models how it went when there are no labaled anomalies?

Ответить
@akashgopikrishnan5019
@akashgopikrishnan5019 - 07.08.2022 19:01

Can you explain how to do the same with supervised anomaly detection with labeled multivariate dataset using LSTM

Ответить
@denys2698
@denys2698 - 04.08.2022 12:02

how to do the same idea of anomaly detection but not for time-series data, for example, having clients in hospital and checking their health tests?

Ответить
@maclovesgeet
@maclovesgeet - 29.07.2022 00:01

Thank you. I could follow your story even though I am not a data scientist. You have unique skills of explaining something complex in simple words with good enough details.

Ответить
@utkarshsharma9708
@utkarshsharma9708 - 26.07.2022 16:22

Thank you for a very informative video.

I have one question (anyone can answer it)

What advantage does autoencoders give for anomaly detection over classical ML algorithms?

Ответить
@PavanKumar-hp1el
@PavanKumar-hp1el - 11.07.2022 08:09

I have a doubt here in autoencoders that output is also x then here why did you trained model with trainx and trainy. instead of train
x and train x

Ответить
@7thdayadventist562
@7thdayadventist562 - 02.07.2022 08:27

Sir could you please provide a video on LSTM Variational Autoencoder for multivariate time series.

Ответить
@chymoney1
@chymoney1 - 23.06.2022 02:39

Wow this was fantastic! I didn't even know what an autoencoder was before watching

Ответить
@adityahpatel
@adityahpatel - 21.06.2022 11:06

In all other autoencoder videos you've done .fit(x,x). Why are you doing .fit(x,y) here?

Ответить
@tunabediz930
@tunabediz930 - 02.06.2022 14:37

Thank you very much for the tutorial.
I have a problem with sns.lineplot (row 142). I always get below error. How can I fix it?
ValueError: Expected 2D array, got 1D array instead:
array=[0.57032452 0.37515913 0.19478522 ... 0.32379982 1.23183246 0.9894165 ].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

Ответить
@ilhammmm13
@ilhammmm13 - 25.05.2022 15:28

i have problem with plotting anomalies (last task), How do I solve ValueError: Expected 2D array, got 1D array instead?

Ответить
@zehra2334
@zehra2334 - 05.05.2022 18:03

How one feature can be 128 features... I couldn't understand here? (Input -LSTM1) @DigitalSreeni

Ответить
@habibuallahmanzoor9051
@habibuallahmanzoor9051 - 12.04.2022 18:09

I am having trouble plotting testPredict and testX. I want to see the predicted curve.

Ответить
@abulfahadsohail466
@abulfahadsohail466 - 09.03.2022 23:29

Sir I have Timeseries dataset in which time and vibration accelerationd have been recorded. So I have to classify the faults of tool on the basis of that dataset on the basis of LSTM. so how to use it.

Ответить
@arnoldjanbitangjol8911
@arnoldjanbitangjol8911 - 24.02.2022 09:48

Can I use this method for clustering?

Ответить
@withknowledgeitriump
@withknowledgeitriump - 23.02.2022 13:23

I have a question, if I am working on a multivariate problems where i have 7 features in my data and I am using for eg. 6 features to predict 1 feature, how should I modify the code to output 1 feature since my trainX.shape[2] contains 6 features instead of 1?

Ответить
@fernandocabrera9072
@fernandocabrera9072 - 06.02.2022 20:48

Thank you . Very clear explanation !!

Ответить
@swamchem
@swamchem - 02.02.2022 09:44

Hi Sreeni, Thanks for the great video. But I just curious to know that after you perform Standard Scaler transformation, how the type of train & test was in pandas data frame. It will be converted to numpy array, once you have done any transformation.

Ответить
@m1a2tank
@m1a2tank - 29.01.2022 16:36

why does your script did not work in my colab environment? train loss does not reduced down to 0.3 which is much bigger value than your video. for me. every value of "trainPredict" is near -0.5 whereas trainY is distributed -1~4.

Ответить
@mindbodyzaid7814
@mindbodyzaid7814 - 22.11.2021 21:16

If the LSTM is reconstructing the same input sequence, why do you create an X and Y? Shouldn't the input and output be both the "X"?

Ответить
@DavidCH12345
@DavidCH12345 - 10.11.2021 23:41

If I understand correctly, autoencoder are not able to detect reocurring patterns. If this anomalous drop would be something reocurring, is there a ways to take this into account?

Ответить
@sangeetaoswal70
@sangeetaoswal70 - 09.11.2021 15:19

Thanks sir just video gave the starting point which was needed to work on (time series anomaly detection)

Ответить
@beagle989
@beagle989 - 26.10.2021 06:56

When I see DigitalSreeni I know I'm in good hands

Ответить
@youngzproduction7498
@youngzproduction7498 - 08.10.2021 10:39

Your explanation is simple but clear. Thanks for you effort.

Ответить
@FezanRafique
@FezanRafique - 30.09.2021 11:09

Subs Added, thanks for the wonderful video.

Ответить
@jamesmasai520
@jamesmasai520 - 27.08.2021 13:56

Thank you for kindly sharing this.

Ответить
@ihebbibani7122
@ihebbibani7122 - 26.08.2021 18:07

Thanks Sir for the videos. Do you have a tutorial on how we can use plotly that will give us at what events each anomaly corresponds ?

Thanks in advance

Ответить
@radityafijarpradana1484
@radityafijarpradana1484 - 16.08.2021 04:12

Extremely helpul. Thanks very much

Ответить
@mohammadyahya78
@mohammadyahya78 - 15.08.2021 14:52

This is extremely helpful. Thank you very much.

Ответить
@kmiyasar
@kmiyasar - 02.08.2021 12:57

The video is interesting. I have a doubt.
1. Given the network is used to train a network where the input and output are the same, why are trainX and trainY given in the fit command.
Shouldn't it be trainX, trainX.

Ответить
@mostafael-sayed4244
@mostafael-sayed4244 - 07.07.2021 11:09

can i use lstm with video analysis to detect anomaly ?

Ответить
@oussamacheta7106
@oussamacheta7106 - 27.06.2021 01:52

Thank you, it looks like GE got hit hard by the 2008-2009 economic crash and maybe by Covid-19 in 2020...

Ответить