Rule Based Approach: It refers to the AI modelling where the relationship or patterns in data are defined by the developer. The machine follows the rules or instructions mentioned by the developer, and performs its task accordingly.
For example: suppose you have a dataset comprising of 100 images of apples and 100 images of bananas. To train your machine, you feed this data into the machine and label each image as either apple or banana. Now if you test the machine with the image of an apple, it will compare the image with the trained data and according to the labels of trained images, it will identify the test image as an apple. This is known as Rule based approach. The rules given to the machine in this example are the labels given to the machine for each image in the training dataset.
Learning Based Approach: In this approach, the machine learns by itself. It refers to the AI modelling where the relationship or patterns in data are not defined by the developer. In this approach, random data is fed to the machine and it is left on the machine to figure out patterns and trends out of it. Generally, this approach is followed when the data is un labelled and too random for a human to make sense out of it.
For example: suppose you have a dataset of 1000 images of random stray dogs of your area. You would put this into a learning approach-based AI machine and the machine would come up with various patterns it has observed in the features of these 1000 images which you might not have even thought of!