Abstract

Line crossing detection is to check whether people or objects go across a given barrier line, which is quite common and important in our daily life, such as the electronic article surveillance (EAS) checkpoint in a retail store or the finish line in track and field. Although existing solutions to line crossing detection have achieved great advancement, they do not function well when multiple objects or people cross the line at the same time. In this paper, we propose a new radio frequency identification (RFID)-based solution called RF-Line to line crossing detection, especially for multiobject scenarios. The biggest challenge is that the RFID reader’s coverage zone is invisible and irregular; we cannot roughly take the time when a tag is seen by the reader for the first time as the time when line crossing occurs. In RF-Line, we deploy two antennas opposite to each other and collect the RF phase profiles of two antennas at the same time. By a series of geometric transformations and mathematical derivations, we find that summing up the two phase profiles will get a new phase curve, in which the inflection point of the curve is the time of line crossing. In addition, we address the problem of turning back or long stay on the barrier line. We implement RF-Line with commodity RFID systems. Extensive experiments show that RF-Line can achieve accurate line crossing detection with a small error of 6.1 cm, with no need for any system calibration or complicated deployment.

1. Introduction

Line crossing detection is to check whether and when people or objects go across a given barrier line, which is quite common and important in our daily life. As shown in Figure 1, in a retail store, line crossing detection is deployed on the electronic article surveillance (EAS) system for detecting pass in and out of customers [13]. If an attacker passes the EAS door with improperly bought items, the system sets off alarms and alerts staff to an attempted theft in progress. In track and field, high-resolution cameras are used to capture images and compute the time when athletes hit the finish line, which determines the winner and ranking of the game. In robotics, the technology of line crossing detection can be applied to create a virtual wall, which is an invisible barrier that robots won’t cross. That makes it easy to confine a robot to a particular area or room and prevents it from approaching anything dangerous [46]. Line crossing detection also provides users the ability to do human–machine interaction. For example, we can use the technique to build a virtual switch that tracks your hand’s trajectory for choosing between two distinct states (e.g., turning on/off the TV).

Existing solutions to line crossing detection generally fall into three categories: infrared sensor [7, 8], camera [911], and virtual wall [46]. Infrared sensor detects line crossing by measuring infrared light radiating from objects in its field of view, which is widely used in security alarms. It tracks general movements but does not tell who or what moved. Camera uses image processing algorithm to recognize the movement of people or objects over a given virtual line. It can be used to detect people crossing over the fence or entering some restricted area. In robotics, a robot constructs the virtual wall, which is an invisible barrier that the robot cannot cross in automatic path planning. Although existing solutions to line crossing detection have achieved great advancement, they do not function well in the case of detecting concurrent line crossing, i.e., multiple objects or people cross the line at the same time.

In this paper, we propose a new solution called RF-Line to the problem of line crossing detection by using radio frequency identification (RFID). As a noncontact passive sensing technology, RFID has attracted increasing attention in recent years and has been widely used in various fields, such as object tracking [1222], warehouse inventory [2330], library management [3134], and others [46, 35, 36]. Each RFID tag has a unique ID that exclusively indicates every tagged object and brings them item-level intelligence. By tracking tags in real time, we can figure out when the tagged people or objects go across a given barrier line, especially for multitarget scenarios. However, this is not easy. The biggest challenge of RF-Line is that the interrogation zone of an RFID reader is irregular and unpredictable since the reader’s signals are susceptible to various factors, e.g., the reader planning, multipath effects, material of tagged objects, surroundings. We cannot roughly take the time when a tag is seen by the reader for the first time as the time when line crossing occurs. Mobile RFID localization is a feasible solution, but it needs complicated system deployment, accurate calibration, or high computation overhead. For example, PinIt and BackPos [15, 37] have to perform a set of calibration experiments to eliminate diversity. Tagoram [12] needs to know the antenna’s position in advance and is also compute-intensive.

