\section{Conclusions}
In this work we introduced 3D-LaneNet+ a 3D lane detection framework that builds upon and improves the recently published 3D-LaneNet. Our main goal was extending 3D-LaneNet allowing it to detect lane topologies previously not supported, including short lanes, lanes perpendicular to the ego vehicle, splits, merges and more.
In order to improve performance in these challenging cases we developed an anchor free method by introducing a semi-local representation that captures topology-invariant lane segments that are then clustered together using a learned global embedding into full lane curves. Removing the need to use lane anchors and lane model fitting (as in 3D-LaneNet) allows 3D-LaneNet+ to support and generalize to different lane topologies, curvatures and surface geometries.
The efficacy of 3D-LaneNet+ was demonstrated on both synthetic and real world data producing a significant improvement in 3D lane detection compared to 3D-LaneNet. A qualitative inspection of the results shows that indeed the method is better equipped to successfully detect lanes of arbitrary topology including splits, merges, short lanes and more. By doing so we take another step towards meeting the requirements of 3D lane detection in autonomous driving in both highway and urban scenarios.

\section{Experimental Setup}\label{Sec:Experiments}
We study the performance of 3D-LaneNet+ using two 3D-lane datasets and compare it to the original 3D-LaneNet of Garnett et al. \cite{garnett20183dlanenet}. We show the advantage of our anchor free approach in detecting short lanes and lanes starting far from the host vehicle demonstrating the method ability to detect different lane topologies and generalize to complex surface geometries.

\pbf{Datasets } Evaluation is done using two 3D lane datasets. The first is \textit{synthetic-3D-lanes} \cite{garnett20183dlanenet} containing synthetic images of complex road geometries with 3D ground truth lane annotations. The second, is a dataset we collected and annotated referred to as \textit{Real-3D-lanes}. This dataset (annotated as in \cite{garnett20183dlanenet}), contains $327K$ images from 19 distinct recordings (different geographical locations which spans an area of $250km$, at different times) taken at 20 fps. The data is split such that the train set, $298K$ images, is comprised mostly of highway scenarios while the test set is comprised of a rural scenario with complex curvatures and road surface geometries, taken at a geographic location not in the train set.
To reduce temporal correlation we sampled every 30'th frames giving us a test set of 1000 images. Examples from the train and test sets can be seen in Fig. \ref{fig:real_data}.

\pbf{Evaluation} We adopt the same evaluation protocol used in the original 3D-LaneNet \cite{garnett20183dlanenet} work that proposes to separate the detection accuracy from the geometric estimation accuracy. Detection accuracy is computed via the commonly used Mean Average Precision (MAP) metric. Similarly to \cite{DAGMapper_2019_ICCV} we adopted the IOU measure to associate between detected curves and GT curves which is general and can account for short lanes or non-parallel lanes that do not go through predefined y-values. The geometric accuracy is assessed by measuring the lateral error of each lane point with respect to its associated GT curve. We divided the entire dataset to lane points in the near range (0-30m) and far range (30-80m) and calculate the mean absolute lateral error for every range.

\pbf{Implementation details } We use the dual-pathway architecture  \cite{garnett20183dlanenet} with a ResNet34 \cite{ResNet} backbone. Our BEV projection covers 20.4m x 80m divided in the last decimated feature map to our tile grid $G_{W\times H}$ with $W=16, H=26$ such that each tile represents $1.28m \times 3m$  of road surface. We found that predicting the camera angle $\varphi_{cam}$ and height $h_{cam}$ gave negligible boost in performance compared to using the fixed mounting parameters on \textit{Real-3D-lanes}, however, on \textit{synthetic-3D-lanes} we followed \cite{garnett20183dlanenet} methodology and trained the network to output $\varphi_{cam}$ and $h_{cam}$ as well. Our average runtime is 85.3 msec using a single GPU (NVIDIA Quadro P5000).

The network is trained with batch size 16 using ADAM optimizer, with initial lr of 1e-5 for 80K iterations which is then reduced to 1e-6 for another $50K$ iterations. We set $\Delta_{pull}$ and $\Delta_{push}$ (Eqs. \ref{Eq:pull}, \ref{Eq:push}) to 0.1 and 3 respectively, and used a coarse 0.3 threshold on the output segment scores $\widetilde{c}_{ij}$ prior to the clustering.

\section{Introduction}
\label{sec:intro}

Camera based 3D lane detection is a cardinal component in many autonomous driving related tasks such as trajectory planning, vehicle localization and map generation to name a few.

Recently, Garnett et al. \cite{garnett20183dlanenet} proposed 3D-LaneNet, a camera-based 3D lane detection method which proposes two novel concepts for lanes detection. The first is a CNN architecture with integrated Inverse Perspective Mapping (IPM) to project feature maps to Bird Eye View (BEV), and the second is an anchor based representation which allows casting the lane detection problem to a single stage object detection problem. Following a similar concept as in SSD \cite{liu2016ssd} or RetinaNet \cite{retina_net}, each BEV column serves as an anchor which regresses the entire lane as a polyline. This imposes strong constrains on the detected lane geometry and topology, limiting this methods ability to detect lanes that are not roughly parallel to the ego vehicle direction of travel. Lanes starting further ahead, and other important non-trivial topologies such as junctions, can not be represented hence are not detected by this method.

In this work, we follow recently proposed anchor free detectors such as FCOS \cite{fcos2019tian} and CenterNet \cite{centernet_zhou2019objects}, and suggest an anchor free extension to 3D-LaneNet we term  \textit{3D-LaneNet+}. Unlike 3D-LaneNet that uses the column based anchors to encapsulate prior information about the lanes structure (long and continuous), anchor-free detectors do not introduce such priors. Their basic paradigm is dividing the input to non-overlapping cells where each cell learns to detect the object that occupies that cell and estimate the object's attributes (e.g. center, dimensions, orientation). Lanes, however, are not compact objects with easily defined centers. Therefore, instead of predicting the entire lane as a whole, we detect small lane segments that lie within the cell and their attributes (position, orientation, height). In addition, we learn for each cell a global embedding that allows clustering the small lane segments together into full 3D lanes. Our suggested solution alleviates the assumption that all lanes should be represented as polylines. This enables detecting lanes of any arbitrary topology including splits, merges, short lanes and lanes perpendicular to the vehicle's direction of travel. Supporting these additional lane topologies improves the detection recall of 3D-LaneNet+, leading to a significant performance improvement relative to the original 3D-LaneNet.

Our anchor free representation can be thought of as compact semi-local representation that is able to capture local topology-invariant lane structures and road surface geometries. Lane detection is done in Bird's Eye View using a grid of non-overlapping coarse tiles, as illustrated in Fig. \ref{fig:method}. We assume lane segments passing through the tiles are simple and can be represented by a low dimensional parametric model.  Specifically, each tile holds a line segment parameterized by an offset from the tile center, an orientation and a height offset from the BEV plane. This semi-local tile representation lies on the continuum between global representation (entire lane) to a local one (pixel level). Each tile output is more informative than a single pixel in a segmentation based solution as it is able to reason on the local lane structure but it is not as constrained as the global anchor based solution which has to capture together the complexity of the entire lane topology, curvature and surface geometry.

We run experiments, using both synthetic and real world datasets, that show 3D-LaneNet+ improves the mean average precision (MAP) over 3D-LaneNet by large margins. We demonstrate qualitatively and quantitatively the efficacy of our representation and its generalization to new lane curvatures and surface geometries.

