Saturday, July 27, 2024
HomeAIMahjong AI – From mechanics and free games to AI strengths!

Mahjong AI – From mechanics and free games to AI strengths!

AI

 While playing mahjong AI games, many of you may have studied the tiles you hit to find out how you can win more.

AI is now used in shogi and go, and how is AI used in mahjong?

In this article, we introduce the mechanism of AI used in mahjong and AI that can analyze tile scores. If you want to become stronger in the game or want to create a strong mahjong AI, please refer to this article.

Table of Contents 

  • What is Mahjong AI?
    • How mahjong AI works
    • Strength of Mahjong AI
  • Why AI Can’t Beat Human Professionals in Mahjong
    • Incomplete information
    • Complexity of movement
    • Importance of luck
  • How to make Mahjong AI
  • 3 Free AI Mahjong Games
    • ①Tenpo
    • ② Mahjong
    • ③ Sparrow soul
  • AI that can play mahjong – can analyze tiles
    • Suphx (Super Phoenix)
    • NAGA
  • In conclusion

What is Mahjong AI?

First, I will introduce Mahjong AI. Mahjong AI, as its name suggests, is an AI that can play mahjong, and it is also introduced in online mahjong games.

Here we will discuss the following two.

  • How mahjong AI works
  • Strength of Mahjong AI

How mahjong AI works

First, I will explain how mahjong AI works.

Mahjong AI uses CNN (convolutional neural network), and this CNN is also divided into several layers.

It looks complicated, but basically it is based on a CNN model that outputs information that can perfectly reproduce the current position, such as your own tile data, your opponent’s tile data, points, and the number of invisible tiles. I’m here.

Based on this mechanism, there is a discarded tile model that outputs which tiles to discard, a secondary model that determines which other player’s discarded tiles are acquired, and also a standing model and a kong model.

Strength of Mahjong AI

Next, I will introduce how strong the Mahjong AI is.

Yoshimasa Tsuruoka, an associate professor at the University of Tokyo who developed the computer shogi Gekisashi'', commented on the mahjong AI,Currently, it is said that it cannot win at the top level, but it is much stronger than ordinary people. AI will be stronger than top professionals.”

In addition, “Microsoft Suphx (Super Phoenix)” developed by Microsoft played the Japanese mahjong service “Tenpo” and reached “10th Dan”, one of the top player ranks, for the first time.

From this, it can be said that AI is rapidly becoming stronger in mahjong. In a few years, it may be strong enough to beat human professionals, just like ” AlphaGo “.

Why AI Can’t Beat Human Professionals in Mahjong

Mahjong AI is getting stronger, but it still can’t beat human pros. There is a reason for this.

  • incomplete information
  • complexity of movement
  • importance of luck

These are the three. I will explain in detail.

incomplete information

One is incomplete information.

Mahjong is an “incomplete information game” in which a lot of information is hidden. Each player has 13 tiles in hand and 84 tiles in hand, but the only information they can grasp is their own hand tiles and discarded tiles, and information on other players’ tiles in hand and tiles that have not yet been picked. . This means that there are more than 120 tiles of unknown information.

AI simulates from information and advances the game by choosing a move with a high probability of being advantageous. Therefore, it can be said that it is very difficult to beat humans in mahjong, which has a lot of unclear information like this.

Complexity of movement

The second is that the movement is complicated.

Mahjong is basically played by four people. Therefore, it is necessary to simulate it in a different way than Go or Shogi, which is played by two people.

When playing with two players, the AI ​​decided the next move on the assumption that the opponent would make the best move. However, in mahjong fighting with four players, the optimal move changes for each player, so it is much more difficult to simulate what kind of move the opponent will make and how it will develop.

In addition, mahjong is more complicated than other games in terms of how to determine roles and points, and the number of tiles is large, so it can be said that simulation is difficult.

Importance of luck

The third is that it is easily influenced by luck.

In mahjong, you can’t see what tiles your opponent has, so you need to read the uncertainties, that is, how to increase your winning rate against your opponent’s tiles.

However, due to the high degree of randomness, it is not possible to eliminate the element of luck in the outcome of the game of guessing tiles that cannot be seen, such as the opponent’s tiles or the tiles in the pile.

How to make Mahjong AI

There are the following four processes to create Mahjong AI.

  1. Incorporate a conditional expression for discarding tiles
  2. Create a merit function
  3. do a simulation
  4. Machine learning from tile scores

Create a model that determines the discarded tiles and a model that guesses the hand from the winning system with CNN, simulates them to create an AI, learns by reading the tile score, and strengthens the strength.

Detailed code is introduced at the following site.

Mahjong AI creation step 1 I wrote a code that can play mahjong alone in Python. – Qiita

3 Free AI Mahjong Games

I will introduce three games that you can play mahjong for free.

  1. Tenpo
  2. Mahjong
  3. Sparrow soul

I will explain each.

①Tenpo

The total number of registered IDs is 6,389,545, and you can play mahjong for free. In addition, it is compatible with Win, Mac, iPhone, iPad, and Android, so anyone can easily start.

② Mahjong

It is a mahjong game for one player that can be played for free. There is no need to download or prepare the environment because it ends with the operation of the browser. It works fine on both PC and smartphone. It’s a one-on-one battle, not an opponent, so you can enjoy it while thinking carefully.

③ Sparrow soul

The cumulative number of members is over 5 million, and you can play against active professional mahjong players. In addition, you can play with a character as your partner, and the CV of this character is handled by a popular voice actor such as Maaya Uchida, so you can enjoy playing mahjong.

AI that can play mahjong – can analyze tiles

There is also an AI that can actually play mahjong. These AIs are able to play mahjong by themselves by analyzing and learning the tiles.

Here we introduce two Mahjong AI.

  1. Suphx (Super Phoenix)
  2. NAGA

I will explain each.

Suphx (Super Phoenix)

Suphx is a mahjong AI developed by Microsoft Research Asia (MSRA), a research and development institute of Microsoft.

Suphx also maintains an average stable rank of 8.7 or higher in over 5000 games. Since the average rank of the top player of “Tokujo table” who played about 10,000 games in Tenpo is 7.4 for him, Suphx’s score is on average higher than that of top human players. outperformed by 1.3 points, a very good performance.

In order to efficiently learn the complex states and strategies of mahjong, a new algorithm was developed to efficiently express the state and acquire strong strategic learning ability and global situation assessment. It was realized by

Mahjong is considered an imperfect information game, and decisions must be made from limited information. Among them, the fact that Suphx was able to acquire the same judgment ability as the top players can be said to be an important first step toward evolution in the history of AI.

NAGA

NAGA is an AI that creates an analysis report on the tile scores of the Tenpo Dan game, the private room game, and the tournament game. In addition, it is a paid service for channel subscribers, and it is divided into gold, platinum, and diamond, each with different monthly fees and functions.

In addition, since NAGA inputs table information almost as it is, the basis for each selection can be visualized. We visualize the features that make that choice by computing the gradient that amplifies our choice. Conversely, we can also visualize features that would discourage their selection by computing a gradient that attenuates their selection.

In conclusion

In this article, we have introduced the mechanism and strength of Mahjong AI, as well as Mahjong games that utilize AI and tile analysis AI.

RELATED ARTICLES

What is an AI algorithm?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Recent Posts

Most Popular

Recent Comments