Communications of the ACM - Artificial Intelligence 19小时前
Visual Object Tracking Challenge: How to Offer a Working Solution in 24 Hours Using Multimodal LLM
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文分享了作者团队在计算机视觉竞赛中,为快速克服质量门槛而采用多模态大模型(Qwen2.5-VL)解决视频目标跟踪问题的经验。文章详细介绍了在视频和图像处理方面的实验过程,包括如何通过调整输入参数以适应模型限制,以及在目标定位和描述方面遇到的挑战与解决方案。尽管在视频跟踪方面未能直接获得理想结果,但通过将任务分解并结合文本描述,最终实现了稳定的目标搜索。文章还探讨了未来改进方向,如模型微调以直接预测跟踪轨迹、输出多边形掩码以及优化搜索策略,强调了多模态大模型在快速构建高质量解决方案中的潜力。

💡 **多模态大模型在计算机视觉竞赛中的应用探索**:作者团队在时间紧迫的情况下,选择利用Qwen2.5-VL这类多模态大模型来解决视频目标跟踪问题,展示了其在快速构建解决方案方面的潜力。模型能够处理文本、图像和视频,为应对复杂视觉任务提供了新的思路。

🎬 **视频目标跟踪的挑战与实验**:在视频跟踪实验中,直接将整个视频输入模型会因超出token限制而失败。通过分析token计算公式,作者发现需要对视频进行降分辨率或抽帧处理。尽管模型能够描述视频内容,但在精确的逐帧目标定位(bbox)任务上表现不佳,仅能提供单个帧的定位信息,而非连续的跟踪轨迹。

🖼️ **图像目标搜索的有效策略**:针对视频跟踪的困难,团队转向了基于图像的搜索策略。初期尝试直接在两张图像间进行目标定位,效果不稳定。最终,通过先识别首帧目标的关键特征(颜色、形状等),再利用文本描述在后续帧中搜索该特征,实现了较为稳定的目标定位。

📈 **实验结果与模型局限性**:在实际竞赛视频测试中,该方法在目标唯一性高的视频上表现良好,但在包含大量相似目标的情况下,效果有所下降,表明模型在区分相似物体方面仍需改进。作者认为,模型训练数据中可能缺乏相似的定位或分割任务,导致其在输出精确边界框或多边形方面存在局限。

🚀 **未来改进方向与多模态模型潜力**:为了进一步提升性能,作者提出了几点改进建议,包括:模型微调以直接预测跟踪轨迹、训练模型直接输出目标多边形掩码以替代SAM模型、以及优化搜索策略使其能参考前一帧的定位信息。这些都指向了多模态大模型在计算机视觉领域更广泛的应用前景。

Computer vision competitions are currently an important event for teams working in this area. They provide an opportunity to try new solutions, practice, and simply enjoy solving interesting problems.

We have previously described on the BLOG@CACM our participation in the VOTS Challenge in 2023, and the appearance of our solution on the leaderboard in 2024.

That same year, we developed a rather interesting solution that showed decent results; but at the last moment, due to technical problems, we lost the trained model and did not have time to fix everything before the deadline. Therefore, we will probably talk about this solution in a future post.

That same year, since the basic solution that we had been making for half a year was not ready, we had to come up with something quickly, and at the same time, overcome the quality threshold. We want to tell readers about such an experience in this post.

Multimodal Models Qwen2.5-VL

To solve the problem, it was decided to use an unusual approach based on multimodal LLMs. They can potentially solve the problem without any additions at all. Among the multimodal LLMs, some of the most famous are the Qwen series models. In particular, we took Qwen2.5-VL.

It can work with texts, images, and videos. This model exists in four variants: 3B; 7B; 32B; and 72B. The authors do not recommend using more than 24,000 tokens per input. In our work, we used the 7B variant because even without quantization it fits on one A6000 48GB video card. The 32B version requires two such GPUs, and the 72B version requires four. There are also quantized versions, but there was no need to use them, since they are the same in speed, and there was enough memory.

Experiment 1: Working with Videos

What if, given an object (or its name) and the entire video, we ask the LLM to build a track of it? After all, the LLM must understand the context well when the entire video is available at once.

