diff --git "a/data_all_eng_slimpj/shuffled/split2/finalzzbxyd" "b/data_all_eng_slimpj/shuffled/split2/finalzzbxyd" new file mode 100644--- /dev/null +++ "b/data_all_eng_slimpj/shuffled/split2/finalzzbxyd" @@ -0,0 +1,5 @@ +{"text":"\\section{Introduction}\n \nComputational fluid dynamics (CFD) has proven to be a very effective research tool in a very wide variety of disciplines, including engineering, science, medicine and more \\cite{CFD1995}. For its applications in turbulent flows, however, the range of the temporal \\& spatial scales is too broad to be captured by brute force direct numerical simulations (DNS) \\cite{Davidson2015}. Large eddy simulation (LES) provides an alternative, by filtering the small-scale scales of transport and concentrating on the larger scale energy containing eddies \\cite{Sagaut05}. By this filtering, LES can be conducted on coarser grids as compared to those required by DNS. The penalty, understandably, is that LES generated data are of lower accuracy compared to DNS. Appraisal of LES predictions and assessments of its fidelity as compared to DNS, have been of interest in the turbulence research community for the past several decades \\cite{givi1989model,pope2001turbulent}. The objective of the present work is to build a new data-driven methodology to reconstruct DNS from LES data, which facilitates a more robust means of LES appraisal. \n\n\nMachine learning, including super-resolution methods~\\cite{Cheo2003SR}, have shown great success in reconstructing high-resolution data in a variety of commercial applications. For example, convolutional neural networks (CNNs) and their extensions, e.g., SRCNN~\\cite{dong2014learning}, RCAN~\\cite{zhang2018image}, and SRGAN~\\cite{ledig2017photo}, have proven very effective in directly mapping low-resolution images to high-resolution images. The effectiveness of these methods mainly come from the power of CNNs in automatically extracting representative spatial features through deep layers. An alternative solution is to consider super-resolution as an inverse modeling problem~\\cite{geiss2020invertible,mccann2017convolutional} with the constraints that the down-sampled version of the underlying high-resolution data should be consistent to the observed low-resolution data. \n\n\n\\begin{figure}[t]\n\\centering \n\\subfigure[LES]{\n\\label{Fig.sub.1}\n\\includegraphics[width=4.1cm,height = 4.1cm]{les.png}}\\subfigure[DNS]{\n\\label{Fig.sub.2}\n\\includegraphics[width=4.1cm,height = 4.1cm]{dns.png}}\n\\caption{An example slice of Large Eddy Simulation (LES) and its corresponding Direct Numerical Simulation (DNS). This example is used to show the \nthe difference between LES and DNS at certain spatial locations and certain time steps. }\n\\label{Sample}\n\\end{figure}\n\nSuper-resolution techniques are starting to be used in turbulence research \\cite{liu2020deep,xie2018tempogan,fukami2019super}. However, there are several major challenges that must be overcome, before they can be employed for routine applications. \nFirst, turbulent flow data often exhibit significant variability. In the absence of underlying physical processes, machine learning models are prone to learning spurious patterns that fit statistical characteristics of available training data collected from a specific time period, but cannot generalize to other time intervals. This can be further exacerbated by limited training data. \nSecond, existing super-resolution algorithms could have degraded performance in CFD because of the huge information loss caused by the large resolution gap. For example, LES data can be of more than 8 times lower resolution compared to DNS data along each axis. Hence, standard statistical interpolation methods may fail to capture fine-level flow dynamics resulting from underlying physical relationships and constraints. Third, existing machine learning models are not designed to deal with the discrepancy between\ndifferent simulation strategies (i.e. LES, DNS and\/or others). In general, the available simulations at a coarser resolution are not simply a down-sampled version of high-resolution simulations. Consider the examples in Fig.~\\ref{Sample}. It is obvious that the LES predictions on the coarser grids do not capture the flow patterns as compared to high-resolution DNS.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\begin{figure*}[htbp]\n\\begin{center}\n\\includegraphics[width = 1.03\\linewidth]{architecture.png}\n\\end{center}\n\\caption{The architecture of the proposed PGSRN model and different components in the loss function. Since the degradation structure is used for computing both the degradation loss and the GAN loss, we use the black arrows and grey arrows in the degradation process to show the flow for computing the degradation loss and GAN loss, respectively.}\n\\label{fig:tf_plot}\n\\end{figure*}\n\n\n\n\nIn this work, we develop a new method, termed Physics-Guided Super-Resolution Network (PGSRN)$\\footnote{The source code for the PGSRN model presented in this study is available online at link: \\url{https:\/\/drive.google.com\/drive\/folders\/1w6j3pNzVqZ7Q9P7ZpnTsVNmvnfJXnxh_?usp=sharing}}$, to improve the reconstruction of high-resolution turbulent flow data. This development is by leveraging known physical constraints and explicitly exploring the discrepancy \\& the consistency between different simulations. First, we generalize the loss function of the super-resolution model by incorporating the divergence-free velocity-field constraint as required in incompressible flows. Second, we introduce a hierarchical\ngenerative architecture by decomposing the data reconstruction into two steps: (i) transform low-resolution flow data into a down-sampled version of high-resolution data, and (ii) reconstruct high-resolution flow data from the down-sampled version. Step (i) allows explicitly modeling the data discrepancy due to different simulation methods used to generate low-resolution and high-resolution data. Step (ii) is to recover the fine-level details of flow data. Finally, we introduce a degradation process to further regularize reconstructed data by imposing the consistency between different simulations. Here we represent the degradation process by a forward model (by framing super-resolution as an inverse problem) that maps high-resolution data to low-resolution data. The forward model output of reconstructed data can then be compared against low-resolution simulations for consistency assessment. We further extend the degradation process as a feature extractor and introduce an adversarial loss on the extracted features from high-resolution data, which helps improve the modeling of fine-level fluid dynamics. \n\nFor the purpose of demonstration, we consider a variant of the Taylor-Green vortex (TGV) \\cite{brachet1984taylor}. This is a three-dimensional incompressible flow and is simulated within a box with periodic boundary conditions. The TGV provides a suitable setting for our demonstration as it exhibits several salient features of turbulent transport. In this flow, the original vortex collapses into turbulent worm-like structures which become progressively more turbulent until viscosity eventually dissipates the large scale vortical structures. \nWe compare our proposed method against several existing super-resolution algorithms to reconstruct DNS data of TGV. \nWe also demonstrate the effectiveness of each component in our proposed method by showing the improvement both qualitatively and quantitatively. \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u00a0\u00a0\u00a0\u00a0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\section{Methodology}\n\nThe goal of our work is to achieve an end-to-end reconstruction mechanism from low-resolution LES data, denoted by $\\textbf{X}_{LR}$ to high-resolution DNS data $\\textbf{X}_{HR}$. In Fig.~\\ref{fig:tf_plot}, we show the overall structure of the methodology. The model has two components, the generative process and the degradation process. These are described here, in order: \n\n\\subsection{Hierarchical Generative Process}\n\n\nThe generative process aims to map \u00a0$\\textbf{X}_{LR}$ to $\\textbf{X}_{HR}$. It contains multiple residual blocks and each block consists of convolutional layers~\\cite{o2015introduction}, batch normalization layers~\\cite{ioffe2015batch}, and parametric ReLUs following previous literature~\\cite{he2015delving}. The generative process outputs a reconstructed data $\\textbf{X}_{SR}$, and then the model is optimized to reduce the difference between obtained $\\textbf{X}_{SR}$ and provided high resolution data $\\textbf{X}_{HR}$. Such a difference is represented as a reconstruction loss $\\mathcal{L}_\\text{recon}(\\textbf{X}_{SR},\\textbf{X}_{HR})$, which can be implemented as mean squared loss (MSE), perceptual loss or other loss functions that measure the difference between two sets of data. In this work, we use the mean squared loss as we do not observe significant improvement using other loss functions.\n\n\n\\subsubsection{Hierarchical Structure}\nWe also build a hierarchical generative structure to decompose the information gap between low-resolution and high-resolution data and explicitly capture their difference. In particular, we consider two types of information loss from high-resolution data to low-resolution data: 1) the discrepancy caused by different simulation methods used to generate data of different scales, and 2) the loss of fine-level information due to the reduced resolution.\n\n\n\nGiven the input low-resolution data $\\textbf{X}_{LR}\\in \\mathbb{R}^{H\\times W\\times C}$ ($H$ and $W$ are spatial dimensions while $C$ is the number of physical variables), we use a hierarchical structure to extract intermediate data representation before generating high-resolution data of size ${KH\\times KW\\times C}$. In particular, we create multiple middle layers $\\{\\textbf{h}_1, \\textbf{h}_2,. . . \\textbf{h}_m\\}$. Here the first middle layer $\\textbf{h}_1$ is used to extract a down-sampled version of the high-resolution data $\\textbf{X}_{HR}$, which is of size $H\\times W$ (same with input low-resolution data). By introducing this layer, the model can explicitly capture the discrepancy between simulation strategies used for generating the input data $\\textbf{X}_{LR}$ (i.e., LES) and target data $\\textbf{X}_{HR}$ (i.e., DNS) on the same resolution. We introduce another loss on this middle layer to reduce the difference between extracted information from $\\textbf{h}_1$ and the down-sampled $\\textbf{X}_{HR}$. \nSpecifically, the model first transforms the hidden layer $\\textbf{h}_1$ into a reconstructed flow data of size $H\\times W\\times C$ via a function $g(\\cdot)$ and then compare $g(\\textbf{h}_1)$ against the down-sampled version of $\\textbf{X}_{HR}$.\nMore formally, this loss is expressed as:\n\\begin{equation}\n\\mathcal{L}_{h1} = \\text{MSE}(g(\\textbf{h}_1),\\textbf{X}^{\\text{down}_1}_{HR}),\n\\end{equation}\nwhere $\\textbf{X}^{\\text{down}_1}_{HR}$ represents the down-sampled version of $\\textbf{X}_{HR}$ of size $H\\times W$. \nWe implement the function $g(\\cdot)$ using convolutional layers and fully connected layers. \n\nWe can define additional losses on other intermediate layers $\\textbf{h}_2,...,\\textbf{h}_m$ by comparing down-sampled $\\textbf{X}_{HR}$ using different down-sampling rates. Specifically, we represent the loss of the hierarchical generative process as follows:\n\\begin{equation}\n\\begin{aligned}\n \\mathcal{L}_{hier} &= \\alpha_1\\mathcal{L}_\\text{recon}(\\textbf{X}_{SR},\\textbf{X}_{HR})+ \\alpha_2\\sum_{i=1}^{m}\\mathcal{L}_{hi} \\\\\n \\mathcal{L}_{hi} &= \\sum_{i=1}^m \\text{MSE}(g(\\textbf{h}_i),\\textbf{X}^{\\text{down}_i}_{HR})\/m,\n\\end{aligned}\n\\end{equation}\nwhere $\\textbf{X}^{\\text{down}_i}_{HR}$ is the down-sampled $\\textbf{X}_{HR}$ of size $k_iH\\times k_iW$, and $1=k_1\\frac{2}{3}$, that is\n\\begin{equation}\n(\\lambda_j^2+\\lambda_k^2)h\\bigg(\\frac{\\lambda_j^2}{\\lambda_j^2+\\lambda_k^2}\\bigg)>\\frac{2}{3},\n\\end{equation}\nfor all distinct $j, k, l$ in $\\{1,2,3\\}$. Since the binary entropy is bounded from above by 1, i.e., $h(x)\\leq 1$ for all $x\\in[0,1]$, we have\n\\begin{equation}\n\\lambda_j^2+\\lambda_k^2>\\frac{2}{3},\n\\end{equation}\nfor all distinct $j, k, l$. This is, however, contradicting the normalization condition $\\lambda_1^2+\\lambda_2^2+\\lambda_3^2=1$.\n\\end{proof}\n\n\\begin{figure}\n\\centering\n\\begin{minipage}[h]{0.9\\linewidth}\n\\includegraphics[width=\\linewidth]{Jeong-2}\n\\end{minipage}\n\\caption{\\textbf{MCPs of randomly generated extended $W$ states.} (a) MCPs of randomly generated extended $W$ states plotted against $\\lambda_0^2$. The solid curve corresponds to MCPs of extended $W$ states that have $\\lambda_1=\\lambda_2=\\lambda_3$ with $\\lambda_0^2$'s given. (b) MCPs of randomly generated extended $W$ states plotted against $\\lambda_1^2$. The solid curve corresponds to the MCPs of extended $W$ states that have $\\lambda_0=0$ and $\\lambda_2=\\lambda_3$ with $\\lambda_1^2$'s given.\n}\\label{numerical}\n\\end{figure}\n\nLet us now consider more general states, the extended $W$ states \\cite{dur2000},\n\\begin{equation}\n|\\psi_{\\text{e}W}\\rangle_{123}=\\lambda_0|000\\rangle+\\lambda_1|100\\rangle+\\lambda_2|010\\rangle+\\lambda_3|001\\rangle,\n\\end{equation}\nwhere $\\lambda_i\\geq0$ and $\\sum_i\\lambda_i^2=1$. Although MCP for a given extended $W$ state can be calculated easily, it is not easy to obtain an analytic expression for arbitrary extended $W$ states. Nevertheless, we generated $10^5$ extended $W$ states randomly and calculated their MCPs, and no extended $W$ state has been found that has a larger MCP than that of the standard $W$ state, $2\/3$, which is shown in Fig.~\\ref{numerical}. Furthermore, we can see from Fig.~\\ref{numerical}(a) that for a given $\\lambda_0^2$, no extended $W$ state has been found that has a larger MCP than that of the extended $W$ state with $\\lambda_1=\\lambda_2=\\lambda_3$. We also conclude that MCP of the extended $W$ states with $\\lambda_1=\\lambda_2=\\lambda_3$ is a monotonically decreasing function of $\\lambda_0^2$. In addition, we also plot the same data against $\\lambda_1^2$, which is shown in Fig.~\\ref{numerical}(b). From the figure, we can also see that for a given $\\lambda_1^2$, no extended $W$ state has been found that has a larger MCP than that of the extended $W$ state with $\\lambda_2=\\lambda_3$ and $\\lambda_0=0$.\n\n\\subsection*{Properties of minimal control power} \\label{sec:pro}\nIn this section, we investigate properties of MCP in terms of genuine tripartite entanglement. Before we start to introduce the properties of MCP, let us rewrite equation~\\eqref{cc2} as\n\n\\begin{equation}\nC^{jkl}_{CD}(\\rho_{123})=1+\\max_\\mathcal{E} \\bigg[\\sum_{i=0}^1 p_i[S(\\rho_l^i)-S(\\rho_{kl}^i)]\\bigg]\n\\end{equation}\nwhere the maximum is taken over all possible ensembles $\\mathcal{E}=\\{p_i,\\rho^i_{kl}\\}$ satisfying $\\sum_{i=0}^1 p_i \\rho^i_{kl}=\\rho_{kl}$, which corresponds to maximization over all Charlie's possible measurement basis \\cite{hughston1993}. Thus, CP also can be written as\n\\begin{align}\nP^{jkl}(\\rho_{123})&=\\max_\\mathcal{E}\\bigg[\\sum_{i=0}^1 p_i[S(\\rho_l^i)-S(\\rho_{kl}^i)]\\bigg]-S(\\rho_l)+S(\\rho_{kl})=\\max_\\mathcal{E}\\bigg[\\sum_{i=0}^1 p_i I(k\\rangle l|\\rho_{kl}^i)\\bigg]-I(k\\rangle l|\\rho_{kl}), \n\\end{align}\nwhere we have used the definition of the coherent information, $I(k\\rangle l|\\rho_{kl})=S(\\rho_l)-S(\\rho_{kl})$, which is also known as a negative quantum conditional entropy \\cite{wilde2013, nielsen2010}. Using the properties of the von Neumann entropy and convexity of coherent information, we can prove the following proposition.\n\n\\begin{prop} For general three-qubit states $\\rho_{123}$, which can be mixed or pure,\n\\begin{equation}\n0\\leq P(\\rho_{123}) \\leq 1.\n\\end{equation}\n\\end{prop}\n\nBefore we start to prove the proposition, we review the inequalities for the von Neumann entropy of the mixture of quantum states $\\rho_i$ \\cite{nielsen2010},\n\\begin{equation}\n\\sum_i p_i S(\\rho_i)\\leq S\\bigg(\\sum_i p_i \\rho_i \\bigg)\\leq \\sum_i p_i S(\\rho_i)+h(p_i), \\label{entropy}\n\\end{equation}\nwhere the equality of the first inequality holds if and only if all the states $\\rho_i$ for which $p_i>0$ are identical, and the equality of the second inequality holds if and only if the states $\\rho_i$ have support on orthogonal subspaces.\n\n\\begin{proof}\nLet us prove the lower bound first. It can be shown that CP of $\\rho_{123}$ is non-negative by using the convexity of the coherent information \\cite{wilde2013, nielsen2010},\n\\begin{equation}\nP^{jkl}(\\rho_{123})=\\max_\\mathcal{E} \\bigg[\\sum_{i=0}^1 p_i I(k\\rangle l|\\rho_{kl}^i)-I(k\\rangle l|\\rho_{kl})\\bigg]\\geq 0. \\label{convex}\n\\end{equation}\nThus, MCP is also non-negative, $P(\\rho_{123})\\geq 0$.\nFor the upper bound, using equation~\\eqref{entropy}, we obtain for CP that\n\\begin{align}\nP^{jkl}(\\rho_{123})=\\max_\\mathcal{E} \\bigg[\\sum_{i=0}^1 p_i[S(\\rho^i_l)-S(\\rho^i_{kl})]\\bigg]-S(\\rho_l)+S(\\rho_{kl})\\leq\\max_\\mathcal{E}\\bigg[-\\sum_{i=0}^1 p_i S(\\rho^i_{kl})\\bigg]+S(\\rho_{kl})\\leq \\max_\\mathcal{E}h(p_i) \\leq 1. \\label{upper}\n\\end{align}\nIt is clear that MCP also has the same upper bound.\n\\end{proof}\n\nWe have found the lower and upper bounds of MCP of general three-qubit states. Now, let us investigate the conditions for pure states that attain the bounds by proving following two propositions.\n\n\\begin{prop}\nFor pure states $\\rho_{123}$, $P(\\rho_{123})=0$ if and only if $\\rho_{123}$ is biseparable or fully separable.\n\\end{prop}\n\n\\begin{proof}\nLet $\\rho_{123}=|\\psi\\rangle\\langle\\psi|_{123}$. If $\\rho_{123}$ is biseparable or fully separable, it is clear that when Charlie has the separated qubit, CP is zero, and thus MCP is zero. Let us now assume that $P(\\rho_{123})=0$. Thus, there exists $\\{j,k,l\\}$ such that $P^{jkl}(\\rho_{123})=0$. We set $\\{j,k,l\\}=\\{3,1,2\\}$ without loss of generality. Equation~\\eqref{convex} implies that for any ensemble $\\{p_i,\\rho_{12}^i\\}$ that satisfies $\\sum_ip_i\\rho_{12}^i=\\rho_{12}$,\n\\begin{align}\n\\sum_i p_i I(1\\rangle 2|\\rho_{12}^i)-I(1\\rangle 2|\\rho_{12})=\\sum_i p_iS(\\rho_2^i)-S(\\rho_2)+S(\\rho_{12})=0\n\\end{align}\nbecause the maximum is zero. Let us write the state in a Schmidt decomposition form $|\\psi\\rangle_{123}=\\sum_i\\sqrt{\\mu_i}|\\psi^i\\rangle_{12}|i\\rangle_3$, and let us assume that $\\mu_i\\neq 0$ because $|\\psi\\rangle_{123}$ is trivially biseparable or fully separable if $\\mu_0=0$ or $\\mu_1=0$. Then, it is easy to obtain\n that $S(\\rho_{12})=h(\\mu_0)$. Furthermore, an ensemble set $\\{p_i=\\mu_i,\\rho_{12}^{i*}=|\\psi^i\\rangle\\langle\\psi^i|_{12}\\}$ should satisfy that\n\\begin{align}\n\\sum_i\\mu_iS(\\rho_2^{i*})-S(\\rho_2)+h(\\mu_0)=0\n\\end{align}\nwhere $\\rho_2^{i*}=\\text{Tr}_1(\\rho_{12}^{i*})$. Therefore, $\\rho_2^{0*}$ and $\\rho_2^{1*}$ are orthogonal; thus we denote $\\rho_2^{0*}=|0\\rangle\\langle0|_2$ and $\\rho_2^{1*}=|1\\rangle\\langle1|_2$ without loss of generality. Thus, the state can be rewritten as $|\\psi\\rangle_{123}=\\sqrt{\\mu_0}|\\phi^0\\rangle_1|00\\rangle_{23}+\\sqrt{\\mu_1}|\\phi^{1}\\rangle_1|11\\rangle_{23}$ where $\\langle0|1\\rangle=0$, but $|\\phi^{0}\\rangle$ and $|\\phi^{1}\\rangle$ are not necessarily orthogonal. Then, $S(\\rho_2)=h(\\mu_0)$ so that $\\sum_ip_iS(\\rho_2^i)=0$ for any ensemble that satisfies $\\sum_ip_i\\rho_{12}^i=\\rho_{12}$. Now, let us choose another ensemble set $\\{p_i^{**}=1\/2,\\rho_{12}^{i**}=|\\phi^{\\pm}\\rangle\\langle\\phi^{\\pm}|_{12}\\}$ where $|\\phi^{\\pm}\\rangle_{12}=\\sqrt{\\mu_0}|\\phi^0\\rangle_1|0\\rangle_2\\pm\\sqrt{\\mu_1}|\\phi^1\\rangle_1|1\\rangle_2$. Since $\\sum_i p_i^{**}S(\\rho_2^{i**})=0$ should be satisfied, we require that $|\\phi^0\\rangle_1=|\\phi^1\\rangle_1$. Thus, the first qubit is separated, i.e., $|\\psi\\rangle_{123}$ is biseparable.\n\\end{proof}\n\n\\begin{prop}\nFor pure states $\\rho_{123}$, $P(\\rho_{123})=1$ if and only if $\\rho_{123}$ is the standard GHZ state.\n\\end{prop}\n\n\\begin{proof}\nWe have already shown that MCP of the standard GHZ state is 1 from equation~\\eqref{ghz}. Now, let us assume that MCP of a pure three-qubit state $\\rho_{123}$ is 1 so that the CPs of $\\rho_{123}$ for any $\\{j,k,l\\}$ are 1. Note that since $S(\\rho_{kl}^i)=0$ for pure states $\\rho_{123}$, CP can be written as $P^{jkl}=\\max_\\mathcal{E}[\\sum_i p_iS(\\rho_l^{i})]-S(\\rho_l)+S(\\rho_{kl})$. To prove that a pure state $\\rho_{123}$ that attains the upper bound should be the standard GHZ state, we need to prove that the measurement basis of Charlie that maximizes $P^{jkl}$ also maximizes $P^{jlk}$ and vice versa. Let $\\mathcal{E}^*=\\{p_i^*,\\rho^{i*}_{kl}\\}$ be an ensemble that maximizes $\\sum_i p_iS(\\rho_l^{i})$ and $\\rho_l^{i*}=\\text{Tr}_k (\\rho_{kl}^{i*})$, and let $\\mathcal{E}^{**}=\\{p_i^{**},\\rho^{i**}_{kl}\\}$ be an ensemble that maximizes $\\sum_i p_iS(\\rho_k^{i})$ and $\\rho_k^{i**}=\\text{Tr}_l (\\rho_{kl}^{i**})$. Using that $S(\\rho_l^{i*})=S(\\rho_k^{i*})$ and $S(\\rho_l^{i**})=S(\\rho_k^{i**})$ for pure states $\\rho_{kl}^{i*}$ and $\\rho_{kl}^{i**}$, we have\n\\begin{align}\n&\\sum_{i=0}^1p_i^{**}S(\\rho_l^{i**})\\leq\\sum_{i=0}^1p_i^*S(\\rho_l^{i*})=\\sum_{i=0}^1p_i^*S(\\rho_k^{i*}), \\\\\n&\\sum_{i=0}^1p_i^*S(\\rho_k^{i*})\\leq\\sum_{i=0}^1p_i^{**}S(\\rho_k^{i**})=\\sum_{i=0}^1p_i^{**}S(\\rho_l^{i**}).\n\\end{align}\nThus, we have $\\sum_ip_{i}^*S(\\rho_l^{i*})=\\sum_ip_{i}^{**}S(\\rho_l^{i**})$ and $\\sum_ip_{i}^*S(\\rho_k^{i*})=\\sum_ip_i^{**}S(\\rho_k^{i**})$, which means that both ensembles $\\mathcal{E}^*$ and $\\mathcal{E}^{**}$ maximize $\\sum_i p_iS(\\rho_k^{i})$ and $\\sum_i p_iS(\\rho_l^{i})$. Therefore, the measurement basis of Charlie that maximizes $P^{jkl}$ also maximizes $P^{jlk}$ and vice versa.\n\nLet us start to prove that if $P(\\rho_{123})=1$, where $\\rho_{123}=|\\psi\\rangle\\langle\\psi|_{123}$, then $\\rho_{123}$ is the standard GHZ state. Since the equality of the last inequality in equation~\\eqref{upper} holds if and only if $p_i=1\/2$, we can write $|\\psi\\rangle_{123}$, up to a local unitary transformation, as\n\\begin{equation}\n|\\psi\\rangle_{123}=\\frac{1}{\\sqrt{2}}(|\\psi^0\\rangle_{12}|\\phi_0\\rangle_3+|\\psi^1\\rangle_{12}|\\phi_1\\rangle_3), \n\\end{equation}\nwhere we have chosen $\\{j,k,l\\}=\\{3,1,2\\}$ without loss of generality, and $\\{|\\phi_0\\rangle, |\\phi_1\\rangle\\}$ is a measurement basis of Charlie that maximizes both $P^{312}$ and $P^{321}$. In addition, $\\langle \\psi^0|\\psi^1\\rangle=0$ because the equality of the second inequality in equation~\\eqref{upper} holds. Let us write $|\\psi^0\\rangle_{12}=\\sum_i \\sqrt{\\lambda_i}|i\\rangle_1|i\\rangle_2$ and $|\\psi^1\\rangle_{12}=\\sum_i \\sqrt{\\mu_i}|\\bar{i}\\rangle_1|\\bar{i}\\rangle_2$. Note that since the equality of the first inequality in equation~\\eqref{upper} holds if and only if $\\rho_l^0=\\rho_l^1$, we have $\\rho_2^0=\\rho_2^1=\\rho_2$. Since we can choose $\\{j,k,l\\}=\\{3,2,1\\}$, we also have $\\rho_1^0=\\rho_1^1=\\rho_1$. Thus,\n\\begin{align}\n\\rho_1^0=&\\sum_i \\lambda_i |i\\rangle_1\\langle i|=\\sum_i \\mu_i|\\bar{i}\\rangle_1\\langle\\bar{i}|=\\rho_1^1, \\\\\n\\rho_2^0=&\\sum_i \\lambda_i |i\\rangle_2\\langle i|=\\sum_i \\mu_i|\\bar{i}\\rangle_2\\langle\\bar{i}|=\\rho_2^1.\n\\end{align}\nSince the eigen-decomposition of $\\rho_1$ and $\\rho_2$ is unique, we require (i) $\\lambda_i=\\mu_i, |i\\rangle_1=|\\bar{i}\\rangle_1$, and $|i\\rangle_2=|\\bar{i}\\rangle_2$, or (ii) $\\lambda_i=\\mu_i=1\/2$. However, the condition (i) contradicts $\\langle\\psi^0|\\psi^1\\rangle=0$. Thus, we can only require condition (ii), which gives us that $|\\psi^0\\rangle$ and $|\\psi^1\\rangle$ are two orthogonal Bell states. Hence, $|\\psi\\rangle_{123}$ is the standard GHZ state up to a local unitary operation.\n\\end{proof}\n\n\\section*{Discussion}\n\\label{sec:con}\nWe have considered controlled dense coding and defined its CP and MCP. We have also calculated MCPs for several important pure three-qubit states such as the extended GHZ states and generalized $W$ states. We found that MCP of the extended GHZ states is a monotonically increasing function of the three-tangle of the states, which quantifies genuine tripartite entanglement. We also found that the standard GHZ state uniquely achieves the maximal value of MCP among the extended GHZ states, so does the standard $W$ state among the generalized $W$ states. \n\nAlthough the extended $W$ states have a genuine tripartite entanglement, the three-tangle of the extended $W$ states vanishes \\cite{dur2000}. Based on the operational meaning of MCP, the three-party entanglement of the extended $W$ states can be witnessed by MCP as we have discussed in this paper. Thus, MCP can be used to quantify the three-party entanglement of the extended $W$ states.\n\nWe also found the lower and upper bounds of MCP for general three-qubit states. In addition, we proved that for pure states $\\rho_{123}$, the equality of the lower bound holds if and only if the three-qubit state is biseparable or fully separable and that the equality of the upper bound holds if and only if the three-qubit state is the standard GHZ state. These properties imply that not only does MCP have an operational meaning in the controlled dense coding scenario but also that it can capture the genuine tripartite entanglement of three-qubit pure states. We remark that it is possible for a separable mixed three-qubit state to attain the maximal value of MCP, for example, $\\rho_{123}=\\frac{1}{4}(|000\\rangle\\langle000|+|110\\rangle\\langle110|+|011\\rangle\\langle011|+|101\\rangle\\langle101|)$. Furthermore, it also means that there exists a mixed state whose MCP is not zero even though the state is fully separable. The interpretation is that both classical and quantum correlations of mixed three-qubit states $\\rho_{123}$ are captured by MCP. Thus, in future work, it would be worth analyzing the relation between MCP and genuine tripartite quantum and classical correlations.\n\nEven though we have analyzed discrete variable controlled dense coding only, it is worth mentioning generalization to continuous variable (CV) systems. In fact, CV dense coding and CV controlled dense coding have been studied \\cite{braunstein2000, loock2000, jing2003, jing2002}. In order to perform CV dense coding, a two-mode squeezed vacuum is shared by Alice and Bob, and Alice encodes CV information by displacing her beam and sends it to Bob, followed by Bob's joint measurement of quadrature variables. For controlled dense coding, a GHZ-like state of CV is shared among Alice, Bob and Charlie, and Charlie performs homodyne detection on his beam. The result of the homodyne measurement is then sent to Alice, and Alice and Bob perform CV dense coding using Charlie's measurement result. In fact, it was shown that channel capacities with and without Charlie's assistance are different \\cite{jing2002}. At a first glance, it seems possible to define the CP and MCP of CV controlled dense coding in a similar manner. However, channel capacity of CV dense coding and that of discrete variable have some differences. The channel capacity of CV dense coding requires certain constraints to prevent it from diverging, which are not required for discrete variable dense coding. In addition, the channel capacities that we have defined for discrete variable controlled dense coding are the optimal ones for given states so that it can be interpreted as an intrinsic property of the state, whereas optimal channel capacities of CV states are not known in general. Thus, in order to define CP and MCP properly and generalize our results to CV systems, it is required to find a general expression of the optimal channel capacity for a given CV state. It would be an interesting future work to generalize the CP and MCP of discrete variable controlled dense coding to CV controlled dense coding.\n\n\\section*{Acknowledgements} The authors thank Chae-Yeun Park, Hyukjoon Kwon, and Seok Hyung Lee for valuable discussions. This work was supported by a National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIP) (No.\\ 2010-0018295) and by the KIST Institutional Program (Project No.\\ 2E26680-16-P025).\n\n\\section*{Author Contributions} C.O. and K.J. conceived the idea and proposed the study. C.O. and H.K. performed the calculations and the proofs. C.O. and H.J. analyzed and interpreted the results. All authors contributed to discussions, reviewed the manuscript, and agreed with the submission.\n\n\\section*{Competing Financial Interests} The authors declare that they have no competing financial interests.\n\n\\bibliographystyle{naturemag}\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\nThe Laser Interferometry Gravitational-wave Observatory's successful detection \\cite{2016PhRvL.116f1102A} of gravitational waves (GW) in the tens to thousands Hertz frequency range heralds in the era of gravitational wave astronomy, allowing us to probe deeper into the depth of the cosmos and the core regions of violent astrophysical events. Just as with electromagnetic observations, GW messengers populate a broad frequency range, and projects are currently underway to detect them in the segments of: around $10^{-16}$Hz through the B-mode polarization of the Cosmic Microwave Background, nanohertz band via pulsar timing arrays, millihertz range by space-based laser interferometers, and upto about $10^4$ Hertz with a network of second generation ground-based interferometers. \n\nIn comparison, activities in the higher frequency ($>100k$Hz) end of the spectrum have been relatively subdued. One of the reasons is that the relevant GW sources have been less certain, so there is a chance that this corner of the GW universe is simply quiet. However, most of the speculative sources proposed so far are intimately tied into fundamental physics (e.g. of cosmological \\cite{Grischuk,Maggiore00,1999PhRvD..60l3511G,2007PhRvL..98f1302G,Easther07,Caprini09a,Copeland09,\nCaldwell96,Leblond09} and braneworld \\cite{Seahra05,Clarkson07} origins), and so a detection in this frequency regime may yield important insights, while null results would still be interesting in terms of constraining exotic models. Another reason for the lack of interest is that our technology has not been sufficiently advanced to make the current detector designs sensitive enough to make the detection of such speculative sources likely (see e.g. Ref.~\\cite{2008PhRvL.101j1101A,2006CQGra..23.6185C}). However, rapid progresses in potentially relevant experimental capabilities are being made in the fields of controlled fusion and laboratory astrophysics. In addition, the wavelengths of high frequency gravitational waves (HFGW) are such that they impose less of a demand on the physical size of the detectors. Therefore, the cost-benefit ratio may eventually justify a new generation of detectors being built to listen for such signals, and it is consequently useful to maintain an active investigation into their design options (see e.g.~\\cite{TiltInPrep}). \n\nAs high HFGWs need to be converted into e.g., electromagnetic (EM) signals, in order for us to take a readout, the very core of the design problem is then to find a physical process that achieves this conversion most efficiently. The options explored so far concentrate on GW interacting with a static magnetic field, with or without a background electromagnetic wave (EMW) at the same frequency as the GW \\cite{Gertsenshtein62,1966PhRv..142..825Z,1972GReGr...3..401B,1983MNRAS.204..485C,2000CQGra..17.2525C,2006CQGra..23.6185C,Li:2009zzy}. \nIn such investigations, the presence of the magnetic field is vital for mediating the coupling between the GW and the EMW, and a curved background spacetime can also serve as the catalyst. More interestingly for our present study though, it has been noted that currents enabled by the presence of a plasma can also greatly enhance the coupling \\cite{1983PhRvD..28.2382M,1990ApJ...362..584M,1998CQGra..15.3655G,1999PhRvL..82.3012B,2000ApJ...536..875M,2000PhRvE..62.8493S,2001A&A...377..701P,2003PhRvD..68d4017S,Duez2005}, through their being disturbed by the GW. It is therefore interesting to examine the possibility of replacing the vacuum electromagnetic field with a strongly magnetized tenuous plasma as the quiescent configuration (in a stationary solution of the so-called force-free electrodynamics, thus no background radiation). In previous studies involving magnetized plasma\/fluid, while detailed equations of motion are written down and some estimates on the amplitude of induced plasma waves (PW) are made, analytical solutions relevant for HFGW detection are generally lacking, and a precise evaluation of the coupling strength and a depiction of the characteristics, such as the associated charges and currents, of the induced radiation remain illusive (we note that explicit solutions are given by Ref.~\\cite{2003PhRvD..68d4017S} for the EMW to GW conversion, but not vice versa, which is noted to be more complicated, and Ref.~\\cite{Duez2005} offers standing but not travelling wave solutions). \n\nIn this paper, we leverage some recent advances in modelling plasma dynamics in curved spacetimes to find simple and explicit analytical solutions, and show that unfortunately, the temporally averaged Poynting flux associated with the PW induced by the HFGW is no stronger than their vacuum counterparts. The introduction of the plasma however allows for the existence of currents, whose amplitudes depend on that of the GW linearly, and makes possible more sensitive detectors of the ammeter type. It is beyond the scope of this paper to design a technologically viable detector though, and therefore the parameter choices are somewhat arbitrary. We hope our demonstration of the potential enhancement in sensitivity through plasma injection, as well as the introduction of the user-friendly analytical solutions, would solicit interest from experts and lead to more detailed studies. We also mention that although not discussed in any detail below, our analytical solutions may also be applied to the beginning of the GW's journey, namely to study their EM counterparts generated by the GWs themselves inside magnetospheres of compact objects. A large body of excellent literature (see last paragraph for references) already exist on this subject, and we refer interested readers to them for potential applications of our results. \n\nWe derive the equations governing the coupling between the GW and the PW in Sec.~\\ref{sec:Eqs}, and analyse properties of the conversion process that they encode in Sec.~\\ref{sec:Ana}. In particular, we clarify what kinds of GW excite which types of PW, providing discussions from a physical point of view. We then discuss general solutions to these equations in Sec.~\\ref{sec:Gen}, and concentrate on a particular one that's relevant for HFGW detection in Sec.~\\ref{sec:Sol}. We further sketch the case for a potential detector design in Sec.~\\ref{sec:Det}, before concluding with a discussion in Sec.~\\ref{sec:Dis}. Unless otherwise stated, the formulae below are expressed in geometrized units where $G=c=\\epsilon_0=1$. Boldface letters are used to represent three or four dimensional vectors and tensors, with specific assignments made clear from context. \n\n\\section{The force-free equations} \\label{sec:Eqs}\nAnalytical solutions describing the interaction between a GW and a magnetized fluid has been worked out in Ref.~\\cite{Duez2005} for the case of a standing GW, and used to test a magnetohydrodynamics code. For the sake of HFGW detection, we need a description of induced PW converted from a travelling GW, and we solve for it under the assumption that the plasma's mass density is negligible in its contribution to the overall stress-energy tensor as compared to the electromagnetic field itself, or in other words we assume that the plasma is tenuous. Such a situation is described by the so-called ``force-free electrodynamics\", frequently invoked when examining astrophysical environments \\cite{Goldreich:1969sb,1977MNRAS.179..433B}. \nMore specifically, the inertia-less plasma particles do not have a tendency to preserve their previous states of motion, and thus require no separate kinetic equations (the state of the magnetized plasma is sufficiently described with only the electric and magnetic fields). A plasma particle's movement is instead governed entirely by the requirement that it experiences vanishing 4-force density (or else it would be infinitely accelerated), i.e. \n\\begin{eqnarray} \\label{eq:FFECond}\nF_{ab}j^b =0 \\,,\n\\end{eqnarray}\nwhere $j^b$ is the 4-current density due to the plasma particles' motion. Enforcing this condition on the currents that act as the source terms in the usual Maxwell's equations leads to the force-free equations, in which the presence of the plasma manifests as nonlinear modifications \\cite{Zhang:2015aga}. \n\nIn this particular limit of magnetohydrodynamics, the propagation speed of the plasma waves are that of the speed of light, therefore optimal for creating resonant conditions where phase coherence with the GW is maintained for as long as possibly, allowing for consistent draining (as opposed to periodically feeding back in) of energy from GW to generate as large an EM signal as possible. Adopting the force-free assumption also allows us to take advantage of some technologies that have recently become available \\cite{Gralla:2014yja}, resulting in our being able to find closed-form solutions. \n\nSpecifically, let us assume that the spacetime is initially flat and there is an uniform magnetic field along the $z$ direction, which is described by the field 2-form (the Faraday tensor)\n\\begin{equation} \\label{eq:BG}\nF_0 = B_0 dx \\wedge dy\\,.\n\\end{equation}\nIn the flat spacetime, the background solution as given by Eq.~\\eqref{eq:BG} carries no current, so the force-free condition is satisfied trivially. However, once metric perturbations are introduced (metric becomes $\\eta_{ab}+h_{ab}$, where $\\eta_{ab}$ denotes the Minkowski values), a background current appears, taking the value of \n\\begin{eqnarray} \\label{eq:BGCurrent}\nj_0^a = B_0\\begin{pmatrix} \n\\partial_y h_{tx}-\\partial_x h_{ty} \\\\\n\\partial_t h_{ty}-\\partial_z h_{yz} -\\frac{1}{2}\\partial_y\\left( h_{tt}+h_{xx}+h_{yy}-h_{zz}\\right) \\\\\n-\\partial_t h_{tx}+\\partial_z h_{xz} +\\frac{1}{2}\\partial_x\\left( h_{tt}+h_{xx}+h_{yy}-h_{zz}\\right) \\\\\n\\partial_x h_{yz}-\\partial_y h_{xz}\n\\end{pmatrix} \\,. \n\\end{eqnarray}\nConsequently, $F_{0ab} j_0^b \\neq 0$ in a curved spacetime and that Eq.~\\eqref{eq:BG} ceases to be a valid force-free solution. The PWs then emerge to restore force-freeness, and the now PW-added field $2$-form can be written as \n\\begin{equation} \\label{eq:Faraday}\nF = B_0 \\,d\\,\\Big(x+ \\alpha(t,x,y,z)\\Big) \\wedge d\\,\\Big(y+ \\beta(t,x,y,z)\\Big)\\,,\n\\end{equation}\nwhereby the terms $x+\\alpha$ and $y+\\beta$ are called Euler potentials. That such a decomposition of the field 2-form is possible is established in Refs.~\\cite{1997PhRvE..56.2181U,1997PhRvE..56.2198U,Gralla:2014yja}. The force-free equations of motion can then be transcribed into the exterior calculus language as \\cite{Gralla:2014yja}\n\\begin{eqnarray} \\label{eq:FFEEqRaw}\n(dx+ d \\alpha )\\wedge d*F=0, \\quad \n(dy+ d \\beta)\\wedge d*F=0\\,,\n\\end{eqnarray}\nwherein the spacetime curvature enters only through the Hodge dual operator $*$ (see Appendix \\ref{sec:AppHodge} for details), a fact that significantly simplifies formalism.\nTo make further progress, let us define, as in \\cite{2016ApJ...817..183Y}, the auxiliary variables\n\\begin{eqnarray} \\label{eq:Defpsi}\n\\psi_1 = \\partial_x \\beta -\\partial_y \\alpha, \\quad \\psi_2 = \\partial_y \\beta+ \\partial_x \\alpha, \n\\end{eqnarray}\nturning the explicit form of the equations \\eqref{eq:FFEEqRaw} (keeping to linear order in metric perturbation) into \n\\begin{align}\\label{Eq:psiEqs}\n \\left(-\\partial^2_t+\\partial^2_z\\right)\\psi_1 =& \\frac{\\partial^2 h_{tx}}{\\partial t \\partial y}-\\frac{\\partial^2 h_{ty}}{\\partial t \\partial x}+\\frac{\\partial^2 h_{yz}}{\\partial z \\partial x}-\\frac{\\partial^2 h_{xz}}{\\partial z \\partial y}\\,, \\nonumber \\\\\n\\left(-\\partial^2_t+\\partial^2_x+\\partial^2_y+\\partial^2_z\\right) \\psi_2 =&\n\\frac{1}{2} \\left(\\partial^2_x+\\partial^2_y\\right)\\left(h_{tt}+h_{xx}+h_{yy}-h_{zz}\\right)\n\\notag\\\\\n& \n+\\frac{\\partial^2 h_{yz}}{\\partial y \\partial z}\n+\\frac{\\partial^2 h_{xz}}{\\partial x \\partial z}-\\frac{\\partial^2 h_{yt}}{\\partial y \\partial t}-\\frac{\\partial^2 h_{xt}}{\\partial x \\partial t}\\,.\n\\end{align}\nThe quantity $\\psi_1$ that propagates along the $z$ direction (see the left hand side of Eq.~\\ref{Eq:psiEqs}) then depicts waves climbing the magnetic field lines or the Alfv\\'en waves, while $\\psi_2$ describes the fast-magnetosonic waves \\cite{2016ApJ...817..183Y}. \n\nFor the purpose of our study, we specialize to a sinusoidal plane gravitational wave, with a uniform transverse profile, propagating in a direction in the $x-z$ plane that extends an angle $\\chi$ with the $z$ axis (for a more generic wave profile, both along and transverse to the propagation direction, see Appendix \\ref{sec:GenericTrain}). \nWe define the amplitudes $h_{\\times}$ and $h_+$ for the cross and plus polarizations (and will use $h$ when distinguishing between them is not necessary), such that in an adapted coordinates system $(t, x',y,z')$ where the GW travels along the $z'$ axis (i.e. spatially rotated against the original coordinates around the $y$ axis by the angle $\\chi$), the metric perturbation takes on the familiar form of\n\\begin{eqnarray}\nh_{a'b'} =\\begin{pmatrix} \n 0 & 0 & 0 & 0 \\\\\n 0 & h_+ & h_{\\times} & 0 \\\\\n 0 & h_{\\times} & -h_+ & 0 \\\\\n 0 & 0 & 0 & 0 \n\\end{pmatrix}\n\\cos\\Big(\\phi_0-\\omega(t-z')\\Big)\\,.\n\\end{eqnarray}\nTransferring back to the original coordinate system where the magnetic field is along the $z$ axis, and in which we will carry out our computations, we then have \n\\begin{eqnarray} \\label{eq:GWperb}\nh_{ab} = \\begin{pmatrix}\n 0 & 0 & 0 & 0 \\\\\n 0 & h_+\\cos ^2\\chi & h_{\\times} \\cos \\chi & (h_+\/2)\\sin 2\\chi \\\\\n 0 & h_{\\times} \\cos \\chi & -h_+ & h_{\\times} \\sin \\chi \\\\\n 0 & (h_+\/2)\\sin 2\\chi & h_{\\times} \\sin \\chi & h_+ \\sin ^2\\chi \\end{pmatrix} \\cos\\xi\\,,\n\\end{eqnarray}\nwhere $\\xi \\equiv \\phi_0-\\omega(t +x \\sin \\chi- z \\cos \\chi )$. The force free equations \\eqref{Eq:psiEqs} then become\n\\begin{align}\n&-\\frac{\\partial ^2\\psi _1}{\\partial t^2}+\\frac{\\partial ^2\\psi _1}{\\partial z^2} \\label{eq:FFE1}\n=\n h_{\\times} \\omega ^2\\sin ^2 \\chi \\cos \\chi \\cos \\xi\\,, \\\\\n&-\\frac{\\partial ^2\\psi _2}{\\partial t^2}+\\frac{\\partial ^2\\psi _2}{\\partial x^2}+\\frac{\\partial ^2\\psi _2}{\\partial y^2}+\\frac{\\partial ^2\\psi _2}{\\partial z^2}\n=\nh_{+} \\omega ^2\\sin ^2 \\chi \\cos \\xi\\,. \\label{eq:FFE2}\n\\end{align}\nNote that in our derivations above, we have ignored the back-reaction of the electromagnetic field on the metric, which is suppressed by a factor of $G\/c^4$ in SI units (and by a corresponding suppression of the EM field strengths when transferring into geometrized units). \n\n\\section{The selection rules} \\label{sec:Ana}\nWe see that the Euler potential formalism allows us to write down very simple equations \\eqref{eq:FFE1} and \\eqref{eq:FFE2}, from which we can glean answers to important questions such as which types of GW excite which types of PW. We in fact have a fairly clean dichotomy: \ncross-polarized GWs excite the Alfv\\'en waves, while \nplus-polarized GWs excite fast-magnetosonic waves. \n\nThe intuitive reasons behind these simple rules are encoded in Eq.~\\eqref{eq:BGCurrent}, which represents the EM effects of immersing the background magnetic field in a curved spacetime. Such effects are the intermediate agents responsible for driving the PWs. \nMore precisely, the force-free condition demands that\n(to leading order in metric perturbation, and thus also $\\alpha$ and $\\beta$) \n\\begin{eqnarray} \\label{eq:CurrentCancellation}\nF_{0ab} j^{(1)b} = F_{0ab} \\left(\\delta j^b + j_0^b\\right) = 0\\,,\n\\end{eqnarray}\nwhere $\\delta j =* (d*\\delta F)$, with \n\\begin{eqnarray} \\label{eq:deltaF}\n\\delta F \\equiv B_0(dx\\wedge d\\beta+ d\\alpha \\wedge dy)\\,\n\\end{eqnarray}\nbeing the leading order perturbation to the field two-form. In essence then, PWs need to be produced in order to provide a current $\\delta j^a$ that cancels out (the troublesome components of) the GW-generated background $j_0^a$. \nFurthermore, we note that $j_0^{z}$ is not an active component in Eq.~\\eqref{eq:CurrentCancellation}, as $F_{0xy}=-F_{0yx}$ are the only non-vanishing components of ${\\bf F}_0$, so only $j_0^{x}$ and $j_0^{y}$ need to be neutralized (currents in the $x-y$ plane experience a Lorentz force from the background magnetic field in the $z$ direction). In contrast, the component $j^{(1)z}$ does not need to vanish, even at leading order, a fact that we will use later to propose HFGW detectors of the ammeter type. The fast-magnetosonic and Alfv\\'en waves split the task of current-neutralization between them. Comparing Eq.~\\eqref{eq:BGCurrent}\nwith Eq.~\\eqref{Eq:psiEqs}, we see that the source to the fast-magnetosonic wave $\\psi_2$ is simply $(\\partial_x j_0^y - \\partial_y j_0^x)\/B_0$, while the source to the Alfv\\'en wave $\\psi_1$ is $-(\\partial_x j_0^x + \\partial_y j_0^y)\/B_0$. We examine the two types of waves in turn.\n\nThe general characteristic of a magnetosonic wave in any magnetized plasma is that it has a tendency (but not absolutely enforced by the operator on the left hand side of Eq.~\\eqref{eq:FFE2}) to travel in the direction perpendicular to the background magnetic field ${\\bf B}_0$, with its associated perturbation to the magnetic field $\\delta {\\bf B}$ having a component along ${\\bf B}_0$ (see e.g.~\\cite{PlasmaBook} and also Eq.~\\eqref{eq:MagB} below).\nTherefore, $\\delta B^z$ is a good quantitative representation for the fast-magnetosonic waves. Substituting into Eq.~\\eqref{eq:deltaF} the two terms $\\partial_y\\beta$ and $\\partial_x \\alpha$ of Eq.~\\eqref{eq:Defpsi} that combine into $\\psi_2$, we see that they in fact give us $\\delta B^z = B_0 \\psi_2$ (obeyed by our specific fast-magnetosonic wave solution presented in Sec.~\\ref{sec:Sol}, see Eqs.~\\eqref{eq:Solpsi2} and \\eqref{eq:MagB} below). \n\nWith regard to polarization, because $\\psi_2$ is essentially $\\delta B^z$, the GWs effective at inducing fast-magnetosonic waves would be the ones that are capable of coupling to the background magnetic field in such a way as to generate a $\\delta B^z$ by introducing currents onto the $x-y$ plane. From Eq.~\\eqref{eq:BGCurrent}, the diagonal entries in $h_{ab}$ are obviously adapt at this task, and according to Eq.~\\eqref{eq:GWperb}, they correspond to the plus polarization. There are also other terms in $j_0^x$ and $j_0^y$, including a $h_{yz}$ that corresponds to the cross polarization. However, with our long wave train without $y$ dependence, the $j_0^x$ introduced by this term has no variation in the $y$ direction and is thus incapable of producing $\\delta B^z$. When a more complicated wave profile is introduced, such as that in Eq.~\\eqref{eq:GenericFFE2} of Appendix \\ref{sec:GenericTrain}, both polarizations are activated, but the general rule still applies, namely that \n\\begin{itemize}\n\\item GWs effective at introducing a current that rescales the background magnetic field would be efficient in inducing fast-magnetosonic waves. \n\\end{itemize}\n\n\nThe Alfv\\'en waves on the other hand, are restricted to propagate along the background magnetic field (see the left hand side of Eq.~\\eqref{eq:FFE1}), and are characterized by the presence of an accompanying dynamical current component flowing in the same direction (see e.g.~\\cite{2016arXiv160309693G,Brennan:2013jla,Yang:2014zva}). \nTherefore, GWs that can produce a dynamical current (as opposed to a constant flux) in the $z$ direction are better ``impedance matched'' \nand more effective at feeding energy into Alfv\\'en waves.\nIndeed, although the source term to $\\psi_1$ in Eq.~\\eqref{Eq:psiEqs} is derived by combining $j_0^x$ and $j_0^y$, the particularities of the combination is such that the source term turns out to be simply $\\partial_z j^z_0$ (ignoring the shift coordinate freedom terms like $h_{tx}$ that do not appear for GWs, see Eq.~\\eqref{eq:GWperb}). From Eqs.~\\eqref{eq:BGCurrent} and \\eqref{eq:GWperb}, we see that $h_{\\times}$ entering through $h_{yz}$ satisfies this requirement, with the lack of $y$ dependence once again suppressing the other polarization hidden in $h_{xz}$. Just as with the fast-magnetosonic waves, more complicated wave profiles allowed in Eq.~\\eqref{eq:GenericFFE1} re-activates $h_{+}$. In summary, a more general rule is that \n\\begin{itemize}\n\\item GWs that introduce variable currents along the background magnetic field direction would be more efficient at eliciting Alfv\\'en waves.\n\\end{itemize} \n\n \n\n\\section{The general solutions} \\label{sec:Gen}\nWe hope that the intuitive guidelines of Sec.~\\ref{sec:Ana} would prove useful in more complicated situations, e.g., ones involving secondary EM radiation coming from compact celestial objects. In such cases, the $j_0^a$ currents from immersing a background EM field in curved spacetimes are straightforward to compute as well, without the need to solve any equations (they are simply $*(d*F_0)$). One can then apply the rules of Sec.~\\ref{sec:Ana} to predict the GW-induced PW content without having to solve the FFE equations. Nevertheless, for more quantitative predictions, detailed solutions are sought, and we present a recipe for acquiring general solutions in this section. \n\nWe begin by noting that the selection rules do not mean a particular type of modes can not exist in the absence of the correct type of GW. In the absence of a source term, the homogeneous force-free equations can still be solved, and the resulting $\\psi_1$ or $\\psi_2$ represent waves being injected at the boundaries of the magnetized regions, and simply traverse such regions as their flat-spacetime counterparts would, without drawing energy from the GW. Such solutions are useful when superposed onto the so-called particular solutions to the inhomogeneous equations when constructing general solutions. The inhomogeneous solutions are more complicated to obtain, but fortunately, we have treated the relativistic effects perturbatively. Specifically, the metric perturbations have all been placed onto the right hand side of the force-free equations, leaving us with simple flat spacetime partial differential operators for the principal part of these equations, for whom the Green's functions are well-known. This allows us to adopt standard Green's function methods to solve them, not only for the long sinusoidal wave trains as assumed for Eqs.~\\eqref{eq:FFE1} and \\eqref{eq:FFE2}, but also the more complicated cases of Appendix \\ref{sec:GenericTrain}. \n\nLet the source terms on the right hand sides of Eqs.~\\eqref{eq:FFE1} and \\eqref{eq:FFE2} be denoted by $\\mathcal{S}_1$ and $\\mathcal{S}_2$, then the particular solutions to the inhomogeneous equations are \n\\begin{eqnarray} \\label{eq:Green}\n\\psi_1({\\bf x'}) &=& \\int \\mathcal{G}_1(\\Delta'_t,\\Delta'_z) \\mathcal{S}_1({\\bf x''})\\ dt''\\, dz'' \\,,\\\\\n\\psi_2({\\bf x'}) &=& \\int \\mathcal{G}_2({\\bf x''}-{\\bf x'}) \\mathcal{S}_2 ({\\bf x''}) d^4 x''\\,, \n\\end{eqnarray}\nwhere $\\Delta'_z \\equiv z'-z''$, $\\Delta'_t \\equiv t'-t''$, and $\\mathcal{G}_{1\/2}$ are the Green's functions. The integrations are to be carried out over the entire vessel containing the magnetized plasma. Homogeneous solutions (satisfying the FFE equations with $\\mathcal{S}_{1\/2}=0$) can then be superposed onto the results in order to satisfy desired boundary and initial conditions. Because we have decoupled the equations for the Alfv\\'en and fast-magnetosonic waves, their boundary conditions can be imposed separately. As already mentioned, these homogeneous solutions are simply freely propagating waves that behave as if they are in flat spacetime, and do not interact with the GW. Therefore, fixing boundary conditions is not important when studying the GW to PW conversion process, and they do not determine which type of PW is induced by the GW. They are however required if one is to compute the observables such as energy fluxes or currents, to be measured by HFGW detectors, because freely propagating waves injected at the boundaries contaminate these quantities. We will discuss this further in Sec.~\\ref{sec:Sol}. \nReturning to the particular solution, the Green's functions are those of the flat spacetime, specifically \n\\begin{eqnarray}\n\\mathcal{G}_1(z'',t'';z',t')&=&\\frac{1}{2}\\Theta(\\Delta'_t)\\Theta(\\Delta'_t+\\Delta'_z)\\Theta(\\Delta'_t-\\Delta'_z)\\,, \\label{eq:G1}\\\\\n\\mathcal{G}_2({\\bf x''}; {\\bf x'}) &=& \\frac{\\delta(t'-(t''-R))}{4 \\pi R}\\,,\n\\end{eqnarray}\nwhere $R\\equiv |{\\bf x}''-{\\bf x}'|$, and $\\Theta$ are the Heaviside step functions. \n\nFor simpler $\\mathcal{S}_{1\/2}$ such as those appearing on the right hand sides of Eqs.~\\eqref{eq:FFE1} and \\eqref{eq:FFE2}, closed-form solutions for $\\psi_{1\/2}$ exist. We will be examining a closed-form particular solution for $\\psi_2$ in Sec.~\\ref{sec:Sol} in quite some detail, so here, we present only a solution for $\\psi_1$. Assuming the interaction between the GW and the magnetized plasma begins at $t_0$, and that the $z$ extent of the plasma container is sufficiently large that at the time $t'$ concerned, all the regions where $\\mathcal{G}_1 >0$ are included within, then we have \n\\begin{eqnarray}\n\\psi_1 &=& 2 h_{\\times} \\Bigg[\\sin ^2\\frac{\\chi }{2} \\sin \\left(\\Delta _0 \\omega \\cos ^2\\frac{\\chi }{2}\\right) \\sin \\left(\\hat{\\xi}+\\frac{1}{2} \\omega \\Delta_0 \\cos \\chi \\right)\n\\notag \\\\\n&&-\\cos ^2\\frac{\\chi }{2} \\sin \\left(\\Delta _0 \\omega \\sin ^2\\frac{\\chi }{2}\\right) \\sin \\left(\\hat{\\xi}-\\frac{1}{2} \\Delta _0 \\omega \\cos \\chi \\right)\\Bigg]\\,, \\notag \\\\\n\\hat{\\xi} &\\equiv& \\phi_0-\\frac{1}{2} \\omega (t_0+t')-x' \\omega \\sin \\chi +\\omega z' \\cos \\chi\\,, \\label{eq:psi1Sol}\n\\end{eqnarray}\nwhere also $\\Delta_0\\equiv t'-t_0$.\n\nGiven the solutions for $\\psi_{1\/2}$, we will then need to reconstruct the original $\\alpha$ and $\\beta$ perturbation functions before we can compute the EM fields. From Eq.~\\eqref{eq:Defpsi}, we deduce that these quantities satisfy the two-dimensional elliptic equations \n\\begin{eqnarray}\n\\left(\\frac{\\partial^2}{\\partial x^2}+\\frac{\\partial^2}{\\partial y^2} \\right)\\alpha &=& -\\frac{\\partial \\psi_1}{\\partial y} + \\frac{\\partial \\psi_2}{\\partial x}\\,, \\label{eq:AlphaFrompsi}\n\\\\\n\\left(\\frac{\\partial^2}{\\partial x^2}+\\frac{\\partial^2}{\\partial y^2} \\right)\\beta &=& \\frac{\\partial \\psi_1}{\\partial x} + \\frac{\\partial \\psi_2}{\\partial y}\\,. \n\\end{eqnarray}\nOnce again, we have a Green's function giving us the particular solution\n\\begin{equation}\n\\alpha =\\int\\frac{\\ln |\\rho-\\rho'|}{2 \\pi} \\mathcal{S}_{\\alpha}(\\rho')\\,d^2 \\rho \\,, \n\\end{equation}\nwhere $\\rho$ denotes locations on the $x-y$ plane, $\\mathcal{S}_{\\alpha}$ represents the right hand side of Eq.~\\eqref{eq:AlphaFrompsi}, and a similar solution exists for $\\beta$. A further integration by parts allows us to write \n\\begin{eqnarray}\n\\alpha({\\bf x}) &=& \\int dx' dy' \\frac{\\Delta_x\\psi_2(x',y',z)-\\Delta_y\\psi_1(x',y',z)}{2 \\pi [\\Delta_x^2+\\Delta_y^2]}\\,, \\\\\n\\beta({\\bf x}) &=& \\int dx' dy' \\frac{\\Delta_x\\psi_1(x',y',z)+\\Delta_y\\psi_2(x',y',z)}{2 \\pi [\\Delta_x^2+\\Delta_x^2]}\\,,\n\\end{eqnarray}\nwhereby $\\Delta_x\\equiv x-x'$ and $\\Delta_y \\equiv y-y'$. It turns out that symbolic manipulation software such as \\verb!Mathematica! are capable of generating closed-form expressions for $\\alpha$ and $\\beta$ that correspond to the $\\psi_1$ given by Eq.~\\eqref{eq:psi1Sol}. The expressions are too long and tedious to be reproduced here, but the integrands are straightforward to input. On the other hand, the closed-form fast-magnetosonic wave we examine in the next section will have simple expressions for $\\alpha$, $\\beta$, as well as the Faraday tensor. \n\n\nWe have (here and in the next section) thus given closed-form particular solutions to both of the inhomogeneous Eqs.~\\eqref{eq:FFE1} and \\eqref{eq:FFE2}, which can be combined with homogeneous solutions to generate general solutions satisfying different boundary and initial conditions. For more complicated $\\mathcal{S}_{1\/2}$ than considered in this paper, numerical integrations can be utilized to yield the various quantities.\n\n\\section{The accumulative solutions} \\label{sec:Sol}\nIn this section, we specialize to an exact solution that resembles the vacuum inverse-Gertsenshtein effect most closely, and is therefore the most relevant for HFGW detection. \nEqs.~\\eqref{eq:FFE1} and \\eqref{eq:FFE2} are simple enough that we can isolate such interesting solutions straight away. We expect efficient GW to PW conversion to be more likely when the two types of waves can co-move in the same direction and retain a constant relative phase. For the Alfv\\'en waves, the intrinsic propagation direction is along the $z$ axis, but the source term on the right hand side of Eq.~\\eqref{eq:FFE1} vanishes when $\\chi=0$. There is however no restriction on the propagation direction for the fast-magnetosonic waves, and therefore we concentrate on this variety. \nMore specifically, we search for solutions that depict the following scenario: that the GW travelling in the direction determined by $\\chi$ excites a fast-magnetosonic wave moving in the same direction, which continues to siphon energy off of the GW while it propagates. Indeed, the following ansatz \n\\begin{eqnarray} \\label{eq:Solpsi2Raw}\n\\psi_2 = \\frac{\\zeta}{4} h_{+} \\omega \\sin^2\\chi \\sin \\xi\\,,\n\\end{eqnarray}\nsolves Eq.~\\eqref{eq:FFE2}, where $\\zeta = t-x \\sin \\chi +z \\cos \\chi$ is the ``advanced'' time (with $\\xi$ being the retarded time) that measures distance along the propagation direction. Therefore, the PW grows linearly in amplitude as it propagates, and it is in this sense we term the solution ``accumulative\". \n\n\\begin{figure}[t,b]\n\\includegraphics[width=0.95\\columnwidth]{Setup2.pdf}\n\\caption{A schematic depiction of the interactions. The plasma and a strong magnetic field (black arrows) in the $z$ direction is contained between the two green screens. The GW (black wiggles) traverses the magnetic field orthogonally from the right. A fast-magnetosonic wave (red wiggles) is induced which grows linearly over distance along $-x$, resulting in a small Poynting flux being registered on the left screen. \n}\n\\label{fig:Setup}\n\\end{figure}\n\nBelow, we will concentrate on this type of growing solutions and elucidate their properties, which would be useful if actual experimental apparatus is to be designed to exploit it in the detection of HFGW. We also note that the source term on the right hand side of Eq.~\\eqref{eq:FFE2} is the largest when $\\chi=\\pi\/2$ (GW propagating along the magnetic field generates no current \\cite{1983PhRvD..28.2382M,1990ApJ...362..584M}), and we will assume this value for the experimental setup. We will however retain $\\chi$ in our formulae in order to present as generic a solution as possible, to facilitate application to other occasions. Schematically, we trap a strongly magnetised plasma in-between two screens as depicted in green in Fig.~\\ref{fig:Setup} (for simplicity, we will set $x=0$ on the right screen where the GW first comes into contact with the plasma), and examine the PW generated by the GW in that region. \nFor comparison, we mention that a growing vacuum EMW would similarly be induced by the GW if the plasma is evacuated from the magnetized region. This phenomenon is commonly termed the inverse-Gertsenshtein effect \\cite{Gertsenshtein62,Lupanov67,1977PhRvD..16.2915D}, and ours is essentially a force-free version of it. \n\nBefore we compute the relevant field quantities, a few remarks regarding the growing solutions for $\\psi_2$ are in order. First of all, the advanced time $\\zeta$ has an arbitrary initial value. Taking the transformation $\\zeta \\rightarrow \\zeta+\\zeta_0$ with a constant $\\zeta_0$ will simply introduce an additional contribution that solves the homogeneous part of Eq.~\\eqref{eq:FFE2}. Physically, the value of $\\zeta_0$ is determined by the initial condition at wherever the GW begins to interact with the plasma, and whether there has already been a seed wave present then. Furthermore, the $\\zeta$ in Eq.~\\eqref{eq:Solpsi2Raw} can be broken into components, and the segmental expressions falling out such as \n\\begin{eqnarray}\n\\psi_2 = \\frac{t}{2} h_{+} \\omega \\sin \\xi \\sin^2\\chi \\,,\n\\end{eqnarray}\nalso solve Eq.~\\eqref{eq:FFE2}. These solutions represent essentially the same physics of amplitude growth during concurrent GW-PW propagation (along null geodesics of constant $\\xi$), but with a rescaling and a geodesic-dependent translation of the affine parameter $\\zeta$. Which particular form of the growing solutions to use obviously depends on the boundary conditions we wish to impose, and as we will enforce a no-initial Poynting flux condition on the entrance screen at $x=0$, it turns out that the most convenient choice is of the form\n\\begin{eqnarray} \n\\psi_2= -\\frac{x}{2} h_+ \\omega \\sin \\xi \\sin\\chi\\,.\n\\end{eqnarray}\n\nNote that we have the freedom to add freely propagating waves (solutions to the homogeneous part of Eq.~\\ref{eq:FFE2}) to the solution to help enforce boundary and initial conditions. In order to avoid being overly restrictive, given that we do not know of the detailed properties of the would-be detectors, and the initial conditions for their interaction with GWs, we look for steady state solutions representing the plasma after interacting with a long GW train for a significant amount of time, and only impose the boundary condition that the screen at $x=0$ does not inject any Poynting flux into the cavity, so that flux registered on the left screen comes from the GW conversion. \nBecause we do not enforce boundary conditions on the other surfaces of the plasma cavity, our solution will not be unique, we instead examine a representative solution, given by \n\\begin{eqnarray} \n\\psi_2= -\\frac{1}{2} h_+ \\Big(\\cos \\xi +x \\omega \\sin \\xi \\sin \\chi \\Big) \\,. \\label{eq:Solpsi2} \n\\end{eqnarray}\n\nWith Eq.~\\eqref{eq:Solpsi2} and the assumption that $\\psi_1=0$, the solutions to Eq.~\\eqref{eq:Defpsi} are easy to obtain by inspection, giving us\n\\begin{eqnarray} \\label{eq:alphabeta}\n\\alpha= -\\frac{x}{2} h_+ \\cos \\xi \\,, \\quad \\beta=0\\,,\n\\end{eqnarray} \nwhich indeed satisfy the original equations \\eqref{eq:AlphaEq} and \\eqref{eq:BetaEq} for these entities. We caution that solution \\eqref{eq:alphabeta} is valid only when either $h_{\\times} = 0$, or $\\chi=\\pi\/2$, or $\\chi=0$. This is because our solution corresponds to $\\psi_1=0$, but a vanishing $\\psi_1$ is only a solution to Eq.~\\eqref{eq:FFE1} when the right hand side of that equation vanishes. For compactness, we will not display the equations for each case separately, but readers should bear in mind this constraint when applying the formulae below. \n\nSubstituting Eq.~\\eqref{eq:alphabeta} into Eq.~\\eqref{eq:Faraday} for the Faraday tensor, we can subsequently compute the electric field ${\\bf E}$ through \n$E^a = F^{ab}\\tau_b$, where $\\tau_b$ is the time-like one form orthogonal to spatial slices of constant $t$, and magnetic field $B^d = (1\/2)\\epsilon^{abcd}F_{ab}\\tau_c$, as well as the Poynting vector ${\\bf P}={\\bf E}\\times {\\bf B}$ (we adopt the convention that $\\epsilon^{0123}=-1$, so $\\epsilon^{123}=\\tau_a\\epsilon^{a123}=1$ in the Minkowski limit). We use perturbed metric for the computation, but keep the results upto only linear order in $h$, which are (all contravariant spatial vectors)\n\\begin{eqnarray}\n{\\bf E}^{(1)}&=& \n\\frac{x}{2} B_0 h_+ \\omega \\sin \\xi \n\\begin{pmatrix} 0 \\\\ 1 \\\\ 0\\end{pmatrix}\n\\,, \n\\quad \n{\\bf B}^{(0)}= \nB_0\\begin{pmatrix} 0 \\\\ 0 \\\\\n1\\end{pmatrix} \\,,\n\\label{eq:ElecE} \\\\\n\\notag \\\\\n{\\bf B}^{(1)}&=& -\\frac{1}{2} B_0 h_+ \\cos \\xi\n\\begin{pmatrix} 0 \\\\ 0 \\\\ 1\\end{pmatrix} \n-\\frac{x}{2} B_0 h_+ \\omega \\sin \\xi\n\\begin{pmatrix} \\cos \\chi \\\\ 0 \\\\\n\\sin \\chi \\end{pmatrix}\n\\,, \\label{eq:MagB} \\\\\n{\\bf P}^{(1)}&=& \\frac{x}{2} B_0^2 h_+ \\omega \\sin \\xi \\begin{pmatrix} 1\\\\0\\\\0 \\end{pmatrix} \n\\,, \\label{eq:Power}\n\\end{eqnarray}\nwhere we note that for our steady state solution, there is a component in ${\\bf B}^{(1)}$ that does not grow linearly in $x$. Nevertheless, there is no first order Poynting flux at $x=0$. In more details, the ${\\bf P}^{(1)}$ above is produced by crossing the induced electric field with the background magnetic field . This first order flux oscillates between going in the positive and negative $x$ directions, and would not contribute to a temporally integrated signal. A consistent flux (without periodic sign reversals causing nearly cancelling positive and negative accumulations) associated with a propagating wave on the other hand, comes from the second term of\n\\begin{align}\n\\mathcal{P}^{(2)} \\equiv {\\bf E}^{(1)} \\times {\\bf B}^{(1)} \n=& -\\frac{x}{8} B_0^2 h_+^2 \\omega \\sin 2\\xi \\begin{pmatrix} 1 \\\\ 0 \\\\0 \\end{pmatrix} \n\\notag \\\\ \n&- \\frac{x^2}{4} B_0^2 h_+^2 \\omega^2 \\sin ^2\\xi\n\\begin{pmatrix} \\sin \\chi \\\\ 0 \\\\ -\\cos \\chi \\end{pmatrix}\\,.\n\\end{align}\nWe caution that $\\mathcal{P}^{(2)}$ does not constitute the entirety of the second order Poynting flux ${\\bf P}^{(2)}$, as there is a contribution from the second order ${\\bf E}^{(2)}$ crossing with the background ${\\bf B}^{(0)}$. The examination of such a term is beyond the scope of our current investigation, but it may nevertheless contain a part that does not average out over time. \n\nWith PWs, charges and currents are allowed, which can be computed by simply noting that half of the Maxwell's equations are given by $d*{\\bf F}={\\bf J}$, where ${\\bf J}$ is the current 3-form, relating to the usual $4$-current density $j^a$ (zeroth component being the charge density $\\rho$) via $j^a = (1\/3!)\\epsilon^{abcd} J_{bcd}$. To first order in metric perturbation, we have \n\\begin{eqnarray} \\label{eq:Current}\n\\rho^{(1)} = 0\\,, \\quad \n{\\bf j}^{(1)}= B_0 h_{\\times} \\omega \\sin \\xi \\sin \\chi \\begin{pmatrix} \\cos \\chi \\\\ 0 \\\\ \\sin \\chi \\end{pmatrix} \\,, \n\\end{eqnarray}\nwhere the cross polarization $h_{\\times}$ is introduced, and $h_+$ removed, when taking the Hodge dual to obtain $*{\\bf F}$. When $\\chi=\\pi\/2$ so we can have $h_{\\times} \\neq 0$, the nonvanishing last row of ${\\bf j}^{(1)}$ is simply $j_0^z$ (see Eq.~\\eqref{eq:BGCurrent}) that does not need to be removed by the PWs (see discussion in Sec.~\\ref{sec:Ana}). We also do not need to be concerned with $h_{\\times}$ generating Alfv\\'en waves, as the source term in Eq.~\\eqref{eq:FFE1} vanishes when $\\chi=\\pi\/2$.\nNow that we have the explicit expression for $j^a$, it is easy to verify that Eq.~\\eqref{eq:FFECond} is indeed satisfied. \n\n\\section{The high frequency gravitational wave detector} \n\\label{sec:Det}\n\nIn the absence of a GW, the plasma will be quiescent, with microwave detectors on the left hand screen registering no Poynting flux. When a GW wave train traverses the magnetic field orthogonally, a fast-magnetosonic wave is produced, which grows in amplitude as it propagates. Such a wave is described by Eq.~\\eqref{eq:Solpsi2}. The dominant instantaneous energy flux recorded on the left screen at $x=-L$ is subsequently given by Eq.~\\eqref{eq:Power}, which when translated into SI units becomes (unit of $P$ is watts per square meter)\n\\begin{align}\\label{eq:SignalAmpInst}\nP_x^{(1)}=2.0\\times 10^{-12} B_{10}^2 L_{10} \\omega _{\\text{GHz}} h_{+-30} \\sin \\xi \\,,\n\\end{align}\nwhere \n\\begin{eqnarray}\nB_{10}&=&B_0\/(10\\text{Tesla})\\,, \\,\\, h_{+-30} = h_+\/10^{-30}\\,, \\,\\, h_{\\times-30} = h_{\\times}\/10^{-30}\\,, \\notag \\\\ L_{10}&=&L\/(10 \\text{m})\\,, \\,\\, \\omega _{\\text{GHz}} = \\omega\/(5\\times 10^9 \\text{Hz})\\,,\n\\end{eqnarray}\nare dimensionless rescaled quantities normalized by typical values (experimentally reasonable and commonly shared across different HFGW source predictions) \\cite{Li:2009zzy}. \nThe time-averaged flux due to the propagating wave on the other hand, appears at the next order, and evaluates to\n\\begin{align}\\label{eq:SignalAmpAvg}\n\\langle \\mathcal{P}_x^{(2)}\\rangle =-8.3\\times 10^{-41} B_{10}^2 L_{10}^2 \\omega _{\\text{GHz}}^2 h_{+-30}^2 \\sin \\chi\\,.\n\\end{align}\nWe notice that, as typical for HFGW detection, higher frequencies can compensate for low strains \\cite{1674-1056-22-12-120402}.\n\nThe time-averaged flux \\eqref{eq:SignalAmpAvg} is at the $\\mathcal{O}(h^2)$ order, thus comparable to the vacuum inverse-Gertsenshtein effect \\cite{Li:2009zzy}. In addition, we do not expect the remaining part of ${\\bf P}^{(2)}$ from ${\\bf E}^{(2)}\\times {\\bf B}^{(0)}$ to provide significant enhancements, as that term would also be proportional to $B_{10}^2 h_{-30}^2$ and would unlikely contain much higher powers of $\\omega_{\\text{GHz}}$ ($L_{10}$ shares the same power for dimensional reasons). This is because even with new second order source terms being introduced into the right hand sides of Eq.~\\eqref{Eq:psiEqs}, the differential operators would still contain only two derivatives in order for the dimensions to match up, therefore we do not have extra derivatives to bring out additional factors of $\\omega$. Furthermore, numerical factors appearing in our geometrized unit computations are all of moderate values, often arising from combinatorics tied down to the $3+1$ dimensionality of our spacetime, so there is unlikely significant boosts from large newly emerging coefficients in the second order computations. In contrast, the state of art photodetector sensitivity circa 2012 is $10^{-22}$W \\cite{Cruise:2012zz}. Consequently, detecting this temporally averaged flux is not feasible. \n\nHowever, we notice that the instantaneous flux \\eqref{eq:SignalAmpInst} is at $\\mathcal{O}(h)$ and is comfortably measurable from a purely power amplitude point of view, provided that the detector is located inside of the magnetized region. With previous detector designs searching for GW to vacuum EMW conversions, the photodetectors are placed outside of the screens that are presumed transparent to the EMW (see Fig.~2 in Ref.~\\cite{Cruise:2012zz}), even though a similar first order effect should be present in that case as well (see e.g. Eq.~1 of Ref.~\\cite{1674-1056-22-12-120402}). This may be due to concerns regarding the effect of the magnetic field on the photodetector (although this issue appears manageable \\cite{Beznosko:2005sy}), or uncertainty in whether a photodetector is capable of registering such a rapidly sloshing energy flux. After all, Eq.~\\eqref{eq:SignalAmpInst} does not represent a steady stream of photons moving towards either the positive or the negative $x$ direction. \n\nWith PWs however, there is an accompanying current, also at $\\mathcal{O}(h)$, due to the kinetic motion of the plasma particles, which may be more readily detectable given that no photon to current conversion is required. Specifically, currents flowing in either direction is permitted, and a direct measurement of the first order effect simply as a high frequency alternating current may be possible. We have computed the current and charge densities for the growing solution, given by Eq.~\\eqref{eq:Current}, which in SI units takes the value of (with units of amperes per square meter, and we set $\\chi=\\pi\/2$ so $h_{\\times}$ does not need to vanish)\n\\begin{align}\n{\\bf j}^{(1)} = 1.3\\times 10^{-22} B_{10} h_{\\times -30} \\omega _{\\text{GHz}} \n\\sin \\xi \n\\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix}\\,. \n\\end{align}\nThe dependence of the current density on $x$ through $\\xi$ means that the current collector would likely need to be stratified along the $x$ direction, with signals from adjacent stripes (each of half a wavelength, or $3\\pi\/(50\\omega_{\\text{GHz}})$ meters) aggregated by subtraction instead of addition, to ensure that positive and negative contributions in the current density do not cancel out. This may also help subtract out some of the background stray noise currents. If we manage to construct a current collecting area of ten meters by ten meters, and perhaps increase the target frequency range (note $\\omega_{\\text{GHz}}$ is angular frequency) and\/or magnetic field strength, we can bring the total current to the atto ($10^{-18}$) ampere regime, for which measurement equipments are already available at the turn of the century \\cite{measurementbook}, and the state of the art may be even more sensitive. \n\n\\section{Discussion \\label{sec:Dis}}\nIn this paper, we have studied the force-free version of the inverse-Gertsenshtein effect, and obtained explicit solutions, allowing us to compute the first order currents that were not present in the vacuum case, offering possibly a new avenue for detecting HFGW. Specifically, we have considered a quiescent background configuration, where the magnetic field is constant in space and time. There is no background electric field, Poynting flux, or current density present in the absence of a GW. We then target nascent electrical current or Poynting flux converted from the GW for detection. \n\nIn other words, our consideration has been restricted to detectors of the ``conversion\" type \\cite{Cruise:2012zz,Gertsenshtein62,Lupanov67,1970NCimB..70..129B,DeLogi:1977qe,Cruise:2012zz}. Our computation shows that temporally averaged Poynting flux for the induced PW is at the $\\mathcal{O}(h^2)$ order, which turns out to be the same for the vacuum cases, and thus the introduction of plasma is unlikely to lead to feasible detectors of the traditional photodetection design. \nIn previous literature, more complicated designs termed \nthe ``geometric\" types \\cite{1978PhLA...68..165P,\n1972GReGr...3..401B,\n1976GReGr...7..583B,\n1974NCimB..19..105T,\n1966PhRv..142..825Z,\n1975PThPh..54.1309T,\n1993ApJ...418..202F,\n1968AnPhy..47..173C,\n1971PhRvL..26.1398B,\n1975GReGr...6..329B,\n1983MNRAS.204..485C,\n2000CQGra..17.2525C,\nCruise06,\nLi:2009zzy} have also been proposed. With such detectors, effects depending on the GW amplitude at the first order is seen in e.g., the polarization state or frequency, of a strong background EMW. Such more subtle characteristics of a EMW tends to be relatively difficult to measure however, and the demand on the purity of the background EMW is also high, so one faces not only a detection problem, but also a generation one. In contrast, the current associated with the PW also appears at the $\\mathcal{O}(h)$ order, but requires fewer intermediate stages before a signal readout can be taken, in addition to needing no nontrivial backgrounds. So introducing plasma may perhaps lead to more sensitive ammeter designs of the conversion type. \n\nAlthough beyond the scope of this paper, one may of course also consider geometric type force-free detectors, where background Alfv\\'en or fast-magnetosonic wave pulses are launched through the plasma cavity, and emerge altered by the GW. \nThe examination of such design choices should be carried out in conjunction with an investigation into technological options, and the general method introduced here should be adaptable to such studies. \n\nLastly, we note that although there is no background current or Poynting flux in theory, the motion of the plasma particles may not conform to force-free electrodynamics perfectly in practical situations, or vibrations of the apparatus may launch unwanted waves (sound wave conversion). Therefore, some level of stray background radiation and current is to be expected, which is likely stochastic. On the other hand, although we have used a clean monochromatic long GW train for analysis, the predicted HFGW signals are also mostly stochastic, and the standard method for analysing such signals is by examining the correlation between readouts from two detectors placed in close proximity \\cite{Cruise06}. This poses certain technical challenges, for example, the local vibrations at the two detectors would also be correlated. In addition, the usual gravity gradient noise etc., all need to be carefully investigated, and so in the end, the noise budget, instead of device sensitivity, may well prove to be the limiting factor for the ammeter detectors. \n\n\\acknowledgements\nWe thank Hao Wen for discussions regarding HFGW detector noises, and an anonymous referee for helpful suggestions that led to the introduction of Secs.~\\ref{sec:Ana} and \\ref{sec:Gen}. F.~Z.~is supported by the National Natural Science Foundation of China grants 11443008 and 11503003, Fundamental Research Funds for the Central Universities grant No.~2015KJJCB06, and a Returned Overseas Chinese Scholars Foundation grant. \n\n \n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\\label{sec:intro}\nThe promise of Digital Agriculture is to feed the growing population of the world with a smaller footprint---less irrigation, agrochemicals, and space. There has long been talk of using computing technologies to make that promise a reality. Yet, this has not come to pass for several reasons, three of which are relevant to our discussion here. \\textit{First}, the sensors to capture fine-grained spatial and temporal data are either not available, are expensive, or are error-prone. \\textit{Second}, the ML platforms are not flexible enough to cater to the varied needs of the different farms. \\textit{Third}, the computing equipment is not available, such as to run fast analytics at the edge, and the wireless communication is unreliable, sparse, or not available at the bandwidth required.\n\nIn the digital agriculture model, equipments such as field cameras, temperature sensors, humidity monitoring sensors, and aerial drones are deployed for data acquisition. These generate streaming, often real-time data, which can be harnessed to guide production decisions, support preventive maintenance of equipment, develop intelligent logistics, and diversify risk management methods, thereby optimizing the efficiency of resource allocation. There is still a large room for improvement, considering the relative lag of agricultural digitization vis-\\`a-vis scarce resources for feeding the world.\n\nIn {\\sc Orpheus}\\xspace, we describe an end-to-end production pipeline of sensing-actuation, transport, and analytics to enable timely actions in digital agriculture toward sustainable agricultural practices. It brings together deploying low-cost energy-saving sensors in a ``living lab'' setting, wireless networking and information theory, applied data analytics, and domain expertise in digital agriculture. We demonstrate {\\sc Orpheus}\\xspace in operational farm settings --- at Purdue's experimental farms (Agronomy Center for Research and Education (ACRE) and Throckmorton Purdue Agricultural Center (TPAC)) and commercial production farms in counties in the vicinity of Purdue, such as Benton and Warren counties. Our vision is logically organized into three categories --- {\\bf Sense} (sensor deployment in the living lab environment, Fig.~\\ref{fig:nitrate},~\\ref{fig:soil-2}), {\\bf Transport} (wireless networking, Fig.~\\ref{fig:topology}), and {\\bf Analyze} (anomaly detection notifications, database aggregation, and dashboard for visualization, Fig.~\\ref{fig:grafana},~\\ref{fig:website},~\\ref{fig:pdr})\\footnote{We make a subset of the data collected from our living lab testbed available for broad research use at~\\cite{purduewhin-sensor-list}. We exclude all data that is privately owned and released by the data owner.}. \n\n\n\\begin{figure*}[htbp]\n \\centering\n \\includegraphics[width=0.85\\textwidth]{Figures\/topology.png}\n \\caption{\n \n \n {Three-layer IoT network topology of our living testbed: SNs, Gateway, and the backend servers. The SNs and LoRa Gateways form an LPWAN using LoRa wireless connection at the edge.\n The LoRa Gateways upload the data collected from the SNs to the backend over TCP\/IP, or forward it to a nearby LoRaWAN Gateway, depending on the availability of Internet access.}\n \n \n Finally, data visualization is built using a Grafana dashboard based on the data at the backend server.}\n \\label{fig:topology}\n \\vspace{-1em}\n\\end{figure*}\n\n\\noindent In {\\sc Orpheus}\\xspace, we make the following contributions:\n\\begin{enumerate}[leftmargin=1em]\n \\item We have deployed a living testbed with dozens of low-power sensors, deployed in a 3-county region, \n \n \n in northern and central Indiana. We show an end-to-end IoT network building scheme in real farms. See our network topology in Fig.~\\ref{fig:topology}. Our network consists of: the edge part that uses SNs (sensor networks, {\\em i.e.,}\\xspace network of embedded devices with sensors) to collect data, and the Gateway nodes, which gather data from all the local SNs. Then, gateway(s) will send all the data to a central server where we have a frontend to visualize the data. We use long-range wireless communication (specifically LoRa) to send data from the SNs to the gateway, which can be miles apart, forming an LPWAN (low-power wide area network or simply LPN, {\\em i.e.,}\\xspace low-power network). Our SNs are power-saving and field-environment resistant, allowing for collection of data over months using standard batteries. Our experience is that these SNs last for 3-5 months on 4 AAA batteries, which we plan on reducing further using our data reduction algorithm, as described in our system---Ambrosia~\\cite{suryavansh2021ambrosia}.\n \n We call this real IoT network a \\textit{living testbed} for use in downstream applications, such as approximate computer vision applications to monitor crop health, or livestock monitoring.\n \\item We also built an embedded testbed in our lab that consists of System-on-Chips (SoCs) from NVIDIA, used for benchmarking various lightweight IoT and object detection protocols~\\cite{chaterji2020cloud, emdl2021} for use in surveillance in our experimental farms, {\\em e.g.,}\\xspace in livestock monitoring~\\cite{suryavansh2021ambrosia}. \n \n \n \n We leverage heterogeneous edge devices, as follows, in our testbed: \\textit{NVIDIA Jetson Nano}, which has 4GB memory, and a 128-core Maxwell GPU; \\textit{NVIDIA Jetson TX2}, which has 8GB memory, and a 256-core Pascal GPU; \\textit{NVIDIA Jetson Xavier NX}, which has a 8GB memory, and a 384-core Volta GPU with 48 Tensor cores; and NVIDIA Jetson AGX Xavier, which has 32GB memory and 512-core Volta GPU. These Jetson-class devices~\\cite{nano,tx2,xaviernx,agxxavier} feature compute-constrained, ML-capable GPUs, and range in price from \\$100 to \\$700.\n We use this testbed to perform computer vision tasks ranging from object classification to object detection to apply to digital agriculture scenarios. Further, drones can be used as data ferries for opportunistically offloading data from the SNs to the gateway nodes in the case of sparse or intermittent connectivity or for offloading large volumes of data. In addition, drones can be equipped with additional embedded devices as payloads to do custom-object detection using our specialized embedded computer vision software~\\cite{emdl2021}, such as ApproxNet for object classification~\\cite{xu2019approxnet} and ApproxDet for object detection~\\cite{xu2020approxdet}.\n \\item We bring out insights about the three aspects of IoT---\\textit{Sense, Transport, and Analyze}---realized through actual (farm) deployments. These insights can serve to enable further efforts both in research and in development of production IoT networks. \n \\end{enumerate}\n \n \n \n \n\n\n\n \n \n\n\n\n\n\n\n\n\n\\begin{comment}\nSolchip was interested in partnering with Purdue & WHIN, so is a good \"tech company\" to vet, so to speak.\nhttps:\/\/sol-chip.com\/sensors\/\n\nSolchip contact comes from WHIN. Solchip is ``LoRa-fying'' their weather stations.\nComparatively - in very casual terms, FarmBeats is yoyo \u2026 you're on your own.\n\nhttps:\/\/www.davisinstruments.com\/enviromonitor\/#gateway -- solchip's box\n\nhttps:\/\/thelightbug.com \u2014 this is the one that is used for one my collaborators' trackers .. we haven't used these but have data from these\n\nhttps:\/\/store.rakwireless.com\/collections\/wisnode\/products\/rak7204-lpwan-environmental-node\n\nhttps:\/\/www.davisinstruments.com\/product_documents\/weather\/EM-sensors.pdf\n\nhttps:\/\/www.digikey.com\/en\/products\/detail\/tektelic-communications-inc\/T0005247\/11203700\nhttps:\/\/www.digikey.com\/en\/products\/detail\/tektelic-communications-inc\/T0004855\/11203703\n\nhttps:\/\/store.rakwireless.com\/collections\/wisnode\/products\/rak7205-lpwan-tracker-node?variant=27837945413732\nhttps:\/\/thelightbug.com \u2014 this is the one that is used for one my collaborators' trackers .. we haven't used these but have data from these\nhttps:\/\/store.rakwireless.com\/collections\/wisnode\/products\/rak7204-lpwan-environmental-node\n\nhttps:\/\/www.davisinstruments.com\/enviromonitor\/#gateway\nhttps:\/\/www.davisinstruments.com\/product_documents\/weather\/EM-sensors.pdf\n\\end{comment}\n\\section{Looking Ahead}\n\\label{sec:looking-ahead}\n\\noindent Big data and precision agriculture will likely be a disruptive force in the farm economy over the medium to long-term range. Digital agriculture, with the incorporation of IoT-based technologies, presents the ability to evaluate a system at multiple levels (individual, local, regional, and global) and generate tools that allow for improved decision making in every sub-process related to digital agriculture.\n\n\\begin{comment}\nAn important focus of the paper is on the convergence of IoT and ML on the one side and agricultural sustainability on the other. The ability to track virtually every farm activity through ubiquitous and inexpensive sensors has spurred efforts to increase sustainability and can be verified and certified by third-parties. \nFor example, there are already commercial efforts to monetize on-farm carbon sequestration for farms using regenerative practices~\\cite{indigoag}. Blockchain technology promises to increase sustainability and ensure food safety by authenticating information across the food system~\\cite{nagaraj2019panel}. In additional to privacy concerns, adoption of precision agriculture and big data is limited by the availability of broadband internet in rural areas~\\cite{whitacre2014connected}. Thus, looking at the policy angle, integrated farm equipment and sensors pipe data up to the cloud in real time meaning farmers are more reliant on upload speeds than the typical user. The societal returns to rural broadband are large though immediate private gains are often unclear. This suggests that high-speed internet will be under-supplied in the market and stresses a role for governmental support. This has been argued by federal government sources like USDA~\\cite{usda-broadband-2019} as well state government sources, such as in Indiana~\\cite{grant2018broadband}. \n\\end{comment}\n\\begin{comment}\n\\noindent Big data and precision agriculture will likely be a disruptive force in the farm economy over the medium to long-term. Technological advancements have led to farm consolidation in the past. Newer and more efficient tools reduce per-unit costs, allowing small and mid-size farms to become more profitable and therefore more prevalent. Moreover, economies of scale---the ability of large firms to spread investment costs over many units of production---allow large operations to exploit precision agriculture and big data tools earlier, potentially accelerating the consolidation trend~\\cite{coble2016advancing}. As mechanization continues and farm operations become more digitized, their labor needs will reduce and will become specialized. This could mitigate the so-called ``brain drain'' impacting many rural communities in the U.S.~\\cite{artz2003brain}. \n\nThe ability to track virtually every farm activity through ubiquitous and inexpensive sensors means that efforts to increase sustainability can be verified and certified by third-parties. \nFor example, there are already commercial efforts to monetize on-farm carbon sequestration for farms using regenerative practices~\\cite{indigoag}. Blockchain technology promises to increase sustainability and ensure food safety by authenticating information across the food system. In additional to privacy concerns, adoption of precision agriculture and big data is limited by the availability of broadband internet in rural areas~\\cite{whitacre2014connected}. Integrated farm equipment and sensors pipe data up to the cloud in real time meaning farmers are more reliant on upload speeds than the typical user. The societal returns to rural broadband are large though immediate private gains are often unclear. This suggests that high-speed internet will be under-supplied in the market and implying a role for external support. This has been argued by federal government sources like USDA~\\cite{usda-broadband-2019} as well state government sources, such as in Indiana~\\cite{grant2018broadband}. \n\\end{comment}\n\\section{Implementation of the Living Testbed of IoT Nodes}\n\\label{sec:living-testbed}\n{Here, we describe the components and technologies to set up the living testbed. First, we describe each of the components in Fig.~\\ref{fig:topology}, followed by how these components are integrated into our three-layer architecture.}\n\n\\subsection{{Components of sensor nodes (SNs)}}\n\\label{subsec:sensor-node}\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=0.9\\columnwidth]{Figures\/node.jpg}\n \\caption{Packaged SNs connected with soil, and nitrate sensors. Location: Purdue University main campus.}\n \\label{fig:node}\n\\end{figure}\n\n\\noindent{\\customsec{Embedded Boards for our Digital Agriculture Application}}\nThe following features are considered while designing the SN (shown in Fig.~\\ref{fig:node}) for our living lab: 1) Durability; 2) Energy efficiency; 3) Ruggedized packaging.\nFig.~\\ref{fig:pcb} shows the printed circuit board (PCB) used for our SN. The most important component is the HM200 module from HuWoMobility~\\cite{HuWoMobility}. It includes a Nordic nRF52832 SoC~\\cite{nRF52832} (with a 512 KB Flash and 64 KB RAM) and a Semtech SX1262 chip~\\cite{SX1262}, allowing both Bluetooth Low Energy (BLE) and LoRa wireless communication protocols, respectively. Fig.~\\ref{fig:pcb_design} shows the block diagram of the custom PCB used in our testbed.\nSX1262 has the following features: a) designed for a long battery life---only 4.2 mA of active current consumption; b) transmits up to +15dBm, with a highly efficient integrated power amplifier; c) supports LoRa modulation and LoRaWAN protocols, which makes the model configurable to satisfy different application demands; d) continuous frequency coverage from 150MHz to 960MHz allows the support of all major sub-GHz ISM bands around the world. Besides the microcontroller module, our SN includes an on-board temperature and humidity sensor HDC2010~\\cite{hdc2010} from Texas Instruments, one antenna port for LoRa, and one port for BLE.\nIn addition, 8 sensor ports can be connected with 4 nitrate sensors and 4 soil sensors.\n\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/pcb.png}\n \\caption{Embedded board (sensor node) with LoRa and BLE modules, on-board temperature \\& humidity sensors (HDC2010), 2 antenna ports---the 915MHz port for LoRa and the 2.4GHz port for BLE---8 sensor ports to connect with external sensors, the ADC module converts the analog signal from nitrate sensors to a digital signal, and the LEDs are for functional checking.}\n \\label{fig:pcb}\n\\end{figure}\n\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/pcb_design.png}\n \\caption{Block diagram of the embedded board for SN.}\n \\label{fig:pcb_design}\n\\end{figure}\n\n\\customsec{On-board Temperature \\& Humidity Sensor}\nThe HDC2010 is an integrated humidity and temperature sensor that offers high precision measurements with low power consumption in an ultra-compact Wafer-Level Chip Scale Package. The HDC2010 includes a heating element to dissipate condensation and moisture, improving its reliability. It is also resilient against dirt, dust, and other environmental contaminants. Moreover, the HDC2010 digital features provide programmable interrupt thresholds that support alerts and device wakeups, without needing a microcontroller to continuously track the system. The HDC2010 supports operation from -40\u00b0C to +125\u00b0C, with a temperature accuracy of 0.2\u00b0C, and 0\\% to 100\\% relative humidity with an accuracy of 2\\%, which could satisfy a vast number of environmental monitoring IoT applications.\n\n\n\\noindent{\\textbf{Nitrate Sensor:}}\nOur node can be connected with, at most, 4 (in-house developed) nitrate sensors (see Fig.~\\ref{fig:nitrate} and Fig.~\\ref{fig:nitrate-2}), and 4 soil moisture sensors, respectively.\nThe nitrate sensors are flexible, screen-printed, detecting nitrate levels in the water. The sensors are comprised of reference and sensing electrodes. The electrodes are fabricated by printing silver ink onto a polyethylene terephthalate substrate. The sensing electrode is coated with an ion-selective membrane, which is selective to nitrate ions, and the rest of the sensor is passivated with a silicone solution. The reference electrodes are passivated at the sensing area. The difference between the nitrate-sensitive electrode and a reference electrode is used to determine the nitrate concentration~\\cite{jiang2019wireless}.\n\n\n\n\\begin{figure}[htbp]\n \\centering\n \\begin{minipage}[t]{0.47\\columnwidth}\n \\centering\n \\includegraphics[width=\\textwidth]{Figures\/nitrate.jpg}\n \\caption{Nitrate sensor of a sensor node in a farm drain tile. A tile drainage system consisting of a network of underground pipes allowing subsurface water to move out from between soil particles into the tile line.}\n \\label{fig:nitrate}\n \\end{minipage}\n \\hspace{0.02\\linewidth}\n \\begin{minipage}[t]{0.47\\columnwidth}\n \\centering\n \\includegraphics[width=\\textwidth]{Figures\/nitrate-2.jpg}\n \\caption{Nitrate sensor of a sensor node in a water quality field station~\\cite{wqfs} at Purdue's experimental farm---Agronomy Center for Research and Education (ACRE). The water is collected using a drainage system.}\n \\label{fig:nitrate-2}\n \\end{minipage}\n\\end{figure}\n\n\\customsec{TEROS 12 Soil Sensor}\nWe used a commercial soil moisture sensor TEROS 12~\\cite{teros}, as shown in (Fig.~\\ref{fig:soil}; Fig.~\\ref{fig:soil-2}). The TEROS 12 sensor for soil moisture, temperature, and electrical conductivity is reliable, easy-to-use, robust, yet economical. It incorporates METER's~\\cite{meter} 70 MHz trademark circuitry with a durable epoxy filling and firmly attached, sharpened stainless steel needles that can slide quickly into the soil. The probe is resistant to salts, preventing sensor degradation. It features very low power consumption, and offers improved accuracy over a longer period of time with a high resolution.\n\n\n\n\\begin{figure}[htbp]\n \\centering\n \\begin{minipage}[t]{0.47\\columnwidth}\n \\centering\n \\includegraphics[width=\\textwidth]{Figures\/soil.jpg}\n \\caption{TEROS 12 Soil Moisture Sensor from METER~\\cite{meter}.}\n \\label{fig:soil}\n \\end{minipage}\n \\hspace{0.02\\linewidth}\n \\begin{minipage}[t]{0.47\\columnwidth}\n \\centering\n \\includegraphics[width=\\textwidth]{Figures\/soil-2.jpg}\n \\caption{TEROS 12 SN placed at 15 cm depth.}\n \\label{fig:soil-2}\n \\end{minipage}\n\\end{figure}\n\n\n\\customsec{Enclosure}\nThe enclosure for the SN can achieve the IP67 Standard, which ruggedizing it. \nIP stands for ``Ingress Protection'' and is the International Protection Marking per IEC standard 60529.\n{The most common use of an IP rating is to show how protected a product is from a solid or liquid entering the product.}\nThe first digit indicates the level of protection a product has from a solid, {\\em e.g.,}\\xspace dust. The second digit indicates the level of protection from liquid intrusion in certain volumes, pressures, or temperatures. So, a sensor that is IP67 rated will remain protected and fully operational in most industrial applications, including those where it is exposed to water spray, rain, debris, etc. The ``6'' indicates the sensor is completely protected against solid objects from entering the sensor, including dust, while the ``7'' indicates the sensor can be completely submerged in 1 meter of water for up to 30 minutes before the moisture penetrates the housing.\nAn example of the deployed sensor is shown in Fig.~\\ref{fig:node-example} and Fig.~\\ref{fig:node-example-2} where the SN keeps working, even after being coated in ice in winter. \n\n\n\n\\begin{figure}[htbp]\n \\centering\n \\begin{minipage}[t]{0.47\\columnwidth}\n \\centering\n \\includegraphics[width=\\textwidth]{Figures\/node-example.png}\n \\caption{SN with antenna extension deployed during summer.}\n \\label{fig:node-example}\n \\end{minipage}\n \\hspace{0.02\\linewidth}\n \\begin{minipage}[t]{0.47\\columnwidth}\n \\centering\n \\includegraphics[width=\\textwidth]{Figures\/node-example-2.png}\n \\caption{The IP67 enclosure providing protection in winter.}\n \\label{fig:node-example-2}\n \\end{minipage}\n\\end{figure}\n\n\\subsection{Gateway}\n\\label{subsec:gateway}\nThe Gateway has two main functions: collecting the data from SNs deployed in the field and uploading the data to the backend database server.\nFirst, the Gateway collects the SN's measurements using LoRa modulation. Then, it backs up the data locally before transferring the readings to the backend over a TCP\/IP connection.\nIn cases of low network connectivity, the Gateway uses a multi-hop approach. Here, the Gateway forwards the data to a nearby LoRaWAN Gateway---using the LoRaWAN protocol---transferring the readings to the backend through TCP\/IP. We use this multi-hop setup in our LoRaWAN deployments, as shown in Fig.~\\ref{fig:multiple-hop}.\n\\begin{comment}\n\\newtext{Depending on the functionality, we can distinguish two types of Gateways: LoRa Gateways or LoRaWAN Gateways. The former --- LoRa Gateways --- collect readings from SNs using LoRa modulation. Then it transfer the measurements to the backend through ethernet cable, WiFi, or a LoRaWAN Gateway. The latter --- LoRaWAN Gateways --- is a standard LoRaWAN Gateway follow LoRaWAN protocol that can receiver signal from either LoRaWAN SNs or our LoRa Gateway.\nWe use LoRaWAN Gateways in our IoT network where an wired or short range Internet connection is not accessible from the LoRa Gateway.\nThus, \\emph{LoRa} deployments are the ones where the SN networks are connected to a LoRa Gateway, and \\emph{LoRaWAN} deployments are the ones where the SNs and LoRa Gateway are connected to a LoRaWAN Gateway.\nWe use Raspberry Pi~\\cite{pi} as our LoRa Gateway in our current deployments.}\n\\end{comment}\nWe built our LoRa Gateway using a Raspberry Pi. The device is equipped with a LoStik transceiver that supports LoRa modulation for reception and transmission, as well as an LPWAN concentrator, compatible with the LoRaWAN protocol. The LoStik is used to collect the measurements from the SNs, and the LPWAN concentrator allows multi-hop routing using LoRaWAN specification.\n\n\\customsec{Raspberry Pi}\nRaspberry Pis are lightweight and popular edge devices, varying in price from \\$35 to \\$140, and with an easily programmable interface for custom applications.\nRaspberry Pi (RPi) 4 Model B, shown in Fig.~\\ref{fig:gateway}(a), has a 1.5 GHz 64-bit quad core ARM Cortex-A72 processor, on-board 802.11ac WiFi, full gigabit Ethernet. The RPi 4 is powered via a USB-C port, enabling additional power to its downstream peripherals.\nThe operating system, RPi OS, is a Debian-based Linux distribution. The Gateway software runs on the RPi, which we manage remotely using SSH (Secure Shell) and VNC (Virtual Network Computing) protocols.\n\n\\customsec{LoStik}\n\\begin{comment}\nLoStik~\\cite{lostik} is a LoRa development tool as shown in Fig.~\\ref{fig:gateway}(b). The LoStik is affixed on top of the RN2903 or RN2483 LoRa Technology Transceiver Module. \nThe LoStik is an opensource USB dongle that plugs into any computer or device and connects it to the LoRa network.\n\\end{comment}\nThe LoStik~\\cite{lostik} is a USB LoRa device, as shown in Fig.~\\ref{fig:gateway}(b). The LoStik is based on the RN2903\/RN2483 LoRa Modules by Microchip, which enables seamless connectivity with LoRa\/LoRaWAN compliant devices. The USB dongle is affixed into the Raspberry Pi to provide a single communication channel to receive and send LoRa packets.\n\n\\customsec{LPWAN Concentrator}\nA LPWAN Concentrator module based on Semtech SX1302 enables integration of the RPi with other network equipment with LPWAN capabilities. The Concentrator can detect uninterrupted packets at 8 different spreading factors, providing 10 channels with continuous demodulation.\n\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/gateway.png}\n \\caption{(a) RPi 4 Model B, (b) LoStik Module with USB port, (c) LoRa Gateway: RPi and LoStik in an IP65 enclosure.}\n \\label{fig:gateway}\n \\vspace{-2mm}\n\\end{figure}\n\n\\subsection{Backend Server} \n\\label{subsec:backend-server}\nWe support our backend on a server with the following specifications: 8 Intel(R) Xeon(R) W-2123 CPU cores at 3.60GHz, NVIDIA Quadro P400 with 256 Pascal CUDA cores and 2 GB of GPU memory, 32GB Memory, 3TB Disk, using Ubuntu 18.04.4 LTS. This server provides the following software components: a NoSQL database and a Web Server (frontend) for \\emph{LoRa} deployments, and a time-series database and application server for \\emph{LoRaWAN} deployments.\n\n\\customsec{Databases}\nSpecifically for \\emph{LoRa}, we use MongoDB to store all the data collected from rural or urban areas.\nMongoDB is a NoSQL database that organizes data collection in JSON-like documents. The dynamic nature of data collected on the field requires a schemaless database like MongoDB. \nIn the meanwhile, for \\emph{LoRaWAN}, we use InfluxDB, a time-series database.\nThese databases are specifically built to handle metrics and time-stamped events. Furthermore, the data is indexed by the SN's identifier, which is useful to query the measurements from the visualization layer. We plan to integrate our autotuning software for increasing the performance of these databases both in conventional~\\cite{rafiki, sophia, optimuscloud} and serverless environments~\\cite{mahgoub2021sonic}.\n\n\\customsec{Application Server}\nThe application server is part of the LoRaWAN stack. \nThe server handles the LoRaWAN application layer, including handling join requests and session keys, uplink data decryption and payload decoding, downlink queuing, and data encryption. \nWe use ChirpStack~\\cite{chirpstack}, an open source solution, for our IoT network. ChirpStack provides a RESTful API and a Web interface to manage users, organizations, applications, and devices related to the LoRaWAN network. \nChirpstack, for example, can inventory and manage all LoRaWAN SNs deployed, configure gateways connected to the IoT network, and monitor the SN condition.\n\n\\customsec{Web\/Visualization Server}\nWe also built a website on a Web server using Django, a high-level Python Web framework.\nThe website allows the user to query the measurements and visualize them on charts or download them in a CSV file for offline analysis.\nA visualization layer for LoRaWAN deployments stored in the InfluxDB time-series database is also included in our IoT network.\nWe use Grafana~\\cite{grafana}, an open-source platform for monitoring and observability, which allows the user to query and visualize the data in dynamic dashboards. Moreover, the user can define alerts' rules to monitor changes.\n\n\\subsection{Three-layer IoT Network Architecture} \n\\label{subsec:network}\nIn this section, we describe our three-layer IoT network architecture. As we can see in Fig.~\\ref{fig:topology}, we use different technologies, including wireless communication and wired communication, to assemble the whole network. \nIn the bottom layer, the SNs send data to the Gateway through either LoRa or BLE. Then, the Gateway uploads the collected data to the backend server using a secure connection over TCP\/IP or LoRaWAN. Finally, the end-user can visualize, in real-time, the measurements collected from the field.\n{Next, we describe the three layers of our architecture.}\n\n\\begin{comment}\nAs you can see in Fig.~\\ref{fig:topology}, we build a three layer IoT network to collect data from the bottom layer--SNs to the Gateway, and then transfer all of the data to the cloud. When we build our network, we use different technologies including wireless communication and wire communication to assemble the whole network. The SNs send data to the Gateway through LoRa or BLE wireless connection, the Gateway can be a Raspberry Pi or a Mini-PC connected with a LoStik module. Then the Gateway connect to the Internet through WiFi, and then upload all the data collected at the edge to the database server through Hypertext Transfer Protocol Secure (HTTPS) connection. All the data is stored in MongoDB on the server. Finally, we have a website build by Django that can do real-time data visualization.\n\\end{comment}\n\n\\subsubsection{First Layer: Data Collection}\n\\label{subsubsec:data-collection}\nWhen building our IoT network, we face multiple decisions regarding the communication protocol between SNs and Gateway and among the SNs themselves, {\\em e.g.,}\\xspace a mesh network proposed in~\\cite{jiang2020hybrid}. If nodes are close to each other (1 to 100 meters), Wireless Local Area Network (WLAN) protocol, such as Bluetooth, WiFi, and ZigBee, are more suitable. In contrast, for long-range communications (a few kilometers in urban areas to over 10 km in rural areas), we need LPWAN protocols. Table~\\ref{tab:protocol} presents an overview of some of the most relevant LPWAN available standards: LoRaWAN, Narrow Band IoT (NB-IoT), and Sigfox.\n\n\\begin{comment}\nDepending on different scenario, we have two choices to send data from the SNs to the Gateway, one method is using LoRa and the other is using BLE. When we are building a IoT network, we have multiple choices of communication protocols to choose: The first group is Wireless local area network (WLAN) protocols: Bluetooth, WiFi, ZigBee, etc, these protocol are suitable to build local area network which are mostly short distance (1-100 meters) wireless communication. The second group is Low Power Wide Area Network (LPWAN) protocols for long range (A few kilometers in urban areas to over 10 km in rural area) wireless communication, {\\em e.g.,}\\xspace LoRa, NB-IoT, Sigfox, etc. We would like to introduce some wireless communication protocols that can be used to build LPWAN in Table.~\\ref{tab:protocol}.\n\\end{comment}\n\n\\begin{table*}[h!]\n \\small\n \\centering\n \\caption{Specification of LPWAN protocols: LoRaWAN, NB-IoT, and Sigfox.}\n \n \\begin{tabularx}{\\textwidth}{|>{\\raggedright\\arraybackslash}X\n |>{\\centering\\arraybackslash}X\n |>{\\centering\\arraybackslash}X\n |>{\\centering\\arraybackslash}X|}\n \\hline\n \\textbf{Protocols} & \\textbf{LoRaWAN} & \\textbf{NB-IoT} & \\textbf{Sigfox} \\\\ \n \\hline\n \\hline\n Spectrum & Unlicensed ISM radio bands & Licensed LTE frequency bands & Unlicensed ISM radio bands \\\\\n \\hline\n Bandwidth & 125 or 250kHz & 180kHz & 192Hz \\\\\n \\hline\n Max data rate & 5.5kbps & 127kbps & 100bps \\\\\n \\hline\n Max messages\/day & 30 seconds air-time per device per day & Unlimited & Uplink: 140, Downlink: 4\\\\\n \\hline\n Max payload length & 242 bytes & 1,600 bytes & 12 bytes\\\\\n \\hline\n Range & Urban: 2-5 km, Rural: 10-15 km & Urban: 1 km, Rural: 10 km& Urban: 3-10 km, Rural: 30-40 km\\\\\n \\hline\n Interference immunity & High & Low & High \\\\\n \\hline\n Authentication \\& encryption & AES 128 bit & 3GPP (128 to 256 bit) & N\/A \\\\\n \\hline\n Cost & Device (\\$4-\\$6), Own network infrastructure (\\$400-\\$1000), Network operation and maintenance & Device (\\$6-\\$12), SIM card (\\$1-\\$2), Subscription fees (\\$5-\\$30)& Device (\\$5-\\$10), Subscription fees (\\$8-\\$12)\\\\\n \\hline\n \\end{tabularx}\n \\label{tab:protocol}\n\\end{table*}\n\n\\customsec{LoRaWAN}\nIt is one of the most promising LPWAN solutions and is currently gaining traction to support IoT applications and services based on the LoRa radio modulation technology. LoRa modulation adopts the frequency-shift keying (FSK) and Chirp Spread Spectrum (CSS) operating at 868 MHz (Europe) and 915 MHz (North America) ISM band, promising ranges upto 20-25 km. LoRa also supports an Adaptive Data Rate (ADR) from 300 bps to 50 kbps for a 125 kHz bandwidth and supports configurable chirp duration (spreading factor) to maximize both the battery life of each device and the overall capacity available through the system. LoRaWAN defines the MAC communication protocol and the system architecture for the network. It uses a hub-and-spoke topology in which every LoRa node can communicate directly with the Gateway module.\n\n\\customsec{NB-IoT}\nThe 3rd Generation Partnership Project (3GPP) is a joint initiative of Asia, Europe, and North America telecommunications standardization organizations to produce global specifications for the Universal Mobile Telecommunication System (UMTS). 3GPP standardized a set of low cost and low complexity devices targeting Machine-Type-Communications (MTC) in Release 13. In particular, 3GPP addresses the IoT market using a threefold approach by standardizing the enhanced Machine Type Communications (eMTC), the NB-IoT (Narrowband IoT), and the EC-GSM-IoT. Specifically, NB-IoT can operate in a system bandwidth as narrow as 200 kHz and supports deployment in spectrum originally intended for GSM or LTE. It also supports a minimum device bandwidth of only 3.75 kHz. This design affords NB-IoT an energy efficient operation, while coexisting with existing GSM and LTE network, reducing deployment costs~\\cite{narrowband2017}. \n\n\\customsec{Sigfox} \nSigfox is a proprietary Ultra Narrow Band (UNB) LPWAN solution that operates in the 869 MHz (Europe) and 915 MHz (North America) bands, with an extremely narrow bandwidth (100Hz). It is based on Random Frequency and Time Division Multiple Access (RFTDMA) and achieves a data rate of around 100 bps in the uplink, with a maximum packet payload of 12 Bytes. However, Sigfox limits the amount of data per device in the network to 14 packets\/day. These limitations, together with a business model where Sigfox owns the network, have shifted the interest to LoRaWAN, which is considered more flexible and open.\n\nAs we can see, none of the previous LPWAN protocols is a perfect scheme. However, considering our application is a local ad-hoc network designed for digital agriculture, LoRa modulation presents a reasonable solution. Its low energy consumption, long-range, privacy features, and flexibility~\\cite{devalal2018lora, sinha2017survey} fit our needs. \nSimilar to the hybrid LPWAN proposed in~\\cite{jiang2020hybrid}, we choose LoRa over LoRaWAN to support a broader coverage since the latter only supports a star\ntopology---SNs connected directly to the Gateway. Nevertheless, in urban areas or widespread rural areas, a mesh network can extend the IoT network coverage. \nFig.~\\ref{fig:gateway}(c) shows a deployed Gateway consisting of a Raspberry Pi and LoStik in an IP56 enclosure~\\cite{pi-package}, ruggedizing it. The configuration of the Gateway can be customized depending on the deployed area. For instance, the spreading factor can vary from 7 to 12, where a higher value denotes a broader coverage.\n\n\\subsubsection{Second Layer: Data Upload}\n\\label{subsubsec:data-upload}\nAfter collecting data from SNs to the Gateway, we need to upload the respective measurements to the backend servers. \n{Considering that the Gateway may not be in the range of any network with Internet access (either through a wired or wireless connection), we have two possible scenarios. }\nIf the Gateway has Internet access, the Gateway uploads the measurements using a Transport Layer Security (TLS), or formerly, Secure Sockets Layer (SSL). In contrast, in the second scenario, the Gateway relies on LoRaWAN to forward the collected readings to a nearby Gateway with Internet access. \nAs described earlier, LoRaWAN uses AES (Advanced Encryption Standard), with a symmetric key of 128 bits to encrypt the data.\n\n\\subsubsection{Third Layer: Data Persistence and Visualization}\n\\label{subsubsec:data-visualization}\n\n\\begin{figure*}[h!]\n \\centering\n \\begin{adjustbox}{varwidth=0.85\\textwidth,margin=0 {\\abovecaptionskip} 0 0, frame=0.25pt }\n \\includegraphics[width=\\textwidth]{Figures\/grafana-temp-example-white-big.png}\n \\end{adjustbox}\n \\caption{Grafana dashboards including the temperature and humidity of 5 different SNs of our IoT network deployment.}\n \\label{fig:grafana}\n \\vspace{1em}\n\\end{figure*}\n\nOur backend includes the following open-source servers: a NoSQL database (MongoDB), an application server (ChirpStack), a time-series database (influxDB), and a visualization server (Grafana). The NoSQL database stores the measurements uploaded through the network. The user can visualize these readings using a frontend website (Django framework). \nThe frontend provides access to the data and allows to export it in a CSV format for further analysis outside of our platform.\nOn the other hand, the application server coordinates the communication with the LoRaWAN gateways deployed in the field. This server is integrated with a time-series database, influxDB, specially useful to store real-time data. Finally, the user can access the measurements using a Grafana server Fig.~\\ref{fig:grafana}, which provides a flexible interface to query, visualize, and analyze the measurements.\n\n\n\\begin{comment}\n\\edgardo{5\/14: Fig.~\\ref{fig:grafana--testing} -- this is just a temporal test}\n\\begin{figure}[h!]\n \\centering\n \\begin{adjustbox}{varwidth=.49\\textwidth,margin=0 {\\abovecaptionskip} 0 0, frame=0.25pt }\n \\includegraphics[width=\\textwidth]{Figures\/grafana-temp-example-white-big.png}\n \\end{adjustbox}\n \\caption{Dashboard in Grafana including the temperature and humidity of 5 different SNs of our real IoT network deployment in the state of Indiana.}\n \\label{fig:grafana--testing}\n\\end{figure}\n\\end{comment}\n\\section{Emulated Testbed}\n\\label{sec:lab-testbed}\n\n\n\n\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/testbed.png}\n \\caption{Heterogeneous testbed using NVIDIA Jetson devices and Raspberry Pis in a local area network (LAN).}\n \\vspace{-2mm}\n \\label{fig:testbed}\n\\end{figure}\nIn addition to our living testbed, we also set up an emulated heterogeneous testbed in our lab using NVIDIA Jetson-class devices. The setup is shown in Fig.~\\ref{fig:testbed}.\nHaving an emulated testbed allows us to fine-tune the hardware-software interactions of the system in a controlled lab environment. Ironing out the kinks, stress testing, and proactively implementing additional layers of redundancy will result in a more resilient field deployment.\nArguably, the most important benefit is that it allows us to fast-forward new feature implementation, major system changes, and prototyping.\n\n\\subsection{Devices}\n\\label{subsec:jetson-devices}\nTable~\\ref{tab:jetson} summarizes the specification of the NVIDIA devices in our emulated testbed.\nBesides, they could be deployed in the field or be carried on an aerial drone if we require a mobile high-performance SN.\n\n\\begin{table*}[h!]\n \\centering\n \\small\n \\caption{Comparison between Jetson modules: Nano, TX2, Xavier NX, and AGX Xavier.}\n \\begin{tabularx}{\\textwidth}{|>{\\hsize=.6\\hsize\\raggedright\\arraybackslash}X\n |>{\\hsize=.68\\hsize\\centering\\arraybackslash}X\n |>{\\hsize=.68\\hsize\\centering\\arraybackslash}X\n |>{\\hsize=.68\\hsize\\centering\\arraybackslash}X\n |>{\\hsize=.68\\hsize\\centering\\arraybackslash}X\n |>{\\hsize=.68\\hsize\\centering\\arraybackslash}X|}\n \\hline\n \\textbf{Models} & \\textbf{Raspberry Pi 4B} & \\textbf{Nano} & \\textbf{TX2} & \\textbf{Xavier NX} & \\textbf{AGX Xavier}\\\\ \n \\hline\n \\hline\n CPU & Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz & Quad-Core ARM Cortex-A57 MPCore @ 1.5GHz & Dual-Core NVIDIA Denver 2 64-Bit CPU and Quad-Core ARM Cortex-A57 MPCore processor @ 2.0GHz & 6-core NVIDIA Carmel ARMv8.2 64-bit CPU 6MB L2 + 4MB L3 @ 1.9GHz & 8-core NVIDIA Carmel Armv8.2 64-bit CPU 8MB L2 + 4MB L3 @ 2.3GHz\\\\\n \\hline\n GPU & Broadcom VideoCore VI @ 500MHz & 128-core NVIDIA Maxwell GPU @ 921MHz & 256-core NVIDIA Pascal GPU @ 1300MHz & 384-core NVIDIA Volta GPU with 48 Tensor Cores @ 1100MHz & 512-core NVIDIA Volta GPU with 64 Tensor Cores @ 1377MHz\\\\\n \\hline\n Memory & 2GB, 4G or 8GB 32-bit LPDDR4 @ 3200MHz - 25.6GB\/s & 4 GB 64-bit LPDDR4 @ 1600MHz - 25.6GB\/s & 8 GB 128-bit LPDDR4 @ 1866MHz - 59.7GB\/s & 8 GB 128-bit LPDDR4x @ 1600MHz - 51.2GB\/s & 32 GB 256-bit LPDDR4x @ 2133MHz - 136.5GB\/s \\\\\n \\hline\n Storage & MicroSD & 16 GB eMMC + MicroSD & 32 GB eMMC + MicroSD & 16 GB eMMC + MicroSD & 32 GB eMMC + MicroSD\\\\\n \\hline\n Power modes & 15W & 5W\/10W & 7.5W\/15W & 10W\/15W & 10W\/15W\/30W\\\\\n \\hline\n DL Accelerator & - & - & - & 2x NVDLA Engines & 2x NVDLA Engines \\\\\n \\hline\n AI Performance & 32 GFLOPS & 472 GFLOPS & 1.33 TFLOPS & 21 TOPS & 32 TOPS \\\\\n \\hline\n Price & \\$55 - \\$100 & \\$100 & \\$400 & \\$400 & \\$700 \\\\\n \\hline\n \\end{tabularx}\n \\label{tab:jetson}\n \n\\end{table*}\n\n\\noindent{\\customsec{Jetson Nano}}\nNVIDIA Jetson Nano is an embedded system-on-module (SoM) including an integrated 128-core Maxwell GPU, quad-core ARM A57 64-bit CPU, 4GB LPDDR4 memory, along with support for MIPI CSI-2 and PCIe Gen2 high-speed I\/O. Jetson Nano runs Linux and provides 472 GFLOPS of FP16 compute performance with 5-10W of power consumption.\n\\noindent{\\customsec{Jetson TX2}}\nNVIDIA Jetson TX2 is an embedded SoM with dual-core NVIDIA Denver2 + quad-core ARM Cortex-A57, 8GB 128-bit LPDDR4 and integrated 256-core Pascal GPU. Jetson TX2 runs Linux and provides greater than 1TFLOPS of FP16 compute performance in less than 7.5 watts of power.\n\\noindent{\\customsec{Jetson Xavier NX}}\nNVIDIA Jetson Xavier NX is an embedded SoM including an integrated 384-core Volta GPU with Tensor Cores, dual Deep Learning Accelerators (DLAs), 6-core NVIDIA Carmel ARMv8.2 CPU, 8GB 128-bit LPDDR4x with 51.2GB\/s of memory bandwidth, hardware video codecs, and high-speed I\/O including PCIe Gen 3\/4, 14 camera lanes of MIPI CSI-2. Jetson Xavier NX runs Linux and provides up to 21 TeraOPS (TOPS) of compute performance in user-configurable 10\/15W power profiles.\n\\noindent{\\customsec{Jetson AGX Xavier}}\nNVIDIA Jetson AGX Xavier is an embedded SoM including an integrated Volta GPU with Tensor Cores, dual DLAs, octal-core NVIDIA Carmel ARMv8.2 CPU, 32GB 256-bit LPDDR4x with 137GB\/s of memory bandwidth, and 650Gbps of high-speed I\/O including PCIe Gen 4 and 16 camera lanes of MIPI CSI-2. Jetson AGX Xavier runs Linux and provides 32 TOPS of compute performance in user-configurable 10\/15\/30W power profiles.\n\n\\begin{comment}\n\\customsec{Server}\nThe server can be one machine from the testbed or a independent desktop server.\n\\pengcheng{Will comment this subsection if there is no major input.}\n\\edgardo{(2\/15) Can we use this server for the workload manager (SLURM)? Besides, is there any tasks that requires of a \"server\"? (for example, maybe an ML algorithm requires some \"server\" processing)}\n\\end{comment}\n\n\\subsection{SLURM}\n\\label{subsec:slurm}\nSLURM is an open-source distributed computing workload manager. SLURM allows multiple devices to work in parallel on a single task, as long as the application is written to execute in parallel mode. \nIn the context of this paper, SLURM acts as a resource scheduler for the emulated testbed. We pre-train ML models on more powerful devices at the edge or cloud. \nThen SLURM could allow us to run inference on embedded devices in the field, resulting in system with significantly less data transferring.\nTraditionally, SLURM is most prevalent in x86 architecture builds, and only recently began gaining traction in the ARM world. With significant numbers of ARM SoCs being deployed, we expect that ARM-based distributed computing will see significant adoption.\nSLURM is used to manage ML training tasks on distributed GPU clusters~\\cite{awan2019scalable, campos2017distributed}, parallelizing the training process.\nIn our testbed, we leverage SLURM to distribute the inference task on multiple heterogeneous Jetson devices to accelerate the prediction process. Main challenge with this is finding the sweet spot of task distribution across multiple devices while keeping resource management, storage I\/O, and power consumption overhead to a minimum.\nAnother benefit of distributing a task across multiple devices is hardware redundancy, increasing the system's reliability. For example, if we rely on a single device to do the object detection task, a hardware failure will kill the system. However, if we spread the task across multiple devices, the system will only fail if all of the devices concurrently go offline.\nFinally, idle standby time can be leveraged to divert workloads to idle devices for resource efficiency.\n\n\n\\subsection{Tegrastats}\n\\label{subsec:tegrastats}\n\n\\begin{figure}[t!]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/energy_new.png}\n \\caption{Jetson TX2's instantaneous power consumption vs DVFS setting of the GPU module while profiling ApproxDet's~\\cite{xu2020approxdet} 40 approximation branches. The current power consumption of the board is directly influenced by the DVFS setting of the GPU module while running object detection tasks.}\n \\label{fig:energy}\n \\vspace{-5mm}\n\\end{figure}\n\nThe Jetson series products provide the {\\em tegrastats} utility~\\cite{tegrastats}, which reports important memory, processor, and disk usage information. This utility can be easily accessed by running the command ``sudo tegrastats.'' The detailed information includes RAM usage, CPU utilization for each core, GPU utilization, power consumption for main hardware modules, etc. \nThe output can be observed in real time, or piped to a file for future analysis. In our experiments, we use the information from {\\em tegrastats} to analyze the relationship between power consumption, and the intensity of computation tasks. We also use it to observe the change of CPU and GPU utilization when specific operations are performed. Fig.~\\ref{fig:energy} shows an example of our profiling experiments of the current power consumption of ApproxDet's 40 execution branches~\\cite{xu2020approxdet}. ApproxDet performs {\\em approximate} video object detection, in a way that adapts to changes in content characteristics and changes in contention levels. This experiment is done on ImageNet Large Scale Visual Recognition Challenge 2015 validation dataset\nwhen we use different Dynamic voltage and frequency scaling (DVFS) settings for the GPU module. The values for DVFS settings of the GPU module are provided by NVIDIA in the NVIDIA Jetson Linux Developer Guide~\\cite{nvidia-doc}. \n{The instantaneous power information is collected by using {\\em tegrastats}.}\nAs seen from the figure, with increasing frequency setting of the GPU module, the mean and median values of current power of the TX2 board keep increasing while running ApproxDet's execution branches. Another observation is that the variance of the energy consumption also increases as GPU frequency increases. That is because with a higher GPU frequency, a greater number branches can run (including the heavyweight branches, which may not have been possible at lower frequencies), resulting in greater variability because of the higher spread of the (possible) approximation branches.\nFurther, we can tune the DVFS settings of CPU, GPU, and memory modules separately based on the API that the Jetson platform provides. \nThis means the user can configure each module independently based on the application requirements (accuracy, latency, and energy). \n\n\\begin{figure}[htbp]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/jtop.png}\n \\caption{Jetson stats' GUI shows detailed working status information for each hardware module on the device.}\n \\label{fig:jtop}\n \\vspace{-2em}\n\\end{figure}\n\nBased on the {\\em tegrastats} utility, an open-source tool named {\\em Jetson stats}~\\cite{jtop} \nhas been developed. It is a package for monitoring and controlling NVIDIA Jetson devices, showing various component-level performance statistics. GUI variant allows tweaking of various hardware settings. Fig.~\\ref{fig:jtop} is an example of running {\\em Jetson stats} on one of TX2 boards in our testbed. By observing the displayed values, we can easily observe the utilization levels of CPU, GPU, and memory. For example, if a GPU-intensive memory task is launched, the GPU frequency and utilization will become high. The temperature and power increases can also be observed.\n\n\n\\subsection{Drones}\n\\label{subsec:drones}\nOur embedded testbed is augmented with aerial drones~\\cite{dronet21}. These complement the ground nodes in two ways. First, the drones periodically fly over the covered regions, and collect data that may have been missed due to communication holes. This interval can range from hourly to once a day. Drone-based data ferrying can help in areas with limited, or no wireless connectivity. This can happen due to physical conditions, such as growth of corn stalks, resulting in a loss of communication of nodes in the network chain.\nThere is a protocol programmed into the SNs\nto send buffered data to the drones when drones indicate being within communication range. This form of data ferrying is well known in the literature~\\cite{pu2019route} and works in our context as there can be short to long periods of network disconnection for some of the nodes. A second enabling factor is that much of the data also does {\\em not} have strict latency requirements and can afford periodic visits by the drones. \n Another use case is an on-demand summoning of a drone by the SNs. An SN has a limited computational capacity and can summon a drone when it senses that some event is unfolding that needs heavyweight processing such as streaming video analytics, object localization, object detection, or face recognition, resulting the actuated ``descent'' of the drone for higher precision. An SN can, through the regular (low bandwidth) LoRa channel, send a request to the backend server to dispatch a single, or multiple drones. The drone with a GPU-enabled embedded board can reach the SN, and perform the heavyweight analytics task for the time for which the event is happening. The raw video data does not need to be communicated over long ranges, but only over a short-range high bandwidth channel like BLE. Further, we have done preliminary work to optimize the drone coverage with a swarm of drones~\\cite{dronet21}. We allow the drone to change its height to optimize the precision versus coverage when a swarm of drones is deployed in a farm (for on-demand data ferrying from the ground sensors). Overall, we have observed that the precision of the computer vision workload is a function of the drone height, rather than the drone speed.\n\n\n\n\n\n\\begin{comment}\n\\somali{Old text from PW}\nWe also have two types of DJI drones for expanding the IoT network into the air. By doing some development on these drones, we can make them serve as a gateways to collect data from the SNs. For some applications that do not need the real time data or someplace that is hard to do the deployment with a static Gateway, the drone could serve as a mobile Gateway. For example, the drone can carry the LoRa Gateway (Raspberry Pi + LoStik) and fly through the farm to collect data twice a day; once in the morning, and once in the afternoon.\n\\pengcheng{Add the specification for the drones; add a figure of how will it work. Should I edit the figure 1 with our future work? That way it is more intuitive.}\n\\end{comment}\n\\section{Implementation and Evaluation}\n\\label{sec:implementation}\nThis section describes the techniques and challenges of the deployment of {\\sc Orpheus}\\xspace in production farms in northern and central Indiana and on Purdue campus.\n\\subsection{Deployment}\n\\label{subsec:deployment}\n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/map_deployed.png}\n \\caption{{\\sc Orpheus}\\xspace's IoT deployment map in Northern and Central Indiana: Purdue Main Campus, Purdue ACRE, Ivy Tech Community College, Throckmorton-Purdue Agricultural Center (TPAC), and commercial farms in Benton and Warren Counties.}\n \\label{fig:map_deployed}\n\\end{figure}\nAs can be observed in Fig.~\\ref{fig:map_deployed}, we deployed a living testbed of IoT nodes in urban areas (Purdue University main campus, West Lafayette) and rural areas (Purdue's experimental farms and commercial farms) across Indiana. \n\\begin{figure}[htb]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/field_deployment.png}\n \\caption{Deployment at a farm in Benton County: The SN is equipped with two TEROS 12 sensors and sends measurements to the LoRa Gateway inside the farmer's house via LoRa.}\n \\label{fig:field_deployment}\n\\end{figure}\nShown in Fig.~\\ref{fig:field_deployment}, an SN is set beside the cornfields, while the LoRa Gateway is located inside a house with a clear line-of-sight (LoS) propagation from the node. The SN is equipped with two TEROS 12 soil sensors, buried underneath the soil, to detect changes in the volumetric water content (VWC) at 12 and 6 inches depth, respectively. Each SN is capable of collecting the temperature and the relative humidity level using the on-board HDC2010 sensor included in the nodes, as described in Section~\\ref{subsec:sensor-node}. \n\n\nSNs transmit the measurements periodically to the nearest Gateway using the LoRa communication protocol. \nGateway receives the measurements and forwards them to the central database servers, as described in Section~\\ref{subsubsec:data-upload}. \nAs a contingency, the Gateway also stores the measurements locally in case of network failure.\n\\begin{figure}[htbp]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/receiver_output.png}\n \\caption{Readings on the Gateway: SN ID, firmware version, time stamp for received message, battery level, temperature, humidity, soil nitrate level, soil dielectric, conductivity, temperature, VWC.}\n \\label{fig:receiver_output}\n \n\\end{figure}\n\n\\begin{figure*}[htbp]\n \\centering\n \\includegraphics[width=0.85\\textwidth]{Figures\/website.png}\n \n \\caption{Website for SN readings, which include information such as SN ID, Location, GPS coordinates, last seen time, and the battery level. The website also allows to directly plot the data online or download it in .csv format.}\n \n \n \\label{fig:website}\n \\vspace{-1em}\n\\end{figure*}\n\n\nFig.~\\ref{fig:receiver_output} shows an example of the output generated on a\nLoRa Gateway each time it receives the measurements. Primary information is received date and SN ID. Secondary information includes specific measurements for each metric: humidity, temperature, nitrate level, soil dielectric permittivity, conductivity, and VWC.\nOnce data is stored in the database server, it can be visualized from the frontend, as can be seen in Fig.~\\ref{fig:website}. On the website, a user can see detailed location for the SN with its GPS coordinates, the last-seen time---a timestamp for the latest message, and the sensor installation information ({\\em e.g.,}\\xspace which sensor ports have been activated and when). We also provide the functionality \\textit{Graph Data} for a user to plot the sensor measurements by choosing the date range and the sensor to use; {\\em e.g.,}\\xspace in Fig.~\\ref{fig:website}, we plot the temperature and humidity data. Finally, user can also download the raw data within a date range for further analysis using the \\textit{Export Raw Data} function.\n\n\n\n\\begin{figure}[htbp]\n \\vspace{-3mm}\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/soil-rain.png}\n \\caption{{Soil VWC (\\%) at different depths (12'' and 6'', respectively) and rain events (inches) in the nearby location.}}\n \\label{fig:soil-rain}\n\\end{figure}\n\n{In Fig.~\\ref{fig:soil-rain}, we show an example of combined analysis using our collected soil VWC data and the open source data from WHIN weather stations on rain events. Both data were collected from June 1, 2021 to August 13, 2021. Our soil sensor data has an interval of 30 minutes and the rain events' data from WHIN's weather station has an interval of 15 minutes. The WHIN weather station is 5.8 miles away from our soil sensor node in a rural area, which we believe, share the same weather patterns, including temperature, rainfall, etc. The X-axis represents the time, synchronized across the two locations. \nThe left Y-axis is VWC (Volumetric Water Content) of soil sensors at two different depths (12 inches and 6 inches). The right Y-axis is the cumulative rainfall in the last 15 minutes. There are some insights we get from the figure:\n\\vspace{-2mm}\n\\begin{enumerate}[leftmargin=1em]\n \\item As expected, the soil VWC measurements always follow the changes in rainfall in direction and magnitude. \n \\item The soil at greater depths has higher VWC. \n\\end{enumerate}\n}\n\n\n\n\\subsection{IoT Network Monitoring and Troubleshooting}\n\\label{subsec:network-monitoring}\n\n\\begin{comment}\n\\end{comment}\n\n\\noindent{\\customsec{Data Filtering}}\nData collected in the field can become corrupted before it gets stored in the backend database. This can happen either due to malfunction of device sensors, or signal interference during wireless communication. Our IoT network uses different filters at both, edge and cloud, to achieve end-to-end data integrity. These filters prevent anomalous data from reaching the front end which is the Data Visualization layer of {{\\sc Orpheus}\\xspace}, as shown in Fig.~\\ref{fig:website}.\nWe use in-lab experiments to determine the threshold for each metric. For example, humidity measurement's reasonable range is between 0\\% to 100\\%; soil VWC's reasonable range is between 0 to 0.7, based on our experiment calculations.\n\n\\begin{comment}\n\\somali{what techniques?}\n\\pengcheng{Changed to \"filters at both edge and cloud\". And added an explanation \"These filters can tell the anomaly data that is out of range, thus do not show it on the front end.\"}\n\\end{comment}\n\n\\begin{figure}[htbp]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/email.png}\n \\caption{Email notification format from Network Monitoring and Anomaly Detection (NMAD), including: SN ID, location, last-seen time, number of messages received in a single day, mean and standard deviation of the measurements collected ({\\em e.g.,}\\xspace nitrate level, temperature, battery level). The red cell indicates that there is no recorded reading from the SN in the last 24 hours.}\n \n \n \\label{fig:email}\n \\vspace{-2mm}\n\\end{figure}\n\n\n\n\n\n\n\\customsec{Network Monitoring and Anomaly Detection}\n\\begin{comment}\nProduction networks require \\rev{constant} monitoring and anomaly detection in several layers of the system. Network traffic monitoring, and data integrity checks ensure long uptime, and maintenance-free operation. Data anomalies can occur from natural causes, and not necessarily from a security breaches. Larger networks require greater amount of sensor node monitoring automation. Out of necessity, and as a part of {{\\sc Orpheus}\\xspace}, we developed NMAD, a server daemon that checks the status of the SNs deployed in the live testbed and sends daily reports or notifications to the system managers.\n\nThe NMAD pulls the measurements from the database server and checks for possible anomalies in the SNs. The notifications, whose frequency can be customized ({\\em e.g.,}\\xspace \\rev{hourly, daily}), includes the mean and standard deviation for every measurement. Fig.~\\ref{fig:email} shows an example of the email notifications. \n\\rev{If the NMAD detects a possible malfunctioning SN that has not been communicating with the Gateway in the last day, it highlights the node in the email notification.}\n\\end{comment}\n\n{Production networks require constant monitoring and anomaly detection in several layers of the system. Network traffic monitoring and data integrity checks ensure long uptime and maintenance-free operation. Data anomalies can occur from natural causes ({\\em e.g.,}\\xspace data drift) and not necessarily from a security breach. Out of necessity, and as a part of {\\sc Orpheus}\\xspace, we developed NMAD, a server daemon that checks the status of the SNs deployed in the live testbed and sends reports or notifications to the system managers. Fig.~\\ref{fig:email} shows an example of the email notifications. \nThe notifications, whose frequency can be customized ({\\em e.g.,}\\xspace hourly, daily), include the mean and standard deviation for every measurement. Moreover, the report highlights possible anomalies in the SNs. As an example, NMAD flags as anomaly any SN that has not communicated any reading in the last 24 hours.}\n{We are including additional features in the NMAD, such as (near-real time) anomaly detection for new data based on the patterns from the existing data.}\n\n\n\n\n\\begin{figure}[htbp]\n \\centering\n \\includegraphics[width=\\columnwidth]{Figures\/pdr.png}\n \\caption{Packet Delivery Ratio (PDR), Packet Error Ratio (PER), and Packet Miss Ratio (PMR) over 7 days in our living testbed.}\n \n \n \n \n \\label{fig:pdr}\n\\end{figure}\n\n\n\\subsection{Network Stability of Large-Scale Deployment}\n\\label{subsec:network-stability}\n{We evaluate {\\sc Orpheus}\\xspace in terms of the stability of the network based on the following metrics: (a) Packet Delivery Ratio (PDR); (b) Packet Error Ratio (PER); and (c) Packet Miss Ratio (PMR).}\nWe report on network measurements from a sample selection of nodes from our living testbed. This includes measurements from farms (ACRE, Ivy Tech Community College, Warren County, and Benton County) and urban areas (Purdue Main Campus). During one week, February 23, 2021 to March 2, 2021, we analyzed the readings collected from these SNs in terms of PDR, PER, and PMR.\nWe calculate PDR, PMR, and PER as follows:\n \n\\begin{equation}\n\\small\n\\label{eq:pdr}\n PDR = \\frac{\\#\\ of\\ Received\\ Normal\\ Messages}{Expected\\ \\#\\ of\\ Messages}\n\\end{equation}\n\n\\begin{equation}\n\\small\n\\label{eq:per}\n PER = \\frac{\\#\\ of\\ Received\\ Error\\ Messages}{Expected\\ \\#\\ of\\ Messages}\n\\end{equation}\n\n\\begin{equation}\n\\small\n\\label{eq:pmr}\n PMR = \\frac{\\#\\ of\\ Missing\\ Messages}{Expected\\ \\#\\ of\\ Messages}\n\\end{equation}\n\n\nWhere \\begin{small}$PDR + PMR + PER = 1.0$\\end{small}. Fig.~\\ref{fig:pdr} summarizes the network stability profile. \n\\begin{comment}\nFig~\\ref{fig:pdr} shows the network stability of large-scale deployment in 4 farms (ACRE, Ivy Tech, Warren County, Benton County) and one urban area (Purdue Main Campus).\nThe data includes one week of measurements, from 2\/23\/2021 to 3\/2\/2021. \n\\end{comment}\nThe communication interval for each SN is 30 minutes.\nWe use this interval to calculate the anticipated number of received messages in one week as: 7 * 24 * 60 \/ 30 $\\approx$ 336.\n\nAs can be seen from Fig.~\\ref{fig:pdr}, SN 56 has a higher PER than the rest of SNs. This is\nbecause of an anomaly where the post with the sensor had fallen to the ground, directly measuring a higher moisture level. SN \\#9 is deployed in an urban area with high building density, with a resultant high PMR. With respect SN \\#71, the slightly high PER and PMR is because there is a slope in the terrain between the SN and the gateway node, affecting the data transmission. The data collected by our living testbed is available at~\\cite{purduewhin-sensor-list}.\n\n\n\n\\subsection{Network Stability of Two-Hop Deployment in Urban Area}\n{Because a building on the path can obstruct the signal, LoS propagation is critical when deploying LoRa devices (usually low-power wireless devices) in urban environments.\nIn addition, the signal will be attenuated with the reciprocal square of distance~\\cite{mahapatra2016experimental}.\nIn practice, however, the LoS wireless propagation path is not always possible, especially in built urban environments. In order to establish an LoS wireless connection in a city, a Gateway or the nodes have to be deployed at heights, such as a building's roof or on a tall utility tower. Because of these constraints, the LoRa network's real communication range is often substantially lower than the theoretical value (5 km in urban area vs 20 km in rural area).\nOur testbed provides a multiple-hop network to tackle this difficulty. \nThrough a LoRa wireless connection, an SN transmits messages to a LoRa Gateway, which then forwards the messages to the LoRaWAN Gateway. We employ hybrid protocols because using LoRa for the first hop allows us to customize our local network. By using LoRaWAN for the second hop connection, we will be able to leverage the previously installed LoRaWAN Gateway and benefit from the standardization of the LoRaWAN protocol.\nThe signal is captured and amplified in the middle point---the LoRa Gateway---enabling us to communicate the data in a reliable manner to the LoRaWAN Gateway.}\n{Fig.~\\ref{fig:multiple-hop} shows the deployment map of our experiments on the Purdue campus.\nWe would like to send the signal from Wang Hall (about 21 meters above the ground) to Flex Lab (about 7 meters above the ground). However, a signal path wireless connection does not work because the buildings between them block the signal. By using our multi-hop network, first, the node sends the signal to the LoRa Gateway, located at the Hockmeyer building (about 13 meters above the ground). The LoRa Gateway collects the data, stores it locally, and then forwards it to Flex Lab by using LoRaWAN modulation. \nTo evaluate the network quality, we measure the PDR, PER, and PMR for the two individual links, and then, the end-to-end connection. Results can be seen in Table~\\ref{tab:multiple-hop}. \n\\begin{table}[h!]\n \\centering\n \\caption{Multiple Hop Network Stability.}\n \\begin{tabular}{|p{2.8cm}|p{1cm}|p{1cm}|p{1cm}|}\n \\hline\n \\textbf{Steps} & \\textbf{PDR} & \\textbf{PER} & \\textbf{PMR} \\\\ \n \\hline\\hline\n Node to LoRa Gateway & 62.15\\% & 7.64\\% & 30.21\\% \\\\\n \\hline\n LoRa Gateway to LoRaWAN Gateway & 88.27\\% & 8.94\\% & 2.79\\% \\\\\n \\hline\n End-to-end & 54.86\\% & 5.56\\% & 39.58\\% \\\\\n \\hline\n \\end{tabular}\n \\label{tab:multiple-hop}\n\\end{table}\nThe first hop achieves a relatively low PDR and high PMR compared to the second hop because the propagation path for the first hop is not a perfect LoS propagation; its distance (1.25km) is much larger than the second hop (187m). The second hop is a clear LoS propagation, resulting in a higher PDR. In a real-world urban area, our multiple-hop network achieves over 55\\% PDR, which a typical LoRaWAN single-hop network cannot.}\n\n\\begin{figure}[htbp]\n \\centering\n \\includegraphics[width=0.9\\columnwidth]{Figures\/multiple-hop.png}\n \\caption{Purdue campus multiple-hop network map.}\n \\label{fig:multiple-hop}\n \n\\end{figure}\n\n\n\\section{Big Data Frameworks to the Rescue}\n\\label{sec:big-data}\n\\noindent Here, we will discuss the popular frameworks through which we will invoke the ML algorithms in our living testbed. This will involve open-source frameworks such as Apache Spark, streaming data processing frameworks such as Apache Flink, and techniques for distributing the ML processing among nodes in a cluster, both on-premise~\\cite{sophia, rafiki} and in a conventional cloud~\\cite{optimuscloud} or serverless environment~\\cite{mahgoub2021sonic}, such as for video analytics workloads~\\cite{xu2019approxnet, xu2020approxdet}. Serverless computing has become a promising cloud model where cloud providers run the servers and manage all administrative tasks ({\\em e.g.,}\\xspace scaling, capacity planning, etc.), while users focus on the application logic~\\cite{schleier2021serverless}.\nDue to its elasticity and ease-of-use, serverless computing is becoming increasingly popular for advanced streaming workflows such as data processing pipelines~\\cite{pu2019shuffling}, ML pipelines~\\cite{muller2020lambada}, and video analytics~\\cite{fouladi2017encoding, ao2018sprocket, xu2020approxdet}. Major cloud providers have recently introduced serverless {\\em workflow} services such as AWS Step Functions, Azure Durable Functions, and Google Cloud Composer, where applications are composed of a sequence of execution stages, which can be represented as a DAG~\\cite{pu2019shuffling,elgamal2018costless}. DAG nodes\ncorrespond to serverless functions ($\\lambda$s) and edges represent the flow of data between dependent $\\lambda$s, as designed in our system, SONIC~\\cite{mahgoub2021sonic}. The serverless abstraction is attractive in this domain because \nthe computation is often \\textit{event driven}, {\\em e.g.,}\\xspace when a particular sensor is triggered, say to detect the sound of an oncoming combine. Thus, compute nodes \\textit{do not} need to be active all the time but can be ``turned on\" at the right time to process an event. \nThe system owner (who is typically not a computer scientist) \nis not responsible for making subtle resource provisioning decisions. A Reinforcement Learning (RL)-based solution can be attached to the serverless execution to make decisions such as how much memory to allocate to any container in the serverless execution. We have productively used such RL-based orchestration for controlling physical operations (in a manufacturing floor setting) in prior work~\\cite{thomas2018minerva}. Another reason serverless appears attractive in this domain is that the owner is only charged based on the number of events processed, rather than for a length of time. This should make it economically attractive for this domain where event-driven processing is the norm. \n\nThis infrastructure is in preparation for deployment of SNs within a farm and then connecting SNs across farms to form a federated setting. In the federated setting, with the privacy transforms, data acquisition and analysis can be done while maintaining anonymity using well-known techniques such as secure multi-party computation (MPC), especially their efficient variants~\\cite{damgaard2013practical, ben2008fairplaymp}. \nSuch techniques will guarantee that individual bad actors cannot break the confidentiality properties of our solution. Rather, only if greater than a threshold of the participants become bad actors will the system become vulnerable. This is feasible because today there exist ``push-button\" solutions for MPC and our domain for many scenarios does not need very low latency (the baseline solutions in MPC are known to be slow). \n\n\\noindent{\\customsec{Streaming data processing}}\nSince most of the data obtained in digital agriculture is real time, stream processing is preferred over batch processing. This adds several constraints: {\\em first}, the data analytics code has to function at a rate at least as fast as the rate at which data is being generated; {\\em second}, it has to calculate statistics (such as, range for normalization of data) without access to the entire data and based on some look-ahead window based on the workload dynamism (for example, for a more dynamic workload, the look-ahead window will be lower for higher accuracy, plus the algorithm should be configured for some degree of error handling); and {\\em third}, the code has to have the right input-output interfaces so that it can ingest streaming data and output its results in a stream. Now we consider some popular open source streaming analytics frameworks---Apache Spark Streaming (\\url{https:\/\/spark.apache.org\/streaming\/}), Apache Storm (\\url{http:\/\/storm.apache.org\/}), and Apache Flink (\\url{https:\/\/flink.apache.org\/}). These differ in the ways in which they can transform the data stream, {\\em i.e.,}\\xspace the kinds of operators that they support, the latency of processing, the programming languages they support, etc. \n\\cite{carbone2015apache} provides an open-source stream processing framework. Flink, however, does not provide its own data storage and needs to be supplemented by frameworks that do, {\\em e.g.,}\\xspace Kafka~\\cite{garg2013apache} or Cassandra~\\cite{cassandra2014apache}. Apache Spark~\\cite{zaharia2016apache} is an alternative that can also be used for data parallelism. \n\n\\noindent{\\customsec{Batch data processing} }\nThere are some data analytics applications that need batch processing in this domain. This includes analytics that will be processed for strategic decision-making, without any real-time requirement. Batch data processing is done through data warehousing tools~\\cite{chaudhuri1997overview, nargesian2019data} and analytics frameworks like Spark (as opposed to Spark-Streaming) that can ingest data from such warehouses. The ease of this mode of processing is that the analytics code can access the entire data in one shot. The challenge with this mode of processing is the large volumes of data. To fit within the resources of the compute nodes, the data has to be segmented and the analytics code then runs on the segmented data. \n\\begin{comment}\n\\noindent{\\customsec{Open-source frameworks}} Open-source frameworks provide extensive customization and allow collaboration. These two properties, among many, make them more preferable. \\cite{hashem2015rise} provides an overview of the existing challenges and solutions to handling big data. Hadoop is one such open-source framework that can process large datasets~\\cite{shvachko2010hadoop}, we have also made an open-source version of Apache-Spark available for distributed SVM approaches~\\cite{ghoshal2015ensemble, ghoshal2018distributed}. It functions on map-reduce programming models. Several warehousing solutions built on Hadoop such as Hive~\\cite{thusoo2009hive} are also available. Apache Drill is another open-source framework that provides interactive analysis of big data~\\cite{hausenblas2013apache}. \\cite{chandarana2014big} provides a comparative study of three open-source frameworks, Hadoop, Drill, and the Project Storm. \n\\end{comment}\n\n\\section{Democratizing AI for Farmers}\n\\label{sec:democratizing-ai}\n\\noindent This will require the accessibility of state-of-the-art wireless, database, and ML technologies to farms---even small-scale farms---deploying leading-edge analytics and broadband modalities to gather data from farms ({\\em e.g.,}\\xspace FarmBeats, AirBand technologies, Open Ag Data Alliance APIs).\nThis will cover the commercial angle of deploying and operating a system and the foundational (and often open-source) technologies that they build upon, such as, TV whitespace spectrum being used to upload high volume data.\nTo bring the benefits of digital agriculture, and the ML driven insights to the farmers, we need to make these systems\naffordable. However, existing digital agriculture solutions are expensive for two key reasons. \n\n\\underline{First}, is the limited broadband connectivity in rural farms. The sensors, drones, and tractors need to send data to the\ncloud to train the ML models, and the insights need to be conveyed to\nthe farmer's devices. Even in the US, around 20 million rural Americans\ndo not have broadband access~\\cite{fc2019eighth}. And a large part of\nfarmland does not have access either.\nTo bridge this digital divide, we need to come up with innovative\nsolutions to bring broadband Internet in the farms. One such promising\ntechnology is the TV White Spaces technology, which refers to unused TV\nchannels~\\cite{bahl2009white}. There is abundant unused TV channels in\nfarms, which can be used to send and receive data in farms. Wireless\nsignals also propagate smoothly in the TV frequencies, and are ideal for connecting farms. Satellite-based Internet access also holds promise, where low-earth orbit (LEO) satellites could enable low-cost backhaul connectivity.\n\n\\underline{Second}, the reason for expensive digital agriculture solutions is the lack of platforms for innovation that are opensource and interoperable. Data acquisition\nsystems are proprietary, and hence getting data from the farm for research is not easy. There is also a dearth of clean data from farms that can be used for building ML models. \nWe propose the building of open-source APIs, and data\nrepositories. These APIs, such as the one from Open Ag Data Alliance,\nafford researchers and startups a platform to prototype their\ninnovation. Similarly, a cloud-based data repository, for example with\ndrone imagery and satellite data from research farms, will enable\nresearchers to train new models. It will also create a\nbenchmarking dataset to evaluate new innovations before\nbringing it to the growers. \n\n\\section{Limitations}\n\\label{sec:limitation}\n\\noindent{Here we acknowledge the key limitations of our initial work setting up practical testbeds:}\n\\begin{itemize}\n \\item Our solution still needs human intervention such as replacing batteries for SN, and stable power supply for LoRa gateways, which limit the places where we can deploy them.\n \\item The bandwidth of LoRa is relatively low such that we cannot transmit complex data ({\\em e.g.,}\\xspace image data, audio data). We can also use 4G and 5G here to transmit data from the SNs to the gateway because they have broader bandwidth, better suited for video feeds, sound feeds, and images.\n \\item We need to deploy and maintain our own LoRa and LoRaWAN gateway, which could be quite expensive in short-term. NB-IoT could be a alternative choice, but NB-IoT will have a monthly payment. \n \\somali{put some specifics, what are the plans like -- data volumes to prices and for which vendors, otherwise this is not suitable to put in technical writing}.\n \n\\end{itemize}\n\\section{Conclusion and Future Work}\n\\label{sec:conclusion}\nWe have built a low-energy, durable, flexible, long-range, low-cost IoT Network. And have inclusive implementation and troubleshooting examples.\nFor future work, we are aiming to develop smart, self-maintainable, sustainable sensor devices and network.\n\n\n\\noindent{\\customsec{Smart and Sustainable Node \\& Gateway}}\n\\begin{itemize}\n \\item Problem: Currently, the SNs need to be powered by batteries. The Gateway can only be put somewhere where have a power supply and Internet access. And need a quite much effort to maintain them.\n \\item Our solution: The overall feature of our solution is that they don't need any human evolving works after the first time deployment. Since the number of IoT devices and networks will explode in the future, sustainable devices and networks is a good point we can emphasize. \n \\item Indesign node + Solar panel (The Indesign node is powered by 4 AAA batteries now, if we can replace the batteries with a solar panel, then we don't need to go to the field to replace the batteries manually.)\n \\item Raspberry-Pi + Solar panel + Camera to serve as a camera SN in the field to do object detection. The detection target could be saboteurs, animals, diseases of crops, or if the height of crops is in anticipation. The traditional camera does not have the ability to analyze the video in the field and needs quite larger network bandwidth to upload the video to the cloud which is very power consuming. By using our method, we can collect the data in the field and directly analyze the video in the field, and only send the results back to the cloud. Since we will have limited power by using the solar panel, we can also incorporate approximate calculation here to save power. And for agriculture application, latency should not be a problem, 5 frames per second should be enough.\n \\item A drone carrying Jetson Nano to do object detection. After the drone collected all the data, it can send the data to the Edge Server (a more powerful machine could be Xavier NX\n\\end{itemize}\n\n\\textbf{Improvement on Network:}\n\\begin{itemize}\n \\item Expand longer coverage by combining LoRa and NB-IoT on a single Raspberry-Pi (It will serve as a relay station between SNs and NB-IoT base station, and this is to solve the coverage issue)\n \\item An intelligent offloading scheme on the Gateway. We can do data analysis on the Raspberry-Pi directly and only send back the result to the cloud (decreasing the data need to be upload to the cloud).\n\\end{itemize}\n\n\n\n\n\n\n\\section{Discussion}\n\\label{sec:discussion}\nHere are some valuable experiences we have learned from the deployment of {\\sc Orpheus}\\xspace:\n\\begin{itemize}\n \\item Since we are using electronic devices to build an IoT network, ruggedizing them to operate outdoors in agriculture settings is vital. Besides, robust firmware to support these devices is also critical. What's more, higher-compute gateway nodes and a backend database server with an in-memory database and application server ({\\em e.g.,}\\xspace Redis), and ability to offload from the SNs or gateway nodes to the cloud-hosted databases is required~\\cite{chaterji2021lattice, jiang2020hybrid, chaterji2020cloud}. Such cloud-hosted databases can serve to aggregate the data from multiple farms, and within each farm, from multiple SNs.\n \\item When we build the whole end-to-end data collecting and visualization pipeline, data transmission and storage are important. Setting up multiple anchor points in the pipeline will be a good solution to avoid missing data and data tampering. This is accomplished by storing our data in both the gateway nodes and backend servers for groundtruthing and online updates.\n Further, daily connectivity, and data integrity checks need to be performed to ensure resiliency of the workflow loop.\n \\item When building a large-scale IoT network architecture, modular design is a good approach, which allows one to divide the system into discrete scalable and reusable modules.\n In our living lab, the SNs are designed by following the LoRa protocol so that the wireless communication in the field is done by using LoRa, the Raspberry Pi, and LoStik module serving as the Gateway. Raspberry Pi can potentially be replaced by more powerful devices, {\\em e.g.,}\\xspace Jetsons, at the gateway.\n The Jetson-class devices can do the heavyweight computation, such as, computing a frequency spectrum of the values and identifying anomalies from them. \n \n \n \n Next, we use standard TCP\/IP protocol connecting the Gateway to the Internet. Finally, our website is developed using the Django framework. MongoDB stores all of the data, and acts as an interface between the cloud website, and the edge LPWAN.\n \\item This is a real-world implementation work, which is subjected to drastic weather and frequently shifting landscape, affecting wireless communication performance, {\\em e.g.,}\\xspace the height of the corn stalks in a corn field can reduce the packet reception ratio between the SNs and the Gateway. \n \n \\end{itemize}\n\\section{Conclusion and Future Work}\n\\label{sec:conclusion}\nWe have deployed three models for testing and refining {\\sc Orpheus}\\xspace. The \\textit{first model} consists of a living lab with real, ruggedized sensors deployed in fields and networking innovations for low end-to-end latency. This is for more latency-sensitive tasks, such as near-live actuation of sensors on applicator for farm supplements and site-specific variable rate treatments. Further, there are multiple-hop networks connecting the sensor nodes on the farm and then aggregated at the gateway server at the farmer's house. This aggregation could be using a Raspberry Pi or a more compute-heavy mobile GPU-enabled, Jetson-class device. The \\textit{second model} consists of an embedded testbed consisting of leading-edge embedded devices in the Jetson class of mobile GPUs.\nSpecifically, three embedded devices are currently used in our embedded testbed to benchmark heavy video object detection algorithms, useful for applications in our living lab. The devices are the \\textit{Jetson TX2}, \\textit{Jetson Xavier NX}, and \\textit{Jetson AGX Xavier}, with different levels of CPU, GPU, and memory capacity. The relation between their computational capacities is Jetson TX2 $<$ Jetson Xavier NX $<$ Jetson AGX Xavier. \\textit{Finally}, we enable opportunistic data ferrying, using drones. This is for traffic that is delay tolerant. The drones perform fly-by over the farm and are able to detect sensor feeds beamed to them from the ground sensor nodes (or sensor nodes on poles) in the living testbed. This enables them to carry high-bandwidth video, sound, or image feeds from the static nodes to the gateway node(s). The drones can also be used for temporal surveillance of the fields where gathered image feeds (over time intervals) can be used for a temporal health scan of the fields. In our current implementation, we use LoRa and LoRaWAN gateways for aggregating the multi-modal sensor data. In alternate settings, these could be replaced by NB-IoT with some infrastructure and recurring costs.\n\nOur living lab testbed across different scenarios is an enabler for usable data collection and analytics from farms, even small-scale farms. This will require a careful adaptation of wireless, database, and ML technologies for the digital agriculture scenario and orchestration of these individual technology elements into a usable and low-cost end-to-end system, as described in Lattice~\\cite{chaterji2021lattice}. There is momentum behind this through projects like FarmBeats, AirBand technologies, and Open Ag Data Alliance. \nWe hope that our work by providing an exemplar instantiation will accelerate this movement.\n\n\n\n\n\n\\section{#1}\\vspace{-4pt}}\n\n\n\n\\newif\\ifdraft\n\\drafttrue\n\n\\usepackage{comment}\n\n\\newcommand{\\pengcheng}[1]{\\ifdraft{\\textcolor{magenta}{\\textbf{PW:} #1}}\\fi}\n\\newcommand{\\somali}[1]{\\ifdraft{\\textcolor{red}{SC: #1}}\\fi}\n\\newcommand{\\saurabh}[1]{\\ifdraft{\\textcolor{orange}{SB: #1}}\\fi}\n\\newcommand{\\edgardo}[1]{\\ifdraft{\\textcolor{blue}{\\textbf{EB:} #1}}\\fi}\n\\newcommand{\\tom}[1]{\\ifdraft{\\textcolor{brown}{\\textbf{TR:} #1}}\\fi}\n\\newcommand{\\question}[1]{\\ifdraft{\\textcolor{red}{Q: #1}}\\fi}\n\\newcommand{\\Ourtodo}[1]{\\ifdraft{\\textcolor{blue}{TODO: #1}}\\fi}\n\n\\newcommand{\\newtext}[1]{\\ifdraft{\\textcolor{red}{#1}}\\else{#1}\\fi}\n\\newcommand{\\rev}[1]{\\ifdraft{\\textcolor{blue}{#1}}\\else{#1}\\fi}\n\\newcommand{\\revreviewed}[1]{\\ifdraft{\\textcolor{brown}{#1}}\\else{#1}\\fi}\n\n\n\\newcommand{{\\em i.e.,}\\xspace}{{\\em i.e.,}\\xspace}\n\\newcommand{{\\em et al.}\\xspace}{{\\em et al.}\\xspace}\n\\newcommand{{\\em e.g.,}\\xspace}{{\\em e.g.,}\\xspace}\n\n\\newcommand{\\customsec}[1]{\\noindent{\\textbf{{#1}:}}}\n\n\\newcommand{{\\sc Orpheus}\\xspace}{{\\sc Orpheus}\\xspace}\n\\newcommand{{\\em Orpheus} is the God of supernatural music and can energize even lifeless rocks and trees to dance in enchantment. We envision our living lab to bring to fruition data analytics technologies, such as those tested on our embedded testbed, to transform IoT-enabled agriculture. \\xspace}{{\\em Orpheus} is the God of supernatural music and can energize even lifeless rocks and trees to dance in enchantment. We envision our living lab to bring to fruition data analytics technologies, such as those tested on our embedded testbed, to transform IoT-enabled agriculture. \\xspace}\n\n\\usepackage[font={bf,footnotesize},labelsep=colon,justification=justified]{caption}\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\n\\section{Fast-oopsi, a brief view}\n\nOopsi, from vogelstein \\cite{vogelstein2010oopsi,vogelstein2010fast}, is a family of optimal optical spike inference algorithms. Here, we focus on the development of the fast-oopsi, which was originally published in \\cite{vogelstein2010fast}. We will port the MATLAB implementation to python. Sec \\ref{sec:model}, \\ref{sec:bayes}, \\ref{fast-oopsi:bayes}, \\ref{fast-oopsi:solver} and \\ref{fast-oopsi:parameters} are digests from the original paper by vogelstein \\cite{vogelstein2010oopsi}.\n\nThe python implementation, \\textcolor{red}{\\textbf{py-oopsi}}, can be obtained at \\textcolor{red}{\\url{https:\/\/github.com\/liubenyuan\/py-oopsi}}.\n\n\\section{Calcium fluorescence model}\n\\label{sec:model}\n\nLet $\\ve{F}$ be a one-dimensional fluorescence trace. At time $t$, the fluorescence measurement $F_t$ is a linear Gaussian function of the intracellular calcium concentration $[\\ensuremath{\\mathrm{Ca}}^{2+}]_t$ at that time:\n\\begin{equation}\n F_t = \\alpha [\\ensuremath{\\mathrm{Ca}}^{2+}]_t + \\beta + e_t, \\qquad e_t\\sim\\mathcal{N}(0,\\sigma^2)\n\\end{equation}\n$\\alpha$ determines the scale of the signal, $\\beta$ absorbs the offset. $\\alpha$ and $\\beta$ may be learned independently per neuron. The noise $e_t$ is assumed to be i.i.d distributed.\n\nThe calcium concentration jumps $A$ $\\mu$M after each spike and decays back down to baseline $C_b$ $\\mu$M, with time constant $\\tau$,\n\\begin{equation}\n [\\ensuremath{\\mathrm{Ca}}^{2+}]_{t+1} = (1-\\Delta\/\\tau)[\\ensuremath{\\mathrm{Ca}}^{2+}]_t + (\\Delta\/\\tau)C_b + An_t,\n\\end{equation}\nwhere $\\Delta$ is the frame interval. The scale $A$ and $\\alpha$, baseline $C_b$ and $\\beta$ are not identifiable, therefore, we may let $A=1$ and $C_b=0$ without loss of generality. $n_t$ indicates the number of times the neuron spiked in time $t$, we may also write it as a delta function $\\delta_t$.\n\nFinally, letting $\\gamma=(1-\\Delta\/\\tau)$, we have\n\\begin{equation}\n C_{t} = \\gamma C_{t-1} + n_t\n\\end{equation}\nand (the filtering model)\n\\begin{equation}\n C[z] = \\frac{1}{1-\\gamma z^{-1}} N[z]\n\\end{equation}\nNote that $C_t$ does not refer to the absolute intracellular concentration, but rather, a relative measure\\cite{vogelstein2010fast}. The simulated calcium trace can be generated if we synthetically generate $n_t$ from a probability distribution. To complete the generative model, we assume spikes are sampled according to a Poisson distribution,\n\\begin{equation}\n n_t \\sim \\text{Poisson}(\\lambda\\Delta)\n\\end{equation}\nwhere $\\lambda\\Delta$ is the expected firing rate per bin, $\\Delta$ is included to ensure that the expected firing rate is independent of the frame rate\\cite{vogelstein2010fast}.\n\n\\section{Bayes Model}\n\\label{sec:bayes}\nWe aim to find the most likely spike trains $\\hat{\\ve{n}}$ given the fluorescence $\\ve{F}$,\n\\begin{equation}\\label{eq:n_map0}\n \\hat{\\ve{n}} = \\operatornamewithlimits{arg\\,max}_{n_t\\in\\mathcal{N}_0,\\forall t} p(\\ve{n}|\\ve{F})\n\\end{equation}\nUsing Bayes' rule,\n\\begin{equation}\n p(\\ve{n}|\\ve{F}) = \\frac{1}{p(\\ve{F})}\\cdot p(\\ve{F}|\\ve{n})p(\\ve{n})\n\\end{equation}\ngiven that $p(\\ve{F})$ merely scales the results, we rewrite \\eqref{eq:n_map0} as,\n\\begin{equation}\n \\hat{\\ve{n}} = \\operatornamewithlimits{arg\\,max}_{n_t\\in\\mathcal{N}_0,\\forall t} p(\\ve{F}|\\ve{n})p(\\ve{n})\n\\end{equation}\nand we already have,\n\\begin{align}\n p(\\ve{F}|\\ve{n}) &= p(\\ve{F}|\\ve{C}) = \\prod p(F_t|C_t), \\\\\n p(\\ve{n}) &= \\prod p(n_t),\n\\end{align}\nwhere,\n\\begin{align}\n p(F_t|C_t) &= \\mathcal{N}(\\alpha C_t + \\beta,\\sigma^2), \\\\\n p(n_t) &= \\mathrm{Poisson}(\\lambda\\Delta)\n\\end{align}\nThe Poisson distribution penalize sparsity (a sparse prior).\n\nFinally, we have the cost function,\n\\begin{align}\n \\hat{\\ve{n}} &= \\operatornamewithlimits{arg\\,max}_{n_t\\in\\mathcal{N}_0} \\prod_{t=1}^{T} \\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp\\left\\{ -\\frac{1}{2}\\frac{(F_t - \\alpha C_t - \\beta)^2}{\\sigma^2}\\right\\} \\frac{\\exp\\left\\{ -\\lambda\\Delta \\right\\}(\\lambda\\Delta)^{n_t}}{n_t!} \\\\\n &= \\operatornamewithlimits{arg\\,max}_{n_t\\in\\mathcal{N}_0} \\sum_{t=1}^{T} -\\frac{1}{2\\sigma^2}(F_t - \\alpha C_t - \\beta)^2 + n_t\\ln \\lambda\\Delta - \\ln n_t!\n\\end{align}\nHowever, solving for this discretized optimization problem is computational intractable.\n\n\\section{Approximate Bayes Filter}\n\\label{fast-oopsi:bayes}\n\nWe can approximate the Poisson distribution with an exponential distribution of the same mean,\n\\begin{equation}\n \\frac{\\exp\\{-\\lambda\\Delta\\}(\\lambda\\Delta)^{n_t}}{n_t!} \\rightarrow (\\lambda\\Delta)\\exp\\{-n_t\\lambda\\Delta\\}\n\\end{equation}\nand consequently,\n\\begin{equation}\n \\hat{\\ve{n}} = \\operatornamewithlimits{arg\\,max}_{n_t>0} \\sum_{t=1}^{T} -\\frac{1}{2\\sigma^2}(F_t - \\alpha C_t - \\beta)^2 - n_t\\lambda\\Delta\n\\end{equation}\nnote that $n_t\\in\\mathcal{N}_0$ has been replaced by $n_t>0$, since exponential distribution can yield any nonnegative number\\cite{vogelstein2010fast}. The exponential approximation imposes a sparsening effect, and also, it makes the optimization problem concave in $\\ve{C}$, meaning that any gradient descent algorithm guarantees achieving \\textbf{the global maxima} (because there are no local minima).\n\nWe may further drop the constraint (nonnegative) by adopting \\textbf{interior point} method,\n\\begin{equation}\n \\hat{\\ve{n}} = \\operatornamewithlimits{arg\\,max}_{n_t} \\sum_{t=1}^{T} -\\frac{1}{2\\sigma^2}(F_t - \\alpha C_t - \\beta)^2 - n_t\\lambda\\Delta + z\\ln n_t\n\\end{equation}\nwhere we add a weighted barrier term that approaches $-\\infty$ as $n_t$ approaches zero, by solving for a series of $z$ going down to nearly zero. The goal is to efficiently solve,\n\\begin{equation}\n \\hat{\\ve{C}} = \\operatornamewithlimits{arg\\,max}_{C} \\sum_{t=1}^{T} -\\frac{1}{2\\sigma^2}(F_t - \\alpha C_t - \\beta)^2 - (C_t - \\gamma C_{t-1})\\lambda\\Delta + z\\ln (C_t - \\gamma C_{t-1})\n\\end{equation}\nthis cost function is twice differentiable, one can use the Newton-Raphson technique to ascend the surface.\n\n\\section{Matrix Notation and the Newton-Raphson solver}\n\\label{fast-oopsi:solver}\nTo proceed, we have\n\\begin{equation}\n \\ve{M}\\ve{C} =\n \\begin{bmatrix}\n -\\lambda & 1 & 0 & 0 & \\cdots & 0 \\\\\n 0 & -\\lambda & 1 & 0 & \\cdots & 0 \\\\\n \\vdots & \\ddots & \\ddots & \\ddots & \\ddots & \\vdots \\\\\n 0 & \\cdots & 0 & -\\lambda & 1 & 0 \\\\\n 0 & \\cdots & 0 & 0 & -\\lambda & 1\n \\end{bmatrix}\n \\begin{bmatrix}\n C_1 \\\\\n C_2 \\\\\n \\vdots \\\\\n C_{T-1} \\\\\n C_{T}\n \\end{bmatrix} =\n \\begin{bmatrix}\n n_1 \\\\\n n_2 \\\\\n \\vdots \\\\\n n_{T-1}\n \\end{bmatrix}\n\\end{equation}\n$\\ve{M}$ is a $(T-1)\\times T$ matrix. Now letting $\\ve{1}$ be a $(T-1)\\times 1$ column vector, $\\bm{\\lambda} = (\\lambda\\Delta)\\ve{1}$, $\\bm{\\alpha}$ and $\\bm{\\beta}$ a $T$-dimensional vector, $\\odot$ to indicate element-wise operations, then \\footnote{contrary to \\cite{vogelstein2010fast}, but alike \\textbf{fast-oopsi.m}, we choose $\\ve{M}$ as a sparse $T\\times T$ matrix, and $\\ve{1}$ as $T\\times 1$ column vector. Therefore we have $n_0=C_0$, we will correct $n_0=\\epsilon$ after convergence.}\n\\begin{equation}\n \\hat{\\ve{C}} = \\operatornamewithlimits{arg\\,max}_{\\ve{MC}\\geq_{\\odot}\\ve{0}} -\\frac{1}{2\\sigma^2}\\norm{\\ve{F}-\\bm{\\alpha}\\ve{C}-\\bm{\\beta}}_2^2 - (\\ve{MC})^T\\bm{\\lambda} + z\\ln_{\\odot} (\\ve{MC})^T\\ve{1}\n\\end{equation}\n\nWe instead iteratively minimize the cost function $\\mathcal{L}$ (called \\textit{post} in our python implementation) where,\n\\begin{equation}\n \\hat{\\ve{C}}_z = \\operatornamewithlimits{arg\\,min}_{\\ve{C}} \\mathcal{L}, \\quad \\mathcal{L}= \\frac{1}{2\\sigma^2}\\norm{\\ve{F}-\\bm{\\alpha}\\ve{C}-\\bm{\\beta}}_2^2 + (\\ve{MC})^T\\bm{\\lambda} - z\\ln_{\\odot} (\\ve{MC})^T\\ve{1}\n\\end{equation}\n$\\mathcal{L}$ is \\textbf{convex}, when using Newton-Raphson method to \\textbf{descend} a surface, one iteratively computes the gradient $\\ve{g}=\\nabla\\mathcal{L}$ (first derivative) and Hessian $\\ve{H}=\\nabla^2\\mathcal{L}$ (second derivative) of the argument to be optimized. Then, $\\ve{C} = \\ve{C} - s\\ve{d}$, where $s$ is the step size and $\\ve{d}$ is the step direction by solving $\\ve{H}\\ve{d} = \\ve{g}$. The gradient and Hessian, with respect to $\\ve{C}$, are\n\\begin{align}\n \\ve{g} &= -\\frac{\\bm{\\alpha}}{\\sigma^2} (\\ve{F} - \\bm{\\alpha}\\ve{C} - \\bm{\\beta}) + \\ve{M}^T\\bm{\\lambda} - z\\ve{M}^T(\\ve{MC})_{\\odot}^{-1} \\\\\n \\ve{H} &= \\frac{\\alpha^2}{\\sigma^2}\\ve{I} + z\\ve{M}^T(\\ve{MC})_{\\odot}^{-2}\\ve{M}\n\\end{align}\n$s$ is found via \\textbf{backtracking linesearches}. $\\ve{M}$ is bidiagonal, so $\\ve{H}$ is tridiagonal, $\\ve{d} = \\ve{H}^{-1}\\ve{g}$ can be efficiently implemented in matlab by assuming $\\ve{H}$ is a sparse matrix. In python, we may use sparse linsolvers (linsolve.spsolve) to efficiently find $\\ve{d}$. Once $\\hat{\\ve{C}}$ is obtained, it is a simple linear transform to obtain $\\hat{\\ve{n}}$, via $\\hat{\\ve{n}}=\\ve{M}\\hat{\\ve{C}}$. We will normalize $\\ve{n}$ by $\\ve{n}=\\ve{n}\/\\mathrm{max}(\\ve{n})$ after convergence.\n\n\\section{Parameters initialize and update}\n\\label{fast-oopsi:parameters}\n\nThe parameters $\\bm{\\theta}=\\{\\alpha,\\beta,\\sigma,\\gamma,\\lambda\\}$ are unknown. We may use pseudo expectation-maximization method,\n(1), initialize the parameters, (2) recursively computes $\\hat{\\ve{n}}$ and updating $\\bm{\\theta}$ given the new $\\hat{\\ve{n}}$ until the convergence is met.\n\nThe scale of $\\ve{F}$ relative to $\\ve{n}$ is arbitrary, therefore, $\\ve{F}$ is firstly \\textit{detrended}, and then \\textit{linearly mapped} between $0$ and $1$.\n\\begin{equation}\n \\ve{F} = \\mathrm{detrend}(\\ve{F}), \\quad \\ve{F}=(\\ve{F} - F_{min}) \/ (F_{max} - F_{min}),\n\\end{equation}\nNext, because spiking is sparse in many experimental settings, $\\ve{F}$ tends to be around baseline, $\\beta$ is set to the median of $\\ve{F}$. We use median absolute deviation (MAD) and correction factor $K$, as a robust normal scale estimator of $\\ve{F}$ where $K=1.4826$. Previous works showed that the results $\\hat{\\ve{n}}$ and $\\hat{\\ve{C}}_z$ are robust to minor variations in the time constant, we let $\\gamma=1-\\Delta$. Finally, $\\lambda$ is set to $1$Hz, which is between baseline and evoked spike rate for data of interest \\footnote{corrections to \\cite{vogelstein2010fast}: 1), add detrend to $\\ve{F}$, 2), $K=1.4826$ and it is multiplied (not divided by) $\\mathrm{MAD}(\\ve{F})$.}.\n\\begin{align}\n \\alpha &= 1, \\\\\n \\beta &= \\mathrm{median}(\\ve{F}), \\\\\n \\sigma &= \\mathrm{MAD}(\\ve{F})\\cdot K = \\mathrm{median}(\\abs{\\ve{F} - \\beta})\\cdot K, \\quad K = 1.4826 \\\\\n \\gamma &= 1 - \\Delta\/(1 \\mathrm{sec}), \\\\\n \\lambda &= 1 \\mathrm{Hz}\n\\end{align}\n\nThen, given $\\hat{\\ve{C}}$ and $\\hat{\\ve{n}}$, we may (approximately) update $\\bm{\\theta}$ by,\n\\begin{equation}\n \\hat{\\bm{\\theta}} \\approx \\operatornamewithlimits{arg\\,max}_{\\bm{\\theta}} p(\\ve{F},\\hat{\\ve{C}}|\\bm{\\theta}) = \\operatornamewithlimits{arg\\,max}_{\\bm{\\theta}} \\ln p(\\ve{F}|\\hat{\\ve{C}};\\{\\alpha,\\beta,\\sigma\\}) + \\ln p(\\hat{\\ve{n}}|\\lambda)\n\\end{equation}\nwhere,\n\\begin{align}\n \\hat{\\lambda} &= \\operatornamewithlimits{arg\\,max}_{\\lambda>0} \\sum_{i=1}^T \\left[ \\ln(\\lambda\\Delta) + \\hat{n_t}\\lambda\\Delta \\right] \\\\\n \\{\\hat{\\alpha},\\hat{\\beta},\\hat{\\sigma}\\} &= \\operatornamewithlimits{arg\\,max}_{\\alpha,\\beta,\\sigma >0}\\sum_{i=1}^T \\left[ -\\frac{1}{2}\\ln(2\\pi\\sigma^2) - \\frac{1}{2}\\left( \\frac{F_t - \\alpha C_t - \\beta}{\\sigma} \\right)^2 \\right]\n\\end{align}\nWe have (by taking the derivatives and letting them equal zero),\n\\begin{align}\n \\hat{\\lambda} &= \\frac{T}{\\Delta \\sum_t n_t}, \\\\\n \\hat{\\alpha} &= 1, \\\\\n \\hat{\\beta} &= \\frac{\\sum_t (F_t - C_t)}{T}, \\\\\n \\hat{\\sigma}^2 &= \\frac{\\sum_t (F_t - C_t - \\beta)^2}{T} = \\frac{\\norm{\\ve{F} - \\ve{C} - \\bm{\\beta}}_2^2}{T}\n\\end{align}\nwhere $\\hat{\\lambda}$ is the inverse of the inferred firing rate, $\\hat{\\alpha}$ can be set to $1.0$ because the scale of $\\ve{C}$ is arbitrary, $\\hat{\\beta}$ is the mean bias, $\\hat{\\sigma}$ is the root-mean-square of the residual error.\n\n\\section{Implementation of oopsi}\nMatlab implementation is available, here we focus on the python migrant, and correct some typos in \\cite{vogelstein2010fast} as needed. The python code itself explains all, see \\ref{fast-oopsi:bayes}, \\ref{fast-oopsi:solver}, and \\ref{fast-oopsi:parameters} for detailed documentary. Pseudo code can be found in Algo \\ref{algo:fast-oopsi}. Algo \\ref{algo:oopsi_est_map} describe the subroutine \\textbf{MAP}, Algo \\ref{algo:oopsi_est_par} describe the subroutine \\textbf{update}.\n\\begin{algorithm}[htbp]\n \\caption{Pseudo code (python) for fast-oopsi}\\label{algo:fast-oopsi}\n \\begin{algorithmic}[1]\n \\STATE Initialize parameters $\\ve{P}$: $\\ve{F}=\\mathrm{detrend}(\\ve{F})$, $\\ve{F}=(\\ve{F}-\\mathrm{min}(\\ve{F}))\/(\\mathrm{max}(\\ve{F})-\\mathrm{min}(\\ve{F}))$, $\\alpha=1.0$, $\\beta=\\mathrm{median}(\\ve{F})$, $\\lambda=1.0$, $\\gamma=1-\\Delta$, $\\sigma=\\mathrm{MAD}(\\ve{F})\\cdot 1.4826$, $T=\\mathrm{len}(\\ve{F})$\n \\STATE one-shot Newton-Raphson $\\ve{n}$, $\\ve{C}$, $\\mathcal{L}$ = MAP($\\ve{F}$,$\\ve{P}$), see Algo \\ref{algo:oopsi_est_map}.\n \\FOR{$i$ in $1\\cdots\\mathrm{iterMax}$}\n \\STATE update parameters $\\ve{P}$ = update($\\ve{n}$,$\\ve{C}$,$\\ve{F}$,$\\ve{P}$), see Algo \\ref{algo:oopsi_est_par}.\n \\STATE iterative through $\\ve{n}$, $\\ve{C}$, $\\mathcal{L}$ = MAP($\\ve{F}$,$\\ve{P}$),\n \\STATE let $\\mathcal{L}^{(k)}=\\{\\mathcal{L}_1,\\cdots,\\mathcal{L}_k\\}$\n \\IF{$\\abs{\\frac{\\mathcal{L}_i-\\mathcal{L}_{i-1}}{\\mathcal{L}_i}}<\\mathrm{ltol}$ or $\\mathrm{any}(\\abs{\\mathcal{L}^{(i)}-\\mathcal{L}_i})<\\mathrm{gtol}$}\n \\STATE break\n \\ENDIF\n \\ENDFOR\n \\end{algorithmic}\n\\end{algorithm}\n\n\\begin{algorithm}[htbp]\n \\caption{Pseudo code of subroutine \\textit{MAP}}\\label{algo:oopsi_est_map}\n \\begin{algorithmic}[1]\n \\STATE Initialize $\\ve{n}=0.01\\ve{1}$\n \\STATE Initialize $\\ve{C}(z) = 1\/(1-\\gamma) \\ve{N}(z)$\n \\STATE Initialize $\\bm{\\lambda}=\\lambda\\Delta \\ve{1}$\n \\FOR{$z=1.0$, $z>1e-13$, $z=z\/10$}\n \\STATE calculate $\\mathcal{L}_z$\n \\WHILE{$s>1e-3$ or $\\norm{\\ve{d}}>5e-2$}\n \\STATE Calculate $\\ve{g}$, $\\ve{H}$ and $\\ve{d}=\\mathrm{spsolve}(\\ve{H},\\ve{g})$\n \\STATE Find $s$ : $\\ve{h}=-\\ve{n}\/(\\ve{M}\\ve{d})$, $s=\\min (0.99\\ve{s}[\\ve{s}>0],1.0)$\n \\STATE Initialize $\\mathcal{L}_s=\\mathcal{L}_z + 1$\n \\WHILE{$\\mathcal{L}_s>\\mathcal{L}_z + 1e-7$}\n \\STATE $\\ve{C}=\\ve{C}+s\\ve{d}$\n \\STATE $\\ve{n}=\\ve{MC}$\n \\STATE update $\\mathcal{L}_s$\n \\STATE decrease $s=s\/5.0$\n \\IF{$s<1e-20$}\n \\STATE break\n \\ENDIF\n \\ENDWHILE\n \\ENDWHILE\n \\ENDFOR\n \\end{algorithmic}\n\\end{algorithm}\n\n\\begin{algorithm}[htbp]\n \\caption{Pseudo code of subroutine \\textit{update}}\\label{algo:oopsi_est_par}\n \\begin{algorithmic}[1]\n \\STATE $\\alpha=1.0$\n \\STATE $\\beta=\\sum_i (F_i-C_i)\/T$\n \\STATE $\\sigma^2=\\norm{\\ve{F}-\\alpha\\ve{C}-\\beta}_2^2\/T$\n \\STATE $\\lambda=T \/ (\\Delta\\sum_i n_i)$\n \\end{algorithmic}\n\\end{algorithm}\n\n\\section{Wiener filter (linear regression, simple convex optimization)}\nIn the wiener filter, we approximate the Poisson distribution with a Gaussian distribution,\n\\begin{equation}\n p(n_t) \\sim \\mathcal{N}(\\lambda\\Delta,\\lambda\\Delta)\n\\end{equation}\nthen, the MAP estimator yields,\n\\begin{equation}\n \\hat{\\ve{n}} = \\operatornamewithlimits{arg\\,max}_{n_t} \\sum_{t=1}^T \\left[ -\\frac{1}{2\\sigma^2}(F_t - \\alpha C_t -\\beta)^2 -\\frac{1}{2\\lambda\\Delta}(n_t - \\lambda\\Delta)^2 \\right]\n\\end{equation}\nand its matrix notation,\n\\begin{equation}\n \\hat{\\ve{C}} = \\operatornamewithlimits{arg\\,max}_{\\ve{C}} -\\frac{1}{2\\sigma^2}\\norm{\\ve{F} - \\alpha\\ve{C} - \\beta\\ve{1}}_2^2 - \\frac{1}{2\\lambda\\Delta}\\norm{\\ve{MC}-\\lambda\\Delta\\ve{1}}_2^2\n\\end{equation}\nwhich is \\textbf{quadratic}, \\textbf{concave} in $\\ve{C}$.\n\nFinally, we aim to optimize (minimize, \\textbf{quadratic}, \\textbf{convex} optimization),\n\\begin{equation}\n \\hat{\\ve{C}} = \\operatornamewithlimits{arg\\,min}_{\\ve{C}} \\mathcal{L}, \\quad \\mathcal{L}= \\frac{1}{2\\sigma^2}\\norm{\\ve{F} - \\alpha\\ve{C} - \\beta\\ve{1}}_2^2 + \\frac{1}{2\\lambda\\Delta}\\norm{\\ve{MC}-\\lambda\\Delta\\ve{1}}_2^2\n\\end{equation}\nwhere $\\mathcal{L}$ is \\textbf{convex} in $\\ve{C}$. Using Newton-Raphson update, we find $\\ve{C}=\\ve{C}-\\ve{d}$, $\\ve{H}\\ve{d}=\\ve{g}$ and $\\ve{g}=\\nabla \\mathcal{L}$, $\\ve{H}=\\nabla^2\\mathcal{L}$. The gradient $\\ve{g}$ and Hessian $\\ve{H}$ are,\n\\begin{align}\n \\ve{g} &= -\\frac{\\alpha}{\\sigma^2}(\\ve{F}-\\alpha\\ve{C}-\\beta\\ve{1}) + \\frac{1}{\\lambda\\Delta}\\left[ \\ve{M}^T(\\ve{MC}) + \\lambda\\Delta\\ve{M}^T\\ve{1}\\right] \\\\\n \\ve{H} &= \\frac{\\alpha^2}{\\sigma^2}\\ve{I} + \\frac{1}{\\lambda\\Delta}\\ve{M}^T\\ve{M}\n\\end{align}\nIn the python implementation, we let $\\alpha=1.0$ and $\\beta=0.0$. Pseudo code can be found in Algo \\ref{algo:fast-wiener}.\n\\begin{algorithm}[htbp]\n \\caption{Pseudo code (python) for wiener filter}\\label{algo:fast-wiener}\n \\begin{algorithmic}[1]\n \\STATE Initialize $\\ve{F}=(\\ve{F}-\\mathrm{mean}(\\ve{F}))\/\\mathrm{max}(\\abs{\\ve{F}})$, $\\sigma=0.1\\norm{\\ve{F}}_2$\n \\STATE Calculate $\\mathcal{L}_0$\n \\FOR{$i$ in $1\\cdots$ iterMax}\n \\STATE Calculate $\\ve{g}$, $\\ve{H}$ and $\\ve{d}=\\mathrm{spsolve}(\\ve{H},\\ve{g})$\n \\STATE Calculate $\\ve{C}=\\ve{C} - \\ve{d}$\n \\STATE Calculate $\\mathcal{L}_i$\n \\IF{$\\mathcal{L}_{i}<\\mathcal{L}_{i-1}+\\mathrm{gtol}$}\n \\STATE $\\ve{n}=\\ve{N}$\n \\STATE $\\sigma=\\sqrt{\\norm{\\ve{F}-\\ve{C}}_2^2\/T}$\n \\ENDIF\n \\ENDFOR\n \\STATE $\\ve{n}=\\ve{n}\/\\mathrm{max}(\\ve{n})$\n \\end{algorithmic}\n\\end{algorithm}\n\n\\section{Simulation Results}\nWe generated synthetic calcium traces with $T=2000$, $\\Delta=20$ms, $\\lambda=0.1$, $\\tau=1.5$. Randomized noise were added with $0.2$ standard deviation. Py-oopsi and wiener filter are used to reconstruct the spikes from calcium fluorescence, where only $\\Delta$ is known a prior. The results are shown in Figure \\ref{fig:demo}\n\n\\begin{figure}[htbp]\n \\centering\n \\includegraphics[width=5in]{demo}\n \\caption{Reconstruct spikes from calcium fluorescence. (a) The synthetic calcium trace. (b), (c), (d) are reconstructed spikes by py-oopsi, wiener filter and discretized binning, respectively.}\n \\label{fig:demo}\n\\end{figure}\n\n\n\n\\ifCLASSOPTIONcaptionsoff\n \\newpage\n\\fi\n\n\\bibliographystyle{IEEEtran}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}