{'fraction_non_alphanumeric': 0.02880479816911968, 'fraction_numerical': 0.007063094345578661, 'mean_word_length': 4.781021897810219, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Structured Hough Voting for Vision-based Highway Border Detection

We propose a vision-based highway border detection algorithm using structured Hough voting. Our approach takes advantage of the geometric relationship between highway road borders and highway lane markings. It uses a strategy where a number of trained road border and lane marking detectors are triggered, followed by Hough voting to generate corresponding detection of the border and lane marking. Since the initially triggered detectors usually result in large number of positives, conventional frame-wise Hough voting is not able to always generate robust border and lane marking results. Therefore, we formulate this problem as a joint detection-and-tracking problem under the structured Hough voting model, where tracking refers to exploiting inter-frame structural information to stabilize the detection results. Both qualitative and quantitative evaluations show the superiority of the proposed structured Hough voting model over a number of baseline methods.


Introduction
Detecting road borders has broad applications in future autonomous vehicles and intelligent transportation systems as an important component of scene understanding. It can provides cues about road structure that benefit motion planning and cruise behavior control. In autonomous driving, the detection of road border is often done by GPS, high quality road map and some other active sensors such as Radar and Lidar. This, however, can sometimes be limited by the accuracy of GPS positioning signal as well as the resolution of active sensors. A natural question is whether we can address the problem with computer vision.
Besides detecting the physical road border, part of our task also includes robustly detecting the shoulder region in order to provide necessary maneuver guidance for future autonomous driving systems. In the United States, highways often contain a so-called "shoulder region" usu- ally defined as the region between the outer-most solid lane marking and the physical road border. This shoulder region serves as a buffer zone before the physical limit of the road. Non-emergency vehicles are mostly not allowed to drive on shoulder regions. But under emergency conditions, they may be allowed on shoulder regions for purposes such as evasive maneuver and emergency parking.
We start from the most basic setting where a side-view production camera 1 looks out from the right side of a vehicle, as illustrated in Fig.1. The detection problem is approached as the problem of detecting the road border (e.g., guard rails, concrete barriers, etc.) and detecting the closest lane marking on the shoulder-side of the vehicle. The expectation is that the algorithm will return an estimate of the drivable regions before the physical road border. If the vehicle is on the right-most lane, the shoulder region is expected to be detected, while if the vehicle is on inner lanes, the detection also include available lanes on the right. We will assume that the shoulder is on the right side of the car, but we can easily apply our approach to the shoulder on the left side provided that the side camera is mounted on the left side of the vehicle. We emphasize that the current system is just one part of a future surround view system where sideview detection and front-view detection can jointly support and improve each other. The current system can also benefit future autonomous driving systems by providing information about road structure. Our goal is to achieve robust detection within 0.5 to 6 meters detection range, while being able to handle various challenging scenarios including strong shadows, diverse border types/appearances and complicated scenarios such as highway entrances and exits.
In the United States, typical highway borders can be classified into three types: concrete barrier, guard rail and soft shoulder. Given this observation, our key assumption is that the types of highway border are not as diverse as the borders in urban or other uncontrolled scenarios and can be learned from a set of labelled images. This assumption, however, by no means makes the problem trivial: the border and shoulder detection problem still needs to address the limited resolution challenge, meet the required speed constraints, deal with complicated border situations and contend with a number of other challenges such as strong shadows, dynamic appearances and other patterns that look like borders.
We show that our problem can be theoretically formulated as a joint detection-and-tracking problem under a graphical model called "structured Hough voting". Our contribution in this paper lies in the fact that the proposed structured Hough voting model exploits a variety of interframe and intra-frame structural information to achieve very robust performance, while using multiple candidate hypotheses and mode selection to retain necessary flexibility. We will show that the proposed model performs very well on the highway border and shoulder detection problem.

Related work
The problem of vision-based scene understanding for autonomous driving has been widely studied. Many seek to address the problem of general object detection, such as the detection of pedestrians [13], bicycles [18], motorcycles and vehicles [11]. There has also been a considerable amount of work regarding scene parsing where each pixel/superpixel in an image is labeled with a certain object class [3,17]. However, most of them focus on the understanding of general objects and the algorithms are often not possible to run in real-time 2 on a regular CPU.
Some relevant works try to understand the structure of road and these works are indispensable parts of the autonomous driving system. Considerable effort has been devoted to automatically detect roads [1,2] and lane markings [12], or to find vanishing points [10]. Others have addressed the problem by exploring more capable sensors, including stereo vision sensors [14] and Lidar sensors [16]. These sensors provide extra depth information which makes the tasks considerably easier. Thus they have been adopted in some autonomous systems [15]. While these sensors are able to provide more information than monocular cameras, their costs are often very high.
The problem of road border detection has been previously addressed [4][5][6][7][8][9] but none has addressed the highway scenario where border detection can become particularly difficult with concrete barriers due to their textureless nature. In addition, most of them focus on features and detectors while our work also presents a novel robust model.

Proposed model
Given a video from the side camera, we investigate both the inter-frame and intra-frame structural information instead of performing Hough voting independently for each frame. Our high-level intuition here is that these structural cues are the key to robust performance. To utilize such cues we formulate our model under a conditional random field (CRF). We shall see that independent Hough voting corresponds to unary prediction in our CRF model, returning how likely the hypotheses are. The inter-frame and intraframe structural information corresponds to pairwise potentials, introducing additional constraints to refine the results.

Hough voting background
Geometrically, a straight line in a 2-D (x, y) space can be represented by the following equation: where r is the algebraic distance between the line and the origin, θ is the angle of the vector orthogonal to the line. Voting points are the points indicating where a line should be. Given a set of voting points whose coordinates are {(x i , y i )|i = 1, ..., N }, the voting weight is defined as: where w i is the weight associated with each voting point. σ is the bandwidth parameter that adjusts how sensitive voting is to relatively far away voting points and is empirically fixed as 5 in this work for its good performance. Let (θ, r) h, conventional Hough voting seeks to find a hypothesis h that maximizes the voting weight: Finding h * with continuous optimization is difficult as it is non-convex. A common way is to discretize h and search for the one with the maximum vote weight. The remaining questions are: 1. How are the voting points defined? 2.
How to obtain these voting points? Type 1 voting points: Voting points are returned by triggered border or lane marking detectors. Here we adopt scanning window detection where each detected positive window returns an equally weighted voting point estimating where the border/lane marking is 3 . We deliberately allow multiple dense triggers (See Fig. 2) and the returned voting points are the main source of detection information.
Type 2 voting points: These are voting points whose coordinates are simply the coordinates of all pixels, while the Hough voting is now weighted by the gradient of each pixel. The intuition is obvious: borders and lane markings often have relatively strong vertical gradients. In case where detectors have failed and very few Type 1 voting points are returned, estimating with gradient might be a good approximate strategy to obtain a reasonable result.

The structured Hough voting model
We seek to treat the Hough voting hypotheses jointly, exploring their probabilistic and structured relations with a graphical model 4 . CRF is a highly suitable model for our problem. Suppose X denotes the aggregate of observations (i.e., the coordinates and weights of voting points) in all the frames and H the aggregate of all the Hough hypotheses, CRF discriminatively defines the joint posterior probability P (H|X) and the inference of CRF is to find the joint hypothesis configuration that maximizes P (H|X): Different from many conventional models, our structured Hough voting model first generates three different candidate hypotheses 5 in every frame (except the initial one). We will show how they are generated later. The intuition is that we want to handle certain situations where: 1. Borders and lane markings can "jump" suddenly due to entrances and lane changes and 2. Failures of border/lane marking detectors can return very few Type 1 voting points. We hope that at least one of them can return a good "guess" of the border/lane marking in every situation and that the model can appropriately select the best expert.
Once the candidate hypotheses are obtained, the model selects the best one as the detection output. Finally, we also check whether the chosen hypotheses for border and lane marking in each frame have violated certain structure restrictions (e.g., whether they have intersected). If violations occur, perturbation is performed on the border hypothesis candidates to guarantee that such structural restrictions are followed. Again, one of the perturbated hypothesis candidates is selected as the final detection result.
Let "bd" and "ln" denote "border" and "lane marking" for short, we define the following notations to better describe our model 6 . In the ith (i ≥ 2) frame, we have: The graphical model is shown in Fig. 3. Let Φ bd,i denote Φ bd (h bd,i−1 ,Ĥ bd,i , xi), and similarly for Φ ln,i , Ψ bd,i , Ψ ln,i and Ωi, We will give detailed definition and intuition for each term in our model. To better illustrate each term, we decompose the model and show them in Fig. 4.

Candidate hypotheses generation unit
The term Φ bd (h bd,i−1 ,Ĥ bd,i , xi) seeks to generate multiple candidate border hypotheses based on the observations in current frame and the selected hypotheses in the previous frame. The intuition here is that the first hypothesis candidateĥ bd1,i is generated by performing unconstrained 8 Hough voting with Type 1 bd voting points. It is able to discover sudden border changes. The second candidate is also generated by Hough voting with Type 1 bd voting points, but is additionally constrained (smoothed) by the previous frame. The third candidate concerns the constrained Hough voting with Type 2 voting points (image gradients). It specifically handles the case of very few returned Type 1 voting points due to occlusions and faded lane markings. The graphical representation is shown in Fig. 4 (a). Note that the unit is not a clique potential. However, it is a composition of a set of potential functions: where φ is the Hough voting function defined in Eq. (2). Let ∆θ |θ1 − θ2| and ∆r |r1 − r2|, ϕ is the inter-frame pairwise potential defined as a binary loss function: where λ bd,θ and λ bd,r are the potential parameters to be learned. They respectively describe the tolerance of the inter-frame offset and angle difference of the hypotheses. Similarly, Φ ln (h ln,i−1 ,Ĥ ln,i , xi) is defined as:

Mode selection potential
The mode selection potential Ψ bd (Ĥ bd,i , h bd,i , xi) seeks to select the best candidate bd hypothesis. A decision tree is used to guide 8 therefore there is no associated pairwise potential the selection. Since the voting weights of candidates can indicate the hypotheses confidence, the decision tree takes such input to predict the best candidate. Let φ(ĥ bd1,i , x bd,i ) be denoted as φ bd1 for short, the decision tree diagram for border is shown in Fig. 5: Letĥ * bd,i denote the candidate selected by the decision tree, andĤ C bd,i the candidates not selected by the decision tree. The mode selection potential is defined as: where λ mode is a nonnegative penalty parameter to be learned. It controls how sensitive the model is to the violation of decision tree output. The mode selection potential basically forces the output to be one of the candidate hypotheses, but allows discrepancy with the decision tree prediction with a penalty. The graphical model of the mode selection potential is shown in Fig. 4 (b).
The decision tree for lane marking is similarly defined. The condition for the root decision node is chosen as: φ ln1 −φ ln2 > 50 and the conditions for the two child decision nodes are respectively φ ln1 > 16 and φ ln2 > 10.

Coupled structure potential
The coupled structure potential Ω(h bd,i , h ln,i ) further regularizes the results by exploiting the intra-frame structure. With this potential, border and lane marking are no longer independent but coupled and it can significantly improve the results under certain cases. The graphical representation of the coupled structure potential is illustrated in Fig. 4 (c).
The potential mainly captures two properties of structural restrictions between border and lane marking: Parallelism: The border and lane marking hypotheses are approximately parallel to each other. The closer they are, the stronger such property holds. Most important of all, they can not intersect. Distance: A border often keeps certain distance from the lane marking. They can not be too close to each other.
Let ∆θi |θ bd,i − θ ln,i | and ∆ri r bd,i − r ln,i . The coupled structure potential is defined as: where λstr1 and λstr2 are the potential parameters learned from training data to control the level of parallelism. d1, d2 and d3 are empirically set to 10, 17 and 35 respectively. Dmin(r ln,i ) is a piecewise-linear function defined as: Dmin(r ln,i ) = max(min(ar ln,i + b, 27), 10), where a and b are parameters that can also be learned through a linear regression from training data.

Inference
The online updating nature (real-time requirement) of this problem limits our scope of observations to the past frames. Suppose at time t the set of available observations is denoted as X1:t. The inference problem is to: However, conducting the above whole inference each time given a new frame is computationally infeasible. A relaxation is to initialize with the inferred state variable configuration of the previous t − 1 frames and infer the current state variables, updating in an incremental way. At t = 1, the inference is to optimize the following problem: φ(h bd,1 , x bd,1 ) + φ(h ln,1 , x ln,1 ) + Ω1 (13) This is to search the maximum Hough voting for border and lane marking based on Type 1 voting points, subject to the constraint from the coupled structure potential. At t > 1, the log probability can be represented as: Since we reuse the previously inferred results, the inference problem becomes: where Ht {Ĥ bd,t ,Ĥ ln,t , h bd,t , h ln,t }. The −∞ penalty in the potential functions essentially serve as hard constraints on the search space of Hough voting hypotheses. To perform inference one needs to follow these constraints and conduct the following 4-step optimization: Step-1: Optimize withĤ bd,t andĤ ln,t .
(Ĥ * bd,t ,Ĥ * ln,t ) = arg max Given h bd,t−1 from the previous frame, generate the candidate hypothesisĥ bd1,t using unconstrained Hough voting andĥ bd2,t and h bd3,t using constrained Hough voting. Similar for lane marking candidate hypotheses.
This step selects the candidate indicated by the decision tree for both border and lane marking.
Step-3: Back perturbation withĤ bd,t . (Optional) Check whether Ω(h bd,t , h ln,t ) equals to −∞. If it is then one needs to go back adjustĤ bd,t such that the three candidates also follow the structure restriction with h * ln,t : Step-4: Optimize with h bd,t . (Optional) Given the adjusted border hypothesesĤ bd,t , again perform mode selection with the decision tree.

Learning
Much of the potential parameters in our model can be automatically learned from training data. We use Gaussian models to fit the differences of r and θ from ground truth hypotheses in consecutive frames. This gives a statistical estimate of how quick the hypotheses can change. Thus λ bd,θ , λ bd,r , λ bd,θ and λ bd,r are learned as twice of the model standard deviation. The estimation of λstr1 and λstr2 is conducted similarly. λ mode is learned to be larger than the largest vote weight loss caused by back perturbation, such that one would not risk violating the decision tree to generate a candidate that does not follow the coupled structure restriction but with a larger voting weight.

Voting point extraction
We first describe how to obtain the Type 1 voting points. We extract the filter bank responses and histogram of oriented gradient (HOG) to perform scanning window detection. The filter bank we used is the same as in [3], while the adopted HOG descriptor follows the work of [19]. We divide each image patch into upper and lower two cells, and concatenate their mean filter bank responses. In addition, we also divide each image patch into 8 cells for HOG, where the normalized gradient histogram of all the cells are concatenated. The final feature for each detector window is the concatenation of the above filter bank responses and HOG features. Fig. 6 illustrates our feature extraction method.
It is worth mentioning that the computation of filter bank and HOG features for scanning windows can be conducted in an extremely efficient way using integral image. Thus the proposed feature extraction method has the potential to work real time. We train two classifiers, one for border detection and the other for lane marker detection. In detail, we perform Fisher discriminant analysis on both the border training set and the lane marker training set, where the features of each training set are extracted as described previously. Then, we train two Radial Basis Function (RBF) Kernel SVMs on the dimensionality reduced training sets.

Highway entrance and lane state detection
In addition to the basic border and shoulder detection, we include highway entrance detection and lane state tracking which allow us to jointly estimate the position of merging/neighboring lane and tracking the lane state of the vehicle (e.g., whether it is the right-most lane). Figure 7 shows some example results returned by the algorithm, where yellow regions in (a) and (b) indicate non-shoulder merging/neighboring lanes. The true shoulders on the other hand are detected as green regions in (c).

Dataset
We collected 4200 highway road shoulder images. Among them, 1592 images are used for training where the images come from the frames of multiple video segments. The remaining 2608 images are used for testing and all the images form a complete video. The dataset contains many challenging and complicated scenarios. Example images from the dataset are shown in Fig. 8 (a)-(d). The number of training images containing concrete barriers, guard rails and soft shoulders are 839, 300 and 453, respectively.
We use the MIT LabelMe open annotation tool to label borders and lane markings. We label the borders into "concrete barriers", "guard rails" and "soft shoulders". A set of well-aligned border image patches can be extracted from each annotated border and lane marker region (See Fig. 8 (e)). These patches form the positive training samples for the scanning window detectors, while negative samples are randomly mined from the background of the training images. The ratio between the number of positive samples and number of negative samples is set as 1 − 3. Fig. 9 illustrates some examples of the training patches.
For test sequence, we label shoulder regions where the upper edges are the ground truth of highway borders. In the experimental  section, we will use such ground truth to generate a set of benchmarks for quantitative comparison.

Experimental results
We conducted an experiment on the 2608 frames of the test video using structured Hough voting. The test sequence contains a variety of challenging situations, including complicated scenarios such as entrances and exits, as well as interfering visual manifestations such as strong shadows, dynamic appearances, drastic illumination change, weak border/lane marking and fake border/lane marking patterns.
To illustrate the performance of the proposed method, we compare our method with 3 baseline methods: 1. Independent Hough voting in each frame using the fired detector voting points, 2. Hough voting using the triggered detector voting points constrained by previous frame and 3. Adding gradient tracking to Baseline 2. We also compare to results obtained by the Kalman filter which is a standard method widely used in lane marking tracking.

Adding coupled structure restrictions
We first illustrate examples that show the difference brought by the coupled structure restrictions. One can see that such restrictions have successfully corrected results where the detection of border failed. Some typical examples are illustrated in Fig. 10. The first row corresponds to the method without coupled structure restriction, while the second row corresponds to the method with such restriction. Figure 10. Examples of results successfully corrected by the coupled structure restriction.

Quantitative evaluation
We conducted a series of evaluations based on the annotated test sequence ground truth and benchmarks 9 . The quantitative results of the baselines and the proposed method (Proposed2 denotes with coupled structure restriction, while Proposed1 denotes without the restriction.) are listed in the table in Table 1. Again, one can see the performance of the proposed method is the best one.

Qualitative evaluation
We also select some challenging frames where the baseline methods usually fail. The results obtained by the baseline methods and the proposed method are shown in Fig. 11. The 6 sets of images (from left to right and top to bottom) correspond to ground truth, baseline1, baseline2, baseline3, Kalman filter and the proposed method.
One can see that our model performs more robustly than the baseline methods in normal situations and is more responsive to drastic border changes in case of highway entrance due to the model flexibility achieved by the scheme of generating multiple hypothesis candidates.

Failure cases
We finally show some failure cases in Fig. 12. The failure cases are mostly caused by false positive voting points and there is little a model could do given such input. This shows that the next step to the improve the method is to enhance the quality of voting point input. 9 Bd Pxl: Average vertical pixel distortion between the detected border and hand annotated border ground truth. Ld Pxl: Defined similarly to Bd Pxl for lane markings. Bd Ang: Angle distortion between the detected border and the Hough configuration fit to the border ground truth. Ln Ang: Defined similarly to Bd Ang for lane markings.

Conclusions
In this paper, we have proposed a novel model called Structured Hough voting, and reported its application on vision-based highway border and shoulder detection. Experimental results have validated the good performance of the proposed model and its superiority over some popular models such as Kalman filter.
Our proposed method is also computationally efficient. First, the feature extraction unit can be implemented with integral image operations where the extraction of both mean filter bank responses and HOG in every scanning window is extremely fast. Second, our proposed inference method performs incremental (online) update, which also requires very few computation. The algorithm complexity of Hough voting is O(M N ) where M is the number of possible hypotheses and N the number of voters. Voting with image gradients takes the most computation among the three candidate hypotheses generation methods. But it is still highly efficient since both hypotheses and voting points are significantly truncated by previous frame. In general, the method is able to run real-time without any GPU acceleration.