% \documentclass{uai2022} % for initial submission
\documentclass[accepted]{uai2022} % after acceptance, for a revised
                                    % version; also before submission to
                                    % see how the non-anonymous paper
                                    % would look like
%% There is a class option to choose the math font
% \documentclass[mathfont=ptmx]{uai2022} % ptmx math instead of Computer
                                         % Modern (has noticable issues)
% \documentclass[mathfont=newtx]{uai2022} % newtx fonts (improves upon
                                          % ptmx; less tested, no support)
% NOTE: Only keep *one* line above as appropriate, as it will be replaced
%       automatically for papers to be published. Do not make any other
%       change above this note for an accepted version.

%% Choose your variant of English; be consistent
\usepackage[american]{babel}
% \usepackage[british]{babel}

%% Some suggested packages, as needed:
\usepackage{natbib} % has a nice set of citation styles and commands
    \bibliographystyle{plainnat}
    \renewcommand{\bibsection}{\subsubsection*{References}}
\usepackage{mathtools} % amsmath with fixes and additions
% \usepackage{siunitx} % for proper typesetting of numbers and units
\usepackage{booktabs} % commands to create good-looking tables
\usepackage{tikz} % nice language for creating drawings and diagrams

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{float}
%% Provided macros
% \smaller: Because the class footnote size is essentially LaTeX's \small,
%           redefining \footnotesize, we provide the original \footnotesize
%           using this macro.
%           (Use only sparingly, e.g., in drawings, as it is quite small.)

%% Self-defined macros
\newcommand{\swap}[3][-]{#3#1#2} % just an example
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}

\title{PDQ-Net: Deep Probabilistic Dual Quaternion Network for Absolute Pose Regression on $SE(3)$ (Supplementary material)}

