Agriculture is an area that currently benefits from the use of new technologies and techniques, such as artificial intelligence, to improve production in crop fields. Zacatecas is one of the states producing the most onions in the northeast region of Mexico. Identifying and determining vegetation, soil, and humidity zones could help solve problems such as irrigation demands or excesses, identify spaces with different levels of soil homogeneity, and estimate the yield or health of the crop. This study examines the application of artificial intelligence through the use of deep learning, specifically convolutional neural networks, to identify the patterns that can be found in a crop field, in this case, vegetation, soil, and humidity zones. To extract the mentioned patterns, the K-nearest neighbor algorithm was used to pre-process images taken using unmanned aerial vehicles and form a dataset composed of 3672 images of vegetation, soil, and humidity (1224 for each class). A total of six convolutional neural network models were used to identify and classify the patterns, namely Alexnet, DenseNet, VGG16, SqueezeNet, MobileNetV2, and Res-Net18. Each model was evaluated with the following validation metrics: accuracy, F1-score, precision, and recall. The results showed a variation in performance between 90% and almost 100%. Alexnet obtained the highest metrics with an accuracy of 99.92%, while MobileNetV2 had the lowest accuracy of 90.85%. Other models, such as DenseNet, VGG16, SqueezeNet, and ResNet18, showed an accuracy of between 92.02% and 98.78%. Furthermore, our study highlights the importance of adopting artificial intelligence in agriculture, particularly in the management of onion fields in Zacatecas, Mexico. The findings can help farmers and agronomists make more informed and efficient decisions, which can lead to greater production and sustainability in local agriculture.