AugLy - Data Augmentation for Deep Learning | Python Library | Applied Machine Learning

1littlecoder · Intermediate ·📐 ML Fundamentals ·5y ago
Skills: ML Pipelines70%

Key Takeaways

Uses AugLy for data augmentation in deep learning with Python

Full Transcript

dear fellow coders welcome to one little coder if you have ever worked with any deep learning problem or even a classical machine learning problem getting a proper data itself is a big problem and that is where data augmentation come into picture data augmentation is a kind of a way a trick to take your existing data which is listen quantity and then do something and then make it more so if you have an image data maybe let's say now you can crop it and make some extra data or you can rotate it and make some extra data so this way uh you can have extra data to train your machine learning algorithm one two adversarial attacks are things you know where anybody can challenge a machine learning algorithms prediction or fool the machine learning algorithm so now the augmented data could be used to check whether your machine learning model is robust your deep learning model is robust or there are any adversarial attacks that could be used against this model so there are a lot of advantages for data augmentation but the problem is data augmentation is uh is like not so standardized so you can do a lot of data augmentation technique and there are a lot of not a lot of good open source solutions where you can also do data augmentation and thanks to facebook uh research a research fair so they have recently released a library called ugly so ugly is a library where you can use for data augmentation for four modalities so you can you can do data augmentation for text you can do data augmentation for audio you can do data augmentation for image computer vision problems and also you can do data augmentation for video so for all these four media types you can do data augmentation and currently they support over 100 data augmentation techniques um which you know some of the examples that we would see in the later part of this video so this video is structured in a way that we are going to quickly go through and understand what ogli can do and then we are going to look at couple of examples one from image and one from text using the google collab notebook that they've given in the documentation so let's first quickly jump into the blog post they've written so ugly as the name such as is a new data augmentation library to help build more robust ai so where does it help like you can see see an example let's say you have got an image like this so there are a couple of things that you can do so one you can increase your its brightness or decrease its brightness change the brightness blur it uh crop it rotate it or or even you know you can you can make it like a screenshot and then you can overlay texture like mean and then you can change the saturation now uh you can you can read about this recession what they've done with this so the thing that you have to understand is um why it matters why it matters is because you can see a couple of places where facebook is already using it so for example the deep fake detection challenge uh so ugly was used there to evaluate the robustness of the deep fake detection models so like like the example that i was giving you slightly earlier about adverse serial attacks so yeah ugly has been used here to detect check the robustness of the models also uh to train models to detect um you know near duplicates uh in uh like sim search net which is a convolutional neural network based model which was uh specifically built to detect near exact duplicates and uh it was trained using uh ugly augmentation also at facebook another example where it has been used uh to exact uh copies or near duplicates that's the the one that we saw uh it has been actually used at facebook itself so you can you can read more about it in this particular link and uh finally also you know as part of facebook's um a uh effort uh starting from uh meme challenge and uh the other kind of data that they have got which is related to the shopping assistant so everywhere you know ugly has been used uh so the point that uh that i would like to make here is ugly is not just you know some any random python package but it has been actually used in facebook both for their research effort and also for their you know on the content that they use on facebook for the models that they use on facebook so this is basically good stuff so that's one thing the second thing is ugly is one library which means it's going to have a very similar api and you can handle four different type of modalities so for example you have an image you want to overlay a text you can do it or maybe you have a text and then you want to change a little bit of you know the way punctuations spoke or the you know create typos in it or you want to replace similar characters you can do it so this is now the the advantage of psychic learn for example in python ecosystem is that you have one package but you can do a bunch of things with a very similar ap that's the biggest advantage of cyclic learn for or for the battery any framework right so then same with this library helps you do data augmentation for four different modalities which means you end up using only one library but you have a lot of options to do different um different type of media type so different type of augmentation so now that is a very quick introduction to ugly and what they've written like a quick summary of what they've written in the blog post now going back to the github repository instantly ugly is quite simple it's thanks to joanna bitten zoe papa kippus so for making this amazing library and they're making it open such as well for us to get started so installing ugly it's quite simple pip install ugly and if you want the latest um latest development version you can install it from github so you can also do a conda install uh and then how do you want to use it so they've already provided a couple of examples which you can see here so once you go into the example section you would see four examples audio image text video so if you click text it would show you the jupyter notebook that is uploaded to this github repository and what i'm going to show you is what you have you can do so i have opened the same same notebook that we just saw on google colab so the thing with google collab is af the first step is you have to install ugly second step is you have to install python 3 magic so after you do this thing after you do install these two so the next thing you have to do is it's going to ask you to restart the runtime so you can either click this button and restart the runtime which i'm going to do now or you can go here runtime and then change uh you start the runtime so after you install this package this is essential for you to do otherwise you know this package wouldn't this example wouldn't work fine so restart runtime click it yes let's please restart it and you can see that it is getting restarted here let me zoom a lot okay now you know that it's been restarted now let's import ugly.txt as test aux or whatever the name uh is we have just used the example that they've given so now at the end of this process in the cell you have given an input text now this is where you know you like imagine this is your input um or existing training data that you want to either uh check the robustness of the model for or you want to you want to generate more data training data so now like this text you can you know do a lot of different augmentation one of the augmentation is um to say a similar typo like that right now there is no typo hello world how are you today but you can simulate typo that's what we are doing here so you can see that it has randomly replaced some letters in it and then you see different different type of every time you see something different so hello sort of that you can do that so there is a different way for you to you know also do things for example you can have meta information and then based on the meta information you know you can do things so uh it can you know you can pass on with the meta information and then add you know like some characters and also the the final example is um you know if you want to replace similar unicode characters like you have unicode characters if you want to replace similar unicode characters uh instead of h you can replace with similar unicode characters like how are you today so this is like with with meta if you want to do it without meta now you can simply take the text and then you can just just the way we did it here you can just do it like that replace unicode characters and then you can get the output so the way it works you can just look at the example and then see it i just wanted to give you a quick over view of how the nlp notebook looks like so the couple of tasks that we did is we simulated typo we uh we replaced similar unicode characters um so see uh like like this crazy crazy things that people write on twitter like you can you can do all those things here so next then we are going to look at uh the notebook for a image here in this case i've already installed ugly and then restarted the runtime so you don't have to be bothered about it so let's open an image so let's say this is our input image ugly.image imageox ugly.utils so image display for displaying the image so you have a test image and then this is this is our image so the very first thing that we can do is we can actually um we can actually uh scale the image so let me even show you before that image so you can see the scaled image the image has been scaled down so if you reduce the factor the image would further you know increase so like you can do whatever factor you want like small do so one is scaling is an option so the second thing is let's say you want to get into a mean format right so now you can you know you get into meme format so if your data requires you to check meme you can do that like now you have other attributes like change the size or change the color like right now you have black uh let me make it white i think all memes are usually black white the ticks you don't see anything because yeah so you can change so this is meme format another raid augmentation technique so final and you have a lot of other options you can try it out finally i wanted to quickly show one final option which is um which is to say that you can get a screenshot format you can do something like this which will give you a like a screenshot format like if uh if you have like their phone instagram like you can see stories and then you have a screenshot format so this is one another augmented technique and then you can see that like you can do a couple of uh transformations together so another good thing is uh you it also integrates uh seamlessly with fight watch uh transforms so if you want to use it as part of your pi touch pipeline so you can still do it and also uh finally you know there's a numpy wrapper if your data is an nd array so you you have a numpy numpy wrapper also available so basically this has been designed in such a way that uh it'll be useful uh for actual tasks rather than you know having a very nice looking library so if you find this useful please uh try out the examples i will link the examples in the youtube description as well but you can easily figure it out and if you have any issues please feel free to go raise an issue here and also if you like this video please let me know in the comment section that will be great help so until next video stay safe