% The standard author block has changed for UAI 2022 to provide
% more space for long author lists and allow for complex affiliations
%
% All author information is authomatically removed by the class for the
% anonymous submission version of your paper, so you can already add your
% information below.
%
% Add authors
%\author[1]{\href{mailto:<jj@example.edu>?Subject=Your UAI 2022 paper}{Jane~J.~von~O'L\'opez}{}}
\author[1]{Wenjie~Li}
\author[2]{Wasif~Naeem}
\author[1]{Jia~Liu}
\author[1]{Dequan~Zheng}
\author[1]{Wei~Hao}
\author[1]{Lijun~Chen}
%\author[3]{Further~Coauthor}
%\author[3,1]{Further~Coauthor}
% Add affiliations after the authors
\affil[1]{%
    Department of Computer Science and Technology\\
    Nanjing University\\
    Nanjing, China
}
\affil[2]{%
    School of Electronics, Electrical Engineering and Computer Science\\
    Queen's University Belfast\\
    Belfast, UK
}
%\affil[3]{%
%    Another Affiliation\\
%    Address\\
%    …
%  }
  
  \begin{document}
\maketitle

In this part, we mainly give the supplementary material for the original paper. First, we show the proofs of several features of the unit dual quaternion distribution on $SE(3)$. Then we give the supplementary analysis of the proposed model on different noisy scenes in the Cambridge Landmark dataset to demonstrate the robustness of our method.


\section{Proof}
\begin{theorem}
    Consider the antipodally symmetric distribution $f(\mathbf{v})$, the sub-block matrix $\mathbf{F}_1\in \mathbb{R}^{4\times 4}$ is real symmetric, $\mathbf{F}_3\in \mathbb{R}^{4\times 4}$ is real symmetric and negative definite.
    \begin{equation}\label{distributionfinal}
        \begin{aligned}
            f(\mathbf{v})&=\frac{1}{N(\mathbf{F})}\exp \underbrace{(\mathbf{q}_r^{T}(\mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T})\mathbf{q}_r}_{Bingham-like}+ \\
            & \underbrace{(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r)^{T}\mathbf{F}_3(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r))}_{Gaussian-like}.
        \end{aligned}
        \end{equation}
\end{theorem}
\begin{proof}
    We expand the original unit dual quaternion probability density function as follows,
    \begin{equation}\label{DistributionExpand}
    f(\mathbf{v}) = \frac{1}{N(\mathbf{F})}\exp\underbrace{\left(
        \begin{bmatrix}
            \mathbf{q}_r \\
            \mathbf{q}_d
        \end{bmatrix}^T 
        \begin{bmatrix}
            \mathbf{F}_1 & \mathbf{F}_2 \\
            \mathbf{F}_{2}^{T} & \mathbf{F}_3
        \end{bmatrix}
        \begin{bmatrix}
            \mathbf{q}_r \\
            \mathbf{q}_d
        \end{bmatrix} 
            \right)}_{A}.
    \end{equation}
    
    We denote the exponential part as $A$, and then we expand it, and have
    \begin{equation}\label{A_exp}
        \begin{aligned}
            A&=\left(
        \begin{bmatrix}
            \mathbf{q}_r \\
            \mathbf{q}_d
        \end{bmatrix}^T 
        \begin{bmatrix}
            \mathbf{F}_1 & \mathbf{F}_2 \\
            \mathbf{F}_{2}^{T} & \mathbf{F}_3
        \end{bmatrix}
        \begin{bmatrix}
            \mathbf{q}_r \\
            \mathbf{q}_d
        \end{bmatrix} 
            \right)\\
            &=\mathbf{q}_r^{T}\mathbf{F}_1\mathbf{q}_r +\mathbf{q}_d^{T}\mathbf{F}_2^{T}\mathbf{q}_r+ \mathbf{q}_r^{T}\mathbf{F}_2\mathbf{q}_d+\mathbf{q}_d^{T}\mathbf{F}_3\mathbf{q}_d.
        \end{aligned}
    \end{equation}

    Clearly, the sub-matrices $\mathbf{F}_1$ and $\mathbf{F}_3$ have to be real symmetric since they are critical for keeping the antipodally symmetric feature of the target probability density function.

    Then we apply a tiny trick to Equation~\eqref{A_exp}, and we have
    \begin{equation}\label{Aexp_2}
        \begin{aligned}
            A = &\mathbf{q}_r^{T}\mathbf{F}_1\mathbf{q}_r-\mathbf{q}_r^{T}\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r+\mathbf{q}_d^{T}\mathbf{F}_3\mathbf{q}_d \\
            & \quad +\mathbf{q}_d^{T}\mathbf{F}_3\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r 
            +\mathbf{q}_r^{T}\mathbf{F}_2\mathbf{F}_3^{-T}\mathbf{F}_3\mathbf{q}_d  \\
            & \quad +\mathbf{q}_r^{T}\mathbf{F}_2\mathbf{F}_3^{-T}\mathbf{F}_3\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r \\
            = &\mathbf{q}_r^{T}(\mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T})\mathbf{q}_r \\
            & \quad +(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r)^{T}\mathbf{F}_3(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r).
        \end{aligned}
        \end{equation}

    Next, we take an integration of $\exp(A)$ over the unit dual quaternion manifold $\mathbb{DH}_1\subset \mathbb{R}^{8}$, 
    \begin{equation}\label{expand}
        \begin{aligned}
        N(\mathbf{F}) =& \int_{\mathbb{DH}_1}f(\mathbf{v})d\mathbf{v} \\
        =&\int_{\mathbb{S}^3}\int_{\mathbb{R}^4}\mathbf{q}_r^{T}(\mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T})\mathbf{q}_r \\
        & \quad +(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r)^{T}\mathbf{F}_3(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r)d\mathbf{q}_d d\mathbf{q}_r.
        \end{aligned}
    \end{equation}

    We find that the inner integration corresponds to the unnormalized Gaussian density function, and then we have
    \begin{equation}\label{Bingham}
        N(\mathbf{F}) \propto \int_{\mathbb{S}^3}\mathbf{q}_r^{T}(\mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T})\mathbf{q}_r d\mathbf{q}_r.
    \end{equation}

    Hence, the matrix $-\frac{1}{2}\mathbf{F}_3^{-1}$ can be regarded as the covariance matrix of the Gaussian distribution, in which $\mathbf{F}_3$ is negative definite while $\mathbf{F}_2$ is arbitrary.
\end{proof}



\begin{theorem}
    The parameter matrix $\mathbf{F}\in \mathbb{R}^{8\times 8}$ is able to be decomposed into an orthogonal matrix $\mathbf{M}\in \mathbb{R}^{4\times 4}$ and a diagonal matrix $\mathbf{Z}\in \mathbb{R}^{4\times 4}$ via the eigendecomposition of $\mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T}$.
\end{theorem}

