Data Science & Machine Learning Project - Part 2 Data Collection | Image Classification

codebasics · Beginner ·📰 AI News & Updates ·6y ago

Key Takeaways

Data collection for image classification using Google Images, web scraping with Python, Chrome extension, and purchasing images from news websites or third-party vendors.

Full Transcript

in this video we are going to talk about data collection aspect of our project now as you know that when you are doing supervised learning you need a lot of data truth data is basically you have an image which you can call it as X or an independent variable and then you have a label a class label which will tell you whether these images of miracoli Maria Sharapova so that label is called Y or a target variable you need lot of these images to train our classifier now how can you collect all these images there are four different ways of collecting this number one is very obvious you go to Google Images start downloading these images one by one now this approach is very manual and labor intensive for our project it works we need probably fifty or more images so it's not that bad but if you are training a huge algorithm with so much data then manually downloading these images might be very tough so the second approach is you can use Python and automatic test software along with chrome driver I found this nice article on towards data science which talks about how you can scrap images from Google and how you can download them in automated way now I'm going to provide a link of the code I don't want to discuss this code in detail for one specific reason the reason is that the code is working today I'm not sure if it's going to work after one week and this is because Google is improving their algorithms and they are trying the best so that people do not scrap their website web scraping in general is a very gray area in terms of legal implication google images are a public information so on one hand you would think that why can't I scrape it but if you are Google then you don't want people to be writing this automated boards which can scrap the content Google in fact had this issue when Binga came out being started escaping a lot of Google articles to improve their own search performance and Google of course did not like it any website would not like the fact that you are a web scraping their content and they will try their best to stop you from writing this web crawler so you have to be very very mindful when you are using any automated way of scrapping Internet just keep in mind that your core might just stop working one fine day and you have to continuously improve or continuously change that now in this video clip you already noticed that when we are running this program or to scrap Google it is opening a chrome or window on its own and it is trying to download the images one by one and at the top you notice this that chrome is controlled by automated testing software now if you know about selenium selenium is an automated testing software which will simulate manual actions so it is like a computer going and clicking different things and right-clicking and downloading it so it is that paradigm there is RPO also which is called robotic process automation which can be used for automating this kind of manual tasks third way which I kind of suggest is probably a better way is to use Chrome extension called fat cool so the fat kun is something you can add it to your Chrome easily and after that you can open a tab of Google Images and you can just say download and it will download all the images you can also filter based on width and height I want to say thank you to my dear friend Kenji who is a head of data scientist he also runs a YouTube channel for data science so I will provide a link of his YouTube channel you can go check it out he's doing some awesome work so thank you can for suggesting me this fat control also I want to thank you my dear friend a big duty Paul who is a data scientist at Amazon he has helped me throughout the project the fourth way of collecting images is to buy these images if you are working for a big company they will have a budget and using that money they can even buy the images from some news website you know let's say you are a CNN or NDT you are Times of India these are news portals the companies will have a lot of images okay and there could be another third-party vendors who might be selling those images so the fourth option which is by paying a price you can buy these images now if you are less the Times of India or CNN yourself then your company will have a team engineering team who will have access to these images so you can contact that team and you can get those images from the team and it store it in your data warehouse for your convenience I have a given link below where you can just download all these images so if you don't want to bother about all this you can I have this relevant data set that you can use but if you want to play with this Google image capping code then I have a link github link in the video description below also try this fat cone tool in the next video we are going to talk about data cleaning and feature engineering

Original Description

There are 4 different ways of collecting data for our project, (1) Manually download images from google images (2) Use python and web scrapping to automate downloading images from google. Here is the article on how you can do that: https://towardsdatascience.com/image-scraping-with-python-a96feda8af2d (3) Use a chrome extention called fatkun. You can download that from here: https://chrome.google.com/webstore/detail/fatkun-batch-download-ima/nnjjahlikiabnchcpehcpkdeckfgnohf?hl=en (4) Buy these images from third party vendor who is selling images database. Sometimes if a company is in sports or news domain they might have internal database of these images. You can work with engineering team that owns that database and get an access of those images 00:00 Overview 00:38 Manually download images from google 01:03 Use python and web scrapping 03:29 Use a chrome extension called fatkun 04:20 Buy data from third party vendor for a price Do you want to learn technology from me? Check https://codebasics.io/ for my affordable video courses. You need to download chrome extension based on your chrome version: https://chromedriver.chromium.org/downloads Put chromedriver.exe in same folder as image_download.py Github link for google image scrapping code: https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/google_image_scrapping/image_download.py Link for dataset if you want to download directly: https://github.com/codebasics/py/tree/master/DataScience/CelebrityFaceRecognition/images_dataset Special thanks to, Ken Jee (https://www.youtube.com/channel/UCiT9RITQ9PW6BhXK0y2jaeg) : For suggesting fatkun Debjyoti Paul (Amazon Data Scientist): For help with entire project Website: https://codebasics.io/ Facebook: https://www.facebook.com/codebasicshub Twitter: https://twitter.com/codebasicshub
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from codebasics · codebasics · 0 of 60

