Mahjong is a captivating game that enjoys popularity in China, Japan, and various other Asian nations. The rapid progress of artificial intelligence technology has spurred significant research attention towards achieving automated mahjong matches. Central to this effort, the precision of mahjong card recognition plays a pivotal role in determining the effectiveness of subsequent tasks.The traditional image recognition method mainly relies on the similarity measurement between the target and the template, whose accuracy and stability cannot meet the needs of the application due to changes in external factors such as the angle and lighting of the mahjong image acquisition in the actual game. In this article, a mahjong intelligent recognition method based on YOLOv5 is proposed. Specifically, this article applies image recognition technology to the AI training of national standard mahjong, and quantitatively analyzes the impact of mahjong image quality (such as shooting angle, mahjong size) on model prediction results. The results show that the proposed method based on YOLOv5 can achieve robust recognition of mahjong, which can bring some new insights to the field AI games.