Traffic State Recognition of Intersection Based on Image Model and PCA Hashing

The premise of implementing an effective traffic control strategy is the accurate traffic state recognition. In the existing study, traffic state recognition methods were processed by using statistical characteristics and long-term scale detection of field traffic data. Hence, the dynamic characteristics and subtle changes in traffic flow were easy to overlook. At present, more and more advanced traffic detection technology provides reliable and accurate data for measuring and distinguishing the state of urban road traffic, such as the cooperative vehicle-infrastructure system, wide-area radar technology, and 5G technology. This study proposes a novel method called HTSI (High Precision Traffic State Identification Method), which is based on the advanced detection technology in traffic state recognition at the intersection: The raw data used for intersection traffic state recognition is high-precision detection data of tracking characteristics, which make the data look like a picture of the intersection at God’s perspective. To this end, we construct an image model for intersections and implement image feature extraction in a way that is different from traditional image processing. Then, the traffic state recognition problem at the intersection is translated into an image searching problem with tags. The image searching is realized by the hashing algorithm. Finally, the comprehensive experiments prove that the proposed method is more accurate and finer than other methods.


Introduction
Intersections are important nodes of urban road networks, and traffic demand often gathers at intersections. e multidimensional, complex, and time-varying characteristics of traffic demand would reflect on traffic states at intersections. erefore, the premise of implementing effective traffic control and preventing traffic congestion is that the accurate traffic states recognition at the intersection are prepared for recognition.
Nowadays, the most widely used traffic signal control systems such as SCOOT [1,2] and SCATS [3] need to accurately identify traffic conditions to ensure that the control strategy being implemented is effective. However, due to the limitations of the existing detection techniques and types of detection data, the accuracy of traffic state recognition of these systems is not sufficient. Specifically, the existing detection technology is mainly based on cross-sectional detection, and the output data are mainly statistical data. Although these data can reflect the movement of some traffic flows, the details are often ignored.
Recently, with the development of the cooperative vehicle-infrastructure system [4,5], wide-area radar technology [6,7], and 5G technology [8][9][10], the low-latency, highprecision, and traceable techniques have been providing new ideas for the recognition of intersection traffic conditions, especially in the accuracy of recognition and the restoration of traffic flow details. Surprisingly, new technologies have been widely used in traffic control [11,12], traffic guidance [13,14], and autonomous driving [15][16][17], but are not used for traffic state recognition.
If we consider the traffic flow at an urban intersection as a video, then the video is composed of images of n frames. If we assume that the detector at the intersection is the lens of this camera, then the acquisition process of the detector is the process of recording the video. e frequency of the detector is the camera's shooting frequency. Based on the abovementioned assumptions, we can map the data of the detector into image data. is assumption would be realized by the proposed HTSI method rather than the existing method. In this way, the research results in the field of image processing can be introduced into the study of traffic state recognition at intersections. en, the traffic problem can be converted into an understanding problem of the image content [18,19] or image search problem [20][21][22]. e main contributions of this paper include the following: (i) We propose an intersection image model based on extended discrete state coding using raw data with high-precision detection. (ii) We convert the problem of the recognition of traffic conditions at intersections into the problem of searching car images, which was first proposed in the field. is makes it possible to use a variety of sophisticated algorithms in the field of image search. (iii) We further demonstrate the superiority of this method. Specifically, it has advantages over the existing methods in terms of the fineness and effectiveness of traffic state recognition. e remainder of this paper is organized as follows: Section II presents a literature review of related work. Section III presents the detail of our image model of intersection and image feature extraction. Section IV describes the transformation of the traffic state recognition problem at the intersection into an image search problem and designs an image search based on PCA (Principal Components Analysis, PCA) hashing. Section V describes the simulation experiments and presents the experimental results. Section VI concludes this paper and discusses directions for future research.

Related Work
e traffic state recognition at urban road intersections is an ancient problem that dates back to the 1950s [23]. It is also a very important issue of urban road traffic control because only effective traffic state recognition can implement effective traffic control strategies. So, it has attracted many scholars to study, and existing methods can be generally categorized into two classes.

Traffic State Recognition Based on Queue Length
Estimation. To estimate the queue length in each direction of the intersection with single detector data [24][25][26][27][28][29][30] or multiple source-detector data [31,32] or vehicle road collaboration data [33], the queue length is used as the basis for traffic state recognition. It can be judged through checking whether the queue length reaches the threshold.