Unlike localization, line crossing detection concerns whether and when people or objects go across a given barrier line, instead of the tag’s coordinates at any time. RF-Line breaks down this problem into two parts. First, when the tag moves along the line parallel to the plane of the antenna (e.g, tagged luggage on conveyor belt), we keep collecting RF phases of the tag and form a phase profile with time stamps. By removing the periodicity of the phase profile and using curve fitting of hyperbola, we are able to get an inflection point that indicates the time when line crossing happens. Second, in a more generalized case where the tag’s trajectory is uncertain, we deploy two antennas opposite to each other and collect the RF phase profiles of two antennas at the same time. By a series of geometric transformations and mathematical derivations, we find that summing up the two phase profiles will get a new phase curve, in which the inflection point is the time of line crossing. In addition, RF-Line addresses the problem of turning back or long stay on the barrier line by recording the readings in each sliding window and calculating entropy of phase values, which avoid false positives. We implement RF-Line with commercial off-the-shelf (COTS) RFID reader (Impinj R420 [38]) equipped with two antennas (Laird S9028PCR [39]). Extensive experiments show that RF-Line can achieve accurate line crossing detection with a small error of 6.1 cm, with no need for any system calibration or complicated deployment.

2. Problem Definition

An ultra high frequency (UHF) RFID system generally consists of some tags and one or more readers (antennas) (we will alternately use reader or antenna in the rest of this paper). Each tag is attached to an object to exclusively indicate the associated object. By communicating with a tag, the antenna can obtain the attributes of the tagged object or the information of physical-layer signals emitted by the tag. As shown in Figure 2, let the center of an antenna be the origin . If one antenna is used, the y-axis is on the line perpendicular to plane of the antenna. If two antennas are deployed, the y-axis is the line that goes through the two centers of the antennas. The x-axis is perpendicular to the y-axis. In RF-Line, the problem of line crossing detection is to check whether and when people or objects go across the y-axis. This is quite common and important in our daily life, such as the EAS checkpoint in a retail store or the finish line in track and field.

The difficulty is that the interrogation zone of an RFID antenna is not a line. Instead, its shape is irregular and unpredictable since the antenna’s signals are susceptible to various factors, e.g., the antenna planning, multipath effects, the material of tagged objects, surroundings. We cannot roughly take the time when a tag is seen by the antenna for the first time as the time when line crossing occurs. For ease of presentation, we just use a one-tag case to show how RF-Line works in what follows. If multiple tagged targets go across the line at the same time, we can classify the collected data based on the tag ID and deal with each tag’s data individually. Hence, the multitag case can be easily reduced to one-tag case.

As the tagged target moves, the distance between the antenna and the tag keeps changing, which leads to the variance of RF phase that is our vehicle for line crossing detection. The RF phase reflects the offset degree between the received signal and the sent signal of electromagnetic wave, ranging from 0 to 2 (360), which is a common parameter supported by COTS readers, e.g., Impinj R420 [38]. Suppose the distance between the reader antenna and the tag is . According to the round-trip backscatter communication, the signal travels a total distance of 2. In addition, the tag’s reflection coefficient, the reader’s transmission circuit, and the reader’s receiver circuits will also cause extra phase rotations, which are denoted as , , and , respectively. The phase output can be expressed as follows:where is the wavelength. The term is called diversity term, which is determined by hardware characteristics. As shown in Figure 2, when a tagged object moves, the antenna keeps querying tags and collecting a sequence of RF phase values together with the corresponding time stamps, which is a phase profile of the tag, denoted by . The objective of RF-Line is to use this profile to estimate whether and when the tag crosses the y-axis.

3. Baseline Solution

In this section, we design a trajectory-based solution for the aforementioned problem. The basic idea is that if we can conduct real-time tracking on each tag, we are able to know when they cross the barrier line as well. To achieve this goal, we deploy two antennas and in opposite directions. As shown in Figure 3, a tag is initially located at and moves to the position . If the distance between and is small, the trajectory of the tag can be treated as a line. By measuring the distances of and , we are able to derive the tag’s position. Suppose the distance is , is , and is , the angle is . Given the three sides of a triangle, can be derived with the following equation:

