Smart agriculture has shifted the paradigm by integrating advanced technologies, particularly weed management. This paper introduces an innovative approach to weed control by applying a Wavelet-based Convolution Neural Network (WCNN). In the era of precision agriculture, our study explores the integration of WCNN into real-world scenarios, emphasizing its adaptability to diverse environmental conditions. Utilizing the spatial-frequency analysis features of wavelets and convolutional neural networks, the WCNN model is the most effective at finding weeds, classifying them, and managing them specifically in agricultural fields in real-time. This research contributes to the scientific discourse on smart agriculture and addresses the challenges of invasive weeds, presenting a sustainable solution for optimizing resource utilization. Our investigation includes a detailed exploration of WCNN’s adaptive learning mechanisms and dynamic adjustment to changing agricultural landscapes. The model seamlessly integrates with existing smart farming infrastructure, showcasing a substantial reduction in manual intervention and a simultaneous increase in agricultural productivity. We incorporate fog computing and resource optimization into our framework, enhancing the efficiency of onboard data processing. To evaluate the real-world efficacy of WCNN, we conducted comprehensive experiments in texture classification and image labelling using two distinct datasets: the plant seedling and soybean weed datasets. Results demonstrate the superior performance of WCNN, achieving higher accuracy in training and test scenarios with significantly fewer parameters than traditional CNNs. For the soybean weed dataset, WCNN achieved remarkable accuracy in the training (0.9970) and testing (0.9987) phases, with correspondingly low losses of 0.0109 and 0.0048. The WCNN model demonstrated high accuracy during training (0.9739) and testing (0.9902), with minimal losses of 0.0898 and 0.0239 in the plant seedling dataset.