← Previous Next →
1 Python Tutorial - 1. Install python on windows
Python Tutorial - 1. Install python on windows
codebasics
2 Python Tutorial - 2. Variables
Python Tutorial - 2. Variables
codebasics
3 Python Tutorial - 3. Numbers
Python Tutorial - 3. Numbers
codebasics
4 Python Tutorial - 4. Strings
Python Tutorial - 4. Strings
codebasics
5 Python Tutorial - 5. Lists
Python Tutorial - 5. Lists
codebasics
6 Python Tutorial - 6. Install PyCharm on Windows
Python Tutorial - 6. Install PyCharm on Windows
codebasics
7 PyCharm Tutorial - 7. Debug python code using PyCharm
PyCharm Tutorial - 7. Debug python code using PyCharm
codebasics
8 Python Tutorial -  8. If Statement
Python Tutorial - 8. If Statement
codebasics
9 Python Tutorial - 9. For loop
Python Tutorial - 9. For loop
codebasics
10 Python Tutorial -  10. Functions
Python Tutorial - 10. Functions
codebasics
11 Python Tutorial - 11. Dictionaries and Tuples
Python Tutorial - 11. Dictionaries and Tuples
codebasics
12 Python Tutorial - 12. Modules
Python Tutorial - 12. Modules
codebasics
13 Python Tutorial - 13. Reading/Writing Files
Python Tutorial - 13. Reading/Writing Files
codebasics
14 How to install Julia on Windows
How to install Julia on Windows
codebasics
15 Python Tutorial - 14. Working With JSON
Python Tutorial - 14. Working With JSON
codebasics
16 Julia Tutorial - 1. Variables
Julia Tutorial - 1. Variables
codebasics
17 Julia Tutorial - 2. Numbers
Julia Tutorial - 2. Numbers
codebasics
18 Python Tutorial - 15. if __name__ == "__main__"
Python Tutorial - 15. if __name__ == "__main__"
codebasics
19 Julia Tutorial - Why Should I Learn Julia Programming Language
Julia Tutorial - Why Should I Learn Julia Programming Language
codebasics
20 Python Tutorial  - 16. Exception Handling
Python Tutorial - 16. Exception Handling
codebasics
21 Julia Tutorial - 3. Complex and Rational Numbers
Julia Tutorial - 3. Complex and Rational Numbers
codebasics
22 Julia Tutorial - 4. Strings
Julia Tutorial - 4. Strings
codebasics
23 Python Tutorial -  17. Class and Objects
Python Tutorial - 17. Class and Objects
codebasics
24 Julia Tutorial - 5. Functions
Julia Tutorial - 5. Functions
codebasics
25 Julia Tutorial - 6. If Statement and Ternary Operator
Julia Tutorial - 6. If Statement and Ternary Operator
codebasics
26 Julia Tutorial - 7. For While Loop
Julia Tutorial - 7. For While Loop
codebasics
27 Python Tutorial  - 18. Inheritance
Python Tutorial - 18. Inheritance
codebasics
28 Julia Tutorial - 8. begin and (;) Compound Expressions
Julia Tutorial - 8. begin and (;) Compound Expressions
codebasics
29 Python Tutorial - 12.1 - Install Python Module (using pip)
Python Tutorial - 12.1 - Install Python Module (using pip)
codebasics
30 Julia Tutorial - 9. Tasks (a.k.a. Generators or Coroutines)
Julia Tutorial - 9. Tasks (a.k.a. Generators or Coroutines)
codebasics
31 Julia Tutorial - 10. Exception Handling
Julia Tutorial - 10. Exception Handling
codebasics
32 Python Tutorial  - 19. Multiple Inheritance
Python Tutorial - 19. Multiple Inheritance
codebasics
33 Python Tutorial - 20. Raise Exception And Finally
Python Tutorial - 20. Raise Exception And Finally
codebasics
34 Python Tutorial - 21. Iterators
Python Tutorial - 21. Iterators
codebasics
35 Python Tutorial - 22. Generators
Python Tutorial - 22. Generators
codebasics
36 Python Tutorial - 23. List Set Dict Comprehensions
Python Tutorial - 23. List Set Dict Comprehensions
codebasics
37 Python Tutorial - 24. Sets and Frozen Sets
Python Tutorial - 24. Sets and Frozen Sets
codebasics
38 Python Tutorial - 25. Command line argument processing using argparse
Python Tutorial - 25. Command line argument processing using argparse
codebasics
39 Debugging Tips - What is bug and debugging?
Debugging Tips - What is bug and debugging?
codebasics
40 Debugging Tips - Conditional Breakpoint
Debugging Tips - Conditional Breakpoint
codebasics
41 Debugging Tips - Watches and Call Stack
Debugging Tips - Watches and Call Stack
codebasics
42 Python Tutorial - 26. Multithreading - Introduction
Python Tutorial - 26. Multithreading - Introduction
codebasics
43 Git Tutorial 3:  How To Install Git
Git Tutorial 3: How To Install Git
codebasics
44 Git Tutorial 1: What is git / What is version control system?
Git Tutorial 1: What is git / What is version control system?
codebasics
45 Git Tutorial 2 : What is Github? | github tutorial
Git Tutorial 2 : What is Github? | github tutorial
codebasics
46 Git Tutorial 4: Basic Commands: add, commit, push
Git Tutorial 4: Basic Commands: add, commit, push
codebasics
47 Git Tutorial 5: Undoing/Reverting/Resetting code changes
Git Tutorial 5: Undoing/Reverting/Resetting code changes
codebasics
48 Git Tutorial 6: Branches (Create, Merge, Delete a branch)
Git Tutorial 6: Branches (Create, Merge, Delete a branch)
codebasics
49 Git Github Tutorial 10: What is Pull Request?
Git Github Tutorial 10: What is Pull Request?
codebasics
50 Git Tutorial 7: What is HEAD?
Git Tutorial 7: What is HEAD?
codebasics
51 Git Tutorial 9: Diff and Merge using meld
Git Tutorial 9: Diff and Merge using meld
codebasics
52 Difference between Multiprocessing and Multithreading
Difference between Multiprocessing and Multithreading
codebasics
53 Python Tutorial - 27. Multiprocessing Introduction
Python Tutorial - 27. Multiprocessing Introduction
codebasics
54 Python Tutorial - 28. Sharing Data Between Processes Using Array and Value
Python Tutorial - 28. Sharing Data Between Processes Using Array and Value
codebasics
55 Git Tutorial 8 - .gitignore file
Git Tutorial 8 - .gitignore file
codebasics
56 Python Tutorial - 29. Sharing Data Between Processes Using Multiprocessing Queue
Python Tutorial - 29. Sharing Data Between Processes Using Multiprocessing Queue
codebasics
57 Python Tutorial - 30. Multiprocessing Lock
Python Tutorial - 30. Multiprocessing Lock
codebasics
58 Python Tutorial - 31. Multiprocessing Pool (Map Reduce)
Python Tutorial - 31. Multiprocessing Pool (Map Reduce)
codebasics
59 What is code?
What is code?
codebasics
60 Python unit testing - pytest introduction
Python unit testing - pytest introduction
codebasics