Suppose the antenna position is the origin point with the coordinate , the y-axis is the line between and and the x-axis is perpendicular to the y-axis at . In the 2D plane constructed by x-axis and y-axis, the tag position can be expressed as . As we can see, the tag position is able to be determined by measuring the three distances , , and . Among them, is a constant since the two antennas are static and we can derive it after the antennas are deployed. Unlike , and are hard to derive since the tag keeps moving. To handle this problem, we aim to take the RF phase as the vehicle to measure them. As shown in Equation (1), the phase value of the tag varies with the distance between the antenna and the tag, which is an ideal metric to do this measurement.

Next, we will introduce how to get the trajectory of the tag with RF phase. Suppose is the phase measurement of the tag. According to Equation (1), the relationship between the phase value of the tag and its distance to the antenna is given as follows:where refers to the distance between the antenna and the tag, and refers to the mod operation, as shown in Equation (1). With a phase measurement and Equation (3), it is still hard to derive because the parameters and are unknown. To handle this problem, we leverage the difference between the adjacent two phase measurements to remove and . Since the sampling rate of RFID readers is generally greater than 30 Hz, the time difference between two samplings is about 0.03 s. Therefore, the distance difference between the two samplings is less than 0.03 . The communication frequency of UHF RFID systems that we use is 920 MHz, so the wavelength is about 0.32 m. Therefore, the moving distance of the object between two samplings needs to be less than half of the wavelength, which is about 0.16 m. In other words, . This holds when the speed is less than 5 m/s, which meets most indoor applications. As shown in Figure 3, the tag’s displacement during two adjacent reads and for antenna is:

Since the above formula takes a phase difference for antenna , the antenna-dependent diversity term and the term has been naturally eliminated. Obviously, the formula for antenna is similar to antenna . Then, we can recover the trajectory of the tag with the displacement. We give an example, as shown in Figure 3, where a tag moves from to . In a short period of time, the tag trajectory can be regarded as a straight line. The phase values of the tag at these two positions for antennas and are, respectively, , and , . According to Equation (4), we can derive and . Let be the intersect point between and its perpendicular line . Because the interval between two samplings is extremely short, the value of (denoted as in short) is extremely small. So, . Since , . Therefore, . is the same. Let be the perpendicular line of and be the perpendicular line of , the intersect points are and , respectively. The position of can be derived according to the position of , , and . Similarly, using this method can deduce the positions of and , as shown in Figure 3, which can form a complete trajectory chain for line crossing detection.

In conclusion, this method can localize the tag location with only two antennas by using the phase changes to infer the movement trajectory of the object. However, this method needs the initial position of a tag together with careful system calibrations (for reader antennas), which is inapplicable in some practical applications. In the next section, we propose a new method called RF-Line, which can do line crossing detection without this limitation. The details are given below.

4. RF-Line

4.1. Basic Idea

We first consider a basic case that the tag moves along the x-axis at a constant speed, which is shown in Figure 2. This can be used in some applications such as conveyor belt in the airport for baggage check or delivery of cargo from storage. In this case, we use one antenna and keep collecting signals from the tag and label each of the corresponding phase value with the time stamps. The labeled RF phase is denoted by , which forms a phase profile. In this profile, the x-coordinate is the time stamp and the y-coordinate is the phase value. In this paper, we find that the phase value looks symmetrical due to the tag’s movement. As the tag moves, the displacement between the antenna and the tag first decreases and then increases after reaching a minimum when crossing the barrier line, resulting in a symmetrical phase pattern in the phase profile. We draw a typical pattern, as shown in Figure 4. As we can see, the phase value repeatedly reduces from 2 to 0 until the tag reaches the nearest place to the antenna. After that, the phase value starts to increase from 0 to 2 periodically and results in an inflection point in this pattern. The inflection point happens when the tag passes the antenna. Through its time stamp, we can easily know when the tag crosses the line (i.e., the y-axis of the coordinate). To find the zero-crossing of the derivative, we use a threshold test, the phase value whose first derivative is equal to zero will be chosen as the inflection point and its y-coordinate indicates when the tag crosses the line.

4.2. Line Crossing Detection with Time Warping

