Epilepsy classification using Welch power spectral density (Complete EEG tutorial)

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • In this tutorial we will learn how to do epilepsy classification using EEG. we will use power spectral density using welch method as features and random forest classifier from sklearn as machine learning model.
    Code is available here
    github.com/tal...

КОМЕНТАРІ • 38

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

    Great video. Sir, since now all of your videos are about binary clasaification. Can you please make a tutorial about multiclass classification using eeg? It will be a great help

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

      Actually multiclass has nothing to with EEG, let say for this tutorial, nothing changes in code, except instead of control and epilepsy, you have multiple variable, one for each class. And instead of O and 1, you need to have 0,1,2 etc

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

    Great video sir...... can you please do also share some videos on other physiological signals like ECG, Blood Pressure, or Respiration. It will be great help

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

    sir, Your videos are very helpful to my research. can you include a video on SEED-VIG dataset?

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

    Good

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

    great video sir, .......After feature extraction how can we show a table with mean of all features across each band...would be great help sir

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

      You cant have a 3d table. Because its subjects x bands x features. So you have to index subjects

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

    Hi, where r u from? Let me know where these labs available in Andhrapredesh

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

    Assalam Alaikum Sir, thank you for this amazing video. I have been trying to run your exact codes but am getting the following message when I run the ..... features.append(eeg_power_band(data[d])) command. I have counterchecked the commands line by line but don't see any problem. Kindly assist Sir, Baraka'Allah Fiykoum:
    ..........
    RuntimeError: Unknown instance type in Spectrum

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

      It says your data is not in the form of epochs

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

    Do you have classes for learning eeg in python?

    • @talha_anwar
      @talha_anwar  2 роки тому +2

      Please follow mike x cohen course on udemy, he has v good course on eeg with python and matlab

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

      @@talha_anwar I cant find it please send the link

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

      @@maryamkhoshkhoo9030 start with this course, its in matlab. the python implementation is available here
      github.com/rklymentiev/nsp-course

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

    Assamualikum brother, could you please solve a problem which I am facing in your this code, this instruction is shown, after running the cell number 16 of your code(copied from github). Google Bard is telling that the function 'psd_welch' is no longer available in the 'mne.time_frequency' module. This is because the function was deprecated in version 1.2 of MNE and removed in version 1.3. Use the 'compute_psd()' method of the 'Raw' or 'Epochs' object. So brother I am requesting you to please just modify that part instructed by bard and upload the code in github or in the comment section here. I am a beginner in this sector, you help would be very vital for me.Gatitude from Bangladesh. 🤲🏻🤲🏻❤. Jazakallhu khairan

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

    Hi. Whenever I try to compute the PSD in the feature extraction I get the error "cannot import name 'compute_psd' from 'mne.time_frequency'" whenever I run the line from mne.time_frequency import compute_psd. Could you please help?

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

      hi, i could not see where i use "compute_psd" can you refer me. the error is that this function, donot exist in mne

  • @BBB-ul4vb
    @BBB-ul4vb 2 роки тому

    Hi Sir , Can we discuss some questions over the email. I want to work on ECG based stress assessment

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

    Hello talha i am working on Nigerian dataset, having dificulty to writing string to separate the epilepsy and control files because the files for nigerian dataset also have session id in files names and not in order as well. how we can write the string kindly guide me. i tried to write in following way but it doesnot working:
    #read csv files
    file =meta_df['subject.id']
    Epilepsy=[pd.read_csv('EEGs_Nigeria/signal-{}-1.csv.gz'.format(file), compression='gzip') for file in EP_sub]
    Control=[pd.read_csv('EEGs_Nigeria/signal-{}-1.csv.gz'.format(file), compression='gzip') for file in CT_sub]

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

      anyone have idea about this?

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

      meta=pd.read_csv('zenodo.org/record/1252141/files/metadata_nigeria.csv')
      EP_sub=meta['csv.file'][meta['Group']=='epilepsy']
      CT_sub=meta['csv.file'][meta['Group']=='control']
      Epilepsy=[]
      for i in EP_sub:
      Epilepsy.append(pd.read_csv('EEGs_Nigeria/{}'.format(i), compression='gzip'))
      Control=[]
      for i in CT_sub:
      try:
      Control.append(pd.read_csv('EEGs_Nigeria/{}'.format(i), compression='gzip'))
      except:
      pass

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

    Sir, I am trying to work with a different dataset in which the files are in 'set' format. i loaded the file with mne.io.read_epochs_eeglab. But the problem is, when i want to take epochs using "mne.make_fixed_length_epochs" it shows an error saying "raw must be an instance of BaseRaw, got class 'mne.io.eeglab.EpochsEEGLAB' instead. what can i do now? please help

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

      Can you upload set files on Google drive and share a public link here or send me on LinkedIn . I don't have eeglab .set files , thats why i cant tell what to do

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

      @@talha_anwar Here is the link drive.google.com/drive/folders/1CbltqKphRsuoSpxYL3nydKHmeWpol47x

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

      sir, did u get the link?

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

      @@vanloo3087 nope

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

      I think youtube is restricting my comment due to the link.
      "drive.google*com/drive/folders/1CbltqKphRsuoSpxYL3nydKHmeWpol47x".
      kindly remove the quotation and * from the link