laitimes

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Reporting by XinZhiyuan

Editor: Good sleepy Yuan Xie

【New Zhiyuan Guide】With a CNN network alone, you can actually run autopilot in the classic racing game of almost 20 years ago! However, why don't you, the AI, hide from obstacles?

Recently, a Reddit netizen built a CNN model himself and let the AI drive in the classic game "Need for Speed 9: Highest Wanted" from 2005.

With more than 1,700 likes, it is the highest post in the machine learning sub-section.

As for the effect...

On the wide road, the AI drives quite smoothly, but from time to time it will "draw snakes"...

Fortunately, the speed control is OK, and it will not easily attract the attention of the "police".

Although it is part of the game mechanics, in order to get rid of these chasing police cars, the player manually operates almost every time to make people feel haggard and their fingers sore.

Especially as the level of pursuit increases, it will no longer be the old patrol cars, but heavy SUVs and even helicopters, and the difficulty of escape will skyrocket.

Probably because of the training data, when the AI encounters obstacles on the road, it behaves exactly like a human player:

The word "hide" does not exist in the ai dictionary.

Tapping the direction, fine-tuning the route, aiming directly into it is king!

From street signs to triangle cones, none of them can be spared.

The project is simple, that is, the data is not enough

"Deep For Speed" is based on Python 3.9 and Pytorch 1.10, and only needs to install numpy and matplotlib libraries.

The authors say the idea for this project came from the NVIDIA project.

In the paper, Nvidia built a self-driving car using only a single convolutional neural network, rather than a large pile of dazzling algorithms.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Infrastructure

The authors say that the workflow of their projects is very simple.

The program will first record the visual pavement in the game's speed dashboard, minimap and visual field and store it as a numpy array, and then call the np.load() function to process it!

The play.py and play_util.py functions in the model are essentially keyboard input simulators that simulate the results of AI's automatic driving into physical keyboard input and control the game.

However, it may be that the project as a reference is older, and the game can only be set to a window with a resolution of 800x600 in the upper left corner of the screen.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Create and work with data

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Use models

According to the project authors, it took two weeks to make a prototype of a model that could be run, and it took another two weeks to modify the model to be available to other users. In total, the time invested in the project is about 1 month.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Among them, the collection of training datasets can be said to be the most difficult part.

The authors said that the data collected during the 20 hours of their own game was only available in the end because of the frequency and amplitude of the model changes.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Part of the project's open source is also due to the need to augment the training dataset: you want to expand the packet, but you can't do it yourself.

However, if you can let everyone play together, maybe some friends will make a larger training dataset, train their own model, and then share it with him

As a result, the author also imitated the name of the original game "Most Wanted" to give the project a nickname - "DeepForSpeed: Data Wanted".

As a ultimate goal, the project authors also wanted to make their CNN projects a common platform/interface that could experiment with multiple architectures.

Allow players to experiment with other neural networks they make while experiencing the simulator's entertainment.

Need for Speed: The most wanted

Need For Speed: Most Wanted is the ninth game in the Need for Speed series racing game from the gaming industry's leading manufacturer Electronic Arts (EA), and was released in the United States on November 15, 2005.

At that time, at the beginning, he had to lose his beloved "Baoju" BMW M3 GTR according to the needs of the plot, which really made the editor feel uncomfortable for a long time.

Especially after that, we must start from the most basic car, which can be called a textbook "motorcycle into a bicycle"...

The game combines features such as sandbox open world, police run and chase mode, bullet time visuals, and player modified vehicles.

These features were at the forefront of the times when almost all major game manufacturers were still engaged in participatory film game projects.

In addition to the Launch of windows versions, the game has also launched corresponding versions for GameCube, GBA, NDS, PlayStation 2, PSP, Xbox, Xbox 360 and other game console platforms.

At the end of 2009, the game's all-platform sales reached 16 million units, which was the best-selling work in the entire Need for Speed series, and it was also the highest sales of single racing game works in the world at that time.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

The female lead actress of the game is this super hot aunt Joseie Maran, who briefly switched from the supermodel industry to an actress in the 2000s, and after not becoming popular, she changed to a cosmetics brand, and finally succeeded.

It was also widely praised among the game media websites of the year. Both Metacritic and Game Rankings give a high score of 82 out of 100.

Eurogamer called it "stunning graphics", with GameSpot giving it a score of 8.4 out of 10, and praising the game for its "sharp graphics" and "outstanding sound", but criticizing the game's AI for being too easy at first and too difficult afterwards.

Some players in China wanted to reminisce about their childhood, so they pulled it out and played it again, and the evaluation was: "The sense of speed is still first-class, and the yellowing, blurred light and shadow and particle effects cover the rudiments of many scenes, which is still relatively flattering."

However, the game now has the characteristics of average graphics quality, but the game operating system is still sharp, which is exactly in line with the requirements of individual developers of machine learning models:

Because the picture quality is average, the hardware requirements are low, and individuals can afford it; because the game is still fun, it is still valuable to train AI models to play.

Inspired by a 2016 paper

In addition, the NVIDIA paper, which is the source of the idea, is also very old, but the effect is still outstanding.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Thesis link: https://arxiv.org/abs/1604.07316

In the paper, the authors trained a convolutional neural network (CNN) that maps the raw pixels of a single front-facing camera directly to the steering instruction.

With very little human data, AI can learn to drive a car, even in places where there are no markers or unclear visual guidance.

Instead of training the AI to detect the boundaries of the road, the authors used the human turn angle as a training signal to detect useful road features, allowing the AI to learn the internal representations.

In contrast to clear decomposition of problems such as lane marking detection, path planning, and control, Nvidia's end-to-end system optimizes all processing steps simultaneously.

The authors believe that this approach results in better performance and smaller systems. Among them, internal self-optimization can maximize the performance of the overall system, rather than optimizing intermediate criteria for human selection, such as lane detection.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

During training, the image is first fed into a CNN network and then a steering command is calculated.

After that, compare this instruction to the expected instruction of the image and adjust the weight of the CNN so that the output of the CNN is closer to the desired output. Among them, the weight adjustment is done by backpropagation.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Once the training is complete, the neural network can generate the correct steering command from the video image.

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Netizen: It's similar to FSD!

"Ai driving in the game performs better than most human drivers on California roads"

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

"AI drives in the game, similar to Tesla FSD!" Great!"

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Netizen: "Big brother is doing a beautiful job, can you make a Mario Racing version?" I'm willing to pay."

Project Author: "Well, if I could record while playing Mario Kart, maybe it would work."

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

"Don't sell this to Tesla as a software upgrade."

Low-end version of AI car god? Netizens used a single CNN to race in the "Need for Speed 9"

Resources:

https://github.com/edilgin/DeepForSpeed

Read on