\begin{proof}
    As shown in Equation~\eqref{expand}, the marginal distribution of $\mathbf{q}_d$ is the unnormalized Gaussian distribution. Here we take an integration to it.
    \begin{equation}\label{single_distribution}
        \begin{aligned}
        f(\mathbf{q}_r) \propto&\exp (\int_{\mathbb{R}^4}\mathbf{q}_r^{T}(\mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T})\mathbf{q}_r \\
        & \quad +(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r)^{T}\mathbf{F}_3(\mathbf{q}_d+\mathbf{F}_3^{-1}\mathbf{F}_2^{T}\mathbf{q}_r)d\mathbf{q}_d ) \\
        &\propto \exp (\mathbf{q}_r^{T}(\mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T})\mathbf{q}_r).
        \end{aligned}
    \end{equation}

    To this point, Equation~\eqref{single_distribution} is a Bingham-like distribution, in which $\mathbf{q}_r \in \mathbb{S}^3$ is the unit quaternion, and we have
    \begin{align*}
    \mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T}=\mathbf{M}\mathbf{Z}\mathbf{M}^{T}.
    \end{align*}
    As a result, the orthogonal matrix $\mathbf{M}$ and the diagonal matrix $\mathbf{Z}$ can be obtained via the eigendecomposition of $ \mathbf{F}_1-\mathbf{F}_2\mathbf{F}_3^{-1}\mathbf{F}_2^{T}$.
\end{proof}


\section{Experiment}
\textbf{Noisy Scenes}
We train our model on the original Cambridge Landmark dataset for $200$ epochs. We use the Adam optimizer and begin with a learning rate of $10^{-4}$, and gradually decrease the learning rate exponentially with the multiplicative factor being $0.9$, where the learning curve is shown in Figure~\ref{fig:learning_rate_cam}. The batch size $16$ and all input images are resized to $224\times 224$.

\begin{figure}[htbp]
    \centering
    \includegraphics[width=0.95\linewidth]{fig-supp/lr_cambridge.png}
    \caption{The learning curve for the Cambridge Landmark dataset.}
    \label{fig:learning_rate_cam}
\end{figure}


Then we apply the trained model to the three different noisy scenes. We select the Kings College, Hospital, ShopFacade and St.Mary Church as our evaluation scenes, which is shown in Figure~\ref{fig:real_img}(a). First, we manually add the Gaussian blur kernel to all frames in above four different scenes, where the radius of the Gaussian blur kernel is $3.8$ shown in Figure~\ref{fig:real_img}(b). Then we randomly change the brightness, the contrast and the saturation on the second noisy scene which can be found in Figure~\ref{fig:real_img}(c), we set the maximum brightness factor is $0.6$, the maximum contrast factor is $0.6$ and the maximum saturation factor is $0.5$ in this case. Finally, we add above two noise, i.e. blur kernel and random brightness, contrast and saturation, to the third noisy scene which can be found in Figure~\ref{fig:real_img}(d).



Next we feed the different noisy frames into the trained model and the uncertainties of our model in all scenes are shown in Figure~\ref{fig:uncertainty}, where the red points are pose errors under the uncertainty of the original scene, the purple points are pose errors in the blur scene, the blur points refer to pose errors in the brightness change scene and the orange points are pose errors in the blur and brightness change environment.


\begin{figure*}[h]
    \centering
    \includegraphics[width=1\linewidth]{fig-supp/cambridge/cambridge.png}
    \caption{Visualization of four different scenes under different noise conditions. The letter (a) refers to the original scenes. The letters (b),(c),(d) correspond to the different noises added to the original scene. And the four different scenes, Kings College, Hospital, ShopFacade, and St.Mary Church, can be found from the first row to the last row.}
    \label{fig:real_img}
\end{figure*}

\begin{figure*}[h]
    \centering
    \includegraphics[width=1\linewidth]{fig-supp/uncertainty/all_uncertainty.png}
    \caption{Uncertainty evaluation on the Cambridge Landmark dataset. The letters (a), (b),(c),(d) correspond to the different scenes of the Cambridge Landmark dataset. The pose errors under different uncertainty metrics of the model in each scene are shown in the corresponding row, where the odd rows show the rotation uncertainty of the corresponding noisy scene and the even rows show the translation uncertainty of the corresponding noisy scene. }
    %The left column shows the uncertainty of the pose estimation in the blur environment, where the radius of the Gaussian blur kernel is $3.2$. The middle column shows the uncertainty of the pose under the brightness change environment, where the maximum brightness factor is $0.6$, the maximum contrast factor is $0.6$ and the maximum saturation factor is $0.5$. The right column indicates the uncertainty of the pose under both the blur and brightness change environment. Note: we only plot the St.Mary Church scene, full information can be found in Supplementary Material.}
    \label{fig:uncertainty}
\end{figure*}



%\begin{acknowledgements} % will be removed in pdf for initial submission,
                         % so you can already fill it to test with the
                         % ‘accepted’ class option
    %Briefly acknowledge people and organizations here.
%    This research is financially supported by the National Natural Science Foundation of China (No. 62072231), Fundamental Research Funds for the Central Universities (No. 14380079), and the Collaborative Innovation Center of Novel Software Technology and Industrialization.

    %\emph{All} acknowledgements go in this section.
%\end{acknowledgements}

%\bibliography{uai2022-template}

\appendix

\end{document}