Traffic State Recognition Based on Traffic Parameters.
Delays [34] and time occupancy [35][36][37][38] are also commonly used as parameters for traffic state recognition at intersections. e traditional detector can effectively measure the delay and time occupancy and can reflect the motion state of the vehicle through these two parameters. is type of model can be used to determine the traffic state at the intersection.
However, to the best of our knowledge, the abovementioned two methods are difficult to obtain satisfactory results in the fineness and effectiveness of traffic state recognition at intersections. e main reason is that these methods are limited by traditional detection techniques. e traditional detection data have the characteristics of coarse granularity and strong statistical properties. ey ignore the intricate details of traffic flow in nature. For example, it is sometimes wrong to treat a traffic accident (As shown in Figure 1(b)) near an intersection as a state of oversaturation (as shown in Figure 1(a)), but this is not the case.

Problem Statement.
In this paper, we consider a typical signalized urban road intersection. e vehicles usually gather at intersections because the intersection will separate the traffic demand in time and space to ensure safety. e characteristics of traffic demand and the traffic flow are dynamic and time-varying. So, it is difficult to identify these changes sensitively and accurately using the existing traffic detection techniques, but using advanced detection techniques such as road coordination and wide-area radar can obtain more accurate and time-series finer raw data. Suppose we consider the process of traffic detection as taking pictures. We can get pictures with continuous time series (as shown in Figure 2) by increasing the frequency of detection, just like the continuous observation of changes in traffic demand with God's perspective (as shown in Figure 3). is assumption is very interesting and meaningful.

Raw Data for Advanced Detection Methods.
Traditional traffic detection data for traffic demand measurement include traffic, occupancy, density, and queue length. ese types of detection data have the characteristics of detecting coarse granularity and strong statistical properties. It is difficult to effectively describe the details of realtime dynamic traffic using them. Advanced detection technology represented by a cooperative vehicle-infrastructure system and wide-area radar technology has developed rapidly, which makes real-time high-precision trajectory detection possible. It is gradually applied to the field of urban road traffic detection based on these advanced technologies (as shown in Figure 4). ese advanced detection techniques generally provide real-time data in milliseconds. Data types include instantaneous vehicle velocity, vehicle latitude and longitude, vehicle ID, vehicle length, and time stamp (as shown in Table 1 for an example of raw data for a wide-area radar detector.). At the same time, they can provide full sample data with a small error within the effective detection range. e true appearance of the traffic demand can be fully reflected when using these full-sample real-time high-precision trajectory data because these data are very subtle and sensitive.

Extended Discrete State Coding.
A full-color image is composed by red-green-blue (RGB) color. Inspired by this, we develop a five-tuple extended discrete state coding [39,40] method. It is used to indicate the attributes of the vehicle and the operation of the vehicle in the effective detection area at the intersection. is quintuple corresponds to the five data types given in Table 1.
e effective detection area of the intersection is L p * L p , which it is determined by the actual detection distance of the detector. However, it should be emphasized that the boundary of the effective detection area should be larger than the maximum queue at intersection when it has reached oversaturation. e lane can be divided into L p /l units with the equivalent car length l as a standard. M represents the attributes and operation of the vehicle in the effective detection area at intersection after the discretization. C denotes whether the lane unit would store information in the presence of the vehicle (one indicates the presence of the vehicle; Zero indicates no vehicle. is description is the result of mapping the real coordinate data to the road segment). R denotes speed information of the stored vehicle    Journal of Advanced Transportation image consisting of "pixels," as shown in Figure 5(b). is has enabled the imaging modeling at the intersection.

