Thanks for putting this together, excellent clear introduction. I spent a little more time on the preprocessing of data and split the lines that had a missing newline so that there were two samples on each line and dealt with another couple of problems with the raw data. This resulted in about 3 times as much data over all (just over a million samples) and using your training model got an accuracy of 94% on test set after 13 epochs. Thank you again for the time you have put into making everything so clear.
Great video. Is there any chance you could explain in more detail your steps for input 50 (under the 2D CNN model heading). I can’t quite understand it
Hi! Thanks for the great video! Is there a way to integrate Gyroscope data together with Accelerometer data into the CNN in this video for Human Activity Recognition?
Really good tutorial! How can I add gyroscope and magnetometer data into the training data set? should I add them as if they are additional "channels" like RGB channels for images?
Hello KGP Talkie, Thanks for always being there for us. Please, I need the dataset use in this project. I checked the link and I was unable to download it and it is also not available on your Github account. Thanks and Appreciate.
Maybe you can make a tutorial to test your model that is it exactly works in real implementation or not, maybe using android device to get accelero data, btw nice video keep it up!
Hello sir, I would like to ask a few questions regarding this coding. def get_frames(df, frame_size, hop_size): N_FEATURES = 3 frames = [] labels = [] for i in range(0, len(df) - frame_size, hop_size): x = df['x'].values[i: i + frame_size] y = df['y'].values[i: i + frame_size] z = df['z'].values[i: i + frame_size] # Retrieve the most often used label in this segment label = stats.mode(df['label'][i: i + frame_size])[0][0] frames.append([x, y, z]) labels.append(label) # Bring the segments into a better shape frames = np.asarray(frames).reshape(-1, frame_size, N_FEATURES) labels = np.asarray(labels) return frames, labels X, y = get_frames(scaled_X, frame_size, hop_size) X.shape, y.shape ((532, 80, 3), (532,)) 1. The first thing I would like to ask is, is the value 532 means that it groups the data to read the first 532 samples ? I am a bit lost at your explanation there. Let say if I want the code to read the first 356 lines of my data ? My sampling rate is 0.1Hz and each data is 10second. How would I code that ? 2. What if my sampling rate, Fs is a floating number ? (0.1Hz) I would get an error that says "'float' object cannot be interpreted as an integer". How do i fix that ?
Hi, there are papers published on this topic which shows how effective it is. you can read this for better understanding of HAR mdpi-res.com/d_attachment/electronics/electronics-11-00322/article_deploy/electronics-11-00322-v2.pdf ieeexplore.ieee.org/document/7881728 iopscience.iop.org/article/10.1088/1757-899X/1031/1/012062/pdf
save the standard scaler and label encoder objects into .pickle file or in .json and when u have new data get new instance from the saved file and preprocess the data and predict it . Hope it helps !
@@rohitsingh-wm1gv first get new data then call get frames func and use the returned data as ur feed data n if u r getting errors than check the shape of input data u r providing to the get frames func
@@kalppanwala6439 I have trained the model with my own data shape The test data has the same number of coloums except for the label I expect the trained model to tell me what the test data is Thats why i havent included it in the testdata
I failed to predict a label with trained model file. And I found an error. You seem to train [x1, x2, x3], [x4,x5,x6]... instead of training [x1, y1, z1], [x2,y2,z2]... Now I get 89% of prediction of random data. I can give you error-corrected code if you want.
Hi, this can be done in several ways. It is just a matter of preference. So this is just another way to do this. I am sure this lesson might have helped you. Thanks for watching ❤️.
output -variable are label encoded in multi-class classification and one hot encoded in multi-label classification. And always one hot encoded if it is input feature .
Can anyone pls tell me now how to use this build model. I have build this model successfully but how to give video input and how it will give output by predicting the Han action? Pls help
Dear Sir, Greetings!! Thank you very much for outstanding implementation. I implemented same model on hospital data and getting 98%training accuracy but validation accuracy is very low 54%. I am requesting your guidance for same. Should I run 1 D CNN model over it? Or you suggest anything to achieve high validation accuracy using same model? . Thank you very much!
Hello, In this tutorial after frame preparation if I want to extract features like mean or standard deviation on this dataset then how will I proceed .please help me in this.
Dear Sir, Greetings!! Thank you very much for useful information. Can you please help me to know how to computer center of mass using left and right hand wrist gait data?
sir, loads of respect to you. u r a lifesaver. is it possible to contact you regarding my project on human activity recognition using Rnn, lstm and gru?
Sir can I deploy this project in my smartphone or any device ? Is it possible to link this code to any device for further data integrations. How to do it sir????
@@merzouklyza8800 Hi, I've managed to fix a code. Here's a solution: def get_frames(df, frame_size, hop_size): N_FEATURES = 3 # Number of features (x, y, z) frames = [] labels = [] for i in range(0, len(df) - frame_size, hop_size): x = df['x'].values[i: i + frame_size] y = df['y'].values[i: i + frame_size] z = df['z'].values[i: i + frame_size] # Retrieve the most often used label in this segment window_labels = df['label'][i: i + frame_size] if len(window_labels) > 0: mode_label = stats.mode(window_labels) try: label = mode_label.mode[0] except IndexError: label = df['label'][i] # Fallback to the first label in the frame if mode is empty or invalid else: label = df['label'][i] # Fallback if window_labels is empty frames.append([x, y, z]) labels.append(label) # Reshape frames into the desired shape frames = np.asarray(frames).reshape(-1, frame_size, N_FEATURES) labels = np.asarray(labels) return frames, labels X, y = get_frames(scaled_X, frame_size, hop_size) # Check the shapes print(X.shape, y.shape)
Hi, This is in regard to the code file which you requested for different topics.I request you to please get enrolled yourself and show your support and love to KGP Talkie. All the code files and video lectures have lifetime access with 30 Days money back Guarantee. Code and question-answer support are also available at Udemy. Code files of RU-vid lectures will be also available once you register in this course. Please send an email to udemy@kgptalkie.com with your registration details of this course and a list of other code files that you want. I promise you to give FREE COUPONS for the next course on Deep Learning and ML. You can click on the link mentioned below and can get yourself enrolled!! bit.ly/udemy95off_kgptalkie New content is added at Udemy: 1. Animation Plot [2 lectures] 2. Python Coding in Mobile [5 lectures] 3. Complete EDA of Boston Dataset [20 lectures] What else we promise in this course 1. Kaggle data EDA 2. Text data EDA 3. More Animation Plot 4. More 3D plots 5. Figure Aesthetics and Decoration 6. Free coupons for next course 7. And so much more. Hurry up!!! Only for a limited time. Please email your details at udemy@kgptalkie.com for the FREE COUPONS of the next course.
--------------------------------------------------------------------------- IndexError Traceback (most recent call last) Cell In[147], line 23 19 labels = np.asarray(labels) 21 return frames, labels ---> 23 X, y = get_frames(scaled_X, frame_size, hop_size) 25 X.shape, y.shape Cell In[147], line 13, in get_frames(df, frame_size, hop_size) 10 z = df['z'].values[i: i + frame_size] 12 # Retrieve the most often used label in this segment ---> 13 label = stats.mode(df['label'][i: i + frame_size])[0][0] 14 frames.append([x, y, z]) 15 labels.append(label) IndexError: invalid index to scalar variable. sir I am getting this error,help me sir
Hi, very nice article. Explained very clearly. Can you share the notebook link or the blog link. This link - kgptalkie.com/human-activity-recognition-using-accelerometer-data/ is not working