In this subsection, we consider a more generalized case that the object moves at a nonuniform speed. In this case, the curve of RF phase will be compressed or stretched as the speed of the tag changes. To solve this problem, we use the dynamic time warping (DTW) algorithm. DTW is one of the algorithms for measuring similarity between two temporal sequences, which might be with different lengths. Assume two phase profiles are X and Y with the lengths of and , respectively. DTW defines a warping path in the form of , where . The form of is , where represents the coordinate in and represents the coordinate in . The warping path must begin with and end with for ensuring that every coordinate in and appears in . In addition, and of in must be monotonically increased, which means:

The result warping path is the one with the shortest distance given as follows:where , and are the and elements of phase X and phase Y. The aim of the algorithm is to find out the final warping path that minimizes by using dynamic programming.

Figures 5 and 6 show the results of DTW algorithm. As shown in the figure, the curve of the measured phase profile and the theoretical phase profile matches well. DTW algorithm uses global matching to get the best matching point. The point in the measured phase curve which corresponds to the inflection point of the theoretical phase curve after DTW is considered as the time when the tag passes y-axis.

4.3. Generalized Cases

In this subsection, we discuss three more generalized situations. First, we assume that the tag moves along a straight line which is not parallel to x-axis at a constant speed. The point closest to the antenna is not on the line perpendicular to plane of the antenna, which means the x-coordinate of the inflection point of the phase profile does not correspond to the time when the tag passes the y-axis. To handle this problem, we deploy one more antenna and try to find the inflection point by jointly considering both of their phase values. As shown in Figure 7, two antennas are on the y-axis, opposite to each other. The inflection points happen when the tag is located at and . Let , , and be the time when the tag passes , , and the y-axis, respectively. Time can be given by the following formula:where and means the distance from to and that of to . According to Section 4.1, and can be calculated. If the value of and can be obtained, then we can get the time as desired. To do so, we can deal with and individually. Hence, the problem is reduced to one-antenna case. As shown in Figure 2, the antenna is at the origin and the coordinate of the tag is . When the tag moves at a constant speed of along the x-axis, the location of the tag is at the time . Hence, the distance at the time is given as follows:

Substituting Equation (8) in Equation (1) and remove the periodical pattern of the phase profile, we get the phase value:

Deforming the formula, we have:where , , and are considered as constants and and are variables. This formula shows that the curve of the phase profile is actually half of a hyperbola. Hence, we can get the estimates of by using one of the existing curve-fitting algorithms of hyperbola. Then, we can use this method to calculate and in Equation (7) and finally calculate the desired time .

However, when the tag does not move at a constant speed, the above method does not work. As a result, we propose a new method by jointly considering the phase measurements from the two antennas. As shown in Figure 8, when the object moves, we assume the distances from the tag to the two antennas are and and the distance between two antennas is . Obviously, because the sum of the two sides of a triangle is greater than the third. The value of reaches the minimum when the object passes the y-axis. Assume that the phase values of the object read by the two antennas are and , respectively, then we can get the formula according to Equation (1):

As aforementioned, the sum of the two phases also first repeatedly reduces from 2 to 0, and then suddenly changes to 2. When the object passes the y-axis, the sum reaches a local minimum and then starts to increase from 0 to 2. So, the figure of also has an inflection point with x-coordinate corresponding to the time when the object passes the y-axis, which is similar to the method we introduced in Section 4.1. We also determine this by calculating the first-order derivative and the point whose first-order derivative is equal to 0 is just the inflection point and its x-coordinate is just the line crossing time that we want to get.

Note that the method we introduced above also works when the tag does not move linearly, as shown in Figure 9. In this case, the minimum of the sum of the two phases also holds if and only if the tag crosses the y-axis. Therefore, the same method can be used to infer the time when the tag’s trajectory is a curve.

4.4. Turn Back and Long Stay