On the first frame of the video, we know the object to search for; so, first we simply ask Qwen what the object in the picture is and, knowing its name, we can make a request to the entire video. We experimented with the first validation video (Fig. 1). This video contains the “black and white cat.”

Fig.1. First frame of the “cat-18” validation video.

The number of tokens needed for a video is calculated using the formula as follows:

tokens = (frames / 2) * (height / 28) * (width / 28)

The original video is available in 1280×720 resolution and 1542 frames. If you use the video as a whole without changes, to analyze it, you will need:

tokens = 46 * 26 * 771 = 922116 tokens

This is significantly higher than the 24,000 limit. Therefore, it is necessary to either reduce the resolution several times or use fewer frames. If you do not change the resolution, it will be safe to use 30-40 frames. We tried using 30 frames.

We asked Qwen to describe each version of the video:

Query: ‘Describe this video’

Reply by Qwen-7B: The video features a black and white cat standing near the rear tire of a vehicle. The cat appears to be looking up, possibly at the camera or something above it. The setting seems to be an outdoor area with some debris on the ground, suggesting it might be a less maintained or industrial location. The tire is large and appears to belong to a truck or a similar heavy vehicle. The background includes parts of the vehicle’s body and some scattered objects on the ground, indicating that the area might be used for storage or maintenance purposes. The overall atmosphere of the video is casual and candid, capturing a moment in the life of the cat in its environment.

We gave the answer for version 7B. All four versions did well, although the answer from 3B contained hallucinations. That is, we learned that the neural network understands well what exactly is happening in the video. And it may be able to build a track for the object we need. Next, we asked to build a track for each frame.

Query: ‘Find black and white cat in every frame of the video and print it in the form ‘: [x1, y1, x2, y2], : [x1, y1, x2, y2], … for all 30 frames in json format.’

But such a request, unfortunately, does not work.

Answer Qwen-32B: json [{“bbox_2d”: [94, 0, 925, 672], “label”: “black and white cat”}]

