Deep Learning

Reinforcement Learning: A Promising AI?

Partager l’article :

This article explores Reinforcement Learning (RL) and its applications, including games (AlphaGo,AlphaStar), autonomous vehicles, and robotics. We present an RL implementation demonstrator from the Aqsone Lab, highlighting learning through trial and error,virtual simulation, and an example of a virtual moon landing, underscoring the challenges and ambitions across various sectors.

Of all the topics in Artificial Intelligence, Reinforcement Learning (RL) is arguably the most promising due to its capabilities across diverse applications, yet it is also the most difficult to implement.

These are the methods that enabled DeepMind’s AlphaGo to defeat the world’s best Go players—a board game with simple rules but an astronomical number of possible move combinations. AlphaGo has since evolved into AlphaStar, which has become nearly unbeatable at the world-renowned game StarCraft II.

‍

‍

We also see this type of method used in autonomous vehicles and industrial robotics. In this article, we will look at how to implement an RL algorithm, its strengths and weaknesses, through a demonstrator created at the Aqsone Lab.

Learning through trial and error… and success!

‍

Training an autonomous vehicle AI without virtual simulation would require losing millions of cars !

‍

This form of machine learning, known as Reinforcement Learning, involves placing an autonomous agent in an environment with a specific goal about which it has no prior information. Through a system of penalties and rewards predefined by the developer, the agent learns to act in the best way possible to achieve this goal with an optimal score. The value of having a simulated environment for the initial training phases is immediately clear. Not only does it prevent excessive hardware damage, but it also allows for parallelizing scenarios to accelerate the learning process.

In the real world, every living being naturally engages in this type of learning: the environment is predefined, and every action taken provides constant feedback that allows the living being to adapt accordingly.

The key to Reinforcement Learning lies in the relevance of the environment simulation, as well as the relevance of the reward and punishment policy.

Let's take the example above of an ant (our agent). It is in an environment with various obstacles (such as a spider) and various opportunities (such as food). These elements are defined in the ant's policy with negative and positive scores. The goal is to reach a final position where the score is maximized (the house).

The agent has the ability (actions) to move in any direction, and its state is defined by its position at time t. Note that the environment can change (the spider moves).

The agent explores different paths, learns from each path taken, and eventually manages to find an optimal route (passing by the leaf, the bread, and the house).

This illustration is very simple, but there are more complex models that allow for the simulation of real-world cases.

The best policy in the best of environments

However, in a real-world application, there are millions of ways to define policies and environments. This is where domain expertise comes into play to properly define the limits, the objectives, and how to achieve them (i.e., the processes or the policy) in order to then correctly model them in a virtual environment.

The other advantage of a virtual environment is that its realism can be improved iteratively by integrating increasingly complex processes, which will allow the agent to become more and more effective in the real world. Fortunately, there are many environment modeling solutions available, whether for robotics applications or for optimizing processes involving physical machines, for example. One notable example is the OpenModelica simulator.

The ultimate goal is ambitious: to achieve results that exceed human capabilities!

An example: The Aqsone lunar lander

Among the most common use cases are Atari-style games, which have a fairly basic environment (few possible actions and a static environment). We decided to work on the OpenAI Gym lunar lander game, which is more complex than Atari games.

The goal is to land a lunar module between two flags, like Apollo on the Moon. The module is piloted using arrow keys to control the thrusters (left, right, and down). The landing must be smooth, otherwise the module will crash.

Here are all the parameters of our model:

  • Agent: Lunar lander equipped with 3 thrusters (down, left, and right) as well as 2 landing legs with shock absorbers.
  • Environment: Lunar surface, with modeled gravity.
  • Possible actions: Activation of each thruster.
  • Policy:
    • If the lander touches down between the flags, it gains points.
    • If it leaves the zone, it loses points.
    • If it lands outside the flags or breaks its legs, it loses points.

To raise the stakes and demonstrate the superhuman capabilities of a reinforcement learning algorithm, we decided to modify the design of the OpenAI Gym lunar lander to take the shape of the word "Aqsone." As a result, the center of gravity is no longer aligned with the central thruster, which requires a more subtle use of all thrusters compared to the standard lander.

Algorithm selection and environment parameters

For this project, we used an actor-critic reinforcement learning method, which has the advantage of requiring very little computing power.

The actor-critic method pits an actor network, which represents the agent, against a critic network. This critic network determines the value associated with a given situation. For example, a situation where the lander is upside down will have a very low associated value because it will almost certainly lead to a crash in the short term.

In addition to calculating the total score at the end of the game (policy-based method), the actor-critic method also evaluates an intermediate score for every situation (value-based method). The actor can then know whether it is in a "good" or "bad" situation at any given moment.

For more technical details on this method, you can check out this article on Towards Data Science: https://towardsdatascience.com/understanding-actor-critic-methods-931b97b6df3f

After a few trials, we realized that the new lander design had significantly increased its mass, which forced us to increase the power of the thrusters.

Once the network size was adjusted and the policy precisely defined, the learning process could begin.

The Process

Let's go!

The lander starts by making many mistakes but gradually learns the consequences of each of its actions. The algorithm progressively records the sequences of actions that worked best—that is, those that earned it the most points.

After several thousand iterations, the final result is impressive: the reinforcement learning model rapidly alternates actions between the different thrusters (see video) at a speed unattainable by a human, resulting in a near-perfect landing.

We tried to land the module manually to compare our performance to the machine's. The results? We never managed to land our new module correctly between the flags. This proves the effectiveness of reinforcement learning algorithms.

We can only acknowledge the extraordinary capabilities of reinforcement learning algorithms. However, we must not forget the importance of the relevance of the environment simulation and the policy implemented before deploying the model in a real-world environment.
The range of use cases for reinforcement learning is very broad, spanning from robotics (physical world) to the optimization of marketing methods (virtual world). We encourage you to contact us to discuss your challenges and determine together if reinforcement learning is the most appropriate technology to address them.

Un accompagnement de A à Z par nos experts dans le but d’une intégration de solutions IA sur-mesure.

Lorem ipsum dolor sit amet consectetur. Ipsum penatibus viverra feugiat amet varius pharetra porta risus lectus. Turpis enim massa non tincidunt in faucibus.

Découvrez plus d’articles

No items found.
Bird with red, yellow, and black feathers in flight, wings spread, against a blurred background of greenery.

Can you chat with your company database just like you do with ChatGPT?

Lire l’article
No items found.

TPOT vs. Auto-sklearn: Comparing Two AutoML Libraries

Lire l’article
Deep Learning

Strengthening convolutional neural networks (CNNs) using capsules

Lire l’article