The present work presents the results of research elaborated to recognize two classes of leaves of weed present in the coffee crops through machine learning techniques, a topic few have explored in the coffee agroindustry, and that can significantly impact the management of herbicides in this important crop. The study involved twenty-four experiments, utilizing a database of 210 images, 70 for each weed class and 70 for coffee leaf samples. All images were processed and transformed into HSV color format. From each image, 33 texture patterns were extracted and reduced to four through principal component analysis. The fractal dimension was added as a fifth pattern. The recognition used three machine learning techniques: support vector machine (SVM), k-near neighbors (KNN), and artificial neuronal networks. The machine learning techniques permitted classification with precision and recall upper or equal to 95%, on average, when the fractal dimension was not used and upper or equal to 97% on average when the fractal dimension was used. SVM and ANN were methods with better outcomes. These experiments constitute a first step towards implementing an automatic system for selective weed eradication in a coffee crop, with promising implications for future developments.