Feature Extraction of Images at
Intersections. e actual content of the image is determined by its characteristics, and the image of the intersection is no exception. erefore, feature extraction of the image of the intersection is required. is section will give a detailed description of the method of feature extraction.
Assume that the effective detection area of the intersection is a set Γ consisting of key parts.
where X � x 1 , x 2 , . . . , x m represents the set of intersection entrance lanes and m is the number of entrance lanes. Y � y 1 , y 2 , . . . , y n represents the set of intersection exit lanes, and n is the number of exit lanes. Z � z 1 , z 2 , . . . , z u represents a set of intersection conflict zones, and u is a block of conflict zones. X, Y, and Z are described as key parts of the effective detection area of the intersection, as shown in Figure 6. As in equation (3), Γ is calculated from the quintuple: [41] of the translation correction process is used to determine e η∈Γ (t).
Here, subindex matrix where a j is the observed value of the j th index, i � 1, 2, 3, 4, 5.
(i) Step-1: the A � [a j ] 5 is normalized to obtain a standard information matrix R � [r j ] 5 . e normalized approach is For the larger and the better the subindex: For the smaller and the better the sub-index: e optimal unit value r * j corresponding to the j th indicator is selected, j � 1, 2, 3, 4, 5. e rules are (ii) Step-2: the distance between r j and r * j is calculated. (iii) Step-3: the probability of the index is calculated.  When d i > 0, there was no need for revision to β j , at that time u i � 0. When d i � 0, the index does not work to e η∈Γ (t), and in order to ensure the availability of all the index data, it needs human translation correction to β j , this time, u i is constant and u i > 0. (iv) Step-4: the distance entropy of the index is calculated. (v) Step-5: the entropy weight is calculated.
e characteristic values of the key parts of the intersection can be expressed as e piecewise linear function is designed as follows. It is used to describe the relationship between the traffic state and the characteristic value of each key part at the intersection.

Journal of Advanced Transportation
Equation (15) is expressed as a set Ξ of images of the traffic state of the intersection. ξ i represents the image in which the i th state is represented.
where ξ i is as shown in the following equation: s e x i ∈ X x 1 s e x i ∈ X x 2 · · · s e x i ∈ X x m s e y i ∈ Y y 1 s e y i ∈ Y y 2 · · · s e y i ∈ Y y n s e z i ∈ Z z 1 s e z i ∈ Z z 2 · · · s e z i ∈ Z z u Equation (16) is transformed as follows. Get σ dimensional feature vector of the intersection image ξ i .
s e x i ∈ X x 1 s e x i ∈ X x 2 · · · s e x i ∈ X x m s e y i ∈ Y y 1 s e y i ∈ Y y 2 · · · s e y i ∈ Y y n s e z i ∈ Z z 1 s e z i ∈ Z z 2 · · · s e z i ∈ Z z u

Method Overview.
In this paper, we translate the traffic state recognition problem at the intersection into an image searching problem, and the imaged modeling of the intersection and the feature extraction of the image have been implemented in the sections above. is section presents an image searching method based on supervised hashing. e core idea of the method is to use the hash function to convert the image features into binary and then judge the similarity of the images by comparing the Hamming distance. In this way, it is only necessary to compare the image to be queried with the image with the label in the gallery to obtain the real content of the image to be inquired. As shown in Figure 7, the architecture of traffic state recognition is proposed in this paper. Offline learning phase: Firstly, the method of the previous section is used to realize the image modeling at intersection and the feature extraction of the image. Secondly, the image feature vector is transformed into a fixed-length hash code by constructing a hash function. All images in the training library are hash coded to get a total hash change set. Online search phase: Firstly, the input data is imaged and feature extracted, and the data is hash coded by using the offline learning stage to obtain a hash function. en, the Hamming distance of the hash code of the image to be checked, and the hash code of the image in the training library are compared. Finally, the query results are reordered according to the Hamming distance and returned, and the real content of the image to be inspected can be obtained.

Objective Function.
Similar to the existing study [42][43][44], we use PCA hash to solve the image searching problem. Basically, the PCA algorithm is used to reduce the original data. en, a hash function is learnt to convert each data point of the image feature into a binary code.
e objective function can be formed by minimizing the target coding matrix and the resulting coding matrix as follows: where G ∈ R c * φ represents a new matrix of the original data E ∈ R σ * φ after the dimensional reduction by the PCA and G � TE ∈ R c * φ , T ∈ R c * σ represents the dimensionality reduction matrix. W ∈ R c * c represents the rotation matrix. H � [h 1 , h 2 , . . . , h φ ] ∈ R c * φ is assumed to be a hashed coding matrix after quantization. h i is the hash code of each sample; μ � (1/n) n i�1 h i is the mean vector of all hash coded vectors.
e main role of the regularization term φ i�1 ‖h i − μ‖ 2 2 is to reduce the influence of the outliers in the process of learning the hash function by reducing the deviation between the value of each hash code and the mean. ρ is the weight of the penalty. (17) shows the objective function. Since the objective function is a convex function and is not smooth, it is difficult to directly find the optimal solution. erefore, this paper uses a two-step alternating optimization method [45] to solve the problem.