Imagine the following situation, the tag turns back before passing the y-axis. As shown in Figure 10, in this case, the phase value also has an inflection point, which shall be treated as a line crossing event by mistake. To handle this problem, we change the deployment of the two antennas by rotating each of them a certain angle, which is shown in Figure 11. The basic idea is intuitive; if the tag turns back in the interrogation zone, its first read and last read will be collected by the same antenna. Otherwise, if line crossing happens, the two reads are expected to be collected by different antennas for sure. Besides, if the turning back event happens, one antenna shall read the tag longer than the other antenna, which the feature shall also be used to determine a cross event. The two features form the basis of our method.

Suppose the antenna A collects reads from the tag and the set of the correspond time stamps is denoted as . The antenna B collects reads from the tag and the set of the correspond time stamps is . The minimum time stamp correspond to the start point is , and the maximum time stamp is ; they form the interval . Divide into slots with the length of , we have . Then, the slot interval is:

Define a feature vector for each antenna with the length of . If there is a time stamp falling in the time slot , then the intermediate time of the time slot is added to the time stamp feature vector :

For each antenna, we calculate the mean of the elements in the first half and second half time stamp feature vectors given as follows:

In general, in the case of an inflection point occurs, the following two cases show that the tag passes the line:

Next, we consider the case when the object keeps still for a long time. Since our methods determine a line crossing with the local minimum value of the phase (the first-order derivative is equal to 0).

However, as shown in Figure 12, the phase value in this case doesn’t change when the tag keeps still and the long flat stage in the curve may be treated as the inflection point by mistake. To remove the impact of the long flat area in the curve, we construct a sliding window and calculate the entropy of the entire dataset. If the phase value in the window doesn’t change, its entropy is small and data in this window will not be treated as the inflection point. Then, the method for calculating the entropy is given below:where is for entropy, represents the number of phase values in the sliding window, and represents the frequency of each phase value. If is over a threshold , it is considered that the phase changes significantly within this sliding window. Otherwise, the inflection point is not in this window. Then, the sliding window will move forward and repeat the calculation. The threshold can be determined through empirical study. We can measure entropies from some tags and calculate the mean value of these entropies. After that, we can let equal to and use it to pick out likely clone tags.

4.5. Enhancement with Kalman Filter

RF-Line leverages phase measurements obtained from two antennas to estimate the target’s position. However, environmental factors and ambient motion are likely to affect phase measurements sometimes, lowering localization accuracy. To alleviate this problem, a Kalman filter can be applied to refine the estimates and reduce the influence of outliers. The Kalman filter consists of two main steps: the prediction step and the correction step. In the context of RFID-based localization, the prediction step predicts the target’s new position based on its previous state and known dynamics. The correction step then adjusts this prediction based on the incoming phase measurements.

As shown in Figure 4, the phase curve can be approximatively treated as a straight in a small time window; RF-Line uses a linear function to predict the phase measurement, which can be written as follows:where represents the state transition matrix and is the phase estimate at time . The corresponding error covariance can be written as follows:where is the error covariance matrix and is the process noise covariance matrix.

In the correction step, we estimate the phase value by the phase measurement and ; the progress consists of follow steps, which can be written as follows:where is the measured phase, is the measurement matrix, and is the covariance matrix of measurement noise. The term is the output of Kalman filter, which can be used to remove the impact of ambient motion. This approach enhances the reliability of RF-Line, making it more robust to outliers and improving the overall performance of line crossing detection.

4.6. Frequency Hopping

In RF-Line, we need to collect the phase profile under a fixed channel, which is fine if a reader is allowed to communicate with the tag at a fixed frequency. For example, Impinj R420 is allowed to communicate with tags with a fixed frequency in China. However, in some countries such as USA, FCC compliant RFID readers need to use frequency hopping, where time is divided into small time windows (e.g., 0.2 s in R420) and a random frequency is used in each window to collect information from tags. To generalize our solution, discuss how can we make the algorithm FCC compliable.

