brunch

You can make anything
by writing

C.S.Lewis

by 라인하트 Dec 20. 2020

앤드류 응의 머신러닝(18-3):인공 데이터 합성

   온라인 강의 플랫폼 코세라의 창립자인 앤드류 응 (Andrew Ng) 교수는 인공지능 업계의 거장입니다. 그가 스탠퍼드 대학에서 머신 러닝 입문자에게 한 강의를 그대로 코세라 온라인 강의 (Coursera.org)에서 무료로 배울 수 있습니다. 이 강의는 머신러닝 입문자들의 필수코스입니다. 인공지능과 머신러닝을 혼자 공부하면서 자연스럽게 만나게 되는 강의입니다. 


Application Example    

(응용 사례 )


Photo OCR (사진 OCR)      


Getting Lots of Data and Artificial Data 

(대량의 데이터 및 인공 데이터 확보하기)


   I've seen over and over that one of the most reliable ways to get a high performance machine learning system is to take a low bias learning algorithm and to train it on a massive training set. But where did you get so much training data from? Turns out that the machine learnings there's a fascinating idea called artificial data synthesis, this doesn't apply to every single problem, and to apply to a specific problem, often takes some thought and innovation and insight. But if this idea applies to your machine learning problem, it can sometimes be a an easy way to get a huge training set to give to your learning algorithm. The idea of artificial data synthesis comprises of two main variations, the first is if we are essentially creating data from it, creating new data from scratch. And the second is if we already have it's small labeled training set and we somehow have amplify that training set or use a small training set to turn that into a larger training set and in this video we'll go over both those ideas. 


   고성능 머신 러닝 시스템을 갖는 가장 신뢰할 수 있는 방법 중 하나는 낮은 편향 알고리즘을 사용하여 대규모 학습 셋에서 학습하는 것입니다. 하지만, 어디서 그렇게 많은 데이터를 얻을 수 있을까요? 머신 러닝 분야에서 인공 데이터 합성이라는 흥미로운 아이디어가 있습니다. 모든 머신 러닝 문제에 적용할 수 없지만, 약간의 혁신과 통찰력이 있다면 특정 문제에 적용할 수 있습니다. 인공 데이터 합성 아이디어는 머신 러닝 분야에서 거대한 학습 셋을 얻을 수 있는 손쉬운 방법일 수 있습니다. 인공 데이터를 합성히기 위한 두 가지 방법이 있습니다.  첫 번째는 기본적으로 처음부터 새 데이터를 생성하는 것입니다. 두 번째는 이미 확보한  레이블이 지정된 작은 학습 셋을 증폭하거나 왜곡 또는 변환하여 더 큰 학습 셋을 만드는 것입니다. 이번 강의에서는 두 가지 아이디어를 모두 설명합니다.   



   To talk about the artificial data synthesis idea, let's use the character recognition portion of the photo OCR pipeline, we want to take it's input image and recognize what character it is.


   인공 데이터 합성 아이디어를 설명하기 위해 Photo OCR 파이프라인의 문자 인식 부분을 다룹니다. 문자 인식 시스템은 입력 이미지가 어떤 문자인지 인지합니다. 



   If we go out and collect a large labeled data set, here's what it is and what it look like. For this particular example, I've chosen a square aspect ratio. So we're taking square image patches. And the goal is to take an image patch and recognize the character in the middle of that image patch. And for the sake of simplicity, I'm going to treat these images as grey scale images, rather than color images. It turns out that using color doesn't seem to help that much for this particular problem. So given this image patch, we'd like to recognize that that's a T. Given this image patch, we'd like to recognize that it's an 'S'. Given that image patch we would like to recognize that as an 'I' and so on. So all of these, our examples of row images, how can we come up with a much larger training set? 


   여기 문자 인식을 위해 레이블이 지정된 대용량 데이터 셋을 수집할 때 얻을 수 있는 데이터 셋 이미지가 있습니다. 각 학습 예제는 정사각형의 가로세로 비를 선택했고 이미지 패치는 정사각형을 활용합니다. 목표는 이미지 패치를 활용하여  문자를 인식하는 것입니다. 단순화하기 위해 이미지를 컬러가 아닌 흑백으로 처리했습니다. 색상을 사용하는 것이 문자 인식에 그다지 도움이 되지 않습니다. 따라서 특정 이미지 패치를 분석하여 텍스트 인식 시스템은 'T'라고 인식합니다. 또 다른 이미지 패치는 'S'라고 인식합니다. 또 다른 이미지 패치는 'I'라고 인식합니다.  여기 이미지의 예에서 훨씬 더 큰 학습 셋을 어떻게 만들 수 있을까요? 



   Modern computers often have a huge font library and if you use a word processing software, depending on what word processor you use, you might have all of these fonts and many, many more Already stored inside. And, in fact, if you go different websites, there are, again, huge, free font libraries on the internet we can download many, many different types of fonts, hundreds or perhaps thousands of different fonts. So if you want more training examples, one thing you can do is just take characters from different fonts and paste these characters against different random backgrounds. So you might take this and paste that 'C' against a random background. If you do that you now have a training example of an image of the character C. 


   오늘날 컴퓨터는 거대한 글꼴 라이브러리가 있습니다. 워드 프로세서 소프트웨어는 엄청나게 많은 글꼴을 이미 가지고 있습니다. 인터넷의 많은 웹사이트에서 방대한 무료 글꼴 라이브러리를 제공합니다. 수많은 다양한 유형의 글꼴을 수백에서 수천 개씩 다운로드할 수 있습니다. 더 많은 학습 예제가 필요할 경우 글꼴을 가지고 와서 무작위로 배경과 합칩니다.  따라서 랜덤 배경에 글꼴 'C'를 붙여 넣습니다. 방금 문자 'C'의 이미지에 대한 학습 예제가 만들어졌습니다. 



    So after some amount of work, you know this, and it is a little bit of work to synthisize realistic looking data. But after some amount of work, you can get a synthetic training set like that. Every image shown on the right was actually a synthesized image. Where you take a font, maybe a random font downloaded off the web and you paste an image of one character or a few characters from that font against this other random background image. And then apply maybe a little blurring operators of app finder, distortions that app finder, meaning just the sharing and scaling and little rotation operations and if you do that you get a synthetic training set, on what the one shown here. And this is work  great, it takes thought at work, in order to make the synthetic data look realistic, and if you do a sloppy job in terms of how you create the synthetic data then it actually won't work well. But if you look at the synthetic data looks remarkably similar to the real data. And so by using synthetic data you have essentially an unlimited supply of training examples for artificial training synthesis And so, if you use this source synthetic data, you have essentially unlimited supply of labeled data to create a improvised learning algorithm for the character recognition problem. So this is an example of artificial data synthesis where youre basically creating new data from scratch, you just generating brand new images from scratch. 


   같은 작업을 반복하면 인공 합성 학습 셋을 얼마든지 만들 수 있습니다. 이것이 실제와 같은 합성 데이터를  만드는 방법입니다. 오른쪽에 표시된 모든 이미지는 합성 이미지입니다. 웹에서 다운로드한 글꼴을 가져오면 임의의 배경 이미지를 붙입니다. 그리고, 글꼴 이미지를 야간 흐릿하게, 왜곡하거나, 크기를 조정하거나, 또는 회전을 적용할 수 있습니다. 합성 데이터를 실제 데이터처럼 보이게 하기 위해 여러 가지를 고려해야 합니다. 합성 데이터를 만드는 작업을 대충 한다면 현실에서 제대로 작동하지 않을 것입니다. 왼쪽의 실제 데이터와 오른쪽 합성 데이터는 매우 유사합니다. 합성 데이터를 사용하면 학습 셋을 무제한으로 제공할 수 있습니다. 합성 데이터는 즉석에서 레이블이 지정된 데이터를 무제한으로 제공합니다. 이것은 인공 합성의 사례입니다. 처음부터 새로운 이미지를 생성하는 것입니다.  



   The other main approach to artificial data synthesis is where you take a examples that you currently have that we take a real example, maybe from real image, and you create additional data so as to amplify your training set. So here is an image of a compared to a from a real image, not a synthesized image, and I have overlayed this with the grid lines just for the purpose of illustration.  Actually have these A. So what you can do is then take this alphabet here, take this image and introduce artificial warpings? or artificial distortions into the image so they can take the image a and turn that into 16 new examples. So in this way you can take a small label training set and amplify your training set to suddenly get a lot more examples all of it. Again, in order to do this for application, it does take thought and it does take insight to figure out what our reasonable sets of distortions, or whether these are ways that amplify and multiply your training set, and for the specific example of character recognition, introducing these warping seems like a natural choice, but for a different learning machine application, there may be different the distortions that might make more sense. 


   두 번째 인공 데이터 합성 방식은 실제 학습 데이터 셋 이미지를 증폭하거나 변형하는 것입니다. 여기 합성하지 않은 실제 글꼴 이미지 'A'가 있습니다. 쉽게 설명하기 위해 격자무늬를 중첩하였습니다. 글꼴 이미지 'A'에 인공적인 왜곡을 적용하여 16개의 새로운 이미지를 만들었습니다. 이런 방식으로 레이블이 지정된 학습 셋을 16 배 더 많은 큰 학습 셋으로 확대합니다. 다시 말하지만, 무엇이 알고리즘을 위한 합리적인 왜곡인지, 실제 예제의 어떤 부분을 모방한 것인지, 단순히 데이터의 수만 늘리는 것인지에 대한 통찰이 필요합니다. 왜곡을 적용하는 것은 자연스러운 것처럼 보이지만 다른 머신 러닝 응용 프로그램에서 다른 방식을 사용할 수도 있습니다.  



   Let me just show one example from the totally different domain of speech recognition. So the speech recognition, let's say you have audio clips and you want to learn from the audio clip to recognize what were the words spoken in that clip. So let's see how one labeled training example. So let's say you have one labeled training example, of someone saying a few specific words. So let's play that audio clip here. 0 -1-2-3-4-5. Alright, so someone counting from 0 to 5, and so you want to try to apply a learning algorithm to try to recognize the words said in that. So, how can we amplify the data set? Well, one thing we do is introduce additional audio distortions into the data set. So here I'm going to add background sounds to simulate a bad cell phone connection. When you hear beeping sounds, that's actually part of the audio track, that's nothing wrong with the speakers, I'm going to play this now. 0-1-2-3-4-5. Right, so you can listen to that sort of audio clip and recognize the sounds, that seems like another useful training example to have, here's another example, noisy background. Zero, one, two, three four five you know of cars driving past, people walking in the background, here's another one, so taking the original clean audio clip so taking the clean audio of someone saying 0 1 2 3 4 5 we can then automatically synthesize these additional training examples and thus amplify one training example into maybe four different training examples. So let me play this final example, as well. 0-1-2-3-4-5 So by taking just one labelled example, we have to go through the effort to collect just one labelled example fall of the 0-1-2-3-4-5, and by synthesizing additional distortions, by introducing different background sounds, we've now multiplied this one example into many more examples. Much work by just automatically adding these different background sounds to the clean audio. 


   다음으로 음성 인식 영역의 사례를 보여드리겠습니다. 음성 인식 시스템이 오디오 클립에서 말하는 단어를 인식하기 위해 학습한다고 가정합니다. 여기 레이블이 지정된 학습 예제인 오디오 클립이 있습니다. 한 사람이 특정 단어 몇 개를 말하는 학습 예제입니다. 오디오 클립을 재생합니다. "0-1-2-3-4-5" 누군가가 0에서 5까지 세고 있습니다. 학습 알고리즘은 음성을 인식합니다. 어떻게 학습 데이터 셋을 늘릴 수 있을까요? 한 가지 방법은 데이터 셋에 오디오 왜곡을 도입하는 것입니다. 두 번째 예제는 휴대폰 통화가 좋지 않은 상황을 가정한 배경 잡음을 추가하였습니다. 신호음이 들리지만 스피커에 문제가 있는 것은 아닙니다.  두 번째 오디오 클립을 재생합니다. "0-1-2-3-4-5" 똑같은 사람이 똑같은 단어를 말하지만 통신 잡음이 썩여 있습니다. 세 번째 예제는 일상의 주변 잡음을 추가하였습니다. "0-1-2-3-4-5" 똑같은 사람이 똑같은 단어를 말하지만, 자동차 소리와 사람들이 걷는 소리도 함께 들립니다. 원래 깨끗한 오디오 클립에 배경 잡음을 추가한 것입니다. 마지막 오디오 클립은  재생하겠습니다. "0-1-2-3-4-5" 똑같은 사람이 똑같은 단어를 말하지만, 기계음을 추가하였습니다. 하나의 학습 예제를 4개의 다른 학습 예제로 확대하였습니다. 레이블이 지정된 예제 하나를 모을 수 있다면, 다른 배경 잡음을 합성하거나 증폭과 왜곡을 하여 더 많은 예를 생성할 수 있습니다. 깨끗한 원래 오디오에 자동으로 배경 잡음을 추가하는 것은 많은 작업이 필요합니다.  



   Just one word of warning about synthesizing data by introducing distortions: if you try to do this yourself, the distortions you introduce should be representative the source of noises, or distortions, that you might see in the test set. So, for the character recognition example, you know, the working things begin introduced are actually kind of reasonable, because an image A that looks like that, that's, could be an image that we could actually see in a test set.Reflect a fact And, you know, that image on the upper-right, that could be an image that we could imagine seeing. And for audio, well, we do wanna recognize speech, even against a bad cell phone connection, against different types of background noise, and so for the audio, we're again synthesizing examples are actually representative of the sorts of examples that we want to classify, that we want to recognize correctly.


   학습 데이터 셋에 왜곡을 도입하여 인공 데이터를 합성할 때 주의할 사항이 있습니다. 주의 사항은 증폭이나 왜곡은 반드시 테스트 셋에서 경험할 수 있는 잡음이나 왜곡을 대표할 수 있어야 합니다. 앞에서 살펴보았던  문자 인식에 대한 인공 데이터 합성은 매우 합리적으로 우리가 현실에 볼 수 있는 이미지들입니다. 음성 인식에 대한 인공 데이터 합성은  스마트폰 연결 상태가 좋지 않거나 다양한 주변 잡음이 있는 환경을 모방한 매우 합리적인 오디오 클립입니다. 현실을 제대로 분류를 하기 위해 현실을 거의 그대로 모방할 수 있는 대표적인 것들을 합성합니다. 



   In contrast, usually it does not help perhaps you actually a meaning as noise to your data. I'm not sure you can see this, but what we've done here is taken the image, and for each pixel, in each of these 4 images, has just added some random Gaussian noise to each pixel. To each pixel, is the pixel brightness, it would just add some, you know, maybe Gaussian random noise to each pixel. So it's just a totally meaningless noise, right? And so, unless you're expecting to see these sorts of pixel wise noise in your test set, this sort of purely random meaningless noise is less likely to be useful. But the process of artificial data synthesis it is, you know, a little bit of an art as well and sometimes you just have to try it and see if it works. But if you're trying to decide what sorts of distortions to add, you know, do think about what other meaningful distortions you might add that will cause you to generate additional training examples that are at least somewhat representative of the sorts of images you expect to see in your test sets.


   반대로 데이터에 의미 없는 잡음이나 랜덤 잡음을 추가하는 것은 도움이 되지 않습니다. 실제 글꼴 이미지 'A'에 랜덤 가우시안 잡음을 추가하여 4개의 이미지를 합성였습니다. 각 픽셀의 밝기를 나타내는 숫자에 가우스 랜덤 잡음을 곱한 것입니다. 보시는 바와 같이 육안으로 거의 구분할 수 없는 완전히 의미 없는 잡음입니다. 테스트 셋에서 이러한 종류의 픽셀 잡음을 유용하지 않습니다. 인공 데이터 합성의 과정에서 반드시 테스트 셋에서 제대로 동작하는 지도 확인해야 합니다. 실제 학습 데이터에 왜곡이나 증폭 또는 잡음을 추가하는 인공 데이터 합성의 결과물은 반드시 테스트 셋에서 볼 수 있을 법한 현실을 모방해야 합니다. 



   Finally, to wrap up this video, I just wanna say a couple of words, more about this idea of getting loss of data via artificial data synthesis. As always, before expending a lot of effort, you know, figuring out how to create artificial training examples, it's often a good practice is to make sure that you really have a low biased classifier, and having a lot more training data will be of help. And standard way to do this is to plot the learning curves, and make sure that you only have a low bias and high variance classifier. Or if you don't have a low bias classifier, you know, one other thing that's worth trying is to keep increasing the number of features that your classifier has, increasing the number of hidden units in neuron network, saying, until you actually have a low bias classifier and only then, should you put the effort into creating a large, artificial training set, so what you really want to avoid is to, you know, spend a whole week or spend a few months figuring out how to get a great artificially synthesized data set. Only to realize afterward, that, you know, your learning algorithm performance doesn't improve that much, even when you're given a huge training set. So that's about my usual advice about of a testing that you really can make use of a large training set before spending a lot of effort going out to get that large training set. 


   마지막으로 인공 데이터 합성 아이디어가 도움이 되지 않는 경우를 설명합니다. 항상 그렇듯이 많은 시간과 노력을 들이기 전에 인공 학습 예제를 만드는 방법을 연구해야 합니다. 예를 들면, 머신러닝 알고리즘이 낮은 편향 분류기라면 더 많은 학습 데이터를 확보하는 것이 도움이 될 것입니다. 낮은 편향 분류기를 확인하는 방법은 학습 곡선을 그리고 나서 낮은 편향과 높은 분산 분류기를 확인하는 것입니다. 낮은 편향이 없다면, 낮은 편향 만들어질 때까지 분류기의 피처의 수를 늘리거나 인공 신경망의 은닉 유닛 수를 늘립니다. 머신 러닝 시스템을 낮은 편향 분류기로 만든 후에 대규모 인공 학습 셋을 만들어야 합니다. 실제로 일주일 내내  또는 몇 달 동안 방대한 데이터를 얻기 위해 노력한 후에 학습 알고리즘의 성능이 그렇게 크게 개선되지 않는다는 것을 알게 되는 것은 재앙입니다. 그래서 방대한 데이터셋이 학습 알고리즘에 실제로 도움이 될 수 있는 지를 먼저 진단해야 합니다. 



   Second is, when i'm working on machine learning problems, one question I often ask the team I'm working with, often ask my students, which is, how much work would it be to get 10 times as much data as we currently have. When I face a new machine learning application very often I will sit down with a team and ask exactly this question, I've asked this question over and over and over and I've been very surprised how often this answer has been that. You know, it's really not that hard, maybe a few days of work at most, to get ten times as much data as we currently have for a machine running application and very often if you can get ten times as much data there will be a way to make your algorithm do much better. So, you know, if you ever join the product team working on some machine learning application product this is a very good questions ask yourself ask the team. Don't be too surprised if after a few minutes of brainstorming if your team comes up with a way to get literally ten times this much data, in which case, I think you would be a hero to that team, because with 10 times as much data, I think you'll really get much better performance, just from learning from so much data 


   두 번째로, 머신 러닝 문제를 다룰 때 팀원들이나 학생들에게 자주 하는 질문이 있습니다. "현재 여러분들이 가진 데이터보다 10 배 더 많은 데이터를 얻기 위해 얼마나 많은 작업을 해야 할까요?" 새로운 머신 러닝 응용 프로그램을 접할 때 팀과 함께 앉아서 이 질문을 합니다. 저도 이 질문을 계속해서 반복했고  얼마나 자주 사용되었는지 매우 놀라기도 합니다. 현재 가지고 있는 데이터보다 10대 많은 데이터를 얻는 것은 그렇게 어렵지 않습니다. 기껏해야 며칠이면 충분합니다. 그리고 10배 많은 데이터를 얻을 수 있다면 알고리즘을 훨씬 더 좋게 만들 수 있습니다. 따라서, 머신 러닝 애플리케이션을 만드는 제품 팀에서 일한다면, 이 질문은 매우 좋은 질문입니다. 제품 팀이 몇 분 동안 브레인스토밍 후에 말 그대로 10 배 더 많은 데이터를 얻을 수 있는 방법을 생각해낸다면, 여러분은 팀의 영웅이 될 것입니다. 10배 많은 데이터를 사용하면 학습 알고리즘이 훨씬 더 나은 성과를 얻을 수 기 때문입니다.  


   So there are several way to get alot more data. in this video, we forcused on the main idea of  Artificial data synthesis that comprised both ideas of generating data from scratch using random fonts and so on. As well as the second idea of taking an existing example and and introducing distortions that amplify to enlarge the training set. A couple of other examples of ways to get a lot more data are to collect the data or to label them yourself. So one useful calculation that I often do is how many minutes, how many hours does it take to get a certain number of examples, so actually sit down and figure out, suppose it takes me ten seconds to label one example then and, suppose that, for our application, currently we have 1000 labeled examples examples so ten times as much of that would be if n were equal to ten thousand. A second way to get a lot of data is to just collect the data and you label it yourself. So what I mean by this is I will often set down and do a calculation to figure out how much time, you know just like how many hours will it take, how many hours or how many days will it take for me or for someone else to just sit down and collect ten times as much data, as we have currently, by collecting the data ourselves and labeling them ourselves. So, for example, that, for our machine learning application, currently we have 1,000 examples, so M 1,000. That what we do is sit down and ask, how long does it take me really to collect and label one example. And sometimes maybe it will take you, you know ten seconds to label one new example, and so if I want 10 X as many examples, I'd do a calculation. If it takes me 10 seconds to get one training example. If I wanted to get 10 times as much data, then I need 10,000 examples. So I do the calculation, how long is it gonna take to label, to manually label 10,000 examples, if it takes me 10 seconds to label 1 example. So when you do this calculation, often I've seen many you would be surprised, you know, how little, or sometimes a few days at work, sometimes a small number of days of work, well I've seen many teams be very surprised that sometimes how little work it could be, to just get a lot more data, and let that be a way to give your learning app to give you a huge boost in performance, and necessarily, you know, sometimes when you've just managed to do this, you will be a hero and whatever product development, whatever team you're working on, because this can be a great way to get much better performance.


   더 많은 데이터를 얻은 방법은 여러 가지가 있습니다. 이번 강의에서 인공 데이터 합성의 두 가지 아이디어를 설명하기 위해 임의의 글꼴을 사용해 처음부터 새로운 데이터를 생성하는 방법과 데이터를 증폭 및 왜곡하는 방법을 활용하였습니다.  그 외에도 직접 데이터를 수집하거나 직접 레이블을 지정하는 방법이 있습니다. 이때 특정한 수의 학습 에제를 획득하는 데 걸리는 시간을 계산합니다. 하나의 학습 예제에 레이블을 붙이는 데 10초가 걸린다고 가정합니다. 머신 러닝 애플리케이션이 1,000개의 레이블이 지정된 학습 예제가 있다면, 지금 보다 10배 많은 데이터는 10,000개의 데이터입니다. 데이터를 직접 수집하고 레이블을 지정하는 것에 얼마나 많은 시간이 걸리는지 계산할 수 있습니다. 예를 들어, m = 1,000인 머신 러닝 애플리케이션이 있습니다. 이제 직접 자신에게 물어보거나 팀에게 물어봅니다. "하나의 학습 예제를 수집하고 레이블을 붙이는 데 얼마의 시간이 걸리나요?" 아마도 10초가 걸릴 수 있습니다. 따라서 10배 더 많은 학습 예제는 m = 10,000 개이므로 약 10,000초가 소요됩니다. 직접 숫자로 소요 시간을 계산해 보면 종종 많은 사람들이 놀랍니다. 더 많은 데이터를 얻는 작업이 생각보다 얼마 걸리지 않을 수 있기 때문입니다. 짧은 시간 안에 여러분의 머신 러닝 애플리케이션의 성능이 기하급수적으로 향상될 수 있습니다. 단순한 작업으로 여러분은 영웅이 될 수도 있고, 어떤 제품 개발이던지 상관없이 훨씬 더 나은 성과를 얻을 수 있는 좋은 방법입니다.

 


   Third and finally, one sometimes good way to get a lot of data is to use what's now called crowd sourcing. So today, there are a few websites or a few services that allow you to hire people on the web to, you know, fairly inexpensively label large training sets for you. So this idea of crowd sourcing, or crowd sourced data labeling, is something that has, is obviously, like an entire academic literature, has some of it's own complications and so on, pertaining to labeler reliability. Maybe, you know, hundreds of thousands of labelers, around the world, working fairly inexpensively to help label data for you, and that I've just had mentioned, there's this one alternative as well. And probably Amazon Mechanical Turk systems is probably the most popular crowd sourcing option right now. This is often quite a bit of work to get to work, if you want to get very high quality labels, but is sometimes an option worth considering as well. If you want to try to hire many people, fairly inexpensively on the web, our label is much more useful. 


   마지막으로 많은 데이터를 얻는 좋은 방법은 크라우드 소싱입니다. 오늘날 인터넷에서 사람을 고용할 수 있는 몇 개의 웹 사이트와 서비스가 있습니다. 대규모 학습 셋을 상당히 저렴하게 레이블을 달 수 있습니다. 따라서, 크라우드 소싱 데이터 레이블링에 대한 아이디어는 전체 학술 문헌 정리와 마찬가지로 복잡합니다. 전 세계 수십만 명의 사람들이 레이블을 상당히 저렴하게 달 수 있습니다. 또한, 아마존 매타니컬 터크 (Amazon Mechanical Turk) 시스템은 현재 가장 인기 있는 크라우드 소싱 옵션입니다. 매우 높은 품질의 레이블을 얻고자 한다면 충분히 고려할 가치가 있는 옵션입니다. 인터넷에서 상당히 저렴한 비용으로 많은 사람을 고용할 경우 레이블은 훨씬 더 유용할 것입니다.

 

   So this video, we talked about the idea of artificial data synthesis of either creating new data from scratch, looking, using the labeling funds as an example, or by amplifying an existing training set, by taking existing label examples and introducing distortions to it, to sort of create extra label examples. And finally, one thing that I hope you remember from this video this idea of if you are facing a machine learning problem, it is often worth doing two things. One just a sanity check, with learning curves, that having more data would help. And second, assuming that that's the case, I will often seat down and ask yourself seriously: what would it take to get ten times as much creative data as you currently have, and not always, but sometimes, you may be surprised by how easy that turns out to be, maybe a few days, a few weeks at work, and that can be a great way to give your learning algorithm a huge boost in performance.


   이번 강의에서 처음부터 새로운 데이터를 생성하는 법 또는 기존 학습 셋을 증폭하거나 왜곡하는 법과 같은  인공 데이터 합성에 대해 다루었습니다. 또한, 직접 또는 클라우드 소싱을 통해 데이터에 레이블을 지정하는 방법도 다루었습니다. 마지막으로 여러분이 머신 러닝 문제에 직면했을 때 더 많은 데이터를 확보하기 전에 두 가지를 먼저 고려하는 것이 좋습니다. 하나는 더 많은 데이터가 도움이 될 것이라는 학습 곡선을 활용한 타당성 검사이고, 다른 하나는 현재 보유한 데이터보다 10배 더 많은 데이터를 확보하려면 무엇이 필요한지 스스로에게 자문해 보는 것입니다. 항상 그런 것은 아니지만, 생각보다 너무 쉬워서 놀랄 수도 있습니다. 아마도 며칠 또는 몇 주일이면 충분할 때도 있습니다. 짧은 기간에 학습 알고리즘의 성능을 크게 향상할 수 있는 좋은 방법입니다. 



