# Fast Self-Adaptive Digital Camouflage Design Method Based on Deep Learning
## 3 Methodology
### Military Target Detection Based on YOLOv3  
To achieve camouflage of the target, we first needed to identify the target that needs camouflage. The YOLOv3 [38] algorithm was used to identify military targets. The Yolo series algorithm is an algorithm that could detect objects quickly [38; 42; 43]. The YOLOv3 is the latest version [38]. YOLOv3 can achieve high precision real-time detection, which is very suitable for our application background. Its network structure is shown in Figure 4. The resolution of the input picture in the network structure diagram is \(416\times 416\times 3\) (in fact, it can be any resolution. ), and has four labeled classes. It uses darknet-53, which removes the full connection layer, as the backbone network. The YOLOv3 is a fully convoluted network that makes extensive use of residual network structures. As shown in Figure 4, YOLOv3 consists of DBL, resin, Up-sample, and concat. DBL stands for convolution (conv), batch normalization (BN) and leaky relu activation (Leaky relu). Resn represents the \(n\) residual units (res unit) in this residual block (res_block). Zero padding means using zero to fill the edge of the image. Up-sampling represents up-sampling. The concat represents the merging tensor. DBL\"n represents the \(n\) DBL. The add represents the addition operation. The following y1, y2, and y3 represent feature maps with three different dimensions. The network structure of darknet-53 is shown in Table 2. It uses successive \(3\times 3\) and \(1\times 1\) convolutional layers and some shortcut connections. The application of the shortcut connection layer allows the network to be deeper. It has 53 convolutional layers [38]. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Category** & **Training Set** & **Test Set** \\ \hline Airships & 459 & 50 \\ Aircraft Carriers & 455 & 50 \\ Tanks & 496 & 55 \\ Uniformed Soldiers & 560 & 62 \\ Total & 1970 & 217 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Details of the training and test set. Figure 3: Data samples from the Places2 dataset. (**a**) forest; (**b**) desert; (**c**) grassland; (**d**) snowfield. The loss function of YOLOv3 consists of localization loss _Lossl_, confidence loss _Lossc_, and classification loss _Lossp_. The loss function is as follows:  
\[Loss=Loss_{l}+Loss_{c}+Loss_{p} \tag{1}\]  
\[Loss_{l}= \begin{array}{ll}\lambda_{coord}\sum\limits_{i=0}^{S^{2}}\sum \limits_{j=0}^{B}t_{ij}^{obj}\left[\left(x_{i}^{j}-\hat{x}_{i}^{j}\right)^{2}+ \left(y_{i}^{j}-\hat{y}_{i}^{j}\right)^{2}\right]\\ +\lambda_{coord}\sum\limits_{i=0}^{S^{2}}\sum\limits_{j=0}^{B}t_{ij}^{obj} \left(\left(\sqrt{w_{i}^{j}}-\sqrt{\hat{w}_{i}^{j}}\right)^{2}+\left(\sqrt{h_{ i}^{j}}-\sqrt{\hat{h}_{i}^{j}}\right)^{2}\right)\end{array}  \tag{2}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Type** & **Filters** & **Size/Stride** & **Output** \\ \hline \multirow{8}{*}{1\(\times\)} & Convolutional & 32 & \(3\times 3\) & \(416\times 416\) \\  & Convolutional & 64 & \(3\times 3/2\) & \(208\times 208\) \\  & Convolutional & 32 & \(1\times 1\) & \\  & Convolutional & 64 & \(3\times 3\) & \\  & Residual & & \(208\times 208\) \\  & Convolutional & 128 & \(3\times 3/2\) & \(104\times 104\) \\  & Convolutional & 64 & \(1\times 1\) & \\
2\(\times\) & Convolutional & 128 & \(3\times 3\) & \\  & Residual & & \(104\times 104\) \\  & Convolutional & 256 & \(3\times 3/2\) & \(52\times 52\) \\  & Convolutional & 128 & \(1\times 1\) & \\
8\(\times\) & Convolutional & 256 & \(3\times 3\) & \\  & Residual & & \(52\times 52\) & \\  & Convolutional & 512 & \(3\times 3/2\) & \(26\times 26\) \\  & Convolutional & 256 & \(1\times 1\) & \\
8\(\times\) & Convolutional & 512 & \(3\times 3\) & \\  & Residual & & \(26\times 26\) & \\  & Convolutional & 1024 & \(3\times 3/2\) & \(13\times 13\) \\  & Convolutional & 512 & \(1\times 1\) & \\
4\(\times\) & Convolutional & 1024 & \(3\times 3\) & \\  & Residual & & \(13\times 13\) & \\  & Avgpool & Global & & \\  & Connected & 1000 & & \\  & Softmax & & & \\ \hline \hline \end{tabular}
\end{table}