A subset of artificial intelligence known as "machine learning" focuses on teaching computers to learn from data, recognize patterns, and make predictions or judgments. It allows a machine to learn from data without explicit programming, in other words.
The ability of robots to carry out tasks that ordinarily require human intelligence, such as natural language processing, picture recognition, and decision-making, is referred to as artificial intelligence (AI), a more general term.
Image recognition serves as an illustration of the differences between the two. In artificial intelligence, a system learns to recognize images by recognizing certain traits and basing judgments on those features. In machine learning, a dataset of images is used to train the computer, which then learns to recognize patterns and predict outcomes in new photos using the knowledge it has gained from the dataset. Hence, while machine learning is a means of achieving artificial intelligence, not all AI systems do.