\begin{figure
\vspace{-2mm}
\centering
\includegraphics[width=\textwidth]{method}
\caption{Method overview. Our network is comprised of two processing pipelines: image view (top) and BEV (bottom). The final decimated BEV feature map is fed to the lane prediction head which outputs local lane segments and global embedding for clustering the segments to entire lanes curves.}
\label{fig:method}
\end{figure}

\section{Method}\label{sec:method}
We now describe our proposed 3D lane detection framework 3D-LaneNet+. A schematic overview appears in Fig.  \ref{fig:method}. We begin by presenting our semi-local tile representation and lane segment parameterization (Sec. \ref{sec:method_representation}) followed by how lane segments are clustered together using learnt embedding (Sec. \ref{sec:method_embedding}).

\subsection{Learning 3D lane segments with Semi-local tile representation}\label{sec:method_representation}

Lane curves have many different global topologies and lie on road surfaces with complex geometries. This makes reasoning for entire 3D lane curves a challenging task. Our key observation is that despite this global complexity, on a local level, lane segments can be represented by low dimensional parametric models. Taking advantage of this observation we propose a semi-local representation that allows our network to learn local lane segments thus generalizes well to unseen lane topologies, curvatures and surface geometries.

Following Garnett et al. \cite{garnett20183dlanenet}, our network is given a single camera image that is fed to the dual pathway backbone which uses an encoder and an Inverse Perspective Mapping (IPM) module to project feature maps to BEV. The projection applies a homography, defined by camera pitch angle $\varphi_{cam}$ and height $h_{cam}$, that maps the image plane to the road plane (see Fig.  \ref{fig:projection_plane}). The final decimated BEV feature map is spatially divided into a grid $G_{W\times H}$ comprised of $W\times H$ non-overlapping tiles. The projection ensures each pixel in the BEV feature map corresponds to a predefined position on the road, independent of camera intrinsics and pose.

We assume that through each tile $g_{ij}\in G_{W\times H}$ can pass a single line segment which can be approximated by a straight line. Specifically, the network regresses, per each tile $g_{ij}$, three parameters: lateral offset distance relative to tile center $\widetilde{r}_{ij}$, line angle $\widetilde{\phi}_{ij}$, (see Local tiles in Fig.  \ref{fig:method}) and height offset $\widetilde{\Delta z}_{ij}$ (see Fig.  \ref{fig:projection_plane}). In addition to these line parameters, the network also predicts a binary classification score $\widetilde{c}_{ij}$ indicating the probability that a lane intersects a particular tile.

Position and $z$ offsets are trained using an $L1$ loss:
\begin{equation}
\mathcal{L}_{ij}^{Offsets} = \|\widetilde{r}_{ij} - r_{ij}\|_1 + \|\widetilde{\Delta z}_{ij} - \Delta z_{ij}\|_1
\end{equation}

Predicting the line angle $\widetilde{\phi}_{ij}$ is done using the hybrid classification-regression framework of \cite{Mahendran2018AMC} in which we classify the angle $\phi$ (omitting tile indexing for brevity) to be in one of $N_{\alpha}$ bins, centered at $\alpha = \{ \frac{2\pi}{N_{\alpha}}\cdot i \}_{i=1}^{N_{\alpha}}$. In addition, we regress a vector $\Delta^{\alpha}$, corresponding to the residual offset relative to each bin center. Our angle bin estimation is optimized using a soft multi-label objective, and the GT probabilities are calculated as $p^{\alpha} = [{1 - |\frac{2\pi}{N_{\alpha}}\cdot i - \phi| / \frac{2\pi}{N_{\alpha}}}]_+ $.

The angle loss is the sum of the classification and offset regression losses:
\begin{multline}
 \mathcal{L}^{angle}_{ij} = \sum_{\alpha=1}^{N_{\alpha}}
     {[p^{\alpha}_{ij}\cdot \log{\widetilde{p}^{\alpha}_{ij}} + (1- p^{\alpha}_{ij}) \cdot \log{(1 - \widetilde{p}^{\alpha}_{ij})}  + \delta^{\alpha}_{ij} \cdot \|\widetilde{\Delta}^{\alpha}_{ij} - \Delta^{\alpha}_{ij} \|_1]}
\end{multline}
where $\delta^{\alpha}_{ij}$ is the indicator function masking the relevant bins for the offset learning.

The lane tile probability $\widetilde{c}_{ij}$ is trained using a binary cross entropy loss:
\begin{equation}
     \mathcal{L}^{score}_{ij} = c_{ij} \cdot\log{\widetilde{c}_{ij}} + (1-c_{ij}) \cdot\log{(1 - \widetilde{c}_{ij})}
\end{equation}

 Finally, the overall tile loss is the sum over all the tiles in the BEV grid:
\begin{equation}
     \mathcal{L}^{tiles} =  \sum_{i,j\in W\times H}(
     \mathcal{L}^{score}_{ij} +c_{ij} \cdot \mathcal{L}^{angle}_{ij} +  c_{ij}\cdot \mathcal{L}^{offsets}_{ij})
     \label{Eq:loss_tiles}
\end{equation}

At inference we convert the offsets ($\widetilde{r}_{ij}, \widetilde{\Delta z}_{ij}$) and angles ($\widetilde{\phi}_{ij}$) back to points by converting them from Polar to Cartesian coordinates, and transform the points from the BEV plane to the camera coordinate frame by subtracting $h_{cam}$ and rotating by $-\varphi_{cam}$ (Fig. \ref{fig:projection_plane}).

\subsection{Global embedding for lane curve clustering}\label{sec:method_embedding}
Once lane tiles are obtained we are still left with the task of generating full 3D lane curves from these small segments. To this end we propose using a clustering approach based on learnt feature embedding. This technique removes the need for using lane anchors and polyline fitting as done in the original 3D-LaneNet, which in turn allow 3D-LaneNet+ to support previously unsupported lanes such as lane perpendicular to the ego vehicle direction of travel and short lanes that start at a long distance from the vehicle.

Specifically, we learn an embedding vector $f_{ij}$ for each tile such that vectors representing tiles belonging to the same lane would reside close in embedded space while vectors representing tiles of different lanes would reside far apart. For this we adopted the approach of \cite{TowardsEnd2End, Semantic_Instance_Segmentation}, and use a discriminative push-pull loss. Unlike previous work, we use the discriminative loss on the decimated tiles grid, which is much more efficient  than operating at the pixel level.

The discriminative push-pull loss is a combination of two losses:
\begin{equation}
 \mathcal{L}^{embedding} = \mathcal{L}^{pull} + \mathcal{L}^{push}
 \end{equation}
 A pull loss aimed at pulling the embeddings of the same lane tiles closer together:
\begin{equation}
     \mathcal{L}^{pull} = \frac{1}{C}\sum_{c=1}^C\frac{1}{N_c}\sum_{ij\in W\times H}{
     [\delta^c_{ij}\cdot\|\mu_c - f_{ij}\| - \Delta_{pull}]_+^2
     }
     \label{Eq:pull}
\end{equation}
 and a push loss aimed at pushing the embedding of tiles belonging to different lanes farther apart:
\begin{equation}
     \mathcal{L}^{push} = \frac{1}{C(C-1)}\sum_{c_{A}=1}^C\sum_{c_{B}=1,c_{B}\neq c_{A}}^C{ [\Delta_{push} - \|\mu_{c_{A}} - \mu_{c_{B}}\|]^2_+ }
     \label{Eq:push}
\end{equation}

where $C$ is the number of lanes (can vary), $N_c$ is the number of tiles belonging to lane $c$, $\delta_{ij}^c$ indicates if tile $i,j$ belongs to lane $c$, $\mu_c=\frac{1}{N_c}\sum_{ij\in W\times H}{\delta^c_{ij}\cdot f_{ij} }$ is the average of $f_{ij}$ belonging to lane $c$, $\Delta_{pull}$ constraints the maximal intra-cluster distance and $\Delta_{push}$ is the inter-cluster minimal required distance.

Given the learnt feature embedding we can use a simple clustering algorithm to extract the tiles that belong to individual lanes. We adopted the clustering methodology from Neven et al. \cite{TowardsEnd2End} which uses mean-shift to find the clusters centers and set a threshold around each center to get the cluster members. We set the threshold to $\frac{\Delta_{push}}{2}$.

\section{Related work}\label{sec:related_work}

\pbf{2D lane detection} Most existing lane detection methods focus on lane detection in the image plane and are mostly limited to detecting lanes parallel to the vehicle direction of travel. The literature is vast and includes methods performing 2D lane detection by using self attention \cite{Hou_2019_ICCV}, employing GANs \cite{ELGAN}, using new convolution layers \cite{pan2018SCNN}, exploit vanishing points to guide the training \cite{lee2017vpgnet} or use differentiable least-squares fitting \cite{wvangansbeke_2019}. Most related to ours is the method of \cite{DeepLearningHW_AndrewNg} that uses a grid based representation in the image plane, with a line parametrizations and density based spatial clustering for highway lane detection. Our approach performs 3D lane detection in BEV perspective, together with a learning based clustering as well as a different parametrization than \cite{DeepLearningHW_AndrewNg}. Another work related to ours is \cite{TowardsEnd2End} that uses learned embedding to perform lane clustering. While \cite{TowardsEnd2End} perform segmentation at the image pixel level, we cluster the lane segments in BEV on the semi-local tile scale, which is far less computationally expensive.

\pbf{3D lane detection} Detecting lanes in 3D is a challenging task drawing increasing attention in recent years. Some methods use LiDAR or a Camera and LiDAR combination for this task. For example, Bai et al.  \cite{bai2018deep} use a CNN over LiDAR points to estimate road surface height and then re-projects the camera to BEV accordingly. The network doesn't detect lane instances end-to-end, but rather outputs a dense detection probability map that needs to be further processed and clustered.
More related to our work are camera-based methods. DeepLanes \cite{gurghian2016deeplanes} uses a BEV representation but works with top-viewing cameras that only detect lanes in the immediate surrounding of the vehicle without providing height information.

Recently, Gen-LaneNet \cite{guo2020gen} suggested using the same column based anchor representation as in 3D-LaneNet \cite{garnett20183dlanenet}, but change the coordinate frame in which the 3d lane points are predicted. Although this new geometry guided lane anchor of Gen-LaneNet is more generalizable to unobserved scenes, it is still limited to long lanes that are roughly parallel to ego vehicle direction of travel. Our proposed anchor free representation is complementary to this new coordinate frame and is therefore expected to be useful in the context of Gen-LaneNet as well (although not tested in our work).

\pbf{Anchor free detectors} Anchor-based methods detect objects in a one-shot global manner by representing the entire object using a set of parameters and regressing these parameters relatively to predefined anchors \cite{liu2016ssd, retina_net}. In the context of lane detection, this problem formulation constrains the lanes to be represented in a global manner by polylines, which limits the variety of lane topologies that can be predicted. Recent anchor free detection works alleviate the need for global anchors and enable the direct regression of the object parameters, or object's sub-parts parameters like in our case. These methods include CornerNet \cite{cornerNet_2018_ECCV} which detects objects as paired keypoints that correspond to the bounding box corners locations, CenterNet \cite{centernet_zhou2019objects} and FCOS \cite{fcos2019tian} which predicts the objects center and dimensions. AFDet, \cite{ge2020afdet} a LiDAR based detector, applies a similar method and predicts the center, orientation and dimensions of objects relatively to a regular top view grid. RepPoints \cite{yang2019reppoints} and Dense RepPoints \cite{yang2019densereppoints} detect objects by predicting sets of representative objects' points, taking a step towards non-rigid object representation which is more fitted to lanes. However, they predict the sets of points relative to the object center, whereas lanes do not have a well defined center. In 3D-LaneNet+ we represent the lane using a set of segments instead of points, thus incorporating information on the lane line structure, and instead of predicting the segments relative to a global lane center, we predict them relative to the grid cell centers. To reason about the segments connectivity we additionally learn instance embedding like in \cite{TowardsEnd2End}.

\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-3mm}
\includegraphics[width=0.48\textwidth]{projection_plane}
\caption{The road projection plane is defined according to the camera mounting pitch angle $\varphi_{cam}$ and height $h_{cam}$, hence our representation is invariant to the camera extrinsics. We represent the GT lanes in full 3D relatively to that plane.}
\label{fig:projection_plane}
\vspace{-8mm}
\end{wrapfigure}
\section{Results}\label{sec:results}