The frequency hopping introduces additional phase offset, which can affect the performance of RF-Line. To address this issue, we need to remove the phase offset and merge the phase measurements obtained from different time windows (frequencies). Let and denote the phase values measured at the frequency and the frequency , respectively. The distance between the reader and the tag is represented as . The phase offset can be expressed as follows:where is the speed of light. In this equation, , , and are known, and the problem is to compute . Since the time window is short, we approximatively consider the distance as a static value within a small time window. Let be the first phase value measured in time window , and be the last phase measured in the preceding time window . Since the sampling rate of a commodity RFID reader is high, the two phase values are measured adjacently and can be regarded as measured from the same position. Thus, we can derive as . By substituting into Equation (22), we can compute the distance and use it to normalize all data measured in the th time window. It is worth noting that the hopped frequencies are randomly determined in a common frequency hopping system. However, in a commercial RFID system, the frequencies can vary randomly or in a predefined order (e.g., from the lowest one to the highest one). The difference is that the RFID reader can obtain frequency information in each tag inventory.

5. Implementation and Evaluation

In this section, we implement a prototype of RF-Line with commodity RFID devices. The performance is compared with the state-of-the-art RFID localization method and the baseline solution we mentioned before in terms of accuracy. To ensure the result is general, we run each setting 100 times and show the results on average. The details are given below.

5.1. Implementation

As shown in Figure 13, we build a prototype of RF-Line in our lab. The system mainly consists of two parts: an RFID module and a robot module. The RFID module consists of an RFID reader, two antennas, and several commodity RFID tags. The reader model is Impinj Speedway R420 [38] whose working frequency is ranging from 920 to 924 MHz. The antenna model is Laird S9028PCL [39] with 8 dBm signal gain. The two RFID antennas are deployed in opposite directions and both of them are connected to the same reader through a cable line. The tag model is Impinj H47 [38]. The valid data acquired by the reader will be forwarded to a backend server through Wi-Fi. We use the Robot Operating System (ROS) to synchronize the clock of the reader and the backend server. The robot module consists of a robot and several RFID tags. We stick tags to the robot, which is used to perform line crossing. The robot model is TurtleBot2 [40]. Its moving trajectory can be controlled through programming. The ground truth is recorded through a camera. The development software of RF-Line is Java, which adopts the Low-Level Reader Protocol (LLRP), specified by EPCglobal in its EPC Gen2 standard, to communicate. The host computer is a laptop with an Intel Core i5-8250U 1.8 GHz CPU and 8 GB RAM.

5.2. Accuracy

In this subsection, we set up the real scenarios and compare the accuracy of RF-Line with a state-of-the-art localization method called Tagoram [12] and the baseline solution we mentioned before in the same scenarios. We use the exact passing line time obtained by the camera as ground truth. Tagoram is a localization work, which can also be used to detect passing line time obviously. We study the impact of different parameter settings on distance error and compare the performance of our method and Tagoram under different scenarios.

We keep collecting phase values from the tag while the tag on the robot is moving in three different trajectories: straight line, slanted line, and curved line, respectively, denoted as case 1, case 2, and case 3. Then, we observe the distance errors of RF-Line, baseline solution, and Tagoram. As shown in Figure 14, the distance errors of Tagoram, baseline solution, and RF-Line are 7.90, 6.68, and 4.47 cm, respectively, in straight line scenario. The distance errors of Tagoram, baseline solution, and RF-Line are 9.01, 7.85, and 6.23 cm, respectively, in slanted line scenario. The distance errors of Tagoram, baseline solution, and RF-Line are 11.33, 9.94, and 7.48 cm, respectively, in curved line scenario. Among the three scenarios, RF-Line can achieve the best distance error with the straight line, and the worst distance error with the curved line. Figure 15 shows the cumulative distribution function (CDF) of the localization errors. The similar conclusion can also be drawn: RF-Line performs the best, baseline follows, and Tagoram is with the biggest error.

Next, we discuss some factors that may affect accuracy, i.e., the speed of object movement, the number of tags, and the angle of antenna rotation.

5.2.1. Impact of Moving Speed

In the experiment, we vary the speed of the robot from 20 to 45 cm/s, which covers most of the situations in practice. As shown in Figure 16, the results show that RF-Line performs best at all testing speeds. The distance errors are 4.47, 5.01, 5.48, 5.55, 5.82, and 7.39 cm when the speed is 20, 25, 30, 35, 40, and 45 cm/s. Besides, it’s worth noting that the detection error increases as the speed of robot increases. This is because a higher speed will affect the channel condition, which shall result in some error in the phase values used in our method.

