Person re-identification

Person re-identification is tracking and recognizing the person through computer vision in a multi-camera system. The recognition of the person does not only occur through tracking but also thanks to the recognition of secondary characteristics attributable to the subject, in multiple frames. The use of personal re-identification is fundamental in the field of security or for the management of a large flow of passengers, for example, airports.

person flow airport

What are the benefits of person re-identification?

Controlling and tracking people is important in larger shopping malls because it allows you to control waiting times in case of queues, arrange flow and signage within the mall, and of course for security.

Another important application is in airports, mainly for passengers. From a careful analysis of the flow of passersby, essential data can be obtained for the design of areas dedicated to waiting, reducing queues, facilitating movement with various arrangements, having greater flexibility, fast check-in, and above all security.

Person identification

The first step for Person re-identification is the recognition of people in the frame. As you can see in the image below each person has a bounding box, this means that in those specific coordinates of the frame, the algorithm has determined that a person is present but it cannot be uniquely determined who it is. We cannot have continuity in identification we cannot determine if that same person is present in subsequent frames

person reidentification bounding box

Person tracking

A tracking algorithm is sufficient for tracking objects but, although sophisticated, it is not always useful for tracking people. To learn more about the basics of tracking you can see Object tracking from scratch – OpenCV and Python or Object Tracking with OpenCV and Python

person tracking

Person re-identification

Identifying people with tracking is insufficient because it only takes one occlusion for the tracked person to lose the ID. Here is the example in the image below. The red circle on the left shows two people with IDs 31 and 38, the image on the left reads 44 and 42. How can this problem be solved?

Person re-identification and tracking comparison

Keep track of people with person re-identification (RE-ID) 

When we identify a person we have to save the image and its ID and then a re-identification algorithm is needed to solve this problem, and I have taken this https://arxiv.org/abs/1905.00953 based on OSNet as an example.

The first step is to save all the people identified with their IDs in the folders. In each folder are the images of the person linked to the ID taken in each frame.

save bounding box

This is the contents of the folders taken for example IDs 42 and 44 that initially corresponded to IDs 31 and 38

The algorithm will compare the images in the folders and if it finds similarities it will reassign the correct ID. In the image below you can see how the ID of the people taken as reference is now corrected.

person reidentification correct id

Use of person reidentification in real conditions

What I have used in this video is just an example to make people understand the potential and operation of this algorithm. In real-use conditions, things change, it is necessary to study the environment to best design the location of the cameras, the hardware to be used and the software to be developed. This algorithm is very heavy so it will require precise calculation of the necessary hardware.

Hardware

Can I use Jetson Nano or Raspberry Pi for this project? As I mentioned in the previous paragraph a lot of computing power is required so these devices can only be used for person recognition to be sent to a server, which will do all the processing and keep track through the various cameras.

Final considerations

The argument presented in the article is a demonstration of the potential of OSNet, the Person re-identification algorithm is an important tool for tracking the flow of large numbers of people, especially when used on multiple cameras and in the presence of many occlusions. It is not easy to use because it requires a lot of computing power, so each application must be designed according to the usage environment.

Blueprint

Learn to build Computer Vision Software easily and efficiently.

This is a FREE Workshop where I'm going to break down the 4 steps that are necessary to build software to detect and track any object.

Sign UP for FREE