\pbf{Synthetic-3D-lanes dataset }
We compared our 3D-LaneNet+ method to the original 3D-LaneNet. Results are presented in Table \ref{Table:blender}. It can be seen that our $MAP$ (mean of $AP_{IOU\%}$ at IOU thresholds $0.1:0.1:0.9$) and $AP_{50}$ are superior to those of 3D-LaneNet\footnote{Results reported here differ than those in \cite{garnett20183dlanenet} since their evaluation disregards short lanes that start beyond 20m from the ego vehicle.} while showing comparable lateral error (for $IOU=0.5$ and $recall=0.75$). We believe the main reason is our semi-local representation that allows our method to support many different lane topologies such as short lanes, splits and merges that emerge only at a certain distance from the ego vehicle. This is evident in Fig. \ref{fig:blender15} showing examples where splits and short lanes are not detected by 3D-LaneNet but detected by 3D-LaneNet+.

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{blender15_2}
\caption{Example results on \textit{synthetic-3D-lanes}.Detected lanes using 3D-LaneNet+ (Our)  \textcolor{blue}{(blue)}, ground truth \textcolor{red}{(red)} and 3D-LaneNet \cite{garnett20183dlanenet} \textcolor{cyan}{(cyan)}. It can be seen that due to the use of lane anchors 3D-LaneNet \textcolor{cyan}{(cyan)} misses many short lanes, splits and lanes starting far ahead from the ego vehicle. Out proposed anchor free approach allows 3D-LaneNet+ \textcolor{blue}{(blue)} to be less constrained and detect splits, short lanes and far lanes that were missed by 3D-LaneNet.}
\label{fig:blender15}
\end{figure}

\begin{table}[!htbp]
\centering
\caption{comparison on \textit{Synthetic-3D-lanes} dataset}
\label{Table:blender}
\begin{tabular}{||l||cc||c|cc||}
\hline
Method & $MAP$ &  $AP_{50}$ & recall &\multicolumn{2}{c||}{Lateral error (cm)} \\
\cline{5-6}
 & & & & 0-30m &  30-80m\\
\hline
3D-LaneNet \cite{garnett20183dlanenet}   &  0.74 & 0.79  &0.75 &\textbf{9.3}  & \textbf{23.9} \\
3D-LaneNet+ (Ours)   &  \textbf{0.9} & \textbf{0.95}  &0.75 & 9.7  & 26.7 \\
\hline
\end{tabular}
\end{table}

\pbf{Real world data} We use the \textit{Real-3D-lanes} dataset to demonstrate our methods ability to handle real world data while generalizing well to different lane topologies, curvatures and surface geometries. Results comparing 3D-LaneNet+ to 3D-LaneNet, trained on the same train set, are summarized in Table \ref{Table:real_data}.

It can be seen that 3D-LaneNet+ achieves better results improving by 9 points over 3D-LaneNet in overall $MAP$ as well as lowering the lateral error for the 3d lane points. This experiment is challenging compared to the \textit{synthetic-3D-lanes} experiment in which train and test sets have the same distribution. In the case of \textit{Real-3D-lanes}, train and test sets were recorded in different geographic location, and have different distributions, i.e., the test set exhibits more complex curvatures and surface geometries. To support this claim we examined the distribution of lane curvature and road surface curvature. On the test set, lane curves have, on average, a curvature score that is higher by an order of magnitude from the train set. The road surface curvature is two orders of magnitude higher in the test set than on the train set (see Fig. \ref{fig:real_data}b for example images). Our ability to generalize to this test set demonstrates the advantage of using the proposed semi-local tiles representation.

\begin{table}[!htbp]
\vspace{-2mm}
\centering
\caption{comparison on \textit{Real-3D-lanes} dataset}
\label{Table:real_data}
\begin{tabular}{||l||ccc||c|cc||}
\hline
Method  & $MAP$ &  $AP_{50}$ & $AP_{90}$&  Recall & \multicolumn{2}{c||}{Lateral error (cm)}\\
\cline{6-7}
 & & & & & 0-30m &  30-80m\\
\hline

3D-LaneNet \cite{garnett20183dlanenet}   &  0.80 & 0.86 & 0.48   & 0.85 & 15.6  & 47.2 \\
3D-LaneNet+ (Ours) w/o global  &  0.84 & 0.94 & 0.43 & 0.85 & 14.5  & 45.5 \\

3D-LaneNet+ (Ours) &  \textbf{0.89} & \textbf{0.95} & \textbf{0.60}  & 0.85 &\textbf{14.1}  & \textbf{44.7} \\

\hline
3D-LaneNet+ (Ours) w synthetic  & \textbf{0.9}  & \textbf{0.95} & 0.59 & 0.85 & \textbf{12.9}  & \textbf{36.3} \\
\hline
\end{tabular}
\end{table}

To show the significance of our clustering approach using global feature embedding we compare it with a na\"ive clustering alternative (Table \ref{Table:real_data} '3D-LaneNet+ w/o global'). This alternative uses a simple greedy algorithm concatenating segments based on continuity and similarity heuristics. We find that when using na\"ive clustering we loose 5 points in overall $MAP$ and 17 in $AP_{90}$ suggesting that detected lanes with greedy clustering are much shorter. In addition, we see that with feature embedding we obtain lower lateral error. This may suggest that feature embedding learning also helps predicting more accurate segments.

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{real_data}
\caption{Example results on \textit{Real-3D-lanes}. (a) Sample images from the training set, (b) examples from the test set. Lanes detected using 3D-LaneNet+ shown in \textcolor{blue}{blue} and lanes detected by 3D-LaneNet in \textcolor{cyan}{cyan}.It can be seen that 3D-LaneNet+ produces more accurate results both by better capturing the correct lane curvature as well as fitting the surface geometry more tightly. Removing the use of lane anchors also helps in reducing the number of false detections.}
\label{fig:real_data}
\end{figure}

We also compare the model trained only on \textit{Real-3D-lanes} with a one trained on both \textit{Real-3D-lanes} and \textit{synthetic-3D-lanes} (Table \ref{Table:real_data} '3D-LaneNet+ w synthetic'). We find that additional 3D training data of complex curvatures and geometries helps in the generalization despite it being synthetic and without using any domain adaptation techniques.

