## 1 Introduction  
Agriculture is confronting enormous difficulties, which include threats from diseases, weeds, and pests, varying climate, severe scarcity of water resources and arable lands, etc. [1]. Many efforts were exerted to weed control over the years by farmers and researchers to solve the difficulties brought by weeds [2]. Weeds appear everywhere arbitrarily in the domain and compete with crops for sunlight, water, and nutrients, which causes harmful effects on crop quality and yields if not controlled properly. Many studies have illustrated a strong correlation between weed competition and crop yield loss [3]. There are different weed varieties that are detrimental to crop productivity and should be identified in the initial stage of growth. The weed's growth in the crop would affect fundamental resources such as minerals, sunlight, water, fresh air, soil, etc., which are the fundamental necessitiesof the crop [4]. It has been found that 35% of crops are ruined because of the growth of various weeds in the agricultural field. This study aimed to learn various techniques and tools employed by the researchers to classify and detect weeds, which are essential for assessing the growth of weeds [5]. Numerous computer-related approaches, such as wireless sensor networks (WSN), artificial intelligence (AI), and some other approaches, are used that enhance agriculture.  
Weed detection in plants is now becoming a great challenge since there is not much effort put into weed detection. Techniques to realize field weed identification through computer vision (CV) technology primarily use conventional deep learning (DL) and image processing [6]. If weed identification has been carried out by conventional image-processing technology, then feature extraction, such as shape, color, and texture of the image, and integration with conventional ML classifiers, such as the Support Vector Machine (SVM) or random forest (RF) algorithm, for weed detection are essential [7]. Such techniques must devise features manually and highly depend on pre-processing methods, quality of feature extraction, and image acquisition algorithms. Classical algorithms for detecting agricultural weeds had a focus on direct identification of the weed; yet, there were substantial variances in weed species [8]. With the advances in computational power and growth in data volume, DL methodologies are capable of extracting multidimensional and multiscale spatial semantic feature information of weeds by using the Convolutional Neural Network (CNN) because of its enhanced data expression abilities for images, evading demerits of conventional extracted approaches [9; 10]. Hence, CNN models have gained higher attention in the research community.  
This manuscript introduces a Modified Barnacles Mating Optimization with Deep Learning based weed detection (MBMODL-WD) technique. The presented MBMODL-WD technique initially pre-processes the input images via the Gabor filtering (GF) technique to eradicate the noise. For automated weed detection, the presented MBMODL-WD technique uses the DenseNet-121 model as feature extractor. Moreover, the MBMO algorithm is used for the hyperparameter optimization process. At last, the Elman Neural Network (ENN) method was applied for the classification of images into plants and weeds. To demonstrate the enhanced performance of the MBMODL-WD approach, a series of simulation analyses were performed.