5.2.2. Impact of Number of Tags

Sometimes, the system may be used to detect multiple line crossing events at the same time. However, more tags will decrease the sampling rate of the reader for each tag, which shall have a bad effect on the detection accuracy. To study this impact, we vary the number of tags used in the system and test the corresponding accuracy. In all experiments, the robot moves along a straight line at a constant speed of 20 cm/s. As shown in Figure 17, the distance error is 5.69 cm when the number of tags is 200, which is 1.24 cm bigger than noninterference condition. Clearly, the error is not large as well. The results illustrate that the number of tags have very small impact on our method.

5.2.3. Impact of Antenna Placement

Next, we collect the data when the two antennas use different rotation angles. We rotate the angle of two antennas from to , and observe the detection accuracy. The results are shown in Figure 18. As we can see, the distance error increases as the rotation angle increases. This is because the rotation of the antenna will result in some errors in its phase measurements. A larger angle causes a lower detection accuracy. However, a higher angle is help to detect the turning back event, and it will be discussed in next subsection.

5.2.4. Impact of Ambient Motion

Next, we test the impact of ambient motion on the estimation accuracy. We test RF-Line in three different rooms and compare the results with the condition without ambient motion. The results are shown in Figure 19. As we can see, the accuracy is close to the scenarios without ambient motion. The distance error is 6.7, 6.5, and 7.0 cm, which can meet the requirement of most applications. This positive result is in part because we leverage the Kalman filter to alleviate effects of the noise caused by ambient motion. In addition, ambient motion usually happens occasionally and will not last for a long time, which means that the outliers are only a small subset of the entire phase profile, which lowers the negative impact on the accuracy.

5.2.5. Impact of Tag Orientation

Next, we test the impact of tag orientation on phase measurement. As shown in Figure 20, we rotate the angle of tag to and observe the phase measurement. The results are shown in Figure 21. As we can see, the phase value nearly unchanged with the rotation of the tag (the tag model is H47, a circularly polarized tag produced by Impinj Inc.). The maximum phase difference is 0.83 rad, which is much smaller than the impact of tag movement. These results demonstrate that RF-Line is robust against tag orientation changes, ensuring consistent and accurate line crossing detection regardless of the tag’s orientation.

5.3. Detection Accuracy of Turning Back

In this subsection, we discuss whether the object can be detected correctly when it turns back while moving. In order to determine detection accuracy, we set two types of experiment: passing the barrier line and turning back without passing the barrier line. We rotate the angle of two antennas from to . The detection accuracy increases as the degree increases; however, the distance error also increases as the rotation angle increases as we mentioned before. Jointly considering the two factors, we choose to set the antenna rotation angle to and test the detection accuracy in the three trajectories. As shown in Figure 22, when the angle is set to , precision and recall reach around 95% in all three trajectories, while the distance error is less than 5.77 cm.

Existing solutions to line crossing detection generally fall into three categories: infrared sensor-based systems [7, 8], camera-based systems [911], and virtual wall [46]. Infrared sensor detects line crossing by measuring infrared light radiating from objects. It can detect a line crossing when the object is closed to sensors, which is widely used in an access control system. Camera-based system recognizes object moving through image processing. By observing the pixels of the object, the line crossing event can be detected as well. In robotics, a robot constructs the virtual wall, which is an invisible barrier that the robot cannot cross. When the robot is close to the virtual wall, its navigation system will give immediately change its moving trajectory. These line crossing systems have already been widely used but they still do not run well in many practical cases, i.e., multiple objects or people cross the line at the same time.