\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{generalization_fig_nips.png}
\caption{generalization to a new camera and scenes: examples from our \textit{internal evaluation dataset}. Our method generalizes well both to the new camera that was not present in the training set, as well as to new scenes, without any need for adaptation. On the right of each example are the detected lane segments depicted on the tiles grid. Color represent the predicted segment confidence, higher is \textcolor{green}{green}, lower is \textcolor{red}{red}.}
\label{fig:generalization}
\end{figure}

\pbf{Generalization to new cameras} We now examine our method's generalization to a new unseen camera. To this end, we conduct a qualitative evaluation on an \textit{internal evaluation dataset} which was not used for training. We can see from Fig. \ref{fig:generalization} that our method succeeds in detecting lanes from unseen camera without any adaptation needed. The examples in Fig. \ref{fig:generalization} shows our representation ability to support different topologies as well as to generalize to new scenes. From upper left clockwise one can see perpendicular lane, split, short lanes starting only across the intersection and a suburbs scene with only road edges that was not present in the train set at all. Note that training our model on these examples, including urban scenes with junctions and perpendicular lanes, will obviously achieve better results while the former methods 3D-LaneNet \cite{garnett20183dlanenet} and Gen-LaneNet \cite{guo2020gen} won't benefit from such training data because of their constrained representation.


\section{Introduction and preliminaries}

