## 2 System Model  
The system model is depicted in Figure 1, where UAV swarms are configured to form a wireless ad hoc network. The network consists of \(N\) UAVs, which are employed in target area monitoring, intermediate data transmission, and classification tasks (e.g., human detection, forest fire detection, highway accident detection). At each time step \(t\), requests are received, which are defined as units of classification tasks to be processed by UAV swarm. \(RQ^{t}\) is the total number of requests at time step \(t\). Each UAV \(i\in\{1,\dots,N\}\) operates under two significant constraints: a maximum memory usage \(m_{i}^{max}\) and a maximum computational capacity \(c_{i}^{max}\). The position of the UAV is represented by 3D coordinates \((x,y,z)\). The proposed system is operated under the following assumptions: First, UAVs can explore the entire mission area, but not all cells are of equal importance. For instance, the system can intensively monitor hot cells that are established to be of high importance (e.g., areas where fires occurred). Second, CNN layers are assigned to each UAV by the DRL model, and the requests are processed in accordance with the  
Figure 1: The proposed system model for resilient distributed CNN inference. UAV. Herein, the DRL model distributes layers to minimize end-to-end latency. The end-to-end latency is defined as the sum of transmission and computational latency. Here, transmission latency represents the time required to transmit intermediate data between UAVs or between a UAV and a ground device, and computational latency represents the time required to process data within each UAV. This end-to-end latency can be affected by several factors, including the distribution of CNN layers, the distance between UAVs, and the available computing and memory resources of each UAV. Third, the proposed system is designed to ensure mission continuity, even if certain UAVs become inoperable due to hardware failures or cyber-attacks. The DRL-RLD model leverages current state information that includes an inoperable state parameter for each UAV. When this parameter is set to be zero, it indicates that a specific UAV is no longer operational. In such scenarios, the DRL-RLD model reallocates layers based on the current state of the remaining UAVs, including available memory, computational capacity, and location. Depending on the mission of the UAV swarm, an appropriate CNN model can be selected. Each UAV in the swarm contains a copy of the trained model and performs tasks associated with the activated layers for distributed inference. The proposed distributed system is designed with the pipeline, incorporating convolutional and fully connected layers (FCN) with rectified linear unit (ReLU) activations, and is compatible with CNN architectures that do not incorporate residual blocks. The CNN model consists of \(L\) layers. For each \(j\in\{1,\dots,L\}\), \(K_{j}\) represents the size of the intermediate output generated at layer \(j\) and transmitted to the subsequent layer \(j+1\) of the CNN model. Each CNN layer has memory requirements \(m_{j}\) and computational load requirements \(c_{j}\). The memory requirements of layers \(m_{j}\) are determined by the number of weights \(W_{j}\) of the current layer \(j\) and the number of bits \(b\) dedicated to storing the weight, and it is represented as \(m_{j}=W_{j}\cdot b\). The computational requirements \(c_{j}\) are the number of multiplications needed to execute the layer \(j\)[27]. Therefore, the computational load requirement of the convolutional layers is calculated as follows:  
\[c_{j\_\_\_\_\text{conv}}=k_{h}\cdot k_{w}\cdot Ch_{\text{in}}\cdot F_{h}\cdot F _{w}\cdot Ch_{\text{out}}, \tag{1}\]  
where \(k_{h}\) and \(k_{w}\) are the height and width of the filter, respectively, and \(Ch_{\text{in}}\) is the number of input channels at layer \(j\), \(F_{h}\) and \(F_{w}\) are the height and width of the output feature map, respectively, and \(Ch_{\text{out}}\) is the number of output channels at layer \(j\).