{'fraction_non_alphanumeric': 0.02968933533152416, 'fraction_numerical': 0.00907286645874681, 'mean_word_length': 4.956574185765983, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
PCGen: Point Cloud Generator for LiDAR Simulation

Data is a fundamental building block for LiDAR perception systems. Unfortunately, real-world data collection and annotation is extremely costly&laborious. Recently, real data based LiDAR simulators have shown tremendous potential to complement real data, due to their scalability and high-fidelity compared to graphics engine based methods. Before simulation can be deployed in the real-world, two shortcomings need to be addressed. First, existing methods usually generate data which are more noisy and complete than the real point clouds, due to 3D reconstruction error and pure geometry-based raycasting method. Second, prior works on simulation for object detection focus solely on rigid objects, like cars, but VRUs, like pedestrians, are important road participants. To tackle the first challenge, we propose FPA raycasting and surrogate model raydrop. FPA enables the simulation of both point cloud coordinates and sensor features, while taking into account reconstruction noise. The ray-wise surrogate raydrop model mimics the physical properties of LiDAR's laser receiver to determine whether a simulated point would be recorded by a real LiDAR. With minimal training data, the surrogate model can generalize to different geographies and scenes, closing the domain gap between raycasted and real point clouds. To tackle the simulation of deformable VRU simulation, we employ SMPL dataset to provide a pedestrian simulation baseline and compare the domain gap between CAD and reconstructed objects. Applying our pipeline to perform novel sensor synthesis, results show that object detection models trained by simulation data can achieve similar result as the real data trained model.


I. INTRODUCTION
The success of deep learning is deeply rooted in the availability of large-scale, high-fidelity datasets. Pioneering datasets [1]- [13] facilitate development of cutting edge visual recognition systems, providing challenging benchmarks for the community. However, collection and annotation of data in the real world is very inefficient, slow and uneconomical. Simulation, on the other hand, give users the flexibility to generate diverse scenarios with ease, as well as providing automatically generated ground truth annotations. For LiDAR simulation, two distinct approaches have been explored: graphics engine based and real data based. Results show that real data based methods produces simulation data with lower domain gap compared to graphics engine based methods. This paper makes the following contributions: • We present FPA raycasting to simulate LiDAR point clouds and sensor features, accounting for noise in the reconstructed scenes. • We develop the surrogate model of a single laser head and use it for raydrop. Comparing to the UNet based raydrop method, the proposed method is sceneindependent. The surrogate model of a specific LiDAR can be trained once and used in different scenes. • We perform novel sensor synthesis with our simulation pipeline. The test results show that it provides highfidelity data for the new sensor configuration, achieving similar result as the model trained on the real data. • We propose Learned Point Cloud Similarity (LPCS) metric to measure domain gap between real and simulation point clouds, from the perspective of perception models • We provide a baseline pedestrian simulation result, using SMPL and reconstructed human models

A. Graphics Engine Based LiDAR Simulator
Initial attempts to LiDAR simulation were spearheaded by Car Learning to Act (CARLA) [14]. Building on top of Unreal Engine 4 (UE4) [15], CARLA's simulation platform allows the user to customize scenarios, including agent model, density, interaction with the world, weather conditions, and sensor suite. Similarly, Yue et al. leveraged the popular, high-fidelity simulation of Grand Theft Auto V (GTA V) to automatically extract point cloud with ground truth labels [16]. The framework also enables users to construct diverse, customized scenarios interactively to test neural network performance in corner cases. Experiments have shown that retraining with additional synthetic point cloud significantly improves model's performance on KITTI dataset [17], [18]. This work is further extended by the Precise Synthetic Image and LiDAR (PreSIL) dataset, which improves the raycasting functionality within GTA V to address the issues of approximating human with cylinders and missed rayscene collisions [19]. PreSIL provides a large simulated dataset in KITTI format, and demonstrate that it can boost the performance on state-of-art model in KITTI 3D Object Detection benchmark.

B. Real Data Based LiDAR Simulator
Generating CAD model assets and complex scenarios are labor-intensive, making simulation difficult and costly to scale. Furthermore, domain gap between noiseless simulation and real-world data leads to poor model performance if only trained on simulation data, prompting the development of domain adaptation techniques [18], [20], [21]. Fang et al. investigated a hybrid, data-driven approach to point cloud generation framework, which combines real world scanned background point cloud and synthetic foreground objects [22]. They show that by augmenting the real dataset with synthetic frames, instance segmentation and object detection performance is improved. Concurrently, LiDARsim employed a similar approach, leveraging real data to reconstruct both background and foreground objects [23]. LiDARsim further extended the simulation with the addition of a learning system to model the physics of LiDAR raydrop, closing the gap between real and simulation point clouds. They show that the simulation data trained models can obtain similar performance in object detection and semantic segmentation as models trained using real data, without domain adaptation techniques. Similar to LiDARsim, Langer et al. developed a simulation pipeline for domain transfer in the context of semantic segmentation [24]. Their results show that closest point raycasting, along with geodesic correlation alignment, successfully generated simulation data to adjust a model trained on the source domain (Velodyne-64) to the target domain (Velodyne-32).

A. 3D Scene Reconstruction
Given a sequence of single frame point clouds, ground truth bounding box annotations are used to crop out foreground object points. If an instance moves more than 0.5 meters in the global frame, the instance is treated as a dynamic object. Since annotation for dynamic objects are less accurate, the bounding box dimensions are slightly enlarged before cropping, to ensure complete removal of all foreground points. Using odometry, single frame point cloud without foreground objects are transformed into the global coordinate frame and subsequently accumulated to obtain a dense 3D reconstruction of the sequence. Voxel downsampling and point cloud radius outlier removal are performed as postprocessing steps, in order to reduce memory requirements and remove noisy points. In the case where odometry is inaccurate, Simoutaneous Localization and Mapping (SLAM) and Iterative Closest Point (ICP) [25] can be used to improve mapping quality.
For object reconstruction, all bounding boxes belonging to the same object throughout the sequence can be identified. The cropped point cloud cluster from each frame can be returned to x-axis aligned origin using bounding box location and orientation. To reduce the impact of human annotation and odometry imperfections, a generalized ICP can be used to improve the alignment. However, if the source and/or target point cloud contain very few points, minimizing the point cloud distance using ICP often leads to unreasonable reconstructions. Thus, we adaptively employ ICP if both source and target point cloud contains greater than threshold number of points, otherwise, object clusters are simply accumulated. The foreground objects can then be inserted into the background to simulate a variety of scenarios.

B. Raycasting method
Theoretically, the reconstructed 3D scene is a 2D surface embedded in the 3D space, represented in the form of a dense point cloud. Through raycasting, intersections between the laser beams and point cloud can be computed. LiDARsim rendered dense point cloud as surfels [26] and used Intel Embree Engine to compute ray-disc intersections [27]. Langer et al. used Closest Point (CP) raycasting, which projects dense point cloud into a range image, and the closest point from each pixel is extracted to render the raycasted point cloud [24]. However, localization, calibration and sensor synchronization are subject to error, points in the reconstructed point cloud do not strictly lie on 2D surface of the scene. Both raycasting methods suffer from noisy reconstructions, leading to noisy raycasted point clouds. Moreover, CP raycasting only works with spinning scan LiDAR. For LiDARs with irregular scan pattern, such as the DJI Livox, multiple rays might land in the same pixel, leading to redundant points.
To solve this problem, we propose First Peak Averaging (FPA) raycasting. First, the reconstructed point cloud is projected into a range image. Each pixel of the range image corresponds to a frustum in the 3D space, as shown in Figure  2(a). Each point within the frustum can be defined using the Spherical coordinates (d, λ , φ ) or the Cartesian coordinates (x, y, z). Typically, the depth distribution of all points within the frustum forms multiple peaks, due to occlusion and observation of the scene from multiple angles. The intuition behind FPA raycasting is to average points from the closest peak, in order to estimate the true 2D surface from the noisy 3D point cloud. We are interested in the closest peak, because it corresponds to the first intersection between the ray and the 3D scene. To speed up the simulation, a fixed peak width δ d is used to screen the first peak points. In Figure 2(b), λ l and φ l are the azimuth and elevation of the casted laser beam (indicated by the blue star), λ i and φ i , i = 1, 2, . . . , N are the azimuth and elevation of each point within the closest peak (indicated by the red and yellow circles, with the red circle being the closest point within the frustrum). The intersection between the ray and the 3D scene is estimated with the Inverse Distance Weighted (IDW) averaging.
where f can be the x, y, z coordinates or the feature, such as the intensity, of a point. The inverse distance weights w i and inverse distance d i are defined as: (3)

C. Raydrop
Laser returns are affected by many factors, such as the distance, incidence angle, material reflectivity and atmospheric composition. The FPA raycasting algorithm records every ray-scene intersection, without taking into account the aforementioned factors. Thus, a domain gap exists, where the simulation point cloud contains more points than the real point cloud. LiDARsim developed a 2D UNet for raydrop [28], trained using pairs of simulation and real point cloud range images. This requires strict pixel-wise correspondence between the two range images, and it cannot be guaranteed due to odometry and calibration error. Furthermore, deep learning models require large amounts of data to generalize. With convolution layers, the encoder-decoder network learns to drop rays based on context. Generalization to different geographies will be limited. A real LiDAR, however, does not use the wide perceptive field of the UNet to determine laser return. To address these problems, we propose a surrogate model (MLP) for the laser head.
where r is a ray's return probability, d, θ , i are the distance, incidence angle and simulation intensity of the ray. By learning ray-wise drop/return probability, the surrogate model does not require pixel-wise range image correspondence between the real and the simulation point clouds. Furthermore, the model does not require large amounts of data to train and can generalize across geographies. Given a pair of raycasted and real dataset, the d, θ and i of each point can be computed and projected into the parameter space, as shown in Fig. 3(a).
where x, y, z is Cartesian coordinate of a raycasted point in the LiDAR frame where R is the ray vector, N is the point's normal vector, computed from single frame point cloud using Open3D [29]. Intensity, i, is taken directly from the real point cloud.
For the FPA simulation point cloud, the raycasted intensity is the average reflection intensity of laser beams from different directions, which abstractly describes the material's reflectivity. To train the model, we pair the real dataset with a simulation dataset, which is raycasted using the real dataset's LiDAR poses. With sufficient data, the parameter space will be filled, which can then be voxelized. The ratio between the number of real points and the number of simulation points, r, can be computed for each voxel. This represents the probability the ray would be returned, at the given d, θ , i. The parameter space can be converted directly into a lookup table for inference. We approximate the parameter space with an MLP, to enable GPU inference acceleration and infer values for voxels without data. shows an example 2D projection of the voxelized input parameter space. Each pixel shows the ray's return probability, with yellow and purple representing a probability of 1 and 0 respectively. A LiDAR point cloud cutoff at 75 meters is observed, and the rays that intersect farther away from the LiDAR require greater intensity to be returned. The parameter space is not very smooth, due to voxelization. In order to reduce the influence of the unsmoothness, the data of a voxel will not be used for training if the number of simulation points in the voxel is less than the given threshold or the number of the real points is larger than that of the simulation points.

D. Learned Point Cloud Similarity (LPCS)
Raycasting algorithm requires the selection of three hyperparameters, the range image width & height and averaging peak width. To tune hyperparameters, a point cloud similaity metric is required. By computing the sum of squared distances between nearest neighbors, Chamfer Distance (CD) does not take into account mismatching local density. Such lowlevel features, however, will be extracted by backbones of the perception architectures and influence model prediction. Inspired by Learned Perceptual Image Patch Similarity (LPIPS), we propose LPCS, which compares the backbone feature distance between pairs of point clouds from a model pretrained on real data. Given a pair of corresponding point cloud, all objects of interest can be cropped out using bounding box annotations, yielding two subset point clouds for simulation and real, P s , P r ∈ R 3 , respectively. LPCS can be computed via the absolute element-wise distance between the feature of both subsets: where F, the model backbone, outputs a high-dimensional vector of N terms

E. Novel Sensor Synthesis
With reconstructed maps and objects, a dense representation of any single frame can be obtained by inserting the objects using their poses from the real frame. By providing the raycasting algorithm with 1. the elevation and azimuth angle of each ray with respect to the LiDAR frame 2. the pose of the LiDAR with respect to the global frame, we can simulate a corresponding point cloud, under a new LiDAR configuration. Note that if the new LiDAR's Field of View (FOV) dramatically exceed that of the original dataset, part of the new dataset might be missing. This can be circumvented by collecting the original dataset using the LiDAR with largest FOV, and optionally, highest density. Our simulation pipeline greatly reduces the data collection and annotation costs to train a model that can generalize to any combination of car and LiDAR models.

F. Pedestrian Simulation
Previous works on simulation for object detection focused primarily on rigid object classes, such as car. We attempt to expand simulation classes to VRU, in particular, pedestrians. Following the same reconstruction procedure from Section III-A, a pedestrian object library is generated. However, body movements lead to deformed reconstructions. To address this problem, we employ the SMPL [30] dataset, which provides realistic 3D human CAD models. Unlike cars, pedestrians share similar geometry and mainly differ in their postures. Thus, we believe that the SMPL models provide sufficient degrees of freedom to capture the diverse set of pedestrian poses that can be found on the road. During raycasting, CAD models are converted to point clouds by sampling a large number of points on the surface of triangle meshes. A tight bounding box can also be generated to enclose all points. Using statistics, dimensions of the real bounding boxes and its enclosed point cloud cluster can be computed. The distributions are used to filter out unrealistic CAD poses, as well as loosening the bounding box annotations to match human annotations.

IV. EXPERIMENTAL EVALUATION
Through the following experiments, we intend to demonstrate the fidelity and potential applications of our pipeline.
1) To verify the fidelity of our raycasting and raydrop algorithms, we show that object detection models trained using real data or simulation data, achieves similar performance when evaluated on the real validation data. 2) To prove LPCS as an useful point cloud similarity metric, we show negative correlation between LPCS and object detection Mean Average Precision (mAP) 3) To demonstrate sensor type conversion, we show that with only source sensor data and 10% annotated target sensor data, we can simulate target sensor and achieve similar object detection performance as 100% annotated target sensor data. 4) To demonstrate VRU simulation, we provide a baseline for pedestrian simulation and compare CAD models against reconstructed pedestrian.
A. Experimental Setup 1) Dataset: We evaluate our simulation pipeline using Waymo Open Dataset, which consists of 800 training and 200 validation segments spanning over different geographical locations [3]. Each segment provides synchronized sensor data over 20 seconds. Each LiDAR frame is composed of 5 LiDARs: top, left, right, front and rear, captured at 10Hz. For all of our experiments, we perform reconstruction and mapping using top LiDAR, due to its high density and long range of 75 meters.
2) Object Detection Model: OpenPCDet [31] implementation of Centerpoint [32] will be used to evaluate the quality of our simulation dataset. During training, no data augmentation is performed, in order to minimize stochasticity among trials. All models are trained over 80 epochs.

