Neural network racing cars around a track
Vložit
- čas přidán 3. 01. 2019
- Teaching a neural network to drive a car. It's a simple network with a fixed number of hidden nodes (no NEAT), and no bias. Yet it manages to drive the cars fast and safe after just a few generations. Population is 650. The network evolves through random mutation (no cross-breeding). Fitness evaluation is currently done manually as explained in the video.
Car picture by Unlucky Studio:
unluckystudio.com/game-art-giv...
Track background created by Keely for Quickrally and modified a bit:
/ screenshot_saturday_26...
Background music by Trevor Lentz:
opengameart.org/users/trevor-...
Coding by Johan Eliasson in 2019.
Shoutout to that one car in first gen who went as far as it could in the other direction. You shall be remebered, rebel
yeah he should have been parented as well to get 2 sets of cars. Some that go left and some that go right. It would be a mix of the choices and eventually one would prevail. would be interesting
Yeah he was smart enough to see that it would be a trafficjam going the same way as the others.
you are right!
Or it's an anti-vaxxer
That one was probably my car
That one car that went backwords: "My goals are beyond your understanding"
That car has watched "Ready Player One"!
@@justus8675 lol
that car had a goal to cross finish line - and it did that first :)
It's speedrunner
3:02 "looks like gen 4 will finish a full lap!"
selected car: *rams into wall*
*unselects car immediately*
you have disappointed me, child
He choked.
blew a tire on the last turn.
That was pog’nt
@@Sifer2 He was paid off
this blows my holy mind
Jesus
Machines will find you jesus
ITS JESUS CHRIST
Don´t fuck with the Jesus!
@@e2U i see
ah the machines are learning!
Now imagine o e million learning one thousand generations per second
I tought you was fake for a second
Yes. We arefz011jk011101001Fhkw/,,.dsd0 *ERROR* sdal+!'"glb.ú - system failure.
Reboot...
...
...
Yes. I agree with you my fellow human.
Lowkey kinda thought u were fake
With the help of a Conscious selector. Interesting.
"Except for that top guy that figured out how to turn left..."
Achievement Unlocked: Pro NASCAR Driver.
NASCAR announcer: "He's making a left turn!"
Was laughing as fuck
Me: Alright, what's on the algorithm menu today?
CZcams: Car breeding
Me: Cool
@@googlexd7294 Sir this is a wendy's drive thru
thats a lot of new stuff I learned today btw
@@googlexd7294 but this video is just neuroevolution. it does not actually do any backpropagation. it just randomly modifies the neural network here and there and then copies it and then rinse and repeat so this video and youtubes ai are different? (please correct me if i am wrong)
@@googlexd7294yes. I think that the forward propagation (goinc through the network in the forward direction) is the same, but in the video the best ones are picked and then randomly mutated and rinse and repeat, but in youtubes algorithm it back propagates the error using fancy mathematical tricks so this network is kinda dumb in comparison, but then again in backward propagation you need the error. For example to make the video ai smarter you could define the output you want from if the car is pointing too left or too right and then back propagate with the actual output of a poorly trained network so that would make the ai more sophisticated, because then it wouldnt need to go through artificial evolution, but instead training. But i am by no means an expert so takr this with a grain of salt.
Edit: you sound like you are interested in ai. I highly advice you to look at 3blue1browns video series on neural networks, coding trains neural network videos and also check out www.neuralnetworksanddeeplearning.com .
@@googlexd7294 That was such an amazing description of the youtube algorithm; I had no idea it was so simple. I am however confused on whether the weighting is done using point differentials (and therefore uses the massey method) or whether the algorithm treats all variables equally (and therefore uses the colley method). I would assume that the variables: liking, commenting, time spent watching, and all the numerous data collection points are all weighted in using point differentials because I would believe that some actions are more pertinent than others. That's my hunch, but would love to find out if somebody knows the answer
I cannot express how much i am laughing at this and i have no clue why lmfao
moral of the story is:
theres still gonna be alot of dumb people every generation even if their family head is a genius/successful
yea, but here they are only breeding the smart ones, real life is almost opposite.
@@IamR3D88 the dumb people fuck like rabbits yeah. Have you seen the movie idiocracy? its really a fun movie about this idea
@@kaiserhhaie841 the plebs are a need
The dumb is there to be taken advantage of.
@@RessG Conscientiousness and agreeableness are stronger correlates of societal and economic success than IQ. And conscientiousness is correlated directly with lower IQ. (:
IQ certainly matters to an extent that you can plan and foresee future outcomes I guess. But this only requires an IQ of "about average or a bit below" though. An IQ of 100 will be indistinguishable from an IQ of 120 or 140 if the latter is neurotic and schizoid or something. Past a certain point, IQ becomes detrimental to economic success, because once you control for IQ the only real effects to be seen are whether or not someone is able to compromise, make good arguments without being overly acerbic, and get along well with coworkers to not be passed up for promotion.
Also since people like diligent workers, conscientious high intellects are in extremely high demand, but remember that conscientiousness is negatively correlated with IQ (a small negative correlate) and the rest of the Big Five are questionable as to which way they swing.
People with higher-than-average (1 SD or more) IQs might make a bit more money but they're also more likely to fall for New Age cults like the Tesla Model S or Scientology, which reduces their effective lifetime earnings. This is natural and normal: there's no real reason to sit on money when it's being raked in unless you anticipate that changing in the future, and people with higher IQs tend to assume that present trends will continue (otoh saving back 6-8 months of pay is not hard for someone with a $70-150K USD job in Middle America).
Only if you compare between populations rather than within populations does it seem like IQ matters for lifetime earnings.
This is why the people who make the most money in their jobs (medical doctors, engineers, etc.) tend to be "around" a standard deviation or so of their population average. On one hand they're clearly clever enough to have a high-in-demand certification or license (medical board, professional engineer license) but they're also conscientious, and that will lower their IQ a wee bit (about 1/3rd a SD maybe? perhaps you need a certain level of conscientiousness to convert extra work hours to more money at a slightly less efficient rate) but because IQ is simply a coefficient of work by putting in another 3-4 hours on the job they don't actually lose money, they gain it.
For high IQ earners, i.e. professional licensed workers, having a conscientiousness rating a full SD higher than standard high IQ population leads to nearly half a million dollars in total earning income. For people who are both extroverted and conscientious, this is about a million extra bucks. Or about 1/3rd more lifetime income. Counter-intuitively, agreeable employees earn a bit less (about 8%) than aggressive ones, but only because they're not willing to go in and fight for a pay increase or negotiate hard. Of course the Ternan study did show that higher IQ (1 SD) than already high IQ does lead to an actual increase in earning, this is entirely eclipsed by being agreeable: a paltry 5% higher earnings over the Ternan study population lifetime incomes. Boo. I'd trade a standard deviation in IQ at around 155 for a standard deviation in conscientiousness if I could min-max my rolls, but that would be cheating the system since it isn't even equivalent: conscientiousness just wins.
Is being smart good? Yeah it's fine, depending on how much work the person is willing to do. I'd take someone with an IQ of 105 who actually does what I tell them to do over a guy with an IQ of 120 who puts in the minimum of effort; any day, any time.
So yes, dumb people exist to be exploited. Specifically by giving them jobs that they're good at and perform well in, which can be anything from machinist to electrical engineer or medical doctor, if we assume that "dumb" is defined as "within a standard deviation of average" or so.
At least they drive better than most players in a Forza lobby.
You have provoken a gang war
Probably rlly bad
first thing that came to my mind
big facts
wonder if you could train them to follow a proper racing line also
Could you put the winner brain in a new, different track?
I would assume that yes. As long as the input remains the same and the output is enough to get through the course, then sure. Obviously it might couple of iterations to get used to new environment since as mentioned cars themselves know nothing other than input - output.
This would be how you test for overtraining on a neural network. It's the difference between learning to drive and learning the line through a single, specific track.
Came up with interesting examples on how similar test could fail:
- Widen the road. The goal is to make laps. Cars implemented here would just try to avoid death. If they could do the 360 in a width of the road, in few generations they would probably just start circling.
against some blue, yellow, green and purple cars? :3
Kinda depends on what he's actually doing internally. If he is training actual neural networks that are being trained to navigate based on wall distance... sure. But if he is deviating from what the video implies and the nets are really just remembering a set of mildly successful actions then no. We can assume from some of the interactions of the cars that he is actually training the network to "predict" (wrong term but that's fine for now) where it should turn based on the variables he gave them.
Evidence:
Turns being made without a generational gap. (implies conditional actions instead of instructions)
Cars continuing to make fairly obvious mistakes in each generation.
Randomized evolution causing occasional large leaps in the success of a generation.
There are some points against, but I suspect that the code runs almost exactly as he described. So the neural nets are trained to take the speed, direction, and nearest walls as data. And then run them through some basic (but i'm sure impressive) conditions that are randomized over time. Assuming the code runs in this way, then yes the cars would work along a different track.
TL;DR
Almost certainly, the cars would run but probably with a slight performance loss.
Gen 200: The cars have have managed to enter the Industrial age.
Gen 1000: The cars have now created their own simulation of neural network cars.
Gen 12^100: ❄︎︎♒︎︎♏︎︎⍓︎︎🕯︎︎❖︎︎♏︎︎ ●︎︎♏︎︎♋︎︎❒︎︎■︎︎♏︎︎♎︎︎ ⧫︎♒︎♋︎⧫︎ ⬥︎♒︎♓︎♍︎♒︎ ⬧︎♒︎□︎◆︎●︎♎︎ ■︎♏︎❖︎♏︎❒︎ ♒︎♋︎❖︎♏︎ ♌︎♏︎♏︎■︎ ●︎♏︎♋︎❒︎■︎♏︎♎︎📬︎
Tis encrypted my boy, I wish thee luck if you desire the knowledge; with a forgiving hint of Lingo~
@@RasmodeusQ"They've learned that which *
should never have been learned." but in Wingdings font *'should' was mistyped
Still using carburettors, but managing to add forced induction ;)
The cars managed to create a racing line
Imagine using this to find perfect lines for actual races
That would end up like the car chase in Blues Brothers
You would need real-car physics such as traction, acceleration, deceleration, etc. I did something similar at Uni, optimising splines for the racing line. I never did get the physics right :(
@@philrod1 you could have a 3d physics engine and just use a template physics pack and just view it from above that would probably make the whole thing alot easier because its been done for 100s of games but i may be wrong I’ve only attempted to make basic games and never went anywhere because I didn’t enjoy it as much as I thought
@@philrod1 Is there any previous art on optimized splines for racing? I assume that's a solved problem (or at least we've figured out the system to optimize), right? Do you have any resources on that? It seems really interesting.
@@sunboy4224 - It was a while back I was working on this but I definitely remember reading a paper on a similar problem. I think they were using sections of spirals. But, yes. There's no reason this is not a solved problem, just that _I_ failed to solve it. It's only maths.
The track should have been re-generated for each generation to avoid overfitting. How the fittest cars perform on other tracks?
Thanks to your comment, I just learned what overfitting actually is :)
Wow had my ML exam today and no book could explain over fitting , yet this guy's one sentence made it clear as a crystal .
Thanks guy
Yes, it knows THIS track. It would be curious to see it on another. And ML means Machine Learning.
eh. overfitting wouldn't be a major issue in terms of tracks, rather the main overfitting problem here is can it perform with different acceleration/traction values.
It's not given perfect spatial information, which means it doesn't actually make decisions based on coordinates/list, but rather it takes in 5 distances and outputs. 5 distance and output sets that work don't vary much track by track, but rather by specific car specs. This is of course assuming the procedure given in the video is fully correct.
The neural network is merely taking in 5 distances to collision and computing what to do in the current situation. It is unlikely that it just makes a list, especially seen when cars don't complete laps in the same way each time.
I dont think it learns like that. I think it just saves the turns it took for the track and variates it slightly in time
Look at the bottom right. You can press K for a thanos snap!
@@bubbles7608 It says 'Kill half' though
Edit: This comment responds to a now deleted comment from 'Bubbles' who claimed pressing k would kill everything.
@@bubbles7608 (K)ill Half
@@bubbles7608 And why the F*ck would the snap only kill a half? Only because he wanted for it to be half... if he wanted to destroy everything it would be everything. thanos snap doesnt mean HALF
@@Riskomul wat
@@Riskomul r/woooosh
"FOLLOW MY PATH MY CHILD"
-the parents
And child be like nahh!
True also in real life.
I just want to appreciate that this video came out in 2019 but looks like it's from 2009.
so?
@@zarrowthehorse it’s a good aesthetic
it looks better than GTA from 1999
CZcams recommendation is the randomest thing in the world
but why on earth i click in..
Because neural networks are fucking awesome, that's why.
Because Google's neural net for recommendation calculated a high probability that you will click in.
am I influencing the neural networks or are the neural networks influencing me ? . . . .
You clicking on this reinforces the algorithm making the right choice :D
@@skop6321 yes
This is very interesting, but you should show also how well (or bad) they are doing when given a different track. By that you'll know if they learned how to ride that specific track, or they learned to drive any track.
the one in the begging that went backwards should have been another Parent representing that change and seeing if some ended up completing it backwards while some went forwards would be cool
Yes, always validate the network on new, unseen data
@@lyricallizard7817
The model thus far would be trash on a new track.
A new track will take a new network.
It will take thousands if not millions of novel tracks with subtle perturbations to complete a neural network capable of truly facing a novel track and succeeding.
@@MotesTV That's not correct. The ANN model is simply a link between the yellow radar inputs and the wheels outputs. The model is essentially "when my front radar and right radars are blocked, turn left, and visa versa." These models are very standard and easy to evolve with ANNs. If anything is overfitted, it will simply be generic features like the width of the track--it may have trouble on a much narrower track, for instance. But it ought to do well on a different track with similar features (width of the track etc.).
@@zamfent
I agree with most of what you said but that I'm "not correct."
For instance this track is very sinusoidal, what if the track were more angular, and the track narrower? What if such a concept as obstacles were introduced, causing networks which engaged in periodic swerving to facilitate "radar scanning" to become promoted?
I'm simply pointing out that if this were to begin to become a "throw everything you got at it" test, the model would need loads of work.
Huh, after only four generations they drive better than the AI in Halo.
and better than the one's in this vid czcams.com/video/oHg5SJYRHA0/video.html
(i don't own the video btw)
@@CranyUnknown reeee
Funny, but that is exactly the amazement which is in this.
HALO AI is old. The AIs have improved a lot since then.
Back then you had to have around 100 Gens of AI until they manage the first round - and then you had to "teach" them go faster....
Better than a lot of people IRL....
@@Rabijeel halo doesnt use this kind of stuff lol its not AI its pre programmed by people
This is the first time I've seen this 5-line-method be used and it actually work! The main difference I see here is that you MANUALLY selected the best network, so it could be an issue with the fitness, and that you used random mutation instead of cross-breeding. Which is very interesting!
Congratulations, you did a great job!
That's an accurate way of teaching how our neural system is working to connect experiences with learning.
"Victory cannot be achieved without sacrifice." - our boi Viktor Resnov straight outta Vorkuta.
Victory cannot be achieved if your opponent is Chuck Norris
@@lasstunsspielen8279 Well, Bruce Lee doesn't agree.
These videos always blow me away how quickly they learn with such little information.
Fantastic visualization of neural nets. Awesome job!
the real test would surely be deploying the evolved cars on a different race track
not very impressive idd
They would still have to learn the track and do the same process like in the video. As OP said, the cars don’t know they’re in a racetrack.
Except they are steering based on the inputs they receive - so it is not necessarily a case of them remembering the race track 'rote'. It's a question of whether they have 'learnt' or developed an algorithm which allows them to keep in the track as it twists and turns based on the set of inputs they are being given as they go round, and the way in which they respond to them. As you say, they don't know they are on a race track - just that they have a set of inputs.
It all depends on what the algorithm in each car is actually doing with the inputs, and to what extent getting around the track is actually blind luck.
@@radioactive.redwood
they wouldn't care what the track looked like. again the ai doesn't know it's driving something, it doesn't know it's on a track, it doesn't know anything but "does line 1-5 hit something?" if it does then adjust inputs.
there are exceptions, like if it hit a big open room it might get messed up but with a bit more training it could figure even that out.
@@rocksfire4390 The AI has to know some things. Collisions are bad, laps are good for example.
97% : I have to go faster!!
2% : I just wanna go back
1% : Paused.
This is the best way to simply explain AI that I can use for anyone. Great stuff!!
those lines were near perfect by the end, stunning
Nice to see someone working on neural networks. I actually did a project exactly like this for my minor back in the day. I evaluated the genomes using 2 factors.
1. Checkpoints: as you've stated. This is annoying to make at first but it is a must to automate evaluation. The more the better.. Hand-picking is just not going to work in the long run haha.
2. Car damage: This one turned out to be very important as well to force the AI to drive acceptably. However i can see that your car just stops after crashing so this might not apply to you.
Also something worth pointing out is that if you want cars to genuinely learn how to drive a track, you should have them learn on multiple tracks. I was so surprised to see my cars drive my first track like pro's only to get destroyed in a new track. What I did to avoid overfitting was to teach my genomes how to drive on 1 track until they're somewhat capable. Then gradually introduce new tracks and evaluate the fitness of all tracks combined. This way, only genomes that adapted to various situations will be selected.
I tried something similar and trained on multiple tracks and then tested on different tracks that were not part of the training data.
There is a video on my channel ;)
I also ran into some overfitting "issues", but I assume this will go away if I use even more tracks for training or reduce the size of the neural network.
And I found a method to not have to do checkpoints, but generate a fitness value for each track pixel.
It was killing me how he was clicking on them too early
Patience is a virtue. Thatbis whybhe makes for a bad god.
Because all the cars will mingle together after some time and itd be difficult to find that car from 300+ cars
@@thelevhart7980 not necessarily. You wait until the end where they all come to a rest or go as far as they're going to, and select them. If 300 cars get up front, then you want those 300.
I did not get why having a selection algorithm was difficult. A simple time/distance would have been interesting to assess
For those wondering, the music used is Hero Immortal, by Trevor Lentz.
Excellent. We are in the process of seeing if this will scale and handle the complexity of real driving with the imperfection of real sensors.
Great work! You can also determine breakpoints and select cars automatically, not manual.
0:37 MY heart. Because you know to much fastfood.
*Wow, I'm really amazed! Great work bro!*
I actually like that you're selecting this manually. I think that may help you to significantly improve the conversion speed vs. regular fitness functions
He's using his own brain's neural network to evaluate the fit of the machine net :)
CZcams recommendations at its best
honestly great video. But the music in the background was so perfect. Really nice choice props to you
Glad you enjoyed the song. You can find my latest album "D-Pad Destruction" on Spotify. open.spotify.com/album/33NZN8PiYeEkW0w8V26rLP
@@TrevorLentz Oi cheers man, you make great music
Great video man! Loved the presentation & visualization!
Awesome stuff man. I did a project at university implementing AI in Robocode(Genetic algorithm for movement, neural network for aiming and shooting and a basean network for decision-making). That was a lot of fun and we found that nearly no matter the parameters, it always decided to not shoot but just avoid bullets.
I absolutely love that in the first few generations they tried to go backwards and then cross the finish line, the little robot buddies are tryna cheese the game already
well some of them were thrown into "existence" facin in the wrong direction lol
After that training, how do they perform on a different circuit?
Very likely they don't perform any better than the first generations. It seems like the program is just given the 5 numbers for distance and spits out two other numbers that trace out a curve. What was selected was the algorithm that spits out a curve that fits the circuit.
@@lucasbruel It doesn't get any numbers for distance inside the curve or location inside the track. It recives distance to the edge of the track. So it could still work relatively well. It would likely manged to turn correctly, BUT, it might be unable to stay at an appropriate speed, because the correct speed might be highly dependent on the track.
It will perform nearly the same. You can see this, when the first generation was driving into new areas... they behaved like in earlier places.
I don't think so. It is like genetic algorithm to overfit only this circuit not a general driving
@@lucasbruel the networks are familliar with gentle and sharp turns in both directions, so they will handle that, but something like a separation or crossing would be new to them
Thanks for explaining whats going on in the process. Really cool stuff
Evolution of life on earth through selection works exactly that way. Fantastic demo!
"Kazunori Yamaguchi programing the AI for Gran Turismo 4 - circa 2003, colorized"
Skip 100 gens and you've got yourself a tiny Senna.
My brother has a tiny senna from Lego
You're like a god, creating your own universe of cars.
A wonderful example, very worthy to be taught to kids of any age!
Now implement Reynold's boids on top of that so that the individual cars could see each other :)
Everybody gansta until the machines start learning
wow ! this totally inspires my confidence in self-driveing cars... specially those guys in the begining
Really great demo!
I wanna see this for DiRT Ralley. That would be so cool.
What’s with the e?
Dude could you imagine the crazy throws AI would do
After that training, how do they perform on a different circuit?
1 week later
Skynet: ALL YOUR BASE ARE BELONG TO US !
Not even Close
This is absolutely brilliant!
Beautiful example! Well done! 👍🤓❤️
Wait! Why am I here? I’m suppose to watch meme videos.. but this is too interesting so imma stay
gigante: breeding cars
me: struggles to get a cnn cat and dog image classifier to work
Amazing. This video was incredible
Thanks, that was incredible !
Getting around the track after 3 mutations seems crazy to me.
EmoryM it’s because he was manually deciding which cars get to move on each generation... kinda cheating
@@goodby39 Well, isn't normaly there a system to decide which ones go on anyway? He just hasn't implemented such a system, so he chose them instead.
i mean you could've just done some kinda least squares fit to a path he himself would draw, but that'd be basically the same thing, and also develop WAY faster.
@@NotLegato Yeah, if he just measured distance travelled and choosed the best one, it would have same result. Still three generations is very fast.
Thanos: You should've gone for the head
*Presses K on the keyboard
Thor: Noooo
I was about to type this.. Lmao 😂 😂 😂
The music is incredible.
They're even developing racing lines. Nice work.
1969: There will be flying cars in the future
2019:
lmao... Maybe they lost the tech like they did for the project to the moon... #lies
I have another for 2050:
Quantum computer will shatter out security model.
2050:
*1 week later*
Skynet: ALL YOUR BASE ARE BELONG TO US !
Not funny
@@chillappreciator885 You are on the way to destruction, you have no chance to survive make your time
I hope gen 2 Skynet will have better grammar 🤣
Noietz PK 🤣that is funny
*1 week ago*
Naked man: I need your clothes, your boots and your motorcycle
The Force is with YOU 🙌🙌
Well done John! Next challenge will be hitting apexes, late braking and situational awareness to minimize lap times!
Looks like a bunch of BMW drivers.
@CF - 12ZZ 571370 Mayfield SS (2452) Indeed they are not using blinkers and overtake on the right.
Audi...
some things are just international, i guess ^^
Jealous!
@@randyfleet9968 Have a Tesla and a Mercedes, can´t be jeaulous of crap
Seems more like some sort of "manual" evolutionary algorithm than a neural network, there is no obvious place where backpropagation or any learning is done.
@@drkmtr Agreed. My reason for commenting is that I feel the title should have included Genetic Algorithm to some extent, as it is the only certain method I can see here for training. There may well be an ANN with connected nodes used, but there is hardly any signs for it, so it's hard to see that a NN is in fact the underlying framework in this case. Without a notion of generality, meaning the algorithm performs comparatively well on a random course, it is hard to see how using a NN framework improves on a straightforward GA approach.
@@karius85 it looks like to me some guy created a program that brute forces the solution and since it doesn't get a chance to keep trying after a car hits the wall he has to manually tell it which ones made the most progress. I hate the term AI. I don't see any intelligence in any of the "AI" examples anyone ever shows. It's just a stupid buzzword to me.
I learn while i live. Can we create Cars that don't die but learn ON THE FLY?
@@MuffinMan0521 I wouldn't go as far as calling it "brute forcing", but I see your point. The results are made slightly less impressive by manual selection for training, instead of a fitness function. I agree that the term "AI" is currently used somewhat loosely, and I prefer more succinct terminology. I've seen simple linear regression being called an AI in the media, which is just ridiculous.
This feels more like a roundabout way of doing inverse reinforcement learning by hand, actually.
You are an inspiration. One day, I will code this.
Phenomenal, thanks for this!
Those dislikes are from humans..
Underated comment
Would be interesting to see you manually trying to compete against the best car from your genetic algorithm.
Hm,would that even be possible?
It would be easy win, the AI doesn't know about racing lines
Henrix98 Thats assuming the human has the reaction time and skill to gain any time with racing lines.
@@alexnuckolls8114 It's not really that hard. It's less reaction time, more simple memorizing rules. It'd hard to get an Assetto Corsa world record; but it's not too hard to be a second off of it.
Great experiment!
F1 races of the future are gonna be really fun.
Am I the only one who was taken back to biology class from the shape of the track
Great Work. A question, How did you implement that? which framework that you used. Pytorch etc, And also GUI - framework connection, data preparation
Would like to know.
This is not using deep neural networks that learn through back-propagation but instead it is using an evolving neural network. (Although this is not neat it acts in very similar way)
You dont actually need GPU nor a neural network library like pytorch or tensorflow to write code like this. (You can implement your own algorithm in python. Or just use neat algorithm since it has the same effect )
If you know how neural networks work simply create one with random weights then alter the weights of the best networks slightly and see if it gets better.
@@princeofexcess Yep. People often see neural networks as something complicated. In fact, one can program it within 20 minutes from scratch. It's really easy to implement.
@@princeofexcess It has similarities to a genetic algorithm.
@@GaryMcKinnonUFO IT IS genetic algorithm. By definition.
Hey, Great job. Thanks for sharing this video. I learnt alot.
Cool af, mad props!
I have no idea what's goin on but I respect it😎
That's cool.
Now make another AI for some tower defense fun!
This shows that most of the tasks we humans do, like playing games can all be represented in complex mathematical equations!!
I would say that this is not a very good representation for everyday tasks - how about the task of creating this? :)
So we are living in a simulation.
The fastest car out of the gate was frequently left by the wayside it appeared on first viewing. Awesome video
I dont know why CZcams recommended this for me... but THANKS CZcams, love the vid
Shouldn't it be called Genetic algorithm rather than Neural Network?
It's both. Using a genetic learning algorithm to train a neural network driving model
Where is the code for this? Has he shared it?
This is awesome!! Did u plan to opensource this???
Yeah, opensource it dude!
I made something very similar in response to this asshat not making his open source. github.com/RyanCopley/self-driving-car-game
@@erix777 Someone mention me pls once it opensourced.
this is AWESOME!!!!!!!!!!!!!!!!!!!!!
thank you for making it!
I like how on the third generation they started doing better than you expected and you had to unselect a few of them
Really cool project, congrats!
My only concern is about generalization: if you get the best performing generation and run it on a different course, will it still perform well? We have to remember that neural networks are models with very high capacity, they can easily overfit. In that case, the "brain" wouldn't really be "intelligent", it would just memorize what to do on each position of this specific course.
Therefore we usually never test the model (the neural network) on the same dataset (the course) used for training.
That could be an interesting next step for your project.
But again, good job!
That was my immediate conclusion - what was being evolved was a machine optimised to find a path around that *specific* racetrack.
That's only a minor criticism though; even an overfit would give a starting 'stock' that had some 'wall avoidance', 'brake/accelerate' and 'turn' behaviours - which could them be used in increasingly-difficult tracks.
Building a general-purpose self-steering mechanism from that stock would be much quicker than starting from scratch.
No, this one will perform well (enough) on most other tracks. As you can judge yourself, inputs are not track specific at all. Worst case will be probably very narrow tracks. Also as you can expect, it will fail on tracks with self intersection. But it will perform well on tracks of the same class.
The car is getting around the track in generation 4, that's 3 mutations - I really doubt it could overfit.
It's really evolving the network to deal with corners, not tracks, so overfitting is unlikely as there is quite a variety of corners on this particular track.
@@thestopper5165 "what was being evolved was a machine optimised to find a path around that specific racetrack." => completely false. What was being evolved is a machine capable of not hitting a wall given 5 inputs representing its distance to said walls. It's completely de-correlated from the track itself.
A recursive NN could be optimized for that specific track. Most likely, this one is a very simple NN with 5 inputs, 2-3 layers, and 2 outputs.
I see now, how you created your driving technique, Takahashi Ryosuke.
You are the GOD to those cars
I clicked this thinking it was a code bullet vid but your video was good man nice job
That's a Genetic Algorithm. The idea behind Neural Networks is to use stochastic gradient descend to adjust the parameters.
Yes, i would think that something like reinforcement learning would be used here. I wonder if he randomly changed the parameters prior to the "generation", and then did this shit. Kinda a interesting approach, but i dont think its as efficient as reinforcement learning
This is simply untrue. If it has neurons and weights, it is a neural network. You're confusing training and neural networks here.
since you didn’t change the environment every iteration, it possibly didn’t learn to drive and it might have just memorised the current environment. Still, this is very impressive though!
While it may be better suited to this particular track, I doubt it's the case that it's solely suited to and 'memorised' this track because a) it has no memory per se, it drives as though it has never seen the track before and bases how it should drive purely on the information that it has at that particular moment. Additionally, you can see that multiple times a new generation would automatically succeed in manoeuvring multiple new corners that it had never encountered before, suggesting it would be able to do the same where it to encounter such a corner (or any other corner for that matter) in an entirely different track.
@@shadiester I think you are right... Everytime it fails, it makes changes to some parameters in its function for the desired output.. so it basically learns what parameters would work best with the given inputs. So as long as its given 7 inputs as he/she has mentioned in the video, cars will learn to drive on any track. Thats how I see it.. i dont know if i am 100% correct because i have just the basic understanding of ML.
@Shadiester. Yes, clearly it can't be memorising. But it might be more tuned to this particular track than you are allowing for. Not so much different bends, but I wonder how it would do with a pronounced narrowing (chicane) or a very wide section (perhaps beyond sensor range, if the sensors have a range), or distinctly polygonal corners, both convex and concave. Because it is using a very small number of nodes and consolidating 5 or so sensors - I can see situations where this brain could be fooled into going backwards if the track perimeter was wrong for it.
@Shadiester @Flutter with Butter @thisnicklldo do you even read? The guy wrote it. The ai has no concept of what will happen if they hit the wall it just takes distances to each wall and randomly outputs numbers that controll speed and direction, while he has to manualy pick the best ai from each iteration. This thing can in theory manouver on any track, but it will freak the fuck out since:
- it doesn't know that it needs to avoide walls
- it outputs random stuff based on input
You wanna see an AI that will understand how to manouver any track? Here:
czcams.com/video/r428O_CMcpI/video.html
@Andy agree with you, in order to see if it really learns he should test a trained "AI" in a new track.
this dude just coded evolution
This is how I started my own learning in this field 10 years ago, I've been a sucker for genetic algorithms since, but with the advent of physical cores on graphics card designed for matrix calculations i'm using back propegation more and more
Very impressive, maybe improve by having them try to learn a correct racing line. Will make them faster. eg, taking the corners to correctly hit the apex and minimize the amount of turning and loss of speed.
Nice video
Could you please explain how you store the genome of each car?
I believe this the best video on how to explain to everyone about how AI works... thanks for the video
I LOVE this!! This makes me want to go get a degree in computer science, with AI as a focus...