# DNNs Based Computation Offloading for LEO Satellite Edge Computing
## 5 Proposed Algorithm  
For the mixed integer programming problem (P1) with a nonlinear objective function, we want to use deep learning methods to solve this problem. The structure of the proposed algorithm is shown in Figure 2. In general, we input computing tasks into DNNs, generate corresponding candidate offloading decisions for computing tasks through DNNs, and allocate bandwidth for each user through the derived optimal bandwidth allocation scheme. Then, the utility function values of the system are calculated through the offloading decisions scheme and bandwidth allocation scheme obtained, and then the offloading decisions corresponding to the optimal system utility function value are output as the optimal offloading decisions of this iteration. Finally, the optimal offloading decisions and the size of the computing tasks are stored in the memory for training DNNs to achieve the goal of optimizing DNNs. It consists of two processes: one is the generation of the offloading decisions, and the other is the update of the offloading strategy, and these two processes are executed alternately. The generation of offloading decisions relies on the DNNs. On the input side, the DNNs take the size of the computing tasks as input and output the corresponding candidate offloading decisions. If the offloading decisions generated by a certain time slot are calculated locally by all users, the bandwidth allocation algorithm will not be performed, \(b_{1}\), \(b_{2}\),..., \(b_{N}\) are set to 0. If the offloading decisions generated by a certain time slot have the edge offloading scheme, the system allocates bandwidth to each transmission channel through our bandwidth allocation algorithm. Then, we calculate the system utility function values. Then, the system selects the offloading decisions with the least system utility function value as the output. In the offloading strategy updates phase, the input computing tasks size and the output offloading decisions are stored in the memory structure, and the training samples are extracted from the memory to train the DNNs. As these two processes iterate, the performance of the DNNs will gradually improve. The specific process of our algorithm is as follows:  
For the deep learning process, we take the computing tasks size \(I\) as the input of the DNNs and output the candidate binary offloading decisions. There are \(d\) DNNs, and \(d\) candidate binary offloading decisions will be generated. Our purpose is to design an offloading strategy function \(\pi_{d}\). For the \(d\)-th DNN, once the all computing tasks size \(I\) for \(N\) users is input at the input, it will quickly generate the corresponding candidate offloading decisions \(\mathbf{x_{d}}\). The strategy is expressed as:  
\[\pi_{d}:\mathbf{I}\mapsto\mathbf{x_{d}}. \tag{10}\]  
When the corresponding offloading decisions are obtained through DNNs, the optimization problem (P1) becomes the optimal bandwidth allocation problem (P2) of the system for each user. Problem (P2) is formulated as:  
\[(\text{P2}):J^{*}(I,\mathbf{x})=\min_{\mathbf{b}}\quad J(I,\mathbf{x},\mathbf{b}) \tag{11}\]  
Figure 2: The schematics of the proposed algorithm. \[\text{subject to }\sum\limits_{n=1}^{N}b_{n}\leq B, \tag{11a}\] \[b_{n}\geq 0,\forall n\in N. \tag{11b}\]  
For the bandwidth allocation problem, we can see from the above formula that the constraint of the optimization problem (P2) is only related to the bandwidth allocation of the system.