B. First Peak Averaging Raycasting Ablation
With 2D and 3D object detection, we quantitatively benchmark CP against FPA. Given a real LiDAR frame, a dense representation can be obtained via reconstruction. Two simulation datasets, which are identical to the real dataset, can be raycasted using CP and FPA. Both datasets employ the same LiDAR pose and ray configurations from Waymo Open Dataset's calibration. Centerpoint is trained using the CP, the FPA and the real dataset. The trained models are evaluated on the real validation dataset, which is summarized in Table I. When trained using only XYZ, FPA method provides a small performance gain of +0.35/ + 0.05% and +0.91/ + 1.31% for 3D and 2D mAP 0.5/0.7 . This shows that the FPA, compared to CP, reduces noise in the simulated point clouds. When point cloud features (intensity, elongation) are included during training, FPA provides +1.72/ + 1.85%,  +1.10/ + 1.89% improvement for 3D and 2D mAP 0.5/0.7 . More importantly, the inclusion of point cloud features lead to improved model performance for FPA, but worsened 3D mAP 0.7 model performance for CP. This indicates that the simulated point cloud feature by CP compared to FPA is also more noisy and can cause confusion for the model.

C. Raydrop Ablation
To show the generalization capability of the proposed raydrop model, we will use a surrogate model trained on the validation set to drop points in the training set. Following IV-B, FPA simulation of the real validation dataset is first generated. Following Section III-C, simulation and real validation dataset is used to train the surrogate model. For each point in the raycasted simulation training set, the surrogate model checkpoint provides a probability the point should be kept. By choosing a threshold, probabilities can be converted to binary drop/keep masks. The higher the threshold, the more points will be dropped. The trained model's performance on the real validation set is summarized in Table II. "No raydrop" indicates original raycasting results, and "Real" indicates real data. Since XYZIE is used for training, these two rows are identical to "Simulation FPA" and "Real" rows of Table I(b). At threshold 0.28, 3D mAP 0.5/0.7 is maximized at 77.56/44.93%, a +1.40/+2.75% improvement compared to without raydrop. 2D mAP 0.5/0.7 also increases +1.51/ + 1.49% and +0.65/ + 2.00% at 0.30 and 0.28 threshold, respectively. Thus, the surrogate model is an extremely light-weight and generalizable method to effectively reduce the sim2real domain gap. Figure 4(a) provides a visual comparison of point cloud with and without raydrop. After raydrop, simulation point cloud more closely matches that of the real point cloud.