Original Description

AugLy is a Python Library for Image Data Augmentation, Text Data Augmentation , Video Data Augmentation, Audio Data Augmentation from Facebook AI Research. In this video, you'll learn about AugLy, How to use AugLy for NLP Text Augmentation, CV Image Augmentation for Deep Learning Machine Learning Links: * AugLy: A new data augmentation library to help build more robust AI models https://ai.facebook.com/blog/augly-a-new-data-augmentation-library-to-help-build-more-robust-ai-models/ * AugLy - Python Library - Github https://github.com/facebookresearch/AugLy * Image Data Augmentation Example with AugLy - https://github.com/facebookresearch/AugLy/blob/main/examples/AugLy_image.ipynb * Text Data Augmentation Example with AugLy - https://github.com/facebookresearch/AugLy/blob/main/examples/AugLy_text.ipynb * Audio Data Augmentation Example with AugLy - https://github.com/facebookresearch/AugLy/blob/main/examples/AugLy_audio.ipynb * Video Data Augmentation Example with AugLy - https://github.com/facebookresearch/AugLy/blob/main/examples/AugLy_video.ipynb
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from 1littlecoder · 1littlecoder · 0 of 60

← Previous Next →
1 How to create your Free Data Science Blog on Github with Fastpages from Fastai
How to create your Free Data Science Blog on Github with Fastpages from Fastai
1littlecoder
2 Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
1littlecoder
3 Create your first Data Science Web App using R Shiny
Create your first Data Science Web App using R Shiny
1littlecoder
4 How to create a Reproducible Example in R using reprex
How to create a Reproducible Example in R using reprex
1littlecoder
5 No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
1littlecoder
6 Scrape HTML Table using rvest and Process them for insights using tidyverse in R
Scrape HTML Table using rvest and Process them for insights using tidyverse in R
1littlecoder
7 Google Teachable Machine Learning Build No Code AI solution
Google Teachable Machine Learning Build No Code AI solution
1littlecoder
8 Create meaningful fake tidy datasets in R using fakir [#rstats Package]
Create meaningful fake tidy datasets in R using fakir [#rstats Package]
1littlecoder
9 How to enable using R Programming with Visual Studio VS Code
How to enable using R Programming with Visual Studio VS Code
1littlecoder
10 Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
1littlecoder
11 Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
1littlecoder
12 Intro to Google Colab - How to use Colab
Intro to Google Colab - How to use Colab
1littlecoder
13 Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
1littlecoder
14 Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
1littlecoder
15 Do you want a career in Data Science - Tamil Webinar
Do you want a career in Data Science - Tamil Webinar
1littlecoder
16 Android Smartphone Analysis in R [Live Coding Screencast]
Android Smartphone Analysis in R [Live Coding Screencast]
1littlecoder
17 Programmatically create Images, Memes, Watermarks using Python with imgmaker
Programmatically create Images, Memes, Watermarks using Python with imgmaker
1littlecoder
18 Kaggle Walkthrough to get you started with Data Science - Webinar
Kaggle Walkthrough to get you started with Data Science - Webinar
1littlecoder
19 Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
1littlecoder
20 Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
1littlecoder
21 Excel to R - Pivot + Bar Chart in Excel  & R using tidyverse [Live Coding]
Excel to R - Pivot + Bar Chart in Excel & R using tidyverse [Live Coding]
1littlecoder
22 Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
1littlecoder
23 5 websites to get Free Real-World Datasets for Data Science/ML Projects
5 websites to get Free Real-World Datasets for Data Science/ML Projects
1littlecoder
24 Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
1littlecoder
25 Correlation-alternative PPS (Predictive Power Score) Python Package Demo
Correlation-alternative PPS (Predictive Power Score) Python Package Demo
1littlecoder
26 Automated Website Screenshots in R using {webshot}
Automated Website Screenshots in R using {webshot}
1littlecoder
27 Installing Custom RStudio Theme (Synthwave85)
Installing Custom RStudio Theme (Synthwave85)
1littlecoder
28 Analyse Google Trends Search Data in R using {gtrendsR}
Analyse Google Trends Search Data in R using {gtrendsR}
1littlecoder
29 3 Tips to ask question on Stack Overflow the right way to get answers
3 Tips to ask question on Stack Overflow the right way to get answers
1littlecoder
30 Learn Data Science with R - Mini Projects - Web Scraping Zomato
Learn Data Science with R - Mini Projects - Web Scraping Zomato
1littlecoder
31 Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
1littlecoder
32 GET Hackernews Front Page Results using REST API in R
GET Hackernews Front Page Results using REST API in R
1littlecoder
33 Quickly deploy ML WebApps from Google Colab using ngrok
Quickly deploy ML WebApps from Google Colab using ngrok
1littlecoder
34 Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
1littlecoder
35 Plotly Interactive Plots as Pandas Plotting Backend df.plot()
Plotly Interactive Plots as Pandas Plotting Backend df.plot()
1littlecoder
36 Stack Overflow Developer Survey 2020 Highlights for New Programmers
Stack Overflow Developer Survey 2020 Highlights for New Programmers
1littlecoder
37 Matplotlib Animation Charts in Python using Celluloid
Matplotlib Animation Charts in Python using Celluloid
1littlecoder
38 Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
1littlecoder
39 Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
1littlecoder
40 Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
1littlecoder
41 Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
1littlecoder
42 Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
1littlecoder
43 ggplot2 Text Customization with ggtext | Data Visualization in R
ggplot2 Text Customization with ggtext | Data Visualization in R
1littlecoder
44 Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
1littlecoder
45 YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
1littlecoder
46 Matplotlib Animated Bar Chart Race in Python | Data Visualization
Matplotlib Animated Bar Chart Race in Python | Data Visualization
1littlecoder
47 Simple Python GUI Development using {guietta}
Simple Python GUI Development using {guietta}
1littlecoder
48 #8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
#8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
1littlecoder
49 Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
1littlecoder
50 Github New Feature Profile Summary/Mini-Resume - Profile Views
Github New Feature Profile Summary/Mini-Resume - Profile Views
1littlecoder
51 Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
1littlecoder
52 What is OpenAI GPT-3 - Hype, Examples, Worries
What is OpenAI GPT-3 - Hype, Examples, Worries
1littlecoder
53 Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
1littlecoder
54 Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
1littlecoder
55 GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
1littlecoder
56 How to use Advanced Google Search to extract Email Ids from Linkedin
How to use Advanced Google Search to extract Email Ids from Linkedin
1littlecoder
57 Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
1littlecoder
58 Flow - R Package to visualize code logic, functions as a Flow Diagram
Flow - R Package to visualize code logic, functions as a Flow Diagram
1littlecoder
59 Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
1littlecoder
60 Create a Pencil Sketch Portrait with Python OpenCV
Create a Pencil Sketch Portrait with Python OpenCV
1littlecoder

Related AI Lessons

Up next
Learn Deep Learning by Hand (Beginner's Guide - Part 1)
Thu Vu
Watch →