In recent years, systems of ear recognition are considered a significant topic of research in the biometrics field. In such systems, the models of machine learning represent a principal part in order to recognise humans’ identities by using their ear images. In this paper, a system of ear recognition is proposed by using random forest (RF) and histograms of oriented gradients (HOG) techniques. The HOG is used to extract features from ear images. Subsequently, these extracted features will be fed to the RF classifier to classify the ear images with respect to the classes. In this study, the ear images have been selected from the Indian Institute of Technology Delhi, second version (IITD II). The performance of the proposed system has evaluated by using different evaluation measures such as accuracy, specificity, and G-mean. The experimental results show that the proposed system for ear recognition obtains accuracy up to 99.69%. Furthermore, this system archives 99.84% and 80.78% for specificity and G-mean, respectively. The proposed system has the ability to identify persons through their ear images effectively.