Answer Qwen-72B: [
{“0”: [94, 287, 465, 727], “1”: [94, 287, 465, 727], “2”: [94, 287, 465, 727], “3”: [94, 287, 465, 727], “4”: [94, 287, 465, 727], “5”: [94, 287, 465, 727], “6”: [94, 287, 465, 727], “7”: [94, 287, 465, 727], “8”: [94, 287, 465, 727], “9”: [94, 287, 465, 727], “10”: [94, 287, 465, 727], “11”: [94, 287, 465, 727], “12”: [94, 287, 465, 727], “13”: [94, 287, 465, 727], “14”: [94, 287, 465, 727], “15”: [94, 287, 465, 727], “16”: [94, 287, 465, 727], “17”: [94, 287, 465, 727], “18”: [94, 287, 465, 727], “19”: [94, 287, 465, 727], “20”: [94, 287, 465, 727], “21”: [94, 287, 465, 727], “22”: [94, 287, 465, 727], “23”: [94, 287, 465, 727], “24”: [94, 287, 465, 727], “25”: [94, 287, 465, 727], “26”: [94, 287, 465, 727], “27”: [94, 287, 465, 727], “28”: [94, 287, 465, 727], “29”: [94, 287, 465, 727]
]

That is, the answer is only for one frame. We tried several different similar queries, but there were no correct answers for the track.

For the large version, the answer turned out to be more similar to the truth, but all the numbers are the same.

It is quite possible that there were simply no similar tasks in the training dataset.

We found out that the neural network can solve problems of this type:

Query: ‘Localize the location of the cat in the video, output the start and end timestamp for each event, and describe each cat location with bbox_2d. Provide the result in json format with ‘mm:ss.ff’ format for the time depiction.’

Answer Qwen-7B: json

[    {       "start_time": "00:00.00",       "end_time": "00:17.40",       "description": "A black and white cat is walking in front of a truck tire."    },    {      "start_time": "00:17.40",      "end_time": "00:35.80",      "description": "The cat stops and looks at the camera."    }]

Thus, it is probably possible to train Qwen 2.5 to solve the video tracking problem, but this requires either the initial Qwen model to be trained on similar problems, or one can try to train it by oneself, for example, on the TAO dataset [see Dave, A., Khurana, T., Tokmakov, P., Schmid, C., & Ramanan, D. (2020). Tao: A large-scale benchmark for tracking any object. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part V 16 (pp. 436–454). Springer International Publishing.], etc.

Experiment 2: Working with Individual Images

Since it was impossible to work with the video directly, the idea of searching for a given object in separate images was tested.

First, an attempt was made to use two images and a question.

Variant 1: Two full-size images are fed to the input. In the first one, the sought object was marked with a red rectangle.

"content": [    {        "type": "image",        "image": image_reference_path,    },    {        "type": "image",        "image": image_search_path,    },    {        "type": "text",         "text": "Target object is located inside the red rectangle on [Image 1]. Can you find this target object on [Image 2]? Report the bbox coordinates of the target object on [Image 2] in JSON format."    },],

Variant 2: Only the cut image of the desired object and the current frame from the video are fed to the input.

"content": [    {        "type": "image",        "image": image_reference_path,    },    {        "type": "image",        "image": image_search_path,    },    {"type": "text", "text": "Find object from [Image 1] on [Image 2] near bbox with coordinates {}. Report coordinates of object in JSON format.".format(previous_cooridnates[0])},],

Both variants quite often fail, and Qwen (for some reason) returns nothing.

Variant 3: Therefore, it was decided to split the query into two. Only for the very first frame, it was decided to find out the short name of the object and then search for this object on each frame of the video. We used the following queries for the tests:

LLM_TASK_V01 = "Describe an object located in a red rectangle in 2-3 words."LLM_TASK_V02 = "Describe an object located in a red rectangle in 2-3 words. Make attention to color, shape and other characteristics which make this object unique for this picture. Don't use verbs in description. Don't mention the red rectangle."

Then, on all the subsequent frames, we searched for the objects according to the text description:

search_text = f"Find object '{object_name}' near bbox with coordinates {previous_cooridnates[0]}. Report coordinates of object in JSON format."

For cases where there are many objects, we immediately asked Qwen to return the one that is closest to the object in the last processed frame.

The last 3rd variant works stably.

Since the conditions of the task require that the object mask be returned, traditionally the Segment Anything Model (SAM) of the first or second version is used for this purpose. But it would be good to get rid of launching the second model and ask Qwen to return the polygon right away. Unfortunately, this is not possible either.

It seems that the training set did not contain requests for searching polygons. In this case, theoretically, it is possible to further train Qwen to search for polygons by selecting the appropriate image datasets for the instance segmentation task.

Example query to find a polygon: “text”: “I gave you 2 images. In the first image, the object is marked in red rectangle. Can you find this object in the second image? Please print the contour of the object in the form of a polygon [x1, y1, x2, y2, …, xN, yN] as a python list. If there is no such object on the 2nd image, then the output is [-1, -1].”

In the end, it was impossible not to use SAM 2.

Experimental Results

The experiments were mainly carried out on the Qwen version 7B model with a good balance of quality/speed of work. The results on the validation videos are given below.

For test videos on LB, we got the metric Quality = 0.37. Quite a large gap is explained by the nature of validation videos. They rarely contain identical objects. This method copes well with the videos where the desired object is one and different from the others. For videos with a large number of identical objects, the method does not work the best and, apparently, requires additional improvements.

Conclusion

In general, the proposed method proved itself successful; especially considering that the solution was obtained in a very limited time. Multimodal LLMs proved their effectiveness and versatility, so they can be used to quickly create various solutions with good quality.

For practical use of our tracker, the original model can be modified by the additional training as follows:

1) to immediately predict a track for each frame for a given input video;
2) to predict not a box, but a polygon for the desired object to get rid of the SAM model;
3) to search for an object by the reference specified in the second image (not by the text description);
4) to search more accurately for the object closest to the specified one.

Perhaps, it makes sense to add tracking methods that use predictions for all the frames processed (not just for the last frame before the specified one as is done in our current version).

The main conclusion from our experience is that participating in Computer Vision competitions is fun (we knew that in advance), and even if everything doesn’t go as expected, some multimodal models will come to the rescue, thanks to which one can get a good solution (a new result) in a short period of time.

Aleksandr Romanov is the professor and head of CAD Laboratory of HSE University, Moscow, Russia.

Roman Solovyev is a Chief Researcher in IPPM RAS, Moscow, Russia.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

多模态大模型 计算机视觉 目标跟踪 Qwen2.5-VL AI应用
相关文章