D. Learned Point Cloud Similarity
We perform a small hyperparameter search using 10% of the validation set. Using different combinations of hyperparameters (averaging peak width, range image width, range image height), new simulation validation datasets are raycasted. With a real data trained model, we can obtain the mAP of each raycasted dataset, as well as computing the LPCS between the raycasted and the real dataset. Figure 5 shows a negative correlation between LPCS and mAP, which implies that LPCS provides a good estimate of the domain gap between the simulation and the real dataset. Using LPCS to guide gridsearch of raycasting hyperparameters, we conclude that the optimal range image dimension is 2560 × 128, along with an averaging peak width of 20cm. These hyperparameters are used in all of the top LiDAR experiments.

E. Novel Sensor Synthesis
In this section, we showcase an example novel sensor synthesis, from top to side LiDARs. Following Section III-E, side LiDAR dataset can be raycasted using top LiDAR reconstructions. First 10% of the real and raycasted side LiDAR training set is used to train a surrogate raydrop model, to raydrop the entire raycasted training set. Using the first 10% and random 10% of the real side LiDAR training set, the simulation data trained models are further finetuned. Object detection performance, evaluated on the real side LiDAR validation set, is summarized under Table III(a). Some real data trained baselines are also provided in Table III  Alternatively, the simulation pipeline can be thought of as a data augmentation generator. The large scale primary dataset can be converted to augmentation frames for the secondary dataset, to improve the model's generalization capability on the secondary dataset.

