Data Science & Machine Learning Project - Part 4 Feature Engineering | Image Classification

Поделиться
HTML-код
  • Опубликовано: 27 авг 2024
  • In this video, we will use cropped images and apply wavelet transform to extract meaning features that can help with image identification. You need to understand many important concepts such as time vs frequency domain, fourier transform, representing images as frequency etc. You will find below resources to understand these concepts. USing wavelet transform and a raw pixel image we will create our X and use class labels as y. These X and y will be used for model training. Feature engineering techniques in this tutorial will enhance your understanding on how they can be used to create powerful prediction function.
    Code: github.com/cod...
    Resources to understand signal processing concepts:
    My friend Iman's youtube channel: / @imanmoaz
    Representing image as a frequency: • Frequency concept in a...
    Fourier transform: • But what is the Fourie...
    Special thanks to,
    Debjyoti Paul (Amazon Data Scientist): For help with entire project
    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.
    Website: codebasics.io/
    Facebook: / codebasicshub
    Twitter: / codebasicshub

Комментарии • 61

  • @codebasics
    @codebasics  2 года назад

    Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced

  • @codebasics
    @codebasics  4 года назад

    Next Video: ruclips.net/video/5Uc_m9CRWro/видео.html
    Data Science Project | Sports Celebrity Image Classification: ruclips.net/video/qWXXHjV3JHI/видео.html
    Machine Learning & Data Science Project | Real Estate Price Prediction Project: ruclips.net/video/rdfbcdP75KI/видео.html
    Learn data science for beginners (How to learn data science for free)?: ruclips.net/video/Vn_mmOuQkSA/видео.html

  • @BeaProgrammer
    @BeaProgrammer 4 года назад +1

    cannot reshape array of size 3072 into shape (1024,1) getting this error 15:37 code, please tell how to resolve this?

    • @timmdunker8507
      @timmdunker8507 4 года назад +2

      I was facing the same issue and wasn't calling the cv2.resize method on the img_har correctly (called it twice on img instead of img_har) so make sure you do this correctly so the dimensions of both images are correct. (scalled_img_har = cv2.resize(img_har, (32,32)) )

    • @JuanAntonioNelson
      @JuanAntonioNelson Год назад

      I have the same error
      [ WARN:0@36129.923] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Neymar/Neymar14.png'): can't open/read file: check file path/integrity
      [ WARN:0@36130.248] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Modric/Modric7.png'): can't open/read file: check file path/integrity
      [ WARN:0@36130.270] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Modric/Modric11.png'): can't open/read file: check file path/integrity
      [ WARN:0@36130.363] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Modric/Modric18.png'): can't open/read file: check file path/integrity
      [ WARN:0@36130.379] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Messi/Messi1.png'): can't open/read file: check file path/integrity

    • @arshhdahiya400
      @arshhdahiya400 Год назад

      Have you found the solution for that,, please help 🙏🏻

  • @bannoreaaditya3909
    @bannoreaaditya3909 2 года назад

    Thank you sir its making things very much easy for me to learn and specifically this series as i dont know to attach backend to frontend , i mix up every thing thank for being there

    • @jashdaftary8965
      @jashdaftary8965 2 года назад +1

      Hello
      Did you encounter difference in the image produced by sir and the code? I am getting completely blackish image

    • @bannoreaaditya3909
      @bannoreaaditya3909 2 года назад

      @@jashdaftary8965 no i didn't encounter just image but it was black and white

    • @jashdaftary8965
      @jashdaftary8965 2 года назад

      @@bannoreaaditya3909 I used the same code he used from GitHub. I don't get it. Can I somehow send you the image I got ?

  • @bannoreaaditya3909
    @bannoreaaditya3909 2 года назад +1

    There is a correction in above code if its giving this error
    setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (200,) + inhomogeneous part.
    The solution is
    change this "imArray_H = list(coeffs)"
    to this "imArray_H = pywt.waverec2(coeffs_H, mode);"

  • @elroyrebello3073
    @elroyrebello3073 3 года назад

    Nice work sir looking forward to see next video of the project ....... Make more awesome simple biggnner projects like this 👍🏽👍🏽👍🏽

  • @sahityayadav8577
    @sahityayadav8577 4 года назад +1

    Awesome video

  • @GILL7173
    @GILL7173 3 года назад

    this series is very good keep it up

  • @taniyadas1231
    @taniyadas1231 3 года назад

    hi! your projects are really insightful. I am finding them very useful for my journey in ML

    • @codebasics
      @codebasics  3 года назад +1

      Glad it was helpful!

    • @taniyadas1231
      @taniyadas1231 3 года назад

      @@codebasics Can you please explain why the gray scale image was stacked with wavelet decomposed image. Can't we only use the wavelet decomposed image? Thanks in advance

  • @charugera7654
    @charugera7654 2 года назад +1

    Really good DS project. Can you please do more DS projects using APIs and Databases in the cloud? Thanks

  • @basotra97
    @basotra97 4 года назад

    I just love your content

  • @shivanshaghor8443
    @shivanshaghor8443 4 года назад

    Hello Sir, Please make more end to end projects like this.

  • @jaganinfo
    @jaganinfo 4 года назад +1

    ​Hi Dhaval, pics which you are using , you may get copyright strike .hope they will not send strike..these are educational video purpose

  • @trunghoang1227
    @trunghoang1227 3 года назад

    good job man

  • @sttaq
    @sttaq 3 года назад

    Nice series. Can you please explain the reason behind stacking the transformed image under the original image? Also, when doing actual prediction do we use a similarly transformed & stacked image?

    • @shubhamgoyal5908
      @shubhamgoyal5908 11 месяцев назад

      +1, Though I searched for it and got this - 'Stacking image and wavelet transformed image in image classification can be a useful technique for enhancing the performance of machine learning models, especially when dealing with texture-rich images or when attempting to capture both high-frequency and low-frequency information'

  • @user-ib6tb4yh3i
    @user-ib6tb4yh3i 10 месяцев назад

    using jupyter notebook you were able to continue from the cropped images after u manually deleted them. I am using virtual studio but whenever i run the code it brings back all the dataset the i manually deleted. my question is how can i continue using the dataset after i have manually deleted them?

  • @elidrissiasmae8436
    @elidrissiasmae8436 2 года назад

    hi ser thank u so much, i have a question please i'm using LBP for feature extraction should i concatenate two images or the input should be just the LBP result ??

  • @bhuvneshsaini93
    @bhuvneshsaini93 3 года назад

    Can you tell, why were you used wavelet and stack it with original image ,what will be the benefit?

  • @favourifunanya6108
    @favourifunanya6108 2 года назад

    Dhaval sir, What is the purpose of changing all the Approximation coefficients to zeros.
    coeffs *= 0??
    Thanks from Nigeria

  • @qwantisheku7452
    @qwantisheku7452 3 года назад

    Is it possible to reshape images in data of final shape (x, y) to the shape that can be accepted by keras models (x, 1, img_size, img_size)?

  • @shubhamrakshe5747
    @shubhamrakshe5747 3 года назад

    hello, i am not able to execute your 1st part of this video....its showing this error "No module named 'StringIO'"
    '

    • @shubhamrakshe5747
      @shubhamrakshe5747 3 года назад

      Actully sir i am doing the image classification on specially on leopard images to classify the species of leopard.& harcascade files are not able to work on those images....so is there any other method to detecting feature & for cropping images.

  • @work-dw2hl
    @work-dw2hl 3 года назад

    u missed the explanation of 6 lines of code how to create a dictionary it contains keys ara names and key values are image paths☺️☺️

  • @jashdaftary8965
    @jashdaftary8965 2 года назад

    Hello
    Did anyone encounter difference in image produced by sir and code? I am getting a blackish image instead of black and white. Please help

  • @jashdaftary8965
    @jashdaftary8965 2 года назад

    w2d function is not working. Any solutions?

  • @jay-rathod-01
    @jay-rathod-01 4 года назад

    Hello sir can we apply the same feature engineering in plant Village dataset?

  • @taniyadas1231
    @taniyadas1231 3 года назад

    Can someone please explain to me why the grayscale image was stacked with a wavelet decomposed image. Can't we only use the wavelet decomposed image?

    • @jayshreeram6684
      @jayshreeram6684 4 месяца назад

      I think, both wavelet & grayscale image makes better to identify their target.

  • @lucasbegue8232
    @lucasbegue8232 4 года назад

    wrote exactly the same w2d function and my the images it provides are very different from your first example. Mine are in gray tones and yours is just black or white

    • @jashdaftary8965
      @jashdaftary8965 2 года назад

      Exactly. Did you find any solution for that?

  • @kritikasharma6112
    @kritikasharma6112 Год назад

    Sir can you please share your python file for this project. I would be easier for me rectify my errors. I have started this project but stuck in between.

  • @jayamishra960
    @jayamishra960 4 года назад

    sir can you clear something . Ultimately we are just following few lines of code written in websites of initial developers . in what way we have control over the project , we are just doing a copy paste kind of thing . if in real corporate also works get done in the same way then it is absolutely . For freshers it's a dilemma to understand

    • @nigamaveena4211
      @nigamaveena4211 4 года назад

      I also have this doubt. Hope we will get an answer.

    • @codebasics
      @codebasics  4 года назад

      It is not bad to do copy paste.in real life developers think about logic and flow. After that they either write little code snippets themselves or copy from other sources like stack overflow.
      I am not very sure if understood your question properly. If not plz post

    • @kishorekumar-iv7ot
      @kishorekumar-iv7ot 4 года назад

      @@codebasics ​ hi dhaval,can you make a video on how to contribute open source data science projects and libraries . And how can we start as a beginner

    • @jayamishra960
      @jayamishra960 4 года назад

      @@codebasics sir why i am asking this question bcoz i dont feel like much control over the coding part of this problem . we are just following code of someone else . there is no sort of improvisation from our side .

    • @rahulkhairnar8336
      @rahulkhairnar8336 4 года назад

      @@jayamishra960 Not true. The logic that we have to do what after what is the control we have on the code. As a developer in a company, you have to think about the logic and not the code. Code can be written easily if you know the logic behind the working.

  • @fahadabdullah510
    @fahadabdullah510 Год назад

    Can anybody suggest a video on wavelet transform on image please

  • @harshvivek14
    @harshvivek14 4 года назад

    Please do this project using Deep Learning too.

    • @codebasics
      @codebasics  4 года назад

      Yes the video on solving same problem using neural network is coming up.. stay tuned.

    • @loicsan5616
      @loicsan5616 3 года назад

      @@codebasics i'm waiting sir.

  • @jaspreetkaur9667
    @jaspreetkaur9667 Год назад

    i have installed PyWavelets still showing PyWavelets not installed @codebasics

  • @loicsan5616
    @loicsan5616 3 года назад +1

    Hello Dear teacher, thank you for this very good tutorial, I have an error that I cannot resolve since in fact it is the function to resize here is the error do you have any idea? thank you
    error: OpenCV(4.5.1) /tmp/pip-req-build-hj027r8z/opencv/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

    • @loicsan5616
      @loicsan5616 3 года назад +2

      I solved the problem just by surrounding code with try catch like this :
      X, y = [], []
      for celebrity_name, training_files in celebrity_file_names_dict.items():
      for training_image in training_files:
      img = cv2.imread(training_image) #training image c'est juste l'image recardrée de chaque sous dico qui est le nom de la célébrité
      try:
      scalled_raw_img = cv2.resize(img, (32, 32))#ici on veut recardrer nos images car avant d'entrainner le modèle les images doivent avoir meme dimension.
      img_har = w2d(img,'db1',5)#appel de la fonction w2d sur chaque image
      scalled_img_har = cv2.resize(img_har, (32, 32))#redimensionnement des images transformées avec pywt
      combined_img = np.vstack((scalled_raw_img.reshape(32*32*3,1),scalled_img_har.reshape(32*32,1)))#les images en pleine couleur on 3 paramètres pour les rga d'ou 3 et les images transformées avec pywavelet ont une seule couleur d'ou 1.
      X.append(combined_img)
      y.append(class_dict[celebrity_name])
      except:
      break

    • @armelsauvy7253
      @armelsauvy7253 3 года назад +1

      @@loicsan5616 Thanks I got the same error and solved as you said, you saved my livre bro.

    • @loicsan5616
      @loicsan5616 3 года назад +1

      @@armelsauvy7253 great.

    • @JuanAntonioNelson
      @JuanAntonioNelson Год назад

      @@loicsan5616 Let me try this solution!

    • @arshhdahiya400
      @arshhdahiya400 Год назад

      @@JuanAntonioNelson Have you found the solution for this ??