앤드류 응의 머신러닝 동영상 강의



정리하며


   머신러닝 알고리즘이 낮은 편향 분류기라면 더 많은 학습 데이터를 확보하는 것이 도움이 될 것입니다. 낮은 편향 분류기를 확인하는 방법은 학습 곡선을 그리고 나서 낮은 편향과 높은 분산 분류기를 확인하는 것입니다. 낮은 편향이 없다면, 낮은 편향 만들어질 때까지 분류기의 피처의 수를 늘리거나 인공 신경망의 은닉 유닛 수를 늘립니다. 머신 러닝 시스템을 낮은 편향 분류기로 만든 후에 대규모 인공 학습 셋을 만들어야 합니다. 


   학습 데이터를 늘리기 위한 인공 데이터를 합성하기 위한 두 가지 방법이 있습니다.  


   첫 번째는 기본적으로 처음부터 새 데이터를 생성하는 것입니다. 예를 들면, 알고리즘이 문자 인식을 할 수 있게 수많은 글꼴을 다운로드하여 랜덤 배경에 글꼴 'C'를 붙여 넣습니다. 방금 문자 'C'의 이미지에 대한 학습 예제가 만들어졌습니다. 


    두 번째 인공 데이터 합성 방식은 실제 학습 데이터 셋 이미지를 증폭하거나 변형하는 것입니다. 여기 합성하지 않은 실제 글꼴 이미지 'A'가 있습니다. 글꼴 이미지 'A'에 인공적인 왜곡을 적용하여 더 많은 새로운 이미지를 만드는 것입니다. 무엇이 알고리즘을 위한 합리적인 왜곡인지, 실제 예제의 어떤 부분을 모방한 것인지, 단순히 데이터의 수만 늘리는 것인지에 대한 통찰이 필요합니다


   학습 알고리즘의 성능을 개선하는 것이 학습 데이터를 늘리는 방법이라면, "현재 여러분들이 가진 데이터보다 10 배 더 많은 데이터를 얻기 위해 얼마나 많은 작업을 해야 할까요?" 질문할 필요가 있습니다. 데이터를 늘리는 것이 생각보다 오래 걸리지 않을 수 있습니다. 


     데이터를 늘리는 또 다른 방법은 직접 데이터를 수집하거나 직접 레이블을 지정하는 방법이 있습니다. 사람들은 데이터를 수집하기 위해 많은 시간이 필요하다고 생각합니다. 하지만, 실제 계산을 해보면 생각보다 매우 짧은 시간에 할 수 있습니다. 또는 크라우드 소싱을 활용하여 저렴하게 데이터에 레이블을 다는 방법도 생각할 수 있습니다. 




문제 풀이


   비용 함수 J를 최소화하기 위해 m개의 예제로 선형 회귀 모델을 학습시키는 중입니다. 모든 학습 예제에 대한 두 개의 복사본을 만들어서 학습 예제의 수는 2m 개입니다. 비용함수를 최적화하는 것에도움이 될까요?

정답은 4번입니다.



   여러분은 최근 12개월 동안 1,000개의 학습 예제를 확보한 머신러닝 애플리케이션 개발을 하는 제품 그룹에 합류했습니다. 수동으로 데이터를 수집하고 레이블을 달고 있습니다. 하나 당 약 10초의 시간이 필요하다고 가정하고 하루에 8시간 동안만 일합니다. 10,000개의 예제를 확보하기 위해 며칠이 필요할까요?


   정답은 2번입니다. 

매거진의 이전글 앤드류 응의 머신러닝(18-2): OCR 파이프라인 
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari