Advancements in the agricultural sector are essential because the need for food is rising as the population of the world is expanding day by day. Traditional agricultural practices are not able to fulfill these needs. Furthermore, these practices are manual and are not optimized resulting in the wastage of resources, which is not suitable for resource-constrained agricultural environments. Besides this, the Internet of Things (IoT) network is playing an important role in the modern farming system. In this paper, we introduce an innovative IoT-enabled hybrid model for smart agriculture, integrating Machine Learning (ML) and Artificial Intelligence (AI) algorithms to provide a cost-effective and reliable decision-making system. Furthermore, we introduce a robust anomaly detection mechanism while applying the capabilities of Multilayer Perceptron (MLP), Naïve Bayes, and Support Vector Machine (SVM) on the dry beans' dataset. Hybrid models, combining neural networks with Random Forest and SVM, were also explored for anomaly detection in the dataset. Furthermore, deep learning models known as MobileNetV2, VGG16, and InceptionV3 are used for the classification of soil type datasets. The hybrid deep learning models were also developed, incorporating InceptionV3 with Long Short-Term Memory (LSTM) and VGG16 with fully connected dense layers. Two types of data sets are used in this study, which are the dry beans dataset (2021) and soil type Dataset (2024). Both datasets contain images. The ML techniques are applied to these datasets for anomaly detection. The simulations results show that the classification performance of the MobileNetV2 model, it has an accuracy and recall of 0.97. It shows that the model can correctly identify the soil type around 97%. On the other hand, the hybrid model combining random forest and neural network achieved an accuracy of 92%, further validating the effectiveness of our approach. Furthermore, the SVM model achieves an impressive overall accuracy of 0.93. Additionally, this accuracy is further enhanced with the integration of SVM and neural networks. Similarly, the hybrid model combining inception V3 with the LSTM layer exhibits a notable accuracy of 0.91, highlighting its efficiency in accurately classifying various instances. Lastly, the hybrid model employing random forest and neural network architecture achieves a commendable accuracy of 92%.