In this blog post, let’s explore the possibility of event detections in crowded scenes, specifically in a shopping mall setting with models capable of running in real time as well as with more openness to different scene understandings.

As robotics technology advances, security robots have the potential to become ubiquitous in public spaces such as shopping malls.

To enhance their capabilities and help build that future, we can use computer vision and machine learning to detect unusual patterns of movement or objects that indicate potential safety incidents or unusual events.

Unusual events could include running, falling down, sudden gathering, or objects left unattended for a long time. All analysis can be performed on anonymised detections without identifying individuals.

However, these capabilities would either be more accurate with more open scene understanding capabilities or faster to detect the events in real-time.

If the robots rely on internet connectivity for accessing bigger and accurate models, the video streaming adds latency. On the other hand, smaller models would require careful training for specific events/tasks before deployment.

Multi-level shopping mall atrium where security robots could patrol
A future shopping mall thought with security robots

Vision Models

Vision models, commonly based on convolution neural networks, are usually the first choice of algorithms to be tested and deployed on today’s AI-based vision systems.

For a security robot in a mall, many pretrained vision models can be fine-tuned to add the capability of detecting certain events like ‘cash payment at the counter’, ‘fall detection’, etc. For specific use cases, this requires data to train or fine-tune the vision model on. A recent use-case of fall detections in a warehouse setting tested at WISIO is shown in the video below:

The trained vision models can perform inference up to 17 frames per second (FPS) on a CPU and up to 60 FPS on NVIDIA T4 GPU making them detect objects in real-time. At WISIO, we try to increase the confidence of these vision models by carefully curating the data and the training pipelines. Once trained, the models can perform multilabel inferences at the fraction of a second.

Vision models can also be used to detect anomalous activities in fixed places, which the model has not seen before e.g., crowd gathering, escalator malfunction, unauthorized access/intrusion, fire/smoke, or any other contingency. Once an anomaly is detected, further necessary actions are triggered. For instance, a passageway may not be allowed to gather on, and a region counter helps in determining such a situation as shown in an example video below:

Vision-Language Models

To train an autonomous patrol unit to detect anomalous events with a supervised vision model — for example a large convolutional classifier — it can run in real time with excellent accuracy. But it depends heavily on data diversity, and training is expensive for real-world use. Vision foundation models pre-trained on very large datasets exist, but when a new class appears that the model never saw in training, it may not be able to infer it.

To address this lack of openness and generalization to new scenes, recent studies encode text into the vision architectures so that the contextual richness in the natural language helps the model fetch the potentially unseen classes during the inference stage. This allows for a good zero-shot performance (where no training data was provided). A pretrained vision-language foundation model can be further fine-tuned on a dataset for a use case.

Vision-language model fine-tuned with an image, text phrase and label
Vision-language model taking an image, text phrase, and corresponding label as input for fine-tuning
Prompting a fine-tuned vision-language model in a new scene
After fine-tuning, a different prompt in a different scene capturing a different people behavior

In a shopping mall deployment, for example, a vision-language model could be trained to recognise common events such as “entering or exiting the mall”, “customer browsing”, “cashier processing payment” and “security guard patrolling”. If people linger in a busy area where that is not allowed, the model may detect it when the activity is described in a text prompt. Using that linguistic context, it can classify the situation as an anomaly even without prior training examples. This makes an autonomous patrol system more robust and adaptable than purely vision-based methods. A list of suitable text prompts is provided once; when a new event needs to be added, a new prompt should ideally be enough, without further fine-tuning.

At WISIO, such near-real-time vision-language models are being actively tested for different use cases with FPS of more than 50 on NVIDIA V100 GPU. In a crowded scene with many objects being detected in parallel, the added latency in comparison to a single object detection is around 15-20%. Even with good generalization abilities, some fine-tuning for different cases is performed. These models do not have tens or hundreds of billions of parameters and could be deployed on the edge devices for real-time performance, therefore, could be suitable for a moving robot.

Multimodal Video Models

Going more towards slower foundation models with general scene understanding capabilities in a multimodal setting, WISIO is actively testing the development and deployment of such models. With the video foundation models, spatiotemporal events can be queried, understood, and used in applications. For example, in the passageway video above, when we queried one of the multimodal foundation models whether it sees some people not walking, the response (zero-shot) was:

Yes, some people in the video are not walking. There is a small group of people, including some children, clustered together near the center-left of the frame. They appear to be stationary, likely talking or interacting with each other, while the rest of the people in the video are walking across the mall floor.

These natural language responses can assist security personnel with general event capturing without any fine-tuning. For the future of the security robots in shopping malls, detailed instructions can be provided with the natural language prompts to give coverage for generally any event.

The accuracies of the above-mentioned domain of models are continuously being improved and consistently developed across the community; therefore, we can leverage and contribute into this ongoing effort.