【Person Re-ID】Beyond Part Models: Person Retrieval with Refined Part Pooling

转载地址:https://zhuanlan.zhihu.com/p/31947809

论文链接:Beyond Part Models: Person Retrieval with Refined Part Pooling

当前利用 part-level feature 做re-id 的方法大致分为两类:

1. 利用在其他数据集上训练好的 pose estimation 模型 unsupervised transfer 到 re-id 数据集上得到 local part 的定位,然后基于local parts 提取 part-level features。

2.不使用额外的类似于 pose estimation 的模型,而是用统一的分块方式,(比如给定一张行人图像,将图像均匀分割为固定的p个horizontal stripes)或者采用 attention 机制去locate 等。

使用第一种方法虽然可以显式的定位 local parts,但是也要忍受 transfer 过程由于 datasets bias 引入的误差。当然如果定位带来的提升大于引入误差导致的性能降低,整体也是可以接受的。这篇文章第一部分PCB模型属于第二类方法,使用得是均匀划分。对不同part用不同loss去训练。对于均匀分割或者其它统一的分割,不同图像在同一part可能因为没有对齐出现不同的语意信息。对此,作者提出了Refined Part Pooling 对统一分割进行提纯,增强 within-part 的一致性,这也是本文的一大亮点。

Method

  • PCB结构:

这里写图片描述

  1. 去掉Resnet50 global average pooling及以后的部分。
  2. 将最后一层feature map 分成 p个horizontal stripes。分别对p个horizontal stripes做global average pooling就得到了p个局部特征。
  3. 因为 Resnet50 最后一层feature map的通道数为2048,作者又用1x1 conv将其降到256维。
  4. 接着用p个n(训练集ID数目)分类softmax作为分类器进行训练。损失函数使用交叉熵损失。
  5. 测试时分别串联向量g和h作为行人图像的特征表示。
  • PCB细节:
  1. 为了丰富特征粒度,参考 SSD 和 R-FCN,作者去掉了 Resnet50 最后一次 down-sampling。
  2. 图像 resize 到 384x128。
  3. horizontal stripes 的个数 p 取6。
  4. 对比了使用单损失和多损失的性能。使用单损失函数时,对 p 个 h 求平均作为图像的特征表示。
  5. 对比了 p 个 softmax 前一层 FC 共享参数的性能。
  • RPP motivition: 作者将 average pooling 前后的向量做最近邻( f_{mn}g_i ),注意到真实的边界并不和统一划分的边界重合,很显然这也是统一划分最大的弊端之一。

  • RPP结构
  1. 作者在最后一层 feature map 后面训练了一个 part classifier。part classifier 使用的是线性层 + softmax,参数记为 W。
  2. 接着将 average pooling 改为向量的加权和,权值即分类器的后验概率。

  • RPP的训练:RPP 只有一项参数 W,训练分三步:
  1. 训练 PCB 至收敛。(这一步引导训练的重要性以及 step3 内在的思想见作者评论补充)
  2. 将 average pooling 替换为 part classifier。
  3. 固定其它参数训练 W 至收敛。
  4. 放开全部参数,fine tune。

Experiments

  • Datasets:Market-1501,DuckMTMC-reID,CUHK03 (new protocol)
  • setting:single-query,without re-ranking

这里写图片描述

  • 结论:
  1. 相比 IDE,PCB 的 mAP 提升8.9-15.3%
  2. RPP 对 PCB 的 rank-1 提升 1.5-3.1%,mAP 提升 3.1-4.2%
  3. 多损失比单损失提升明显,mAP 提升约 10-15%
  4. p 个分类器不共享参数相比共享参数提升 mAP 2.4-7.4%
  • 关于图像分辨率以及去掉 Resnet50 最后一次 down-sample 的实验

  • 对 horizontal stripes 数目 p 的讨论

  • PCB 引导训练的重要性讨论以及与另一篇基于 attention 机制方法的对比