The problem of counting derangements was initiated by Pierre R\'emonde de Motmort in 1708 (see [1,2]).
A derangement is a permutation of the elements of a set, such that no element appears in its original position. In other words, a derangement is a permutation that has no fixed points. The derangement number $D_{n}$ is the number of fixed point free permutations on an $n\,(n \ge 1)$ element set. \par
The aim of this paper is to study derangement polynomials and numbers, their connections with cosine-derangement polynomials and sine-derangement polynomials and their applications to momnets of some variants of gamma random variables. Here the derangement polynomials $D_{n}(x)$ are natural extensions of the derangement numbers. \par
The outline of our main results is as follows. We show a recurrence relation for derangement polynomials. Then we derive identities involving derangement polynomials, Bell polynomials and Stirling numbers of both kinds. In addition, we also have an identity relating Bell polynomials, derangement polynomials and Euler numbers. Next, we introduce the two variable polynomials, namely cosine-derangement polynomials $D_n^{(c)}(x,y)$ and sine-derangement polynomials $D_n^{(s)}(x,y)$, in a natural manner by means of derangement polynomials. We obtain, among other things, their explicit expressions and recurrence relations. Lastly, in the final section we show that, if $X$ is the gamma random variable with parameters 1, 1, then $D_n(p), D_n^{(c)}(p,q), D_n^{(s)}(p,q)$ are given by the `moments' of some variants of $X$. \par
In the rest of this section, we recall the derangement numbers, especially their explicit expressions, generating function and recurrence relations. Also, we give the derangement polynomials and give their explicit expressions. Then we recall the gamma random variable with parameters $\alpha, \lambda$ along with their moments and the Bell polynomials. Finally, we give the definitions of the Stirling numbers of the first and second kinds. \par
As before, let $D_n $ denote the derangement number for $n \ge 1$, and let $D_0=1$. Then the first few derangement numbers $D_{n}\, (n \ge 0)$ are 1, 0, 1, 2, 9, 44, 265, 1854, 14833, 133496, 1334961, $\dots$. For $n\ge 0$, the derangement numbers are given by
\begin{align}
D_{n}\ &=\ n!-\binom{n}{1}(n-1)!+\binom{n}{2}(n-2)!-\binom{n}{3}(n-3)!+\cdots+(-1)^{n}\binom{n}{n}0!\label{1}\\
&\ =\ \sum_{k=0}^{n}\binom{n}{k}(n-k)!(-1)^{k}=n!\sum_{k=0}^{n}\frac{(-1)^{k}}{k!},\nonumber\quad(\mathrm{see}\ [8,10,11]).
\end{align}
From \eqref{1}, we note that
\begin{equation}
\sum_{n=0}^{\infty}D_{n}\frac{t^{n}}{n!}=\frac{1}{1-t}e^{-t},\quad(\mathrm{see}\ [1,2,3,8,10,14]).\label{2}
\end{equation}
By \eqref{2}, we get
\begin{equation}
e^{-t}=(1-t)\sum_{n=0}^{\infty}D_{n}\frac{t^{n}}{n!}=1+\sum_{n=1}^{\infty}\big(D_{n}-nD_{n-1}\big)\frac{t^{n}}{n!}.\label{3}
\end{equation}
From \eqref{3}, we can easily derive the following recurrence relation :
\begin{equation}
(-1)^{n}=D_{n}-nD_{n-1},\quad(n\ge 1),\quad (\mathrm{see}\ [4,6,11,12,16]). \label{4}
\end{equation}
Now, we consider the derangement polynomials which are given by
\begin{equation}
\frac{e^{-t}}{1-t}e^{xt}=\sum_{n=0}^{\infty}D_{n}(x)\frac{t^{n}}{n!},\quad(\mathrm{see}\ [12]).\label{5}
\end{equation}
From \eqref{5}, we have
\begin{equation}
\sum_{n=0}^{\infty}D_{n}(x)\frac{t^{n}}{n!}=\frac{1}{1-t}e^{-t}e^{xt}=\sum_{n=0}^{\infty}\bigg(\sum_{l=0}^{n}\binom{n}{l}D_{l}x^{n-l}\bigg)\frac{t^{n}}{n!}.\label{6}
\end{equation}
By comparing the coefficients on both sides of \eqref{6}, we get
\begin{equation}
D_{n}(x)=\sum_{l=0}^{n}\binom{n}{l}D_{l}x^{n-l},\quad (n\ge 0),\quad (\mathrm{see}\ [12]). \label{7}
\end{equation}
On the other hand,
\begin{align}
\frac{e^{-t}}{1-t}e^{xt}\ &=\ \frac{1}{1-t}e^{(x-1)t}\ =\ \sum_{l=0}^{\infty}t^{l}\sum_{m=0}^{\infty}(x-1)^{m}\frac{t^{m}}{m!}\label{8}\\
&=\ \sum_{n=0}^{\infty}\bigg(n!	\sum_{m=0}^{n}\frac{(x-1)^{m}}{m!}\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
From \eqref{6},\eqref{7} and \eqref{8}, we have
\begin{equation}
D_{n}(x)=n!\sum_{m=0}^{n}\frac{(x-1)^{m}}{m!}=\sum_{l=0}^{n}\binom{n}{l}D_{l}x^{n-l},\quad(n\ge 0).\label{9}
\end{equation}
A continuous random variable $X$ whose density function is given by
\begin{equation}
f(x)=\left\{\begin{array}{ccc}
	\lambda e^{-\lambda x}(\lambda x)^{\alpha-1}/ \Gamma(\alpha), & \textrm{if $x\ge 0$}, \\
	0 & \textrm{if. $x<0$}
\end{array}\right.,\quad(\mathrm{see}\ [13,15,17]),\label{10}
\end{equation}
for some $\lambda>0$ and $\alpha>0$ is said to be the gamma random variable with parameter $\alpha,\lambda$ which is denoted by $X\sim\Gamma(\alpha,\lambda)$. \par
For $X\sim\Gamma(\alpha,\lambda)$, the $n$-th moment of $X$ is given by
\begin{align}
E[X^{n}]\ &=\ \frac{\lambda}{\Gamma(\alpha)}\int_{0}^{\infty}x^{n}e^{-\lambda x}(\lambda x)^{\alpha-1}dx. \label{11}\\
&=\ \frac{1}{\lambda^{n}\Gamma(\alpha)}	\int_{0}^{\infty}t^{n+\alpha-1}e^{-t}dt=\frac{\Gamma(\alpha+n)}{\lambda^{n}\Gamma(\alpha)}=\frac{(\alpha+n)\cdots(\alpha+1)\alpha}{\lambda^{n}}.\nonumber
\end{align}
It is well known that the Bell polynomials are defined by
\begin{equation}
e^{x(e^{t}-1)}=\sum_{n=0}^{\infty}\mathrm{Bel}_{n}(x)\frac{t^{n}}{n!},\quad(\mathrm{see}\ [9]).\label{12}
\end{equation}
When $x=1$, $\mathrm{Bel}_{n}=\mathrm{Bel}_{n}(1)$, $(n\ge 0)$ are called the Bell numbers. \par
The Stirling numbers of the first kind are defined as
\begin{equation}
(x)_{n}=\sum_{l=0}^{n}S_{1}(n,l)x^{l},\quad(n\ge 0),\quad(\mathrm{see}\ [7,18]),\label{13}
\end{equation}
where $(x)_{0}=1,\ (x)_{n}=x(x-1)\cdots(x-n+1)$, $(n\ge 1)$. \par
As an inversion formula of \eqref{13}, the Stirling numbers of the second kind are defined by
\begin{equation}
x^{n}=\sum_{l=0}^{n}S_{2}(n,l)(x)_{l}\quad(n\ge 0),\quad(\mathrm{see}\ [5,7,18]).\label{14}
\end{equation}

\section{Derangement polynomials and numbers}
From \eqref{5}, we have
\begin{equation}
e^{(x-1)t}=\bigg(\sum_{n=0}^{\infty}D_{n}(x)\frac{t^{n}}{n!}\bigg)\big(1-t\big)=1+\sum_{n=1}^{\infty}\big(D_{n}(x)-nD_{n-1}(x)\big)\frac{t^{n}}{n!}.\label{15}
\end{equation}
On the other hand,
\begin{equation}
	e^{(x-1)t}=\sum_{n=0}^{\infty}\frac{(x-1)^{n}}{n!}t^{n}=1+\sum_{n=1}^{\infty}\frac{(x-1)^{n}}{n!}t^{n}. \label{16}
\end{equation}
Therefore, by \eqref{15} and \eqref{16}, we obtain the following lemma.
\begin{lemma}
	For $n\ge 1$, we have
	\begin{displaymath}
		D_{n}(x)-nD_{n-1}(x)=(x-1)^{n}.
	\end{displaymath}
\end{lemma}
Replacing $t$ by $1-e^{t}$ in \eqref{5}, we get
\begin{align}
e^{(1-x)(e^{t}-1)}\ &=\ e^{t}\sum_{l=0}^{\infty}D_{l}(x)\frac{1}{l!}(1-e^{t})^{l} \label{17}\\
&=\ \sum_{m=0}^{\infty}\frac{t^{m}}{m!}\sum_{l=0}^{\infty}(-1)^{l}D_{l}(x)\sum_{j=l}^{\infty}S_{2}(j,l)\frac{t^{j}}{j!}\nonumber\\
&=\ \sum_{m=0}^{\infty}\frac{t^{m}}{m!}\sum_{j=0}^{\infty}\bigg(\sum_{l=0}^{j}(-1)^{l}D_{l}(x)S_{2}(j,l)\frac{t^{j}}{j!}\nonumber\\
&=\ \sum_{n=0}^{\infty}\bigg(\sum_{j=0}^{n}\sum_{l=0}^{j}\binom{n}{j}(-1)^{l}D_{l}(x)S_{2}(j,l)\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
From \eqref{17}, we have
\begin{equation}
\mathrm{Bel}_{n}(1-x)=\sum_{j=0}^{n}\sum_{l=0}^{j}\binom{n}{j}(-1)^{l}D_{l}(x)S_{2}(j,l),\quad(n\ge 0).\label{18}
\end{equation}
It is easy to show that
\begin{align}
\frac{1}{e^{t}}e^{(1-x)(e^{t}-1)}\ &=\ \sum_{l=0}^{\infty}\frac{(-1)^{l}}{l!}t^{l}\sum_{m=0}^{\infty}\mathrm{Bel}_{m}(1-x)\frac{t^{m}}{m!}\label{19} \\
&=\ \sum_{n=0}^{\infty}\bigg(\sum_{m=0}^{n}\binom{n}{m}\mathrm{Bel}_{m}(1-x)(-1)^{n-m}\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
Replacing $t$ by $\log(1-t)$ in \eqref{19}, we get
\begin{align}
\frac{1}{1-t}e^{-t}e^{xt}\ &=\ \sum_{l=0}^{\infty}\sum_{m=0}^{l}\binom{l}{m}\mathrm{Bel}_{m}(1-x)(-1)^{l-m}\frac{1}{l!}\big(\log(1-t)\big)^{l}\label{20} \\
&=\ \sum_{l=0}^{\infty}\sum_{m=0}^{l}\binom{l}{m}\mathrm{Bel}_{m}(1-x)(-1)^{l-m}\sum_{n=l}^{\infty}(-1)^{n}S_{1}(n,l)\frac{t^{n}}{n!}. \nonumber\\
&=\ \sum_{n=0}^{\infty}\bigg(\sum_{l=0}^{n}\sum_{m=0}^{l}\binom{l}{m}\mathrm{Bel}_{m}(1-x)(-1)^{n-l-m}S_{1}(n,l)\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
From \eqref{5} and \eqref{20}, we have
\begin{equation}
D_{n}(x)=\sum_{l=0}^{n}\sum_{m=0}^{l}\binom{l}{m}\mathrm{Bel}_{m}(1-x)(-1)^{n-m-l}S_{1}(n,l),\quad(n\ge 0). \label{21}
\end{equation}
Therefore, by \eqref{18} and \eqref{21}, we obtain the following theorem.
\begin{theorem}
	For $n\ge 0$, we have
	\begin{displaymath}
		\mathrm{Bel}_{n}(1-x)=\sum_{j=0}^{n}\sum_{l=0}^{j}\binom{n}{j}(-1)^{l}D_{l}(x)S_{2}(j,l),
	\end{displaymath}
	and
	\begin{displaymath}
		D_{n}(x)=\sum_{l=0}^{n}\sum_{m=0}^{l}\binom{l}{m}\mathrm{Bel}_{m}(1-x)(-1)^{n-m-l}S_{1}(n,l).
	\end{displaymath}
\end{theorem}
\begin{corollary}
	For $n\ge 0$, we have
		\begin{displaymath}
		\mathrm{Bel}_{n}=\sum_{j=0}^{n}\sum_{l=0}^{j}\binom{n}{j}(-1)^{l}D_{l}S_{2}(j,l),
	\end{displaymath}
	and
	\begin{displaymath}
		D_{n}=\sum_{l=0}^{n}\sum_{m=0}^{l}\binom{l}{m}\mathrm{Bel}_{m}(-1)^{n-m-l}S_{1}(n,l).
	\end{displaymath}
\end{corollary}
Replacing $t$ by $-e^{t}$ in \eqref{5}, we get
\begin{align}
\frac{1}{e^{t}+1}e^{(1-x)e^{t}}\ &=\ \sum_{m=0}^{\infty}D_{m}(x)\frac{(-1)^{m}}{m!}e^{mt} \nonumber\\
&=\ \sum_{m=0}^{\infty}\frac{D_{m}(x)(-1)^{m}}{m!}\sum_{n=0}^{\infty}m^{n}\frac{t^{n}}{n!}\label{22}\\
&=\ \sum_{n=0}^{\infty}\bigg(\sum_{m=0}^{\infty}\frac{(-1)^{m}D_{m}(x)}{m!}m^{n}\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
On the other hand, we have
\begin{align}
\frac{1}{e^{t}+1}e^{(1-x)e^{t}}\ &=\ \frac{e^{1-x}}{2}\frac{2}{e^{t}+1}e^{(1-x)(e^{t}-1)} \label{23}\\
&=\ \frac{e^{1-x}}{2}\sum_{l=0}^{\infty}E_{l}\frac{t^{l}}{l!}\sum_{m=0}^{\infty}\mathrm{Bel}_{m}(1-x)\frac{t^{m}}{m!}\nonumber\\
&=\ \frac{e^{1-x}}{2}\sum_{n=0}^{\infty}\bigg(\sum_{m=0}^{n}\mathrm{Bel}_{m}(1-x)E_{n-m}\binom{n}{m}\bigg)\frac{t^{n}}{n!},\nonumber
	\end{align}
where $E_{n}$ are the ordinary Euler numbers. \par
Therefore, by \eqref{22} and \eqref{23}, we obtain the following theorem,
\begin{theorem}
	For $n\ge 0$, we have
	\begin{displaymath}
		\sum_{m=0}^{n}\mathrm{Bel}_{m}(1-x)E_{n-m}\binom{n}{m}=2e^{x-1}\sum_{m=0}^{\infty}(-1)^{m}\frac{D_{m}(x)}{m!}m^{n}.
	\end{displaymath}
\end{theorem}
Now, we observe that
\begin{align}
\bigg(\frac{1}{1-t}\bigg)^{r}\ &=\ \bigg(\frac{1}{1-t}\bigg)^{r}e^{-rt}e^{rt}=\bigg(\frac{1}{1-t}e^{-t}\bigg)^{r-1}\frac{e^{-t}}{1-t}e^{rt}	\nonumber \\
&=\ \sum_{k=0}^{\infty}\sum_{l_{1}+\cdots+l_{r-1}=k}\binom{k}{l_{1},\dots,l_{r-1}}D_{l_{1}}D_{l_{2}}\cdots D_{l_{r}}\frac{t^{k}}{k!}\sum_{m=0}^{\infty}D_{m}(r)\frac{t^{m}}{m!}\label{24} \\
&=\ \sum_{n=0}^{\infty}\bigg(\sum_{k=0}^{n}\sum_{l_{1}+\cdots+l_{r-1}=k}\binom{k}{l_{1},\dots,l_{r-1}}\binom{n}{k}D_{l_{1}}D_{l_{2}}\cdots D_{l_{k-1}}D_{n-k}(r)\bigg)\frac{t^{n}}{n!},\nonumber
\end{align}
where $r$ is a positive integer. \par
On the other hand,
\begin{equation}
\bigg(\frac{1}{1-t}\bigg)^{r}=\sum_{n=0}^{\infty}\binom{-r}{n}(-1)^{n}t^{n}=\sum_{n=0}^{\infty}n!\binom{r+n-1}{n}\frac{t^{n}}{n!}. \label{25}
\end{equation}
Therefore, by \eqref{24} and \eqref{25}, we obtain the following Proposition.
\begin{proposition}
For $r\in\mathbb{N}$, we have
\begin{displaymath}
\binom{r+n-1}{n}=\frac{1}{n!}\sum_{k=0}^{n}\sum_{l_{1}+\cdots+l_{r-1}=k}\binom{k}{l_{1},\dots,l_{r-1}}\binom{n}{k}D_{l_{1}}\cdots D_{l_{r-1}}D_{n-k}(r).
\end{displaymath}
\end{proposition}
It is well known that
\begin{equation}
e^{ix}=\cos x+i\sin x,\quad i=\sqrt{-1},\quad(\mathrm{see}\ [5,7,19]).\label{26}
\end{equation}
From \eqref{5}, we note that
\begin{equation}
\frac{e^{-t}}{1-t}e^{(x+iy)t}=\sum_{n=0}^{\infty}D_{n}(x+iy)\frac{t^{n}}{n!},\quad(x,y\in\mathbb{R}),\label{27}
\end{equation}
and
\begin{equation}
\frac{e^{-t}}{1-t}e^{(x-iy)t}=\sum_{n=0}^{\infty}D_{n}(x-iy)\frac{t^{n}}{n!}.\label{28}
\end{equation}
By \eqref{9}, \eqref{27} and \eqref{28}, we get
\begin{equation}
D_{n}(x+iy)=n!\sum_{m=0}^{n}\frac{(x-1+iy)^{m}}{m!},\label{29}
\end{equation}
and
\begin{equation}
D_{n}(x-iy)=n!\sum_{m=0}^{n}\frac{(x-1-iy)^{m}}{m!},\quad(n\ge 0).\label{30}
\end{equation}
From \eqref{29} and \eqref{30}, we can derive the following equations:
\begin{equation}
\frac{e^{-t}}{1-t}e^{xt}\cos(yt)=\sum_{n=0}^{\infty}\bigg(\frac{D_{n}(x+iy)+D_{n}(x-iy)}{2}\bigg)\frac{t^{n}}{n!},\label{31}
\end{equation}
and
\begin{equation}
\frac{e^{-t}}{1-t}e^{xt}\sin(yt)=\sum_{n=0}^{\infty}\bigg(\frac{D_{n}(x+iy)-D_{n}(x-iy)}{2i}\bigg)\frac{t^{n}}{n!}.\label{32}
\end{equation}
We define cosine-derangement polynomials and sine-derangement polynomials respectively by
\begin{equation}
\frac{e^{-t}}{1-t}e^{xt}\cos yt	=\sum_{n=0}^{\infty}D_{n}^{(c)}(x,y)\frac{t^{n}}{n!},\label{33}
\end{equation}
and
\begin{equation}
\frac{e^{-t}}{1-t}e^{xt}\sin yt	=\sum_{n=0}^{\infty}D_{n}^{(s)}(x,y)\frac{t^{n}}{n!},\label{34}
\end{equation}
Thus, we have
\begin{equation}
D_{n}^{(c)}(x,y)=\frac{D_{n}(x+iy)+D_{n}(x-iy)}{2},\label{35}
\end{equation}
and
\begin{equation}
	D_{n}^{(s)}(x,y)=\frac{D_{n}(x+iy)-D_{n}(x-iy)}{2i},\quad(n\ge 0).\label{36}
\end{equation}
Therefore, we obtain the following theorem.
\begin{theorem}
	For $n\ge 0$, we have
	\begin{displaymath}
		D_{n}^{(c)}(x,y)=\frac{n!}{2}\sum_{m=0}^{n}\frac{1}{m!}\big((x-1+iy)^{m}+(x-1-iy)^{m}\big),
	\end{displaymath}
	and
	\begin{displaymath}
		D_{n}^{(s)}(x,y)=\frac{n!}{2i}\sum_{m=0}^{n}\frac{1}{m!}\big((x-1+iy)^{m}-(x-1-iy)^{m}\big).
	\end{displaymath}
\end{theorem}
From \eqref{33}, we note that
\begin{align}
\sum_{n=0}^{\infty}D_{n}^{(c)}(x,y)\frac{t^{n}}{n!}\ &=\ \frac{e^{-t}}{1-t}e^{xt}\cos(yt)\label{37}\\
&=\ \sum_{l=0}^{\infty}\frac{D_{l}}{l!}t^{l}\sum_{k=0}^{\infty}\sum_{m=0}^{[\frac{k}{2}]}\binom{k}{2m}(-1)^{m}y^{2m}x^{k-2m}\frac{t^{k}}{k!}	\nonumber \\
&=\ \sum_{n=0}^{\infty}\bigg(\sum_{k=0}^{n}\binom{n}{k}D_{n-k}\sum_{m=0}^{[\frac{k}{2}]}\binom{k}{2m}(-1)^{m}y^{2m}x^{k-2m}\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
Therefore, by comparing the coefficients on both sides of \eqref{37}, we obtain the following theorem.
\begin{theorem}
	For $n\ge 0$, we have
	\begin{displaymath}
		D_{n}^{(c)}(x,y)=\sum_{m=0}^{[\frac{n}{2}]}\sum_{k=2m}^{n}\binom{n}{k}\binom{k}{2m}D_{n-k}(-1)^{m}y^{2m}x^{k-2m}.
	\end{displaymath}
\end{theorem}
\begin{corollary}
	For $n\ge 0$, we have
	\begin{displaymath}
		\frac{n!}{2}\sum_{m=0}^{n}\frac{1}{m!}\big((x-1+iy)^{m}+(x-1-iy)^{m}\big)=\sum_{m=0}^{[\frac{n}{2}]}\sum_{k=2m}^{n}\binom{n}{k}\binom{k}{2m}D_{n-k}(-1)^{m}y^{2m}x^{k-2m}.
	\end{displaymath}
\end{corollary}
By \eqref{33}, we get
\begin{align}
e^{(x-1)t}\cos yt\ &=\ (1-t)\sum_{n=0}^{\infty}D_{n}^{(c)}(x,y)\frac{t^{n}}{n!} \label{38} \\
&=\ 1+\sum_{n=1}^{\infty}\big(D_{n}^{(c)}(x,y)-nD_{n-1}^{(c)}(x,y)\big)\frac{t^{n}}{n!}.\nonumber
\end{align}
Thus, we have
\begin{align}
\cos yt\ &=\ e^{(1-x)t}+e^{(1-x)t}\sum_{m=1}^{\infty}\big(D_{m}^{(c)}(x,y)-mD_{m-1}^{(c)}(x,y)\big)\frac{t^{m}}{m!} \label{39} \\
&=\ \sum_{n=0}^{\infty}(1-x)^{n}\frac{t^n}{n!}+\sum_{l=0}^{\infty}(1-x)^{l}\frac{t^l}{l!}\sum_{m=1}^{\infty}\big(D_{m}^{(c)}(x,y)-mD_{m-1}^{(c)}(x,y)\big)\frac{t^{m}}{m!}\nonumber\\
&=\ 1+\sum_{n=1}^{\infty}\bigg((1-x)^{n}+\sum_{m=1}^{n}\binom{n}{m}(1-x)^{n-m}\big(D_{m}^{(c)}(x,y)-mD_{m-1}^{(c)}(x,y)\big)\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
On the other hand, we also have
\begin{equation}
\cos yt=\sum_{n=0}^{\infty}\frac{(-1)^{n}}{(2n)!}y^{2n}t^{2n}. \label{40}
\end{equation}
Therefore, by \eqref{39} and \eqref{40}, we obtain the following theorem.
\begin{theorem}
	For $k\in\mathbb{N}$, we have
	\begin{displaymath}
		(1-x)^{n}+\sum_{m=1}^{n}\binom{n}{m}(1-x)^{n-m}\big(D_{m}^{(c)}(x,y)-mD_{m-1}^{(c)}(x,y)\big)=\left\{\begin{array}{ccc}
			(-1)^{k}y^{2k}, & \textrm{if $n=2k$,}\\
			0, & \textrm{if $n=2k-1$}.
		\end{array}\right.
	\end{displaymath}
\end{theorem}
By \eqref{33}, we get
\begin{align}
e^{(x-1)t}\cos yt\ &=\ \sum_{n=0}^{\infty}D_{n}^{(c)}(x,y)\frac{t^{n}}{n!}(1-t) \label{41}\\
&=\ \sum_{n=1}^{\infty}\big(D_{n}^{(c)}(x,y)-nD_{n-1}^{(c)}(x,y)\big)\frac{t^{n}}{n!}+1.\nonumber
\end{align}
On the other hand,
\begin{align}
e^{(x-1)t}\cos yt\ &=\ \sum_{l=0}^{\infty}(x-1)^{l}\frac{t^{l}}{l!}\sum_{m=0}^{\infty}y^{2m}(-1)^{m}\frac{t^{2m}}{(2m)!} \label{42} \\
&=\ 1+\sum_{n=1}^{\infty}\bigg(\sum_{m=0}^{[\frac{n}{2}]}\binom{n}{2m}(-1)^m(x-1)^{n-2m}y^{2m}\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
Therefore, by \eqref{41} and \eqref{42}, we obtain the following theorem.
\begin{theorem}
	For $n\ge 1$, we have
	\begin{displaymath}
		D_{n}^{(c)}(x,y)-nD_{n-1}^{(c)}(x,y)=\sum_{m=0}^{[\frac{n}{2}]}\binom{n}{2m}(-1)^{m}(x-1)^{n-2m}y^{2m}.
	\end{displaymath}
\end{theorem}
It is not difficult to show that
\begin{equation}
\sum_{n=0}^{\infty}D_{n}^{(c)}(x+r,y)\frac{t^{n}}{n!}=\sum_{n=0}^{\infty}\bigg(\sum_{l=0}^{n}\binom{n}{l}D_{l}^{(c)}(x,y)r^{n-l}\bigg)\frac{t^{n}}{n!},\label{43}
\end{equation}
where $r$ is positive integer. \par
By comparing the coefficients on both sides of \eqref{39}, we get
\begin{equation}
D_{n}^{(c)}(x+r,y)=\sum_{l=0}^{n}\binom{n}{l}D_{l}^{(c)}(x,y)r^{n-l}. \label{44}
\end{equation}
Now, we observe that
\begin{equation}
\sum_{n=1}^{\infty}\frac{\partial}{\partial x}D_{n}^{(c)}(x,y)\frac{t^{n}}{n!}=\frac{\partial}{\partial x}\bigg(\frac{e^{-t}}{1-t}e^{xt}\cos yt \bigg)\label{45}\qquad\qquad\qquad
\end{equation}
\begin{displaymath}
	=t\frac{e^{-t}}{1-t}e^{xt}\cos yt=t\sum_{n=0}^{\infty}D_{n}^{(c)}(x,y)\frac{t^{n}}{n!}=\sum_{n=1}^{\infty}nD_{n-1}^{(c)}(x,y)\frac{t^{n}}{n!}.
\end{displaymath}
Form \eqref{45}, we note that
\begin{displaymath}
	D_{0}^{(c)}(x,y)=1,\quad\frac{\partial}{\partial x}D_{n}^{(c)}(x,y)=nD_{n-1}^{(c)}(x,y),\quad(n\ge 1).
\end{displaymath}
Therefore, we obtain the following theorem.
\begin{theorem}
	For $n\ge 0$, we have
	\begin{displaymath}
		D_{0}^{(c)}(x,y)=0,\quad \frac{\partial}{\partial x}D_{n}^{(c)}(x,y)=nD_{n-1}^{(c)}(x,y),\quad(n\ge 1).
	\end{displaymath}
	In particular,
	\begin{displaymath}
		\frac{d}{dx}D_{n}(x)=\frac{\partial}{\partial x}D_{n}^{(c)}(x,0)=nD_{n-1}^{(c)}(x,0)=nD_{n-1}^{(c)}(x),\quad (n\ge 1).
	\end{displaymath}
\end{theorem}
\begin{corollary}
$D_{n}^{(c)}(x,y)$ as a polynomial in $x$, for each fixed $y$, and $D_{n}(x)$ are Appell sequences.
\end{corollary}
From \eqref{34}, we note that
\begin{align}
\sum_{n=0}^{\infty}D_{n}^{(s)}(x,y)\frac{t^{n}}{n!}\ &=\ \frac{1}{1-t}e^{-t}e^{xt}\sin yt \label{46} \\
&=\ \sum_{k=0}^{\infty}\frac{D_{k}}{k!}t^{k}\sum_{j=1}^{\infty}\sum_{m=0}^{[\frac{j-1}{2}]}\binom{j}{2m+1}x^{j-2m-1}y^{2m+1}\frac{t^{j}}{j!}\nonumber \\
&=\ \sum_{n=1}^{\infty}\bigg(\sum_{j=1}^{n}\sum_{m=0}^{[\frac{j-1}{2}]}\binom{j}{2m+1}\binom{n}{j}x^{j-2m-1}y^{2m+1}D_{n-j}\bigg)\frac{t^{n}}{n!}.\nonumber
\end{align}
Therefore, by \eqref{46}, we obtain the following theorem.
\begin{theorem}
	For $n\ge 0$, we have
	\begin{displaymath}
		D_{0}^{(s)}(x,y)=0,\quad D_{n}^{(s)}(x,y)=\sum_{j=1}^{n}\sum_{m=0}^{[\frac{j-1}{2}]}\binom{j}{2m+1}\binom{n}{j}x^{j-2m-1}y^{2m+1}D_{n-j}.
	\end{displaymath}
\end{theorem}
By \eqref{30},\eqref{32} and Theorem 13, we obtain the following theorem.
\begin{corollary}
	For $n\ge 1$, we have
	\begin{displaymath}
		\frac{D_{n}(x+iy)-D_{n}(x-iy)}{2i}=\sum_{j=1}^{n}\sum_{m=1}^{[\frac{j-1}{2}]}\binom{j}{2m+1}\binom{n}{j}x^{j-2m-1}y^{2m+1}D_{n-j}.
	\end{displaymath}
\end{corollary}
By \eqref{46}, we see that
\begin{align}
\sin yt\ &=\ e^{(1-x)t}\sum_{k=1}^{\infty}\big(D_{k}^{(s)}(x,y)-kD_{k-1}^{(s)}(x,y)\big)\frac{t^{k}}{k!}\label{47}\\
&=\ 	\sum_{m=0}^{\infty}(1-x)^{m}\frac{t^m}{m!}\sum_{k=1}^{\infty}\big(D_{k}^{(s)}(x,y)-kD_{k-1}^{(s)}(x,y)\big)\frac{t^{k}}{k!}\nonumber \\
&=\ \sum_{n=1}^{\infty}\bigg(\sum_{k=1}^{n}\binom{n}{k}\big(D_{k}^{(s)}(x,y)-kD_{k-1}^{(s)}(x,y)\big)(1-x)^{n-k}\bigg)\frac{t^{n}}{n!}. \nonumber
\end{align}
On the other hand, we also have
\begin{equation}
\sin yt=\sum_{n=1}^{\infty}\frac{(-1)^{n-1}}{(2n-1)!}y^{2n-1}t^{2n-1}. \label{48}
\end{equation}
Therefore, by \eqref{47} and \eqref{48}, we obtain the following theorem.
\begin{theorem}
For $m\in\mathbb{N}$, we have
\begin{displaymath}
\sum_{k=1}^{n}\binom{n}{k}\big(D_{k}^{(s)}(x,y)-kD_{k-1}^{(s)}(x,y)\big)(1-x)^{n-k}=\left\{\begin{array}
{ccc}
(-1)^{m-1}y^{2m-1}, & \textrm{if $n=2m-1,$}\\
0, & \textrm{if $n=2m.$\quad\ \ }
\end{array}\right..
\end{displaymath}
\end{theorem}
It is easy to show that $\displaystyle\frac{\partial}{\partial x}D_{n}^{(s)}(x,y)=nD_{n-1}^{(s)}(x,y)\displaystyle$. However, $D_{n}^{(s)}(x,y)$ is not an Appell sequence, since  $D_{0}^{(s)}(x,y)=0$. \par
We observe that
\begin{align}
\sum_{n=0}^{\infty}D_{n}^{(s)}(x,y)\frac{t^{n}}{n!}\ &=\ \frac{e^{-t}}{1-t}e^{xt}\sin yt \label{49}\\
&=\ \sum_{l=0}^{\infty}D_{l}(x)\frac{t^{l}}{l!}\sum_{m=0}^{\infty}(-1)^{m}y^{2m+1}\frac{t^{2m+1}}{(2m+1)!}\nonumber \\
&=\ \sum_{n=1}^{\infty}\bigg(\sum_{m=0}^{[\frac{n-1}{2}]}\binom{n}{2m+1}(-1)^{m}y^{2m+1}D_{n-2m-1}(x)\bigg)\frac{t^{n}}{n!}. \nonumber
\end{align}
Comparing the coefficients on both sides of \eqref{49}, we have the following theorem.
\begin{theorem}
For $n\ge 1$, we have
\begin{displaymath}
D_{n}^{(s)}(x,y)= \sum_{m=0}^{[\frac{n-1}{2}]}\binom{n}{2m+1}(-1)^{m}y^{2m+1}D_{n-2m-1}(x).
\end{displaymath}
\end{theorem}
For $r\in\mathbb{N}$, we have
\begin{align*}
\sum_{n=0}^{\infty}D_{n}^{(s)}(x+r,y)\ &=\ \frac{e^{-t}}{1-t}e^{(x+r)t}\sin yt\
=\ \frac{e^{-t}}{1-t}e^{xt}\sin yte^{rt}\\
&=\ \sum_{l=0}^{\infty}D_{l}^{(s)}(x,y)\frac{t^{l}}{l!}\sum_{m=0}^{\infty}r^{m}\frac{t^{m}}{m!}\\
&=\ \sum_{n=0}^{\infty}\bigg(\sum_{l=0}^{n}\binom{n}{l}D_{l}^{(s)}(x,y)r^{n-l}\bigg)\frac{t^{n}}{n!}.
\end{align*}
Thus, we obtain
\begin{displaymath}
D_{n}^{(s)}(x+r,y)=\sum_{l=0}^{n}\binom{n}{l}D_{l}^{(s)}(x,y)r^{n-l},\quad(n\ge 0).
\end{displaymath}

\section{Further Remarks}
Let $X$ be a gamma random variable with parameters 1,1 which is denoted by $X\sim\Gamma(1,1)$. \\
Then we observe that
\begin{equation}
E\big[e^{(X-1+p)t}\big]=\int_{0}^{\infty}e^{(x-1+p)t}f(x)dx,\label{50}
\end{equation}
where $f(x)$ is the density function of $X$, and $p \in \mathbb{R}$. \par
From \eqref{10} and \eqref{50}, we can derive the following equation \eqref{51}.
\begin{align}
E\big[e^{(X-1+p)t}\big]\ &=\ \int_{0}^{\infty}e^{(x-1+p)t}e^{-x}dx \label{51} \\
&=\ e^{-t+pt}\cdot\int_{0}^{\infty}e^{-x(1-t)}dx\nonumber\\
&=\ \frac{e^{-t}}{1-t}e^{pt}\ =\ \sum_{n=0}^{\infty}D_{n}(p)\frac{t^{n}}{n!}.\nonumber
\end{align}
On the other hand, by Taylor expansion, we get
\begin{equation}
E\big[e^{(X-1+p)t}\big]=\sum_{n=0}^{\infty}E\big[(X-1+p)^{n}\big]\frac{t^{n}}{n!}.\label{52}
\end{equation}
Therefore, by \eqref{51} and \eqref{52}, we obtain the following theorem.
\begin{theorem}
For $n\ge 0$, $X\sim\Gamma(1,1)$, the moment of $X-1+p$ is given by
\begin{displaymath}
E\big[(X-1+p)^{n}\big]=D_{n}(p).
\end{displaymath}
\end{theorem}
When $p=0$, $D_{n}=D_{n}(0)=E[(X-1)^{n}]$, $(n\ge 0)$. \par
Thus, we note that
\begin{equation}
D_{n}=\sum_{l=0}^{n}\binom{n}{l}(-1)^{n-l}E\big[X^{l}\big].\label{53}
\end{equation}
For $X\sim\Gamma(1,1)$, we note that the moment of $X$ is given by $E[X^{n}]=n!$, $(n\ge 0)$. \par
Therefore, by \eqref{53}, we obtain the following corollary.
\begin{corollary}
	For $n\ge 0$, $X\sim\Gamma(1,1)$, we have
	\begin{displaymath}
		D_{n}=\sum_{l=0}^{n}\binom{n}{l}(-1)^{n-l}l!
	\end{displaymath}
and
\begin{displaymath}
	D_{n}(p)=\sum_{l=0}^{n}\binom{n}{l}(p-1)^{n-l}l!.
\end{displaymath}
\end{corollary}
For $X\sim\Gamma(1,1)$, we have
\begin{equation}
E\big[e^{(X-1+p+iq)t}\big]=\frac{e^{-t}}{1-t}e^{(p+iq)t},\quad\mathrm{where}\ p,q\in\mathbb{R}.\label{54}
\end{equation}
From \eqref{54}, we note that
\begin{equation}
	E\big[e^{(X-1+p-iq)t}\big]=\frac{e^{-t}}{1-t}e^{(p-iq)t}.\label{55}
\end{equation}
By \eqref{54} and \eqref{55}, we get
\begin{equation}
	E\big[e^{(X-1+p+iq)t}\big]+ E\big[e^{(X-1+p-iq)t}\big]=\frac{2e^{-t}}{1-t}e^{pt}\cos qt=\sum_{n=0}^{\infty}2D_{n}^{(c)}(p,q)\frac{t^{n}}{n!}. \label{56}
\end{equation}
On the other hand, by Taylor expansion, we get
\begin{align}
& E\big[e^{(X-1+p+iq)t}\big]+ E\big[e^{(X-1+p-iq)t}\big]\label{57} \\
&\quad=\ \sum_{n=0}^{\infty}E\big[(X-1+p+iq)^{n}+(X-1+p-iq)^{n}\big]\frac{t^{n}}{n!}.\nonumber
\end{align}
Therefore, by \eqref{56} and \eqref{57}, we obtain the following theorem.
\begin{theorem}
	For $n\ge 0$, $X\sim\Gamma(1,1)$, we have
	\begin{displaymath}
		E\bigg[\frac{(X-1+p+iq)^{n}+(X-1+p-iq)^{n}}{2}\bigg]=D_{n}^{(c)}(p,q).
	\end{displaymath}
\end{theorem}
It is easy to show that
\begin{align*}
	& E\big[e^{(X-1+p+iq)t}\big]-E\big[e^{(X-1+p-iq)t}\big]\\ \\
&\quad=\ 2i\frac{e^{-t}}{1-t}e^{pt}\sin qt=(2i)\sum_{n=1}^{\infty}D_{n}^{(s)}(p,q)\frac{t^{n}}{n!},
\end{align*}
where $X\sim\Gamma(1,1)$. \par
Thus, we have
\begin{displaymath}
	E\bigg[\frac{(X-1+p+iq)^{n}-(X-1+p-iq)^{n}}{2i}\bigg]=D_{n}^{(s)}(p,q),\quad(n\ge 0),
\end{displaymath}
where $X\sim\Gamma(1,1)$. \par

\section{Conclusion}
The introduction of deragement numbers $D_n$ goes back to as early as 1708 when
Pierre R\'emond de Montmort considered some counting problem on derangements. In this paper, we dealt with derangement polynomials $D_n(x)$ which are natural extensions of the derangement numbers. We showed a recurrence relation for derangement polynomials. We derived identities involving derangement polynomials, Bell polynomials and Stirling numbers of both kinds. In addition, we also obtained an identity relating Bell polynomials, derangement polynomials and Euler numbers. Next, we introduced the cosine-derangement polynomials $D_n^{(c)}(x,y)$ and sine-derangement polynomials $D_n^{(s)}(x,y)$, by means of derangement polynomials. Then we derived, among other things, their explicit expressions and recurrence relations. Lastly, as an applications we showed that, if $X$ is the gamma random variable with parameters 1, 1, then $D_n(p), D_n^{(c)}(p,q), D_n^{(s)}(p,q)$ are given by the `moments' of some variants of $X$. \par
We have witnessed that the study of some special numbers and polynomials was done intensively by using several different means, which include generating functions, combinatorial methods, umbral calculus, $p$-adic analysis, probability theory, special functions and differential equations. Moreover, the same has been done for various degenerate versions of quite a few special numbers and polynomials in recent years with their interests not only in combinatorial and arithmetical properties but also in their applications to symmetric identities, differential equations and probability theories. It would have been nicer if we were able to find abundant applications in other disciplines. \par
It is one of our future projects to continue to investigate many ordinary and degenerate special numbers and polynomials by various means and find their applications in physics, science and engineering as well as in mathematics.

\vspace{0.5cm}

{\bf Author Contributions:} T.K. and D.S.K. conceived of the framework and structured the whole paper; D.S.K. and
T.K. wrote the paper; L.C.J. checked the errors of the paper; H.L. typed the paper; D.S.K. and T.K.
completed the revision of the article. All authors have read and agreed to the published version of the manuscript.

\vspace{0.3cm}

{\bf Funding:} Not applicable.

\vspace{0.3cm}

{\bf Conflicts of Interest:} The authors declare no conflicts of interest.