Algorithm. Equation
(a) When H remains constant, the problem becomes 6 Journal of Advanced Transportation Solution: (b) When W remains constant, the problem becomes By mathematical derivation of equation (21), the result of h i is obtained: By deriving equation (19) and letting the derivative be zero, we get the optimal solution of h i : Binary coding for h i : Finally, the hash code matrix B � [b 1 , b 2 , . . . , b φ ] of the original data set E is obtained (PCA hashing algorithm is shown in Algorithm 1).

Simulation Experiment and Case Study
In this section, we present the (1) simulation experiment and (2) case study.

VISSIM Simulation Environment.
e signalized intersection is implemented in VISSIM. e detailed settings of the VISSIM simulation environment are listed in Table 2.

Training Set and Test Set.
e sampling interval of the simulation data is set to 1 s to simulate the detection frequency of the advanced detector.
is will give 36,000 samples. We used 30,000 samples as the training set and 6000 samples as the test set (see Table 3).

Analysis Results.
e effects of fineness FI and effectiveness TM are evaluated.
where TP represents the number of samples that were correctly searched. FN indicates the number of samples that were incorrectly searched. FE represents the recognition time. FT represents the total search time. is study is compared with the relevant research in the author's preliminary work [30,37]. From the comparison of results analysis, the method used in this paper has a higher improvement in the fineness and effectiveness of traffic state recognition at intersections (see Figure 8, the data points are calculated once every 3600 s.). As shown in Figure 8(b), the reason for the large improvement in effectiveness is that the periodic recognition is used for the traffic state recognition at the intersection, and the real-time recognition is also used in the paper.

Background. Balong Road intersection in Xuchang
city is used as a case study. e calibration of static data is provided by the traffic management department, and the calibration of dynamic data is proceeded by using the detection data of wide-area radar, as shown in Figure 9.

Results and Discussion.
e data is collected at weekdays' morning peak hours and the evening peak hours, as shown in Figure 10.
In this case study, the selected traffic states are undersaturated and oversaturated. e range of the undersaturated state is s 1 � [0, 1), and the range of the oversaturated state is s 2 � [1, 1.5).
As shown in Figure 11, the oversaturated occurred at the morning peak hours and the evening peak hours of Balong Road intersection. is judgment result is consistent with the change of traffic flow, as shown in Figure 10. erefore, this case study proved the validity of the proposed method.

Conclusions
In this paper, inspired by the high-precision detection technology and image searching technology, we develop a new HTSI modeling method and a semisupervised hashbased TSI recognition algorithm. We present a detailed process of image modeling and an image searching method Input: training samples E ∈ R σ * φ , control parameter ρ, number of dimensionality reduction c, random initialization H � [h 1 , h 2 , . . . , h φ ] ∈ R c * φ and W ∈ R c * c . Output: hash coding matrix B ∈ R c * φ , T ∈ R c * σ and μ. Process: Start.
Using G � TE ∈ R c * φ to obtain G. Using (12) to calculate W. Using (13) to calculate H and until convergence. Using (15) to obtain hash function. e binarization threshold vector is obtained by calculating the mean vector of all H samples by sgn (h i(j) ). Obtain a final hash coding matrix B through μ ; Over.
ALGORITHM 1: PCA hashing algorithm.  (2) is paper requires that the accuracy of the detection data is sufficiently high, but does not consider the applicability in the case of insufficient data accuracy. In the future study, we will study the abovementioned two issues in detail and try to extend the method to short-term traffic flow estimation, traffic signal control, and other fields. Literature [14] Literature [15] This paper Data Availability e data generated by the simulation are used in the paper, and the parameters have been calibrated in the simulation environment because the data are available. e data of the case in this paper are provided by Xuchang traffic police detachment in Henan Province. e data are the real traffic data of Xuchang City. Disclosure e views are those of the authors alone.

Conflicts of Interest
e authors declare no conflicts of interest.

Authors' Contributions
Li-li Zhang and Qi Zhao contributed equally to this work.     Figure 11: e morning and evening peak traffic status of Balong road intersection.