INFO | open_webui.retrieval.models.external:predict:37 - ExternalReranker:predict:query 深圳河水质监测技术改进 - {} 2025-07-24 16:45:44 2025-07-24 16:45:44.142 | ERROR | open_webui.retrieval.models.external:predict:59 - Error in external reranking: 405 Client Error: Method Not Allowed for url: http://host.docker.internal:11434/ - {} 2025-07-24 16:45:44 Traceback (most recent call last): 2025-07-24 16:45:44 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap 2025-07-24 16:45:44 self._bootstrap_inner() 2025-07-24 16:45:44 │ └ <function Thread._bootstrap_inner at 0x786151af09a0> 2025-07-24 16:45:44 └ <Thread(ThreadPoolExecutor-10_1, started 132355104691904)> 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner 2025-07-24 16:45:44 self.run() 2025-07-24 16:45:44 │ └ <function Thread.run at 0x786151af0680> 2025-07-24 16:45:44 └ <Thread(ThreadPoolExecutor-10_1, started 132355104691904)> 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/threading.py", line 982, in run 2025-07-24 16:45:44 self._target(*self._args, **self._kwargs) 2025-07-24 16:45:44 │ │ │ │ │ └ {} 2025-07-24 16:45:44 │ │ │ │ └ <Thread(ThreadPoolExecutor-10_1, started 132355104691904)> 2025-07-24 16:45:44 │ │ │ └ (<weakref at 0x786082c8acf0; to 'ThreadPoolExecutor' at 0x786083728310>, <_queue.SimpleQueue object at 0x786082e0bf10>, None,... 2025-07-24 16:45:44 │ │ └ <Thread(ThreadPoolExecutor-10_1, started 132355104691904)> 2025-07-24 16:45:44 │ └ <function _worker at 0x786150bb2b60> 2025-07-24 16:45:44 └ <Thread(ThreadPoolExecutor-10_1, started 132355104691904)> 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 83, in _worker 2025-07-24 16:45:44 work_item.run() 2025-07-24 16:45:44 │ └ <function _WorkItem.run at 0x786150bb2ca0> 2025-07-24 16:45:44 └ <concurrent.futures.thread._WorkItem object at 0x786087361990> 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run 2025-07-24 16:45:44 result = self.fn(*self.args, **self.kwargs) 2025-07-24 16:45:44 │ │ │ │ │ └ {} 2025-07-24 16:45:44 │ │ │ │ └ <concurrent.futures.thread._WorkItem object at 0x786087361990> 2025-07-24 16:45:44 │ │ │ └ ('b5dcbf6d-5774-402d-9fff-5ec4906807ea', '深圳河水质监测技术改进') 2025-07-24 16:45:44 │ │ └ <concurrent.futures.thread._WorkItem object at 0x786087361990> 2025-07-24 16:45:44 │ └ <function query_collection_with_hybrid_search.<locals>.process_query at 0x78608378b100> 2025-07-24 16:45:44 └ <concurrent.futures.thread._WorkItem object at 0x786087361990> 2025-07-24 16:45:44 2025-07-24 16:45:44 File "/app/backend/open_webui/retrieval/utils.py", line 354, in process_query 2025-07-24 16:45:44 result = query_doc_with_hybrid_search( 2025-07-24 16:45:44 └ <function query_doc_with_hybrid_search at 0x78608d3b8220> 2025-07-24 16:45:44 2025-07-24 16:45:44 File "/app/backend/open_webui/retrieval/utils.py", line 161, in query_doc_with_hybrid_search 2025-07-24 16:45:44 result = compression_retriever.invoke(query) 2025-07-24 16:45:44 │ │ └ '深圳河水质监测技术改进' 2025-07-24 16:45:44 │ └ <function BaseRetriever.invoke at 0x78608d4d8a40> 2025-07-24 16:45:44 └ ContextualCompressionRetriever(base_compressor=RerankCompressor(embedding_function=<function chat_completion_files_handler.<l... 2025-07-24 16:45:44 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/site-packages/langchain_core/retrievers.py", line 259, in invoke 2025-07-24 16:45:44 result = self._get_relevant_documents( 2025-07-24 16:45:44 │ └ <function ContextualCompressionRetriever._get_relevant_documents at 0x78608d4d87c0> 2025-07-24 16:45:44 └ ContextualCompressionRetriever(base_compressor=RerankCompressor(embedding_function=<function chat_completion_files_handler.<l... 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/site-packages/langchain/retrievers/contextual_compression.py", line 48, in _get_relevant_documents 2025-07-24 16:45:44 compressed_docs = self.base_compressor.compress_documents( 2025-07-24 16:45:44 │ │ └ <function RerankCompressor.compress_documents at 0x78608d3ba520> 2025-07-24 16:45:44 │ └ RerankCompressor(embedding_function=<function chat_completion_files_handler.<locals>.<lambda>.<locals>.<lambda> at 0x78608378... 2025-07-24 16:45:44 └ ContextualCompressionRetriever(base_compressor=RerankCompressor(embedding_function=<function chat_completion_files_handler.<l... 2025-07-24 16:45:44 2025-07-24 16:45:44 File "/app/backend/open_webui/retrieval/utils.py", line 877, in compress_documents 2025-07-24 16:45:44 scores = self.reranking_function.predict( 2025-07-24 16:45:44 │ │ └ <function ExternalReranker.predict at 0x7860893142c0> 2025-07-24 16:45:44 │ └ <open_webui.retrieval.models.external.ExternalReranker object at 0x786082e78fd0> 2025-07-24 16:45:44 └ RerankCompressor(embedding_function=<function chat_completion_files_handler.<locals>.<lambda>.<locals>.<lambda> at 0x78608378... 2025-07-24 16:45:44 2025-07-24 16:45:44 > File "/app/backend/open_webui/retrieval/models/external.py", line 48, in predict 2025-07-24 16:45:44 r.raise_for_status() 2025-07-24 16:45:44 │ └ <function Response.raise_for_status at 0x78614e2a6ca0> 2025-07-24 16:45:44 └ <Response [405]> 2025-07-24 16:45:44 2025-07-24 16:45:44 File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1026, in raise_for_status 2025-07-24 16:45:44 raise HTTPError(http_error_msg, response=self) 2025-07-24 16:45:44 │ │ └ <Response [405]> 2025-07-24 16:45:44 │ └ '405 Client Error: Method Not Allowed for url: http://host.docker.internal:11434/' 2025-07-24 16:45:44 └ <class 'requests.exceptions.HTTPError'> 2025-07-24 16:45:44 2025-07-24 16:45:44 requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: http://host.docker.internal:11434/ 2025-07-24 16:45:44 2025-07-24 16:45:44.145 | ERROR | open_webui.retrieval.utils:query_doc_with_hybrid_search:187 - Error querying doc b5dcbf6d-5774-402d-9fff-5ec4906807ea with hybrid search: 'NoneType' object has no attribute 'tolist' - {}
最新发布
07-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值