CANNABIS VILLAGE - Identifying sick Cannabis with AI
This is a modal window.
Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.
Formale Metadaten
Titel |
| |
Alternativer Titel |
| |
Serientitel | ||
Anzahl der Teile | 322 | |
Autor | ||
Lizenz | CC-Namensnennung 3.0 Unported: Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen. | |
Identifikatoren | 10.5446/39837 (DOI) | |
Herausgeber | ||
Erscheinungsjahr | ||
Sprache |
Inhaltliche Metadaten
Fachgebiet | ||
Genre | ||
Abstract |
|
00:00
Software EngineeringQuick-SortAbstandIdentifizierbarkeitSystemplattformSmartphoneSelbst organisierendes SystemVirtuelle MaschineDigitale PhotographieAlgorithmische LerntheorieVollständiger VerbandEndliche ModelltheorieSchnittmengeProzess <Informatik>BenutzerfreundlichkeitAbgeschlossene Menge
01:37
ModelltheorieTermKontextbezogenes SystemSmartphoneEndliche ModelltheorieSchnitt <Mathematik>Standardabweichung
02:38
Endliche ModelltheorieDomain <Netzwerk>ExpertensystemHilfesystem
03:35
SoftwareDatenmodellWellenpaketMaschinelles LernenProzess <Informatik>TropfenIterationSoftwareVirtuelle MaschineEndliche ModelltheorieProzess <Informatik>Digitale PhotographieVorhersagbarkeitSchnittmengeComputeranimation
04:28
SpezialrechnerWeb SiteAutomatische HandlungsplanungDigitale PhotographieComputeranimation
05:10
SpezialrechnerBitDigitale Photographie
05:27
SpezialrechnerEndliche ModelltheorieObjekt <Kategorie>Bildgebendes VerfahrenQuick-SortSchnittmengeKlasse <Mathematik>Digitale PhotographieRandomisierungWellenpaket
06:37
Virtuelle MaschineMAPBildgebendes Verfahren
06:59
Neuronales NetzWellenpaketDatenmodellWärmeübergangGarbentheorieEndliche Modelltheorie
07:32
Dienst <Informatik>DatenmodellWellenpaketProgrammbibliothekInstantiierungUmwandlungsenthalpie
08:10
PrognoseverfahrenFaltungsoperatorDatenmodellWellenpaketWärmeübergangModelltheorieObjekterkennungMinimumEndliche ModelltheorieDigitale PhotographieGewicht <Ausgleichsrechnung>Bildgebendes VerfahrenKlasse <Mathematik>Wellenpaket
09:24
WellenpaketDatenmodellFigurierte ZahlComputerarchitekturResiduumValiditätSoftwareMAPEndliche ModelltheorieResonatorResultanteCASE <Informatik>Bildgebendes VerfahrenGewicht <Ausgleichsrechnung>Computeranimation
10:44
WellenpaketDatenmodellPunktwolkeBildgebendes VerfahrenProdukt <Mathematik>ZweiLogischer SchlussVorhersagbarkeitPunktwolkeComputeranimation
11:15
Digitale PhotographieBenutzeroberflächeDemo <Programm>Elektronische PublikationMultiplikationsoperatorKlasse <Mathematik>SoftwaretestBrowserComputervisualistikBenutzeroberflächeEndliche Modelltheorie
12:03
IterationSpezialrechnerSystemplattformMultiplikationsoperatorExpertensystemBildgebendes VerfahrenQuick-SortGüte der AnpassungOpen SourceSchlüsselverwaltungsinc-Funktion
13:02
Lokales MinimumWeb SiteQuellcodeKlasse <Mathematik>ComputervisualistikQuick-SortBildgebendes VerfahrenNatürliche SpracheComputeranimation
14:29
Endliche ModelltheorieFreewareVorhersagbarkeitSchnittmengeQuick-SortExpertensystemWeb SiteWasserdampftafelSystemplattformDigitale PhotographieComputeranimation
16:35
Endliche ModelltheorieVerschlingungMaschinencodeMAPCOMBildgebendes VerfahrenKlasse <Mathematik>Elektronische PublikationAlgorithmische LerntheorieErweiterte Realität <Informatik>ZahlenbereichDigitale PhotographieQuick-SortProjektive EbeneSoftwareProzess <Informatik>WellenpaketMultiplikationsoperatorWasserdampftafelPunktSchnittmengeSichtenkonzeptDifferenteTypentheorieVirtuelle MaschineComputeranimation
20:56
Web SiteCOMComputeranimation
Transkript: Englisch(automatisch erzeugt)
00:00
We have Harry Moreno. He's going to talk about how one would identify sick cannabis plants using machine learning. Is your mic good? Hello? Hey. Keep it close. My name's Harry. All right, thank you. So, hi, hope you're enjoying DEFCON.
00:24
So, we'll begin. This is machine learning for sick cannabis. How would you build a model to identify sick cannabis? I designed this with the intention of being very practical.
00:42
So, folks could take a photo of any sort of cannabis plants at a average distance from your smartphone. So, who am I? I'm a software engineer. I'm not a data scientist. That's not my job title.
01:01
I'm actually a software engineer. But I'm interested in data science and machine learning, and I thought this would be a pretty interesting problem, very practical problem to solve. I'm from New York. I'm an organizer at Kaggle New York City. Kaggle, for those who don't know, is a data science platform where people compete
01:23
from around the world to be the best data scientist on interesting data sets. So, if you're in New York and want to do hands-on machine learning, please join us. What's the background here? So, some context on what's possible,
01:43
what's being done with AI in 2018. Artificial intelligence is becoming more pervasive and accessible. Two examples, radiologists and interpreting X-rays.
02:04
The say of the art is that we built models that are as good or better than professional radiologists in terms of accuracy, as well as, I think, last year,
02:23
Stanford University published a model for skin cancer, diagnosing skin cancer that could run on a smartphone. So, that's what's possible. And so, what are we trying to do?
02:43
We are trying to see if we can build something similar, but for diagnosing cannabis. The intended users are hobbyists, people that aren't doctors, aren't plant doctors,
03:01
and they just want to grow a plant, industrial players. So, if you have a cannabis farm, you're very keen on knowing if your crops are sick. And the other problem, too, is that diagnosing a plant
03:22
requires a domain expert. So, for example, I'm not a domain expert in diagnosing plants, so I would want a model like this to help me. And so, that's our goal. We want software that tells you if cannabis is sick
03:40
by using your farm. So, how do we make this, how do we make a model? How do we make a predictive model? The machine learning process is this. You gather data, you train on examples, you build a predictive model on the examples.
04:02
We launch it, we publicize it so that people can use it, and then we iterate. So, one of the things that we can do once we've deployed it is that as people use it, as people upload photos to get their predictions, that grows our data set.
04:23
And the goal is to make a very, very accurate, free, predictive model. So, for step one, gathering data, myself and some other people in the community
04:41
helped scrape for sick cannabis, pictures of sick cannabis. And there are websites that do this. That you upload your pictures of your sick plant and other people tell you what might be wrong, like if it's purple or if it's yellow, it means different things, and to solve them,
05:02
they have different solutions. So, we built a scraper to collect sick cannabis photos. Similarly, we collected healthy cannabis photos. This was a little bit easier because
05:21
people like to show off their healthy plants and how well they're doing, so that was easier. Here, we collected data for, a data set that would trick the plant. So, if our goal is to build a model that can tell you
05:43
if a plant is, a cannabis plant is sick or if it's healthy, another, a very practical concern is, if I upload a photo, can the model tell me if there's even cannabis in the photo? So, I added this third class that was basically composed of meme photos,
06:03
the Caltech object data set with random, everyday objects, and a lot of pictures of flowers and plants to see if the model could learn to, what, if the model could learn how to identify what is a cannabis plant first,
06:21
and then if it's sick or healthy. So, this is sort of the design of the training, and built this other images data set. So, at the end of this stage of gathering the data,
06:43
we ended up with 3,000 images, 1,000 sick, 1,000 healthy, 1,000 other. This is actually a very, very tiny data set in terms of we're doing this machine learning stuff, and we'll see that, how it performs.
07:00
If you wanna follow along, what I pretty much did was I read section 5.3 in deep learning with Python. Here, they go over data augmentation, which helps with mutating your data set so that you can get more mileage out of it, as well as transfer learning,
07:20
which allows you to begin building your model based off of the cutting edge research that other people have publicized. So, for practical concerns, I work off of a fairly old MacBook,
07:42
and it has a GPU, but it's just very, very old. So, I use Amazon Web Services, their SageMaker offering, which is a one-click deploy. So, a GPU instance, and you get all of the libraries installed. The one GPU instance is $1.50 an hour,
08:01
the four GPU is $10 an hour. So, if you wanna do this and you don't have a GPU, this is how you could do it. The specific technique that I used here was transfer learning, which basically, we take the ImageNet winner. So, ImageNet was another problem
08:21
that was very, very popular, and now it's considered a solved problem, which the challenge was object recognition. So, that challenge was you're given tons of data and there's 1,000 classes, and your model has to say what's in the photo.
08:44
This is actually considered a solved problem now, and there are plenty of pre-trained models that you can build your own models off of, and that's what this transfer learning technique is. We basically take the,
09:00
so, the full, imagine from top to bottom is the ImageNet solution. You would take that, remove the top layer, and put in your own, and that's what you're training. So, these lower layers are reusable feature detectors,
09:20
that you can use. And so, what are some of the results? There, we tried two architectures broadly. There's this ResNet50, ResNet short for residual network. I don't wanna get into the details, but I tried this one first because this is the one that reached human level accuracy
09:43
on the ImageNet competition, and the accuracy that we got, when building our model was about 60% validation accuracy.
10:00
And then I tried another model, another architecture called VGG16, and this is coming out of Oxford, and this one achieved 80% accuracy. And this is pretty much what I ended up deploying, this second architecture. I wanna figure out why this is the case.
10:23
Everything online tells me that ResNet should have been more accurate, but it seems like we just need more data. So, if we had something like 20,000 or 50,000 images, I would like to try this again with ResNet and see if that could get up to 95, 99% accuracy.
10:45
But for now, with 3,000 images, we have VGG16. And then we deployed it to the cloud. This is running on EC2. There's no GPU in production.
11:01
It takes about one second for inference to happen, for the prediction to, for you to get a prediction. And it's built with Python tools like Keras, Flask, and that's about it. We built a user interface, and you can check this out right now,
11:20
chronicsickness.com. And if there's enough time, I'll demo it. But it's there, it's live. Pretty much, you upload a file from your phone or from your browser, from your computer, and you submit it, and you get a probability
11:42
of what the model thinks is the outcome. So, for this example picture, it's 88%, so it all adds up to one, the three classes. So, it would predict that that picture is of healthy cannabis. And I encourage you to test it out,
12:01
help us make it better. We want to iterate, so this is just the first step. 80% isn't that great. I feel like this, if we're putting radiologists and dermatologists out of work, this, I think, in my opinion, would be a simpler problem.
12:21
So, it's really just about getting more data. 3,000 images is way, way too small. We want to, it's already open source. We want to, the key problem, though, is getting good label data. And that's very time-intensive, requires an expert.
12:42
So, we want to now build some sort of crowdsourcing platform where people can contribute when they have free time or as their interest brings them in, and as they lose interest, they can leave, but we want to preserve that sort of work in a crowdsourced sort of way.
13:01
So, look out for that. Future work. So, the problem of diagnosing sick plants is a three-class problem, not as, it's hard to say what should be more difficult
13:20
or less difficult, but for example, ImageNet was a 1,000-class challenge, and statistically, if you just made a random guess, it'd be pretty hard to get the right guess when there's lots of classes. So, these other problems, if we could classify the exact disease of a plant, is much more difficult
13:44
than just what we have now, which is sick or not sick or not cannabis. And then, it might be fun, because there's lots of sites like this already, to try to predict the, the strain of the cannabis, just for fun,
14:01
and that is many, many, well, one source told me that it was about 800 strains, so that's arguable as well, but it'd be pretty interesting to build something like this with no access to the plant's genetics, it's outward appearance,
14:21
and seeing what computers think, what sort of strains they discover. And that's my talk. The site's available at chronicsickness.com, and if you want to reach out to me, that's my site, haramareno.com, and if you want to help,
14:40
if you have access to a large data set of labeled cannabis photos, I really want to speak with you. Other than that, I want to build the crowdsourcing sort of platform, so that people can contribute, and let's make a free predictive model
15:07
for cannabis disease, that's free for everybody, that we could all build together, and it benefits everybody, so that's kind of what I want to build, and that's it.
15:27
So, I can take questions, by my clock, I have 10 more minutes, but if people want to, yeah, I guess, questions, any questions?
15:45
Yeah, with the hat.
16:10
Okay, so, I think the question is, do we want to build something that is for ailments other than diseases, like lack of water,
16:21
and yeah, so actually when, so maybe I'm not an expert in cannabis, but when I said disease, I was actually going, I was actually including those sort of ailments, because this breakdown of 40 plant diseases is actually from groweateasy.com,
16:41
and so we see things like boron deficiency, for example, light burn, which isn't a disease, but it's more of a issue that you'll have if you are just doing this in your closet or something. So, we could build both, but I think for proper diseases,
17:00
it would actually be more difficult, and you would actually want to get some sort of botanist. I think from a more practical point of view, it'd be much easier to get, collect data on those things that you did mention, so practical things like, is it lacking water, does it need more sunlight, and is it too close to the generator? That's one that I learned in this project.
17:24
So, it's sort of like the software sort of meets you in the middle, so if people want to build certain things or we have the talent, we could certainly build a proper diseased one, but I think it'd be just way easier to do the common ailments.
17:44
In the back, the hat. So, the question is, does the model...
18:03
Yeah, chronicsignals.com, it does not do this. This is for future work. We have a model that's about 80% accurate on just telling you if it's sick or not, and first we want to solve that problem. It should be, in my opinion,
18:22
I think that we should be able to build a model that's above human level accuracy. We could debate about that, what that means exactly, but we should be able to build that for sick, not sick, and then once that's solved, we can tackle more granular problems like the specific ailment and the strains, just for fun.
18:52
So, we don't have an API yet. It's just the chronicsignals.com where you can upload a photo,
19:00
and there's a link to the GitHub so you can see the code, but the model is not publicized. The model itself is about 110 megabytes. GitHub doesn't have support for large files, so it's not there, but we can speak offline about that. If people want an API, we could build something like that.
19:22
Oh, one more question. Yeah, so the GPU really helps
19:42
with the specific technique called data augmentation, and so you can do that for different types of data, so in machine learning problems, you might have audio data or text data. In this problem, it's image data, and so it turns out that we can do random projections like rotating and skewing it and zooming in.
20:04
All of that is drastically accelerated with a GPU, so in the book, it says that if you don't have a GPU, don't even try to do data augmentation, and so there's that, and then the actual model training time with a GPU,
20:21
it's about an hour and a half for 3,000 images, and I think that would grow linearly, so yeah, if we get 20,000 images, it might be like six-hour jobs.
20:41
I think so. I think the model training is more, it grows linearly with your data set size, not so much with the number of classes you're trying to predict, so, and so if you have any more questions, the site is chronicsignals.com. You can follow through to the GitHub
21:00
and find my handling. You can send me emails if you want, if you want to help, or if you have suggestions. Thank you.