# Effect of Compressed Sensing Rates and Video Resolutions on a PoseNet Model in an AIoT System
## 2 Proposed AIoT System with Compressed Sensing and Pose Estimation
### Compressed Sensing for Data Traffic Mitigation  
Compressed sensing is a framework that samples a high-dimensional sparse signal at much lower rates than the Nyquist rate by sensing or measurement matrices (e.g., random sampling matrix), and this greatly improves the sampling efficiency [33; 34]. In a recovery process (e.g., CS recovery), a sparse transform domain representation is produced by solving the optimization problem (i.e., \(L_{1}\) norm minimization) [17; 35; 36; 37; 38; 39]. Then, by its inverse transformation (e.g., transform matrix), we can obtain a recovered signal. We will explain the use of CS in data traffic mitigation in our AIoT system.  
After the IoT-sensing device extracts a large amount of data \(P\times Q\) original image \(\mathbf{O}\), the \(K\times P\) random sampling matrix \(\mathbf{\Phi}\) compresses the original image \(\mathbf{O}\) according to the CS rate \(r=K/P\) to generate a \(K\times Q\) compressed image \(\mathbf{c}\), as given below  
\[\mathbf{c}=\mathbf{\Phi}\mathbf{O} \tag{1}\]  
Figure 1: Proposed AIoT system with an IoT sensing device for CS and an AIoT edge server for CS recovery and pose estimation.  
where \(\mathbf{\Phi}\) randomly selects pixels from the original image \(\mathbf{O}\). The compressed image \(\mathbf{c}\) will be sent to the AIoT edge server. In other words, we can mitigate the data traffic by generating the compressed image according to the CS rate.  
In the AIoT edge server, the CS recovery reconstructs the sparse transform domain representation \(\hat{x}\) from the compressed image \(\mathbf{c}\) by solving the \(L_{1}\) norm minimization with the above OWL-QN algorithm [27]. In this Algorithm 1, an object function is assumed to minimize \(f(x)=\ell(x)+C\|x\|_{1}\) where \(\ell(x)\) is the loss term, and \(C\) is a given constant. Additionally, \(\diamond f(x)\) denotes the pseudo-gradient of \(f\) at \(x\)  
\[\diamond_{i}f(x)=\begin{cases}\partial_{i}^{-}f(x)&\text{ if }\partial_{i}^{-}f(x)>0 \\ \partial_{i}^{+}f(x)&\text{ if }\partial_{i}^{+}f(x)<0\\ 0&\text{ otherwise},\end{cases} \tag{2}\]  
where right and left partial derivatives are given by \(\partial_{i}^{+}f(x)\) and \(\partial_{i}^{-}f(x)\), \(\mathbf{H}_{j}\) denotes the limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) approximation to the inverse Hessian of the loss, and \(\pi(x;v)\), denoted as the projection of \(x\) onto an orthant defined by \(v\)  
\[\pi_{i}(x;v)=\begin{cases}x_{i}&\text{ if }\sigma(x_{i})=\sigma(v_{i})\\ 0&\text{ otherwise}\end{cases} \tag{3}\]  
where \(\sigma(\cdot)\) denotes the sign function to take values in \(\{-1,0,1\}\). The two-dimensional (2D) inverse discrete cosine transform (IDCT) matrix \(\mathbf{\Psi}\) transforms the sparse transform domain representation \(\hat{x}\) to obtain the recovered image \(\mathbf{\hat{O}}\), which can be represented by  
\[\mathbf{\hat{O}}=\mathbf{\Psi}\hat{x} \tag{4}\]  
```
1: choose initial point \(x^{0}\)
2:\(M\Leftarrow\{\},N\Leftarrow\{\}\)
3:for\(j=0,1,\dots,MaxIters\)do
4: Compute \(w^{j}=-\diamond f(x^{j})\)
5: Compute \(e^{j}\Leftarrow\mathbf{H}_{j}w^{j}\) using \(M\) and \(N\)
6:\(t^{j}\Leftarrow\pi(e^{j};w^{j})\)
7: Find \(x^{j+1}\) with constrained line search
8:if termination condition satisfied then
9: Stop and return \(x^{j+1}\)
10:endif
11: Update \(M\) with \(m^{j}=x^{j+1}-x^{j}\)
12: Update \(N\) with \(n^{j}=\
abla\ell\big{(}x^{j+1}\big{)}-\
abla\ell\big{(}x^{j}\big{)}\)
13:endfor
```  
**Algorithm 1** Orthant-Wise Limited-memory Quasi-Neton (OWL-QN)  
The entries of \(\mathbf{\hat{O}}\) are defined as  
\[[\mathbf{\hat{O}}]_{pq}=\sum_{b=0}^{P-1}\sum_{d=0}^{Q-1}r_{b}r_{d}[\hat{x}]_{ Md}\cos\frac{\pi(2p+1)b}{2P}\cos\frac{\pi(2q+1)d}{2Q} \tag{5}\]  
where \(0\leq p\leq P-1\), \(0\leq q\leq Q-1\), and  
\[r_{b}=\left\{\begin{array}{ll}\frac{1}{\sqrt{p}},&b=0\\ \sqrt{\frac{2}{p}},&1\leq b\leq P-1\end{array}\right.\quad and\quad r_{d}= \left\{\begin{array}{ll}\frac{1}{\sqrt{Q}},&d=0\\ \sqrt{\frac{2}{Q}},&1\leq d\leq Q-1\end{array}\right. \tag{6}\]