RFID, as a noncontact passive sensing technology, can solve this problem. There is no straightforward solution to line-crossing detection. RFID localization initially appears to be a potential solution, which can be categorized into two types: received signal strength indicator (RSSI)-based methods and RF phase-based methods. RSSI-based methods [15, 41] usually appear in some early works. These methods commonly need to deploy a large number of reference tags whose positions are known. Due to the low resolution of RSSI and the restrictions of deployment, it is not a very good choice for localization. In recent years, the research starts to shift to using RF phase for RFID localization. The competitive advantage of RF phase is that it provides us with a high-resolution measurement of the signals when the tag–reader communication distance varies. Many advanced phase-based methods have been proposed for dealing with different scenarios, especially for mobile localization.

Tagoram [12] tracks moving objects, which achieves a very high accuracy when the trajectory and speed of the object are known in advance. D-watch [42] implements a device-free localization, which does not require any device attached to the target. The basic idea of D-watch is that the signal power will experience a drop when a target blocks the signal’s propagation path. See-through-walls [43] can track moving objects through walls by deploying reader, antenna, and tag array on the other side of the wall of the room to be inspected. It measures the phase of the tag array when in the absence of anyone in the room in advance and compares it with the situation when someone enters the room. RF scanner [31] mainly focuses on the localization of the books in library. It moves the antenna to determine the order of books along the moving direction. When the antenna passes through the tag in a straight line at a constant speed, the phase image is the above half of the north–south opening hyperbola. Direction of arrival [44] can estimate the direction of tag by using linear phased array, which is widely used in electromagnetic and acoustic fields. However, the distance between two antennas needs to be kept below (about 16 cm). In spite of these advancement, the localization-based solutions need complicated system deployment, accurate calibration, or high computation overhead.

The most related work is localization of RFID tags moving on a conveyor belt. The work [45] uses the reader antenna’s radiation pattern together with the RSSI threshold to determine the order of tagged tires on the conveyor belt. It, however, cannot figure out when the tagged tires go across a given line and also suffer from environmental affects. The work [46] jointly uses synthetic-array radar principles, knowledge-based processing, and the reader–tag communication signal to track tagged items moving along a conveyor belt. The above solutions, however, are tailored to the applications of conveyor belt, which require to know the trajectory and speed of the object.

7. Conclusion

Line crossing detection is quite common in our daily life. In this paper, we propose a lightweight method called RF-Line that deploys two antennas opposite to each other to track the objects crossing a given barrier line, without any complicated system deployment or calibration. By concurrently collecting the RF phase and jointly estimating an inflection point by two antennas, RF-Line is able to know whether and when a tagged object crosses the line connecting the center of the two antennas. We implement a prototype of RF-Line with a commodity RFID system. Extensive experiments show that RF-Line can achieve a high tracking accuracy with a small error of 6.1 cm.

Data Availability

The data used to support the findings of this study are included within the article.

Additional Points

Limitations: First, tag orientation does not affect the performance due to the choice of a double-dipole tag (i.e., Impinj H47) in the experiments. However, in the case of dipole tag use (e.g., Alien 9740), phase values will be affected, which are likely to cause performance degradation. Though tag orientation has not been explored in the scope of this paper, it remains open as potential future work in this area. Second, if an RFID tag is carried by a subject in motion, the noise level on the phase profile will vary with the motion of the subject. Therefore, depending on the level of subject’s motion (e.g., running, walking, bouncing, etc.), the performance degradation is expected.

Disclosure

A conference has previously been published [47].

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Authors’ Contributions

Conceptualization, Xingyu Chen, Xuan Wang, Kai Xun, and Jia Liu; methodology, Xingyu Chen, Xuan Wang, Kai Xun, and Jia Liu; software, Xingyu Chen and Kai Xun; validation, Xingyu Chen, Xuan Wang, and Xia Wang; writing—original draft preparation, Xingyu Chen, Xuan Wang, and Xia Wang; writing—review and editing, Xia Wang and Jia Liu; supervision, Jia Liu and Zhihong Zhao; funding acquisition, Jia Liu and Lijun Chen. All authors have read and agreed to the published version of the manuscript.

Acknowledgments

This work was supported by the National Natural Science Foundation of China under Grant 62072231, Collaborative Innovation Center of Novel Software Technology and Industrialization, and Open Project of State Key Laboratory for Novel Software Technology under Grant KFKT2021B15.