TensorFlow 2.0 Tutorial for Beginners 14 - Human Activity Recognition using Accelerometer and CNN

Поділитися
Вставка
  • Опубліковано 23 гру 2024

КОМЕНТАРІ •

  • @timojeverett
    @timojeverett 3 роки тому +3

    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.

  • @IgorAherne
    @IgorAherne 5 років тому +11

    Thank you for these tutorials. Quite hard to find tf 2.0 videos right now, you are doing a great contribution

    • @KGPTalkie
      @KGPTalkie  5 років тому +1

      Thank you so much for watching. Please watch other videos and share those. Thank you.

  • @Lucifer-en3xc
    @Lucifer-en3xc 4 роки тому +4

    You mentioned to get the links from the description but they are not here!

  • @nirranjanrasaratnam2996
    @nirranjanrasaratnam2996 3 роки тому +7

    Brother Could you plz tell me how to use this trained model in real time?? I'm looking forward to hear from you. Thanks

  • @ishitagupta6369
    @ishitagupta6369 5 років тому +1

    Please share the architecture of the CNN model you have used

  • @muhammadzubairbaloch3224
    @muhammadzubairbaloch3224 5 років тому +3

    Sir the great. you are highly appreciate-able. I have no words to say thanks. Great lectures.

  • @riti1217
    @riti1217 2 роки тому +1

    Can you please provide blog link
    The link that you provided is not working

  • @Rikimkigsck
    @Rikimkigsck 2 роки тому

    How can we fix "class_names = label.classes" in plot_confusion_matrix at 51:08 "labels = label.classes" doesn't work either

  • @ayoige7937
    @ayoige7937 3 роки тому

    The frame segmentation method used, is that a sliding window or a fixed window technique.

  • @khushboosoni19
    @khushboosoni19 Рік тому

    Hello, thanks for this video. Would you suggest any videos on instance selection not feature selection?

  • @chiduralalakshmigayathri5782
    @chiduralalakshmigayathri5782 4 роки тому +2

    but your github link is showing page not found error

  • @flamming_arrow
    @flamming_arrow Рік тому

    It's very huge model. Reducing the size of x_train and x_test having no impact. What you suggest I do?

  • @bhaumikchaudhari1495
    @bhaumikchaudhari1495 4 роки тому +1

    Sir after data preprocessing and train model then next how we detect human activity can you give code for demonstration of activity from video

  • @damilareadeyoyin4083
    @damilareadeyoyin4083 Рік тому

    Great Video, how can we make predictions considering the train data has been reshaped

  • @arunaslipnickas4405
    @arunaslipnickas4405 5 років тому +3

    you should finish the code with lines to release the GPU memory. For instance:
    from numba import cuda
    cuda.select_device(0)
    cuda.close()

    • @KGPTalkie
      @KGPTalkie  5 років тому +1

      Thanks for pointing it out.

  • @chrisogonas
    @chrisogonas 3 роки тому +1

    Great stuff, and thanks for putting this together.

  • @hammadalitariq7027
    @hammadalitariq7027 3 роки тому +1

    Thankyou Sir,
    Can you instruct how to use this model to make predictions?

  • @Pxmuchim
    @Pxmuchim Рік тому

    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?

  • @Rikimkigsck
    @Rikimkigsck 2 роки тому

    This video helped me a lot can't thank enough!

  • @tyreesefranks6322
    @tyreesefranks6322 4 роки тому

    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

  • @akashpawar9058
    @akashpawar9058 5 років тому +2

    Another video has completed sir
    I saw cleaning and understanding data very typical
    Training data is very easy

    • @KGPTalkie
      @KGPTalkie  5 років тому +1

      Happy to know 😊

  • @aninditasaha0307
    @aninditasaha0307 4 роки тому

    Hi...can you help me to do the same CNN in UCIHAR dataset?

  • @sohaibjawad3307
    @sohaibjawad3307 5 років тому

    Why is len(processedList) equals 343,416, when originally the number of examples is 1,098,207?

  • @sound2810
    @sound2810 3 роки тому

    Thanks for the informative video. I tried to view your blog and code. But it's showing 503 error for past few days. Could u reupload the link.

  • @subhamsabud5723
    @subhamsabud5723 3 роки тому

    @ KGP talkie -- Can you please mention the IEEE reference paper related to this video.

  • @RajaKumar-fz6jo
    @RajaKumar-fz6jo 2 роки тому

    Where we can find code? Link given in discription is not opening

  • @fahadraza7152
    @fahadraza7152 3 роки тому

    Thank you for these tutorials.

  • @xuliu2010
    @xuliu2010 2 роки тому

    Dear sir,
    Have you published any papers on this subject? I'd like to learn from it.

  • @shubhamgugale7691
    @shubhamgugale7691 4 роки тому +1

    Can you please share the code for inference?

  • @mdjahidhasan513
    @mdjahidhasan513 3 роки тому

    how can I test my custom data in this model?

  • @tessa10001
    @tessa10001 3 роки тому

    Please share the notebook link.

  • @ashwaniprasad3613
    @ashwaniprasad3613 3 роки тому

    the confusion matrix doesn't get printed in my case :(

  • @jfabian
    @jfabian 5 років тому +1

    Shouldnt this be done using OneHotEncoding instead of Label Encoding?

    • @KGPTalkie
      @KGPTalkie  5 років тому

      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 ❤️.

    • @jfabian
      @jfabian 5 років тому

      @@KGPTalkie yup. But for accuracy using the OHE instead of label encoding Is better. models tends to believe than a 2 or 3 is better than a 1.

    • @rohitsingh-wm1gv
      @rohitsingh-wm1gv 4 роки тому

      @@jfabian bro im trying to using OHE
      but im getting error

    • @yashagarwal2486
      @yashagarwal2486 4 роки тому +1

      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 .

    • @MrSpiderboy7
      @MrSpiderboy7 4 роки тому

      Only if they were input variables.

  • @mehdihazrati7731
    @mehdihazrati7731 2 роки тому

    Thank you, it was great, but the link to your code doesn't work.

  • @saicharankukudala2357
    @saicharankukudala2357 4 роки тому

    Sir, is it Possible to get Good accuracy using Machine learning Models instead of Deep learning

  • @akhaled4990
    @akhaled4990 3 роки тому

    Brilliant video!

  • @rushabhdayannavar3675
    @rushabhdayannavar3675 2 роки тому

    I think there is no spatial relation in data, so why CNN ( convolution nn) ? You could have used fully connected nn.
    Plz anyone answer.

    • @KGPTalkie
      @KGPTalkie  2 роки тому

      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

  • @nafisatabassum227
    @nafisatabassum227 3 роки тому

    I can't fine out data set link please give me data set link or say how to fine out data set ???

  • @shivanigiri4308
    @shivanigiri4308 3 роки тому

    Thank you so much . Doing great work . Keep it up

  • @ramanjaneyuluthanniru1428
    @ramanjaneyuluthanniru1428 4 роки тому

    please provide the data set of WISDM.....
    we are unable to download it from original website

  • @muhammadhuzaifaasif7756
    @muhammadhuzaifaasif7756 4 роки тому +1

    a veryyyyyyyyyyyyyyyyyy awesome tutorial

  • @sodiqrafiu9072
    @sodiqrafiu9072 4 роки тому +1

    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.

    • @KGPTalkie
      @KGPTalkie  4 роки тому +1

      Dataset Link: www.cis.fordham.edu/wisdm/dataset.php

  • @maxwelllearning4923
    @maxwelllearning4923 6 місяців тому

    can you provide github link of this project?

  • @messaoudbessa5292
    @messaoudbessa5292 4 роки тому +1

    Good evening, thank you for your amazing video,
    i want to ask you how shoudl i do to predict new data!?, it seems that i have problem.
    thank you

    • @kalppanwala6439
      @kalppanwala6439 4 роки тому +1

      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 !

    • @KGPTalkie
      @KGPTalkie  4 роки тому +1

      Thanks for watching

    • @rohitsingh-wm1gv
      @rohitsingh-wm1gv 4 роки тому

      @@kalppanwala6439 I dont understand, im getting errors when i import new data and apply get_frames functions

    • @kalppanwala6439
      @kalppanwala6439 4 роки тому +1

      @@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

    • @rohitsingh-wm1gv
      @rohitsingh-wm1gv 4 роки тому

      @@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

  • @Rikimkigsck
    @Rikimkigsck 2 роки тому

    Why did you use 2D CNN but not 1D?

  • @YasinShah1
    @YasinShah1 5 років тому +1

    great work. I really appreciate. very detailed and informative tutorial.

    • @KGPTalkie
      @KGPTalkie  5 років тому

      Thank you so much Yasin ❤️

  • @polassingha447
    @polassingha447 4 роки тому

    what output show in this project

  • @rarryabatol6196
    @rarryabatol6196 4 роки тому

    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?

    • @rasachin8592
      @rasachin8592 4 роки тому

      Hey I'm trying to do the same too. I've two accelerometer data reading and not sure for to train the model.

  • @Ceglasty9
    @Ceglasty9 4 роки тому

    Where do i find the notebook link?

  • @khemant7067
    @khemant7067 3 роки тому

    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

  • @sonalyadav2487
    @sonalyadav2487 4 роки тому

    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.

  • @maheshmishra9454
    @maheshmishra9454 4 роки тому

    Can this be used to show a live demo of falling ???

  • @sohamkatkar4535
    @sohamkatkar4535 4 роки тому

    what if the dataset is in CSV format?

  • @xuhans9748
    @xuhans9748 4 роки тому

    Sir, May I know why do you need to reshape the X_train to (425, 80, 3, 1) at 40:40 ? I'm confused about the '1' added there. Thanks!

  • @gourabasis
    @gourabasis 3 роки тому

    Nice video bro, are you able to integrate the model into android as tflite? And how do you handle the input size for the model in android studio?

  • @mohammedtaherhabeeb3049
    @mohammedtaherhabeeb3049 3 роки тому

    Hi can you help me to start this project ?!!

  • @rohitsingh-wm1gv
    @rohitsingh-wm1gv 4 роки тому +1

    Hey sir
    Can I test with my own personal data
    I dont want it to predict
    I want it to classify

    • @KGPTalkie
      @KGPTalkie  4 роки тому +2

      Thanks for watching. Yes you can test it with your data. Use preexisting data for training then use your data for prediction.

    • @rohitsingh-wm1gv
      @rohitsingh-wm1gv 4 роки тому +1

      KGP Talkie I’ll do that thanks

    • @KGPTalkie
      @KGPTalkie  4 роки тому

      Thanks ❤️

  • @avastone9968
    @avastone9968 4 роки тому

    How to test an unmarked data on your model?

  • @filbertdaniel3276
    @filbertdaniel3276 3 роки тому

    Link code is broken buddy may u renew the link for code?

  • @jalaludinzakaria2949
    @jalaludinzakaria2949 4 роки тому

    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 ?

  • @jenilgandhi9941
    @jenilgandhi9941 4 роки тому

    bhai aapka github pe jo link hai vo khul hi nahi rahi hai repos delete kar diye hai kya??

  • @muhammadzubairbaloch3224
    @muhammadzubairbaloch3224 5 років тому +4

    Sir please make a video on brain tumor detection by using CNN

    • @KGPTalkie
      @KGPTalkie  5 років тому

      I will try it sure 😊😊😊

  • @brownsquare77
    @brownsquare77 Рік тому

    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.

    • @merzouklyza8800
      @merzouklyza8800 8 місяців тому

      Pls can u share it with me

    • @jaehochoi8062
      @jaehochoi8062 8 місяців тому

      @@merzouklyza8800 # start of original code in youtube
      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]
      label = stats.mode(df['label'][i: i+frame_size])[0][0]
      frames.append([x,y,z])
      labels.append(label)
      print('before reshape
      ', frames[0:10])
      frames = np.asarray(frames).reshape(-1, frame_size, N_FEATURES)
      print('after reshape
      ', frames[0:10])
      labels = np.asarray(labels)
      return frames, labels
      # end of original code in youtube
      # start of revised code
      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]
      label = stats.mode(df['label'][i: i+frame_size])[0][0]
      frames.append([x,y,z])
      labels.append(label)
      # hereafter added code
      newframes = []
      k = 0
      m = 0
      for k in range(532):
      for m in range(80):
      newframes.append([frames[k][0][m], frames[k][1][m], frames[k][2][m]])
      print(len(newframes))
      # end of added code
      frames = np.asarray(newframes).reshape(-1, frame_size, N_FEATURES)
      labels = np.asarray(labels)
      return frames, labels
      # end of revised code

  • @arunaslipnickas4405
    @arunaslipnickas4405 5 років тому +1

    Good job.

  • @neerajvarshney9275
    @neerajvarshney9275 4 роки тому

    Your github link is not working. please check once

  • @uddhavn
    @uddhavn Рік тому +1

    how to fix error on line 38

    • @merzouklyza8800
      @merzouklyza8800 8 місяців тому +1

      Are find a solution to fixe that plz ?

    • @Milan_Zavada
      @Milan_Zavada 7 місяців тому

      @@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)

  • @mohammedshoeb1151
    @mohammedshoeb1151 4 роки тому

    Great work.

  • @ankitkeshri6830
    @ankitkeshri6830 4 роки тому

    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????

    • @KGPTalkie
      @KGPTalkie  4 роки тому

      Yes you can deploy it. Integrate it with Android Apps.

    • @ankitkeshri6830
      @ankitkeshri6830 4 роки тому

      @@KGPTalkieUsing Android Studio ?
      How to do it sir any video link or website help???
      This Is my final yr project and I don't know how to do it

    • @KGPTalkie
      @KGPTalkie  4 роки тому

      Well. Of course you need to first make some Android Apps. Search on UA-cam you will get lots of good resources.

    • @ankitkeshri6830
      @ankitkeshri6830 4 роки тому

      @@KGPTalkieThankyou so much sir !!!

  • @garvrathi6470
    @garvrathi6470 Рік тому

    Brother can you share your github link for your code

  • @alphalimit8
    @alphalimit8 5 років тому +1

    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!

  • @nakulamate3558
    @nakulamate3558 4 роки тому

    u used fit_transform but u mention previously it needs to be done for training u are doing it for full dataset why?

    • @nakulamate3558
      @nakulamate3558 4 роки тому

      sorry i got it but why did u used 2d instead of 1d when data was not image

    • @MrSpiderboy7
      @MrSpiderboy7 4 роки тому

      @@nakulamate3558 Data is 2D.. It has components in x, y and z. Its why he applied a reshape

  • @ankur31100
    @ankur31100 4 роки тому

    Sir GitHub link for downloading file is not working please provide.

    • @KGPTalkie
      @KGPTalkie  4 роки тому

      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 UA-cam 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.

  • @fahadraza7152
    @fahadraza7152 3 роки тому

    sir, please make tutorials on detect accelerometer data using an android device

  • @arjuns8072
    @arjuns8072 4 роки тому

    Code is missing in github

  • @PratapO7O1
    @PratapO7O1 3 роки тому

    video starts at 2:00

  • @emna_belhaj
    @emna_belhaj 2 роки тому

    Why have you used CNN and not RNN ?

  • @karthikkumar3878
    @karthikkumar3878 4 роки тому

    I need base paper for u explained.

  • @陳廷威-m3c
    @陳廷威-m3c 4 роки тому

    Very helpful

  • @icarofreitas6523
    @icarofreitas6523 2 роки тому

    Thanks

  • @vikaskumar-nk2yu
    @vikaskumar-nk2yu 5 років тому +1

    make video on flowers recognigation

    • @KGPTalkie
      @KGPTalkie  5 років тому

      I am really excited to make one on flower plant recognition. I will make one soon. Thanks for watching.

  • @abhijeet6989
    @abhijeet6989 3 роки тому

    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!

  • @abhijeet6989
    @abhijeet6989 3 роки тому

    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?

  • @Lucifer-en3xc
    @Lucifer-en3xc 4 роки тому

    Where are the code links?

    • @KGPTalkie
      @KGPTalkie  4 роки тому

      Please follow along the video. Due to some technical issue codes are not available.

    • @Lucifer-en3xc
      @Lucifer-en3xc 4 роки тому

      @@KGPTalkie Okay. It's a nice way to analyse this type of data without understanding about signal processing

  • @jaspreetkaur-yh1ve
    @jaspreetkaur-yh1ve 5 років тому +1

    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?

    • @KGPTalkie
      @KGPTalkie  5 років тому

      Thanks for watching ❤️ 😍. Currently I am on leave.

  • @karthikkumar3878
    @karthikkumar3878 4 роки тому

    mam i have error

  • @Sum-np9gk
    @Sum-np9gk 7 місяців тому

    ---------------------------------------------------------------------------
    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

  • @ankitaparashar2816
    @ankitaparashar2816 3 роки тому +4

    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

  • @michalpesko5598
    @michalpesko5598 10 місяців тому

    Great video, really helpful, thanks!