This video discusses four methods for collecting data for image classification projects, including manual download, web scraping with Python, using a Chrome extension, and purchasing images from news websites or third-party vendors. The importance of data collection for supervised learning is highlighted, and the challenges of web scraping are discussed.

Key Takeaways
  1. Manually download images from Google Images
  2. Use Python and web scraping to automate downloading images from Google
  3. Use a Chrome extension like Fatkun to download images
  4. Purchase images from news websites or third-party vendors
  5. Consider using pre-existing datasets for convenience
💡 Web scraping can be a useful method for data collection, but it requires careful consideration of legal implications and the potential for automated scripts to stop working due to changes in website algorithms.

Related Reads

📰
Musk thanks Micron for chips, and builds a $55bn fab to replace it
Elon Musk thanks Micron for providing Tesla with a significant allocation of memory chips, highlighting the scarcity of this crucial component in the AI boom
The Next Web AI
📰
Jensen Huang calls the AI jobs panic ‘complete nonsense’, and takes aim at his peers
Nvidia CEO Jensen Huang dismisses AI job replacement panic as 'complete nonsense', offering a contrasting view to his peers
The Next Web AI
📰
IMF says Africa has to keep lights on before it can bet on AI
Africa's AI ambitions are hindered by unreliable electricity, highlighting the need for basic infrastructure before investing in AI
TechCabal
📰
What Does Job Security Even Look Like In 2026? It Starts With Skills
Job security in 2026 requires adapting to AI and economic uncertainty by acquiring in-demand skills
Forbes Innovation

Chapters (5)

Overview
0:38 Manually download images from google
1:03 Use python and web scrapping
3:29 Use a chrome extension called fatkun
4:20 Buy data from third party vendor for a price
Up next
Catch Me Live on Earn Your Leisure Talking AI
Alicia Lyttle
Watch →