## 3 The Proposed Model
### Feature Extraction  
For automated weed detection, the DenseNet-121 model produces feature vectors. A CNN accomplishes higher performance in the domain of image classification [19]. However, training a CNN from scratch is not easier because classifier accuracy based on hyperparameter tuning, namely learning rate, initial weight, number of epochs, optimizers, and dropout, needs a wide-ranging amount of labeled training datasets and higher computation power. This problem can be leveraged by means of the TL method. In the TL model, the training time can be decreased by the weight attained from the pretrained mechanism that is applied as an initial weight for training the novel problem. This process of reusing the pretrained weight leads to lower generalization errors. The DenseNet framework is popular since the DenseNet module motivates feature reuse, attenuates the gradient vanishing problems, decreases the parameter count, and enhances feature propagation. In DCNN, all the layers are interconnected to other layers as a feed forward pattern. Every layer in DenseNet accepts the feature map of each previous layer as other inputs and passes on its own feature map to every succeeding layer. Therefore, the \(n\)-th layer has \(n\) inputs of each previous layer. In general, a CNN changes the size of feature maps via the down-sampling of layers. However, DenseNet facilitates feature concatenation and down-sampling by separating the network into multiple densely connected dense blocks. The feature map size in the block is unchanged. Inside the dense block, the size of the feature maps is similar which assists in performing concatenation while outside the dense block, while pooling and convolution operations were performed to down-sample. At the end of every dense layer, a transition block or layer was added. The transition layer comprises a batch normalization layer, a \(1\times 1\) convolutional, and \(2\times 2\) average pooling layers. The transition layer changes the size of the feature map. Therefore, the DenseNet comprises 1 classification, 117 Conv, and 3 transitions, making the size of the layer 121 [19]. Here, the MBMO algorithm as a hyperparameter optimizer is applied. Barnacles are certain kinds of arthropods which constitute an infraclass Cirripedia based on crabs and lobsters [20]. A barnacle is a marine animal that lives in shallow and tidal waters. They can be found all around the seawater and are raised on hard surfaces in seawater. After they hatch eggs, barnacle larvae were disseminated in the water to find and stick to hard surfaces. Indeed, hard surfaces cover the bodies of barnacles and enhance shell plates. They must seek a balance between managing ever-longer penises and accomplishing more mates in a turbulent flow. A novel optimization technique, named the barnacles mating optimizer (BMO) technique, based on these behaviors has been introduced. The balance behavior can be devised depending upon the Hardy-Weinberg equilibrium as follows:  
The initial population of barnacles for the solution can be determined by:  
\[X= \begin{cases}\chi_{1}^{1}&\chi_{1}^{N}\\ \vdots&\vdots\\ \chi_{n}^{1}&\chi_{n}^{N}\end{cases}  \tag{2}\]where \(n\) defines candidate number, and \(N\) denotes count of decision parameters according to lower and higher bounds:  
\[l_{b}=\left[l_{b}^{1},\ \ldots,\ l_{b}^{i}\right] \tag{3}\]  
\[u_{b}=\left[u_{b}^{1},\ \ldots,\ u_{b}^{i}\right] \tag{4}\]  
From the expression, \(u_{b}\) and \(l_{b}\) indicate the upper and lower bounds of variable \(i\). By assessing the objective function for each candidate, better outcomes to worst outcomes are stored and arranged at the initial iteration. The presented method involves exploration and exploitation. The offspring generation can be performed by the sperm cast method as an exploration term:  
\[b_{D}=rand(n) \tag{5}\]  
\[b_{M}=rand(n) \tag{6}\]  
where \(b_{D}\) and \(b_{M}\) denote the mated parents.