F. Deformable Object Simulation
Table IV compares the pedestrian simulation using reconstructed and CAD pedestrians, when evaluated on the real top validation set. "Real" represents real data trained model. "CAD Naive" represents randomly sampling from the CAD library and replacing real pedestrians. "CAD Modified" improves upon "CAD Naive" with the inclusion of pose filtering and bounding box adjustment as described in Section III-F. "Reconstruction" replaces real with reconstructed pedestrians. Figure 6 provides a visual comparison of the above experiments. The reconstructed pedestrians leads to noticeably thicker outline compared to the real and CAD point clouds.
Compared to car classes, reconstructed pedestrians suffer from increased sim-real domain gap of −8.55/ − 14.48% and

V. CONCLUSION
In this work, we propose a point cloud based simulation pipeline. Experiments show that the pipeline is capable of transferring a dataset collected by an old sensor to recreate the LiDAR stream that would have been collected by a new sensor configuration of different density, placement and scanning mechanism. It greatly reduces the cost of data collection and annotation to generalize model performance from a particular vehicle-LiDAR setup to any desired combination. To harness the full potential of our pipeline, we look to close the domain gap between simulated and real pedestrians by augmenting the SMPL dataset with accessories, such as backpacks and handbags, as well as expanding VRU simulation to cyclists.