## 4 Intelligent Aerial Remote Sensing
### The Lightweight Multitask Deep Learning Model in a Drone in Edge Computing  
Our learning approach aims at reactively predicting drone motion for the captured SWIR images. Due to the drone jitter and weather conditions, the captured SWIR image may become blurred. The blur leads to losing sharpness at the edges and increasing invisibility. Therefore, to improve the image quality, it is imperative to control the drone action during the acquisition process. In this study, we propose a lightweight multitask deep learning-based flying model (LMFM) in the AI layer to deal with this issue, as shown in Algorithm 1. Since we aimed to reduce the AI model processing time and implementation in a real drone, our learning approach reactively predicts drone motion from the captured SWIR image using a lightweight double CNN with small size and parameters, as shown in Figure 4. The motion predicting the result, which is converted into a flying control command two regression values later (rotor rotation speed: 4), is the remote control input. The image was preprocessed and resized and then input into the deep learning model. Initially, an image captured from the SWIR camera is resized to \(224\times 224\). The normalized image is input to a convolutional layer (\(222\times 222\times 8\)) followed by a max-pooling layer (\(111\times 111\times 8\)), a second convolutional layer (\(109\times 109\times 16\)) followed by a second max-pooling layer (\(54\times 54\times 16\)), and a third convolutional layer (\(52\times 52\times 32\)) followed by a max-pooling (\(26\times 26\times 32\)), in which the output is flattened and concatenated with the feature from \"Next_Waypoint\". \"Next_Waypoint\" is all the remaining waypoints of the predefined path. Then, the concatenated feature is shared and fed into two subnetworks to predict the velocity and yaw. The subnetworks include a dense layer with a depth of 256, whose output is sent to another dense layer with a depth of 32. Finally, the architecture was separated into two branches, which were two linear regressions, including the \"Velocity_Regressor\" and \"Yaw_Regressor\" such that \(v\) and \(\delta\) denote the velocity and steering angle, respectively. ```
1:SWIR_image, next_waypoint, LMFM model
2:\(\vec{x},\vec{y},\vec{\psi}\)
3:whilewhile Remote_Sensing_Processing do
4: on each \(t\)
5:resize_SWIR_image to \(224\times 224\)
6:functionLMFM (SWIR_image, next_waypoint)
7:\(\textit{Velocity\_Regressor, Yaw_Regressor}\leftarrow\text{fit (LMFM\_model)}\)
8:\(v\leftarrow\textit{Velocity\_Regressor,}\delta\leftarrow\textit{Yaw\_Regressor}\)
9: computing \(x_{t+1},y_{t+1},\textit{and }\psi_{t+1}\)
10: computing \(u_{1}\) and \(u_{4}\)
11: computing \(\vec{x},\vec{y},\textit{and }\vec{\psi}\)
12:return\(\vec{x},\vec{y},\vec{\psi}\)
13:endwhile
```  
**Algorithm 1** Flying control via LMFM. Figure 4: The lightweight multitask deep learning model to achieve real-time computational capacity in a drone. A drone mathematical model is a multiple-input-multiple-output system with six degrees of freedom for its operation. It consists of the position \(p=[x,y,z]^{T}\) and Euler angles \(\xi=[\phi,\theta,\psi]^{T}\), which are the roll, pitch, and yaw, respectively. We assumed that the drone flew at a fixed altitude to perform the remote-sensing tasks. Consequently, we approximated the control system as follows:  
\[\zeta=[x,y,\psi]^{T} \tag{1}\]  
Thus, the dynamics of the drone are defined as follows:  
\[x_{t+1}=x_{t}+v_{t}\times\cos(\psi_{t+1}) \tag{2}\]  
\[y_{t+1}=y_{t}+v_{t}\times\sin(\psi_{t+1}) \tag{3}\]  
\[\psi_{t+1}=\psi_{t}+\delta_{t} \tag{4}\]  
The motion of a drone can be fully controlled by changing the propeller rotation at speed \(\omega_{t}\), \(i=1,2,3,4\).