A large scene image visual positioning method
Patent Information
- Application Number
- CN202611377587.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]然而,由于大场景的目标普遍占据极少的像素,上述方法虽实现了大场景图像的视觉定位任务,但仍难以兼顾实际部署中算法推理的精度和效率
[0031]1、本发明设计了包含移动、缩放、高精度确认和终止动作的智能体仿生动作空间,从而减少固定扫描和单次被动筛选造成的无效计算,进而在保障视觉定位准确性的同时提升大场景图像视觉定位效率;
Smart Images

Figure CN123015687A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and visual positioning, and in particular to a method for visual positioning of large-scene images. Background Technology
[0002] Visual localization aims to determine the location of corresponding targets in images based on natural language descriptions, and has significant applications in municipal scenarios such as security and transportation. With the adoption of multi-camera stitching or ultra-high-resolution imaging in systems such as wide-area surveillance, transportation hubs, campus security, and emergency search and rescue, single-frame images can reach hundreds of millions or even billions of pixels. In these images, specific targets typically occupy only a very small proportion of the entire image, with a target area ratio of less than 0.1%, and hundreds to thousands of similar-looking targets often coexist in the same scene. Therefore, exploring visual localization methods for large-scene images using large-scene image data is of significant research importance.
[0003] Currently, significant progress has been made in large-scene visual localization technology. The SAHI (Slice-Assisted Hyper-Inference) scheme proposed by Akyon et al. achieves high-precision localization of small targets in large scenes through exhaustive search. Ma et al. proposed a two-step visual localization method that first locates the region and then locks the local target, significantly improving search efficiency. Goto et al. further extended the two-step search to a multi-step process, gradually locating the target position through cascaded region detection.
[0004] However, since targets in large scenes generally occupy very few pixels, although the above methods have achieved the visual localization task of large scene images, they still cannot balance the accuracy and efficiency of algorithm inference in actual deployment. Summary of the Invention
[0005] Compared to conventional images, large-scene images typically have ultra-high resolution, making it difficult for existing visual localization methods to balance localization efficiency and accuracy, thus limiting their effective application in large-scale monitoring environments such as urban traffic and security. To address this, this invention proposes a visual localization method for large-scene images. This method designs a biomimetic action space for an intelligent agent, including movement, zooming, high-precision confirmation, and termination. It utilizes a local visual branch network, a global visual branch network, and a historical memory branch network to jointly perceive the current state. The next search action is predicted through multimodal fusion and action evaluation output modules. A two-stage training strategy is employed based on a dense reward function to train the model, significantly improving inference efficiency while maintaining high localization accuracy. Details are described below.
[0006] A method for visual localization of large-scene images, the method comprising:
[0007] The agent selects actions from the action set according to the policy and outputs the probability distribution of each candidate action based on the current observation;
[0008] The local vision branch network is used as the local perceptual channel of the active search network, with the current local field of view as the input. At the image pyramid level Cropping the corresponding high-resolution image and outputting local visual features;
[0009] The global vision branch network is used as the global perception channel of the active search network. It takes a low-resolution thumbnail of the entire large scene image as input and outputs global visual features.
[0010] A spatial heatmap centered on the current local visual field center is generated based on local visual features. Based on the spatial heatmap, the spatial memory is recursively updated according to the time decay method. The historical memory encoder encodes the multi-layer spatial memory to obtain historical memory features.
[0011] The multimodal fusion module integrates complementary information from local visual features, global visual features, and historical memory features with the target appearance text into a single decision representation; it concatenates the transformed four types of features according to feature dimensions and then passes them through a multilayer perceptron. Obtain fusion features;
[0012] An action evaluation output module consisting of an action generation branch and a state evaluation branch is constructed. When the action generation branch outputs a preset action, the agent performs low-cost continuous search by moving or scaling the action, calls a high-precision visual positioning model by confirming the action with high precision, and outputs the positioning result after the termination condition is met.
[0013] The set of actions consists of four categories of behaviors;
[0014] The "move" action used to change the viewpoint at the current level. This includes up, down, left, and right; the "zoom" action used to change the viewing resolution. This includes zooming in and out; and the "high-precision confirmation" action used to invoke a high-precision visual positioning model. ; and the "termination" action used to end the search and output the results. ;
[0015] Actions can be represented as , ;
[0016] in, , , , .
[0017] The spatial memory is recursively updated according to a time decay method as follows:
[0018]
[0019] in, The time decay factor, For hierarchical indicator functions, This represents a spatial heatmap of the current local field of view. Indicates time step The updated version Spatial memory of an image pyramid hierarchy, This represents the spatial memory of the level corresponding to the previous time step.
[0020] When the action generation branch outputs a preset action, the agent performs corresponding processing, specifically including:
[0021] When the action generation branch outputs a movement or scaling action, the agent executes the movement or scaling action, updates the current local field of view and historical memory, and re-extracts local visual features and historical memory features in the next time step.
[0022] When the action generation branch outputs a high-precision confirmation action, the current local field of view remains unchanged, and the image block and target appearance text corresponding to the current local field of view are input into the high-precision visual positioning model, and the candidate target local field of view box in the current local field of view coordinate system is output.
[0023] When the action generation branch output terminates the action, the agent outputs a comparable matching confidence score based on whether the high-precision visual positioning model can be used.
[0024] The method further includes: employing behavior cloning learning-based cold start training, which includes: generating demonstration search trajectory data based on the target ground bounding box, the current local field of view, and the current image pyramid level in each training sample according to the following rules.
[0025] The method further includes: fine-tuning training using reinforcement learning based on a proximal policy optimization algorithm, including:
[0026] The design incorporates a dense reward system consisting of rewards for achieving the goal, rewards for challenging and disruptive lessons, rewards for exploring new areas, and action costs.
[0027]
[0028]
[0029] in, The reward for a successful match between a candidate bounding box obtained from the agent's field of vision and a real target; The course reward for an agent hitting a difficult distractor with a similar appearance in its field of vision is used to indicate that the agent has learned the basic appearance attributes of the target. This is an exploration reward for determining that the current local view belongs to a new area based on historical memory. The sum of the costs of an agent making an incorrect action, corresponding to the number of steps penalized. Repeat access penalty Penalties for crossing boundaries or invalid actions .
[0030] The beneficial effects of the technical solution provided by this invention are:
[0031] 1. This invention designs a bionic action space for an intelligent agent that includes movement, scaling, high-precision confirmation, and termination actions, thereby reducing the invalid calculations caused by fixed scanning and single passive screening, and thus improving the efficiency of visual positioning of large scene images while ensuring the accuracy of visual positioning.
[0032] 2. This invention designs a local visual branch network to extract local visual features of the current local field of view, a global visual branch network to extract global visual features of the entire large scene image, and a history memory branch network to extract history memory features. The above three types of features are fused with the target appearance text features through a multimodal fusion module. The action evaluation output module outputs the probability distribution of each candidate action and the current state score based on the fused features, thereby improving the search decision-making ability in complex large scenes.
[0033] 3. This invention designs a dense reward system that includes rewards for successful target acquisition, rewards for challenging interference courses, rewards for exploring new regions, and various action costs. This reward design provides continuous feedback for long-sequence searches, alleviates the training difficulties caused by using only terminal success / failure rewards, and effectively suppresses repeated visits, out-of-bounds searches, and invalid searches.
[0034] 4. This invention designs a two-stage agent training method that combines behavioral cloning learning cold start and reinforcement learning fine-tuning. This allows the model to first learn basic search behavior and then optimize long-term rewards through environmental interaction, thereby improving training stability and the effectiveness of localization strategies. Attached Figure Description
[0035] Figure 1 A flowchart of a large-scene image visual localization method;
[0036] Figure 2 A schematic diagram of the reasoning case localization results in a large-scene image visual localization task;
[0037] Figure 3 This is a schematic diagram of a specific reasoning process in a large-scene image visual localization task. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below.
[0039] The following examples illustrate the specific implementation of a large-scene image visual positioning method according to an embodiment of the present invention.
[0040] I. Design of the biomimetic motion space for intelligent agents
[0041] This invention first constructs an image pyramid from the original large-scene image, consisting of multiple resolution levels, and establishes a unified coordinate mapping relationship between each level. Since the agent cannot read the entire image at the original resolution in a single computation, the target search process is modeled as a partially observable sequential decision-making process. The agent at time step... The obtained observation representation From the current local view At the level Image cropping based on deadline step Historical visit trajectory Constructed spatial memory and target appearance text that does not contain spatial priors Together they form a whole.
[0042] The observations are represented as follows:
[0043]
[0044] in, This indicates an image cropping operation performed based on the current local field of view and the image pyramid hierarchy. Indicates the historical visit trajectory The process involves memory encoding, where I represents the large-scale scene image to be visually localized. The agent then performs the encoding according to the policy. The selection of actions aims to maximize the expected cumulative reward within a finite search time domain. These are the parameters of a trainable agent model. for The action to be executed at any given moment. The agent model outputs the probability distribution of each candidate action based on the current observation. During the training phase, actions are sampled based on this probability distribution, and during the inference phase, the candidate action with the highest probability is selected as the actual action to be executed.
[0045] The action set includes four types of behaviors: "movement" actions used to change the view position at the current level. This includes up, down, left, and right; the "zoom" action used to change the viewing resolution. This includes zooming in and out; and the "high-precision confirmation" action used to invoke a high-precision visual positioning model. ; and the "termination" action used to end the search and output the results. The action space can be represented as , .in, , , , Movement and zoom actions handle low-cost searching and view adjustments. This indicates an upward translation (in the direction of decreasing y-coordinate). This indicates a downward translation (in the upward direction of the y-coordinate); This indicates a translation to the left (in the direction of decreasing x-coordinate); This indicates a rightward translation (in the upward direction of the x-coordinate); Indicates a zoom-in operation; This indicates a zoom-out operation. This corresponds to calling a high-precision visual positioning model to perform costly and detailed verification. The action corresponds to ending the search and outputting the results, thereby decoupling navigation decisions from precise positioning.
[0046] For movement, the field of vision is proportional to its own size. A translation is represented as:
[0047]
[0048] in, This represents the direction vector corresponding to the selected movement action. This indicates the width and height of the current local field of view. This indicates multiplication by coordinate dimensions. Indicates time step The current local field of view, Indicates the next time step after the movement action is performed. The local field of view. Executing this formula allows the agent to shift its local field of view in the next time step in a specified direction (left, right, up, down) by a fixed proportion of the current local field of view width or height. The shifted field of view is limited to the effective image range of the current layer; zooming in or out switches adjacent layers while keeping the center of the field of view as unchanged as possible, and synchronously updates the field of view coverage. If the current local field of view may contain a target, the agent can perform a high-precision confirmation action to obtain candidate boxes and matching confidence scores. If the matching confidence score reaches the candidate output confidence score threshold, the corresponding candidate target box is stored in the candidate target set, and the agent can further execute a termination action; if the confidence score is insufficient, the agent continues to perform shifting or zooming actions. When an existing candidate box meets the output conditions or the maximum search steps are reached, the agent executes a termination action to end the search. The output conditions refer to the candidate box's matching confidence score reaching the candidate output confidence score threshold, or, in the case that the high-precision visual localization model does not output matching confidence scores, being determined as the only matching candidate through candidate re-judgment. For example: when the agent has not yet found a candidate that matches the target's appearance text in the current local field of view, it can choose to move left, right, up, or down, or narrow the field of view; when a candidate that matches the appearance but is small in size is found, the field of view can be zoomed in; when the target details match the target's appearance text description, a high-precision confirmation action is performed; when a reliable candidate that meets the output conditions is obtained, or when the agent has been running for a long time, a termination action is performed and the localization result is output. In this embodiment, the movement step size ratio... Set it to 0.25.
[0049] II. Constructing Local Visual Branch Networks
[0050] The local vision branch network serves as the local perceptual channel for the active search network, with the current local field of view as its input. At the image pyramid level The corresponding high-resolution image is then cropped. For each time step, the image is first cropped based on the view coordinates. A local region is obtained from the image, and then the local region is scaled and normalized to the input specifications of the local visual encoder to ensure that different levels and different coverage areas of the field of view can be processed by the same encoder.
[0051] set up The local visual features representing the above cropping and scale normalization operations are as follows:
[0052]
[0053] in, Represents a local visual encoder. This represents the local visual features of the current local field of view. The local visual encoder focuses on preserving fine-grained appearance information of the target, while also retaining information on occlusions and neighboring targets that may affect recognition within the current local region. The proposed local visual features are used to characterize whether there are candidates in the current local region that match the target's appearance text, whether the resolution of the candidate targets is sufficient, and whether the candidate details are adequate. In this embodiment of the invention, the local visual encoder uses MobileNetV3 (Mobile Lightweight Convolutional Neural Network Version 3).
[0054] The output of the local visual branch network is passed to the multimodal fusion module and recalculated at each time step as the field of view changes, so that the active search strategy can respond to the current local image content in a timely manner.
[0055] III. Constructing a Global Visual Branch Network
[0056] The global vision branch network serves as the global perception channel for the active search network, taking a low-resolution thumbnail of the entire large scene image as input. The thumbnail preserves the overall field of view and aspect ratio of the original image, enabling the encoding result to reflect the macroscopic layout of the scene, but does not require direct resolution of the fine details of small objects in this branch.
[0057] The global visual features are:
[0058]
[0059] in, This means scaling the entire large scene image to the input size of the global visual encoder. Represents the global visual encoder. This represents global visual features. Global visual features are used to provide scene priors for local search. If the current local view falls on a large area of sky, ground, or open background, the global visual features, after being fused with other branch features, can provide decision information for the agent to leave irrelevant areas. When there are multiple candidate regions in the image, the global visual features, current local visual features, and historical memory features together provide information for subsequent action selection. In this embodiment of the invention, the global visual encoder uses MobileNetV3.
[0060] By encoding stable global scene information separately from local field of view information that changes over time, this embodiment of the invention avoids the loss of detail caused by directly locating the entire large scene image after forced compression, while preserving the necessary global sense of direction for gradual searching.
[0061] IV. Constructing a Branch Network of Historical Memory
[0062] Historical memory branch networks are used to explicitly record the regions the agent has observed, the image pyramid hierarchy at which the observation occurred, and the timeliness of access, avoiding decisions made without historical basis based solely on the current local image. It is assumed that the image pyramid has a total of... Each level, in time step Maintaining multi-layered spatial memory Each layer of the memory map corresponds to a level of an image pyramid.
[0063] After obtaining the current local field of view, its center position and coverage area are mapped to the memory map of the corresponding level, generating a spatial heatmap centered on the center of the current local field of view. The radius of effect of the spatial heatmap is proportional to the receptive field of the current level of view in the original map, ensuring a consistent representation of the access range across different scaling levels. The spatial memory is recursively updated according to a time decay mechanism.
[0064]
[0065] in, This is the time decay factor. For hierarchical indicator functions, when It is 1 if it is true, otherwise it is 0. This represents a spatial heatmap of the current local field of view. Indicates time step The updated version Spatial memory of an image pyramid hierarchy, This represents the spatial memory of the level corresponding to the previous time step. The level indicator function ensures that only the current image pyramid level is updated each time, and time decay gradually weakens the earlier access records, thus simultaneously indicating "whether it has been visited" and "when it was last visited".
[0066] Historical Memory Encoder Encoding multi-layered spatial memory yields historical memory characteristics:
[0067]
[0068] in, This represents the total number of levels in the image pyramid. For image pyramid level indexing, and .
[0069] Historical memory features are passed to the multimodal fusion module to distinguish between unexplored areas, recently visited areas, and areas observed at other resolution levels. Combined with the reward for exploring new areas and the cost of repeated visits in subsequent rewards, the historical memory branch can reduce round-trip movement, local loops, and repeated calls to the high-precision visual localization model for the same area. In this embodiment of the invention, the historical memory encoder uses MobileNetV3.
[0070] V. Constructing a multimodal fusion module
[0071] The multimodal fusion module is used to unify the complementary information from the three visual branches with the target appearance text into a single decision representation. First, a text encoder is used... For target appearance text The target appearance text is encoded to describe only the visible appearance attributes of the target, excluding absolute coordinates, relative orientation, or landmark relationships. The target appearance text features are:
[0072]
[0073] Since the target appearance text remains unchanged within the same search round, the target appearance text features are calculated once at the beginning of the search round and reused at each time step of that search round.
[0074] Subsequently, local visual features were analyzed separately. Global visual features Characteristics of historical memory and target appearance text features Dimensional transformation is performed to unify different feature dimensions. In this embodiment of the invention, the text encoder adopts Long-CLIP (Long Text Contrastive Language-Image Pre-trained Model), which supports long text input.
[0075] The four transformed features are concatenated according to their feature dimensions and then processed using a multilayer perceptron. Obtain fusion features :
[0076]
[0077] In this system, the multilayer perceptron learns the combination relationships between four types of information through linear mapping, nonlinear activation, and feature normalization. (Feature fusion) Integrating local visual information, global scene information, historical access status, and target appearance text information, the intelligent agent can leverage these fused features. Determine whether there is a possibility of finding the target in the current local field of view, whether it is necessary to call a high-precision visual positioning model for further confirmation, and whether the current area has been sufficiently searched.
[0078] Fusion results As the common input to the action generation branch and state evaluation branch in the subsequent action evaluation output module, action generation and state value estimation are based on the same comprehensive observation.
[0079] VI. Constructing the Action Evaluation Output Module
[0080] The action evaluation output module includes: action generation branch and state evaluation branch.
[0081] The action generation branch will fuse features. The probability distribution of the eight candidate actions is mapped to represent the probability of performing each action under the current observation.
[0082]
[0083] in, This represents the output of the action generation branch. This represents the trainable parameter matrix for the action generation branch. During the reinforcement learning training phase, random sampling is performed based on the action probability distribution to explore different actions, while the action with the highest probability is selected during the inference phase. The parameters are set as trainable parameters during model initialization and are obtained through backpropagation iterative updates during the two-stage agent training process. The specific iterative update steps are well known to those skilled in the art, and will not be described in detail in this embodiment of the invention.
[0084] The state evaluation branch maps the same fused feature to a scalar value of the current observed state, which is used to estimate the expected cumulative reward that the agent can obtain by continuing the search, specifically expressed as follows:
[0085]
[0086] in, The score represents the current state score and is the output of the state evaluation branch. This represents the trainable parameter matrix for the state evaluation branch. Current state score. This represents an estimate of the expected cumulative reward that the agent can obtain by continuing to search. It can be used as a benchmark to evaluate whether the selected action is better or worse than the original expectation. The training program uses this value to determine the direction and magnitude of parameter updates for the action generation branch, thereby reducing the variance of the training gradient of the action generation branch. The parameters are set as trainable parameters during model initialization and are obtained through backpropagation iterative updates during the two-stage agent training process. The specific calculation is well known to those skilled in the art, and will not be elaborated upon in this embodiment of the invention.
[0087] For example, suppose the agent's current state score in the current local field of view is 8, meaning that continuing the search from the current moment is expected to yield an additional 8 points of cumulative reward. If the agent performs the "move right" action, and the estimated cumulative reward based on subsequent search results is 8.9, the difference is 0.9, indicating that the action's result is better than expected, and the output probability of the "move right" action is increased accordingly during training. Conversely, if the estimated cumulative reward is 7.2, the difference is -0.8, indicating that the action's result is worse than expected, and the output probability of the action is decreased accordingly during training. This difference represents how much better or worse the actual result of the action is compared to the original expectation, and serves as the basis for adjusting the corresponding action probability during training. By using relative differences instead of only relying on the absolute value of the reward to update parameters, the fluctuation of parameter updates in the action generation branch during training can be reduced, thereby reducing the variance of its training gradient. The state evaluation branch does not send action or control commands to the action generation branch.
[0088] The action evaluation output module only outputs the probability distribution and current state score of each candidate action. The agent selects and executes actions based on the action probability distribution. The high-precision visual localization model is only invoked when the agent selects a high-precision confirmation action. The high-precision confirmation action is one of eight agent-inspired actions in the proposed agent-inspired action space. It refers to maintaining the current local field of view and inputting the image patch and target appearance text corresponding to the current local field of view into the high-precision visual localization model to perform a detailed verification of whether there are candidate targets matching the target appearance text within the current local field of view. Each search round cycles through feature extraction, action probability output, action selection and execution, and updating the current local field of view and historical memory until the agent selects a termination action.
[0089] When the action generation branch outputs a move or zoom action, the agent executes the corresponding action, updates the current local field of view and historical memory, and re-extracts local visual features and historical memory features in the next time step. For example, when the action generation branch outputs a move to the right action, the agent moves the current local field of view to the right; when the action generation branch outputs a zoom action, the agent switches to the adjacent high-resolution image pyramid level while keeping the center position of the field of view unchanged.
[0090] When the action generation branch outputs a high-precision confirmation action, it keeps the current local view unchanged and sets the image patch and target appearance text corresponding to the current local view unchanged. Input a high-precision visual localization model, which locates the target within the current local view based on the target's appearance text, and outputs the candidate target local view bounding box in the current local view coordinate system. If the high-precision visual positioning model used supports outputting comparable matching confidence scores, it also outputs the corresponding matching confidence scores. Then, the candidate target local view bounding box is determined based on the offset and scaling relationship of the current local view in the original image. The target is mapped to the coordinate system of the original large-scene image and written into the candidate target set. For example, assuming the target appearance text is "a person wearing a white shirt and carrying a red backpack," when the action generation branch outputs a high-precision confirmation action, the target appearance text and the current local view are input into the high-precision visual positioning model. If the high-precision visual positioning model outputs a candidate target local view box that matches the description "a person wearing a white shirt and carrying a red backpack" in the current local view, then based on the position and scaling ratio of the current local view in the original large-scene image, the candidate target local view box is mapped to the coordinate system of the original large-scene image and written into the candidate target set.
[0091] When the action generation branch output terminates the action, the agent no longer updates the current local field of view. Instead, it determines the final localization result by using one of the following two mutually exclusive methods, depending on whether the high-precision visual localization model outputs a comparable matching confidence score.
[0092] The first approach is to select the candidate bounding box with the highest confidence level that meets the candidate output confidence threshold as the final localization result if the high-precision visual localization model can output comparable matching confidence scores for each candidate target. However, if the confidence scores of all candidate targets are lower than the candidate output confidence threshold, a "not localized" flag is output.
[0093] The second approach is to analyze the candidate target set. If the high-precision visual positioning model does not support outputting comparable matching confidence scores, it cannot be directly sorted by confidence score values. Instead, it needs to perform a unified re-evaluation of the candidate target set, and the high-precision visual positioning model selects the single best-matching candidate from it. If the high-precision visual positioning model considers all candidates to be unmatched, it outputs a "not located" flag.
[0094] For example, in the first approach, the candidate target set includes candidate target A, candidate target B, and candidate target C. The matching confidence scores output by the high-precision visual positioning model are 0.86, 0.72, and 0.41, respectively. In this case, candidate target A with the highest matching confidence score is taken as the final positioning result. If the three confidence scores are 0.22, 0.43, and 0.11, respectively, all of which are lower than the preset candidate output confidence score threshold of 0.5, then a "not located" flag is output.
[0095] For example, in the second approach, all candidate bounding boxes generated at different time steps are first aggregated and deduplicated by overlapping within the original large-scene image coordinate system. Then, candidate images containing appropriate context are cropped around each candidate bounding box and assigned alphanumeric identifiers. These candidate images, along with the target appearance text, are input into a high-precision visual localization model for comparison. The single best-matching candidate is selected as the final localization result; if no matching candidate is found, a "not located" flag is output. When the number of candidates exceeds the single input capacity of the high-precision visual localization model, batch re-judgment is performed, followed by a second re-judgment of the winning candidates from each batch. For example, the agent obtains candidate target A, candidate target B, and candidate target C at time steps 2, 5, and 8, respectively. When the action generation branch outputs the termination action, the aforementioned candidate targets are deduplicated by overlapping within the original large-scene image coordinate system, and the deduplicated candidate images, along with the target appearance text, are input into the high-precision visual localization model for overall comparison. If the model determines that candidate target B best matches the target appearance text, candidate target B is used as the final localization result; if the model determines that all candidate targets do not match, a "not located" flag is output. Furthermore, if the candidate target set contains too many targets (e.g., 15), exceeding the single input capacity of the high-precision visual positioning model (11), the 15 candidate targets are first divided into two batches for re-judgment, and the candidate target that best matches the target's appearance text in each batch is obtained. For example, the first 11 targets are input into the high-precision visual positioning model, then the 12th to 15th targets are input into the high-precision visual positioning model, and then the two best matches (e.g., the 3rd and 14th targets) are input into the high-precision visual positioning model again for re-judgment, finally outputting the most reliable candidate.
[0096] In this embodiment, the model input capacity is set to 11. The high-precision visual positioning model can be selected from the Qwen-VL series or the InternVL series, including Qwen3-VL-32B, Qwen3-VL-8B, Qwen3-VL-4B, Qwen3-VL-2B, InternVL-3.5-14B, InternVL-3.5-8B, InternVL-3.5-4B, or InternVL-3.5-2B. This embodiment of the invention does not impose any limitations on this.
[0097] Thus, the agent performs low-cost continuous search through movement or scaling actions, invokes a high-precision visual positioning model through high-precision confirmation actions when needed, and outputs the positioning result after the termination condition is met.
[0098] VII. Two-stage agent training
[0099] This invention is based on training on a training dataset. Each sample in the training dataset includes the original large-scene image, target appearance text, and target ground truth bounding box. The current local view and the current image pyramid level are not fixed labels in the samples, but are process data dynamically generated by the search environment based on the agent's actions during training.
[0100] Because large-scale scene search involves long rounds and numerous action options, if the initial strategy is approximately random, the agent will struggle to find the true target and obtain a success reward in the early stages of training. Therefore, a two-stage agent training method is designed.
[0101] The first training phase uses the target's real bounding box to generate a demonstration search trajectory, enabling the agent to master basic movement, scaling, high-precision confirmation, and termination actions. In this embodiment, the first training phase employs behavior cloning learning-based cold start training.
[0102] The second training phase continues by having the agent perform actions in the search environment to learn, further enhancing the accuracy of the agent's actions. In this embodiment, the second training phase employs reinforcement learning fine-tuning training based on a proximal policy optimization algorithm.
[0103] For the first training phase, demonstration search trajectory data is generated based on the target's true bounding box, the current local view, and the current image pyramid level in each training sample, according to the following rules: Specifically, when the target has not entered the current local view, a movement action or a zoom-out action is selected that brings the current local view closer to the target; when the target has entered the current local view, but the ratio of the target's true bounding box area to the current local view area is lower than the preset high-precision confirmation area ratio, a zoom-in action is selected; when the above area ratio reaches the high-precision confirmation area ratio, a high-precision confirmation action is selected; when a candidate target box matching the target's true bounding box is obtained after executing the high-precision confirmation action, a termination action is selected.
[0104] Next, the current observation at each time step in the demonstration search trajectory is used as the training input, and the demonstration actions generated by the above rules are used as supervision labels. The supervision loss between the eight action probabilities output by the action generation branch and the demonstration action labels is calculated, and the agent network parameters are updated through backpropagation to increase the output probability corresponding to the demonstration actions. Thus, the first stage obtains an initial policy capable of executing the basic search process.
[0105] In this embodiment of the invention, the learning rate for the first stage of training is set to... .train One interactive step, batch size set to .
[0106] In the second training phase, the agent is no longer provided with rule-generated demonstration action labels; instead, training continues using the agent network parameters obtained in the first phase. This phase employs Proximal Policy Optimization (PPO) to fine-tune the local visual branch network, global visual branch network, historical memory branch network, multimodal fusion module, action generation branch, and state evaluation branch end-to-end. The use of PPO for reinforcement learning training is well-known to those skilled in the art, and will not be elaborated upon in this embodiment. Furthermore, to alleviate the reward sparsity problem in large-scale environments, a dense reward system is designed, consisting of a goal success reward, a difficult interference item course reward, a new area exploration reward, and action costs.
[0107]
[0108]
[0109] in, The reward for a successful match between a candidate bounding box obtained from the agent's field of vision and a real target; The course reward for an agent hitting a difficult interference item with a similar appearance in its field of vision indicates that the agent has learned the basic appearance attributes of the target. The difficult interference item refers to a candidate target in the same large scene image that has a similar appearance description to the real target, excluding the real target. Specifically, a Long-CLIP (Long Text Contrast Language-Image Pre-trained Model) text encoder is used to extract text features of the target appearance text and the appearance texts of other candidate targets, respectively. The cosine similarity between each candidate target and the real target is calculated, and the top candidates are selected from high to low similarity. Each candidate objective is considered a difficult interference term; when the number of candidate objectives is less than... When all candidate targets are considered as difficult interference terms, then all candidate targets are treated as difficult interference terms. This is an exploration reward for determining that the current local view belongs to a new area based on historical memory. The sum of the costs of an agent making an incorrect action, corresponding to the number of steps penalized. Repeat access penalty Penalties for crossing boundaries or invalid actions . This is a function indicating successful target localization. It returns 1 when the high-precision confirmation result matches the target's true bounding box, and 0 otherwise. This is a function indicating difficult interference items. It takes the value 1 if the intersection-union ratio (IU) between the high-precision confirmation result and the bounding box of any difficult interference item is greater than a preset IU hit ratio for difficult interference items; otherwise, it takes the value 0. To explore the indicator function, it is set to 1 if the current local view covers an unvisited area, and 0 otherwise. This is a step indicator function; it returns 1 for each search action performed and 0 otherwise. This is a repeat access indicator function; it takes the value 1 if the current local view repeatedly accesses the same region, and 0 otherwise. This is an invalid action indicator function. It takes the value 1 if the action causes an out-of-bounds movement, exceeds the image pyramid level range, or fails to produce a valid state change; otherwise, it takes the value 0. For example, if the current local view is already at the far left of the image, and the agent still performs the action of moving to the left, it will result in an invalid action. This triggers a penalty for invalid actions.
[0110] In the second stage of training in this embodiment, when the intersection-union ratio (IUU) between the candidate bounding box output by the high-precision visual positioning model and the ground truth bounding box of the target is greater than 0.5 after the high-precision confirmation action is performed, a target success reward of 2.0 is given. When a difficult distractor item that resembles the target in appearance is hit, only a 0.5 course reward is given. The inclusion of a reward for challenging interference items is designed to encourage the agent to pay close attention to areas resembling the target's appearance during the search process and to perform high-precision verification of these potentially valuable candidates. This allows the high-precision visual localization model to further filter and identify candidates. This reward is lower than the target success reward, encouraging the agent to observe and verify more similar candidates while maintaining accurate target localization as the primary optimization objective.
[0111] This embodiment determines whether the current local field of view covers an insufficiently explored area based on the historical memory map. If so, an exploration reward of 0.3 is given. Each step incurs a step cost of 0.01. A repetition cost of 0.3 is applied to repeated observations of recently visited areas. A penalty of 0.2 is applied to out-of-bounds movements, scaling beyond the specified level, or other invalid actions. Rewards and costs work together to guide agents to reduce redundant visits and ineffective actions, thereby improving search efficiency.
[0112] Training is conducted in rounds, with each round starting with a low-resolution, large field of view and continuing until execution terminates or the maximum search steps are reached. Behavioral cloning provides an initial policy, and proximal policy optimization, guided by dense rewards, continues to learn long-term action combinations, balancing localization success rate, search steps, pixel processing volume, and the number of calls to the high-precision visual localization model. In this embodiment, the maximum search steps during training are set to 512, and the number of calls to the high-precision visual localization model is set to 128.
[0113] VIII. Agent Deployment Reasoning
[0114] During the deployment and inference phase, the target's ground truth bounding box is no longer used, and the network parameters are no longer updated. The trained network weights with fixed parameters are loaded, and the original large-scene image and target appearance text are received. An image pyramid consisting of multiple resolution levels is constructed based on the original image. At the start of each inference round, the agent's field of view and historical memory are initialized, and global visual features and target appearance text features are extracted or cached. At each time step, local visual features are extracted based on the current local field of view, cached global visual features and target appearance text features are read, and historical memory features are extracted after updating the historical memory based on the current local field of view. These features are then input into the multimodal fusion module to form a comprehensive state representation. The action generation branch outputs the probability distribution of candidate actions, the state evaluation branch outputs the current state score, and the agent selects the candidate action with the highest probability as the next action.
[0115] When a move or zoom action is selected, the current local field of view and historical memory are updated before proceeding to the next time step. When a high-precision confirmation action is selected, the high-precision visual positioning model is invoked to obtain candidate targets and update the candidate target set. When a termination action is selected, or when the preset number of search steps, the maximum number of high-precision visual positioning model calls, or the inference latency budget is reached, the candidate target set is merged, filtered, and processed, and the target bounding boxes mapped to the original large-scene image coordinate system are output. If no reliable candidates exist or the re-judgment result is no matching candidate, a "not located" flag is output. In this embodiment, the maximum number of search steps for inference deployment is set to 512 or 256 steps, and the number of high-precision visual positioning model calls is set to 256.
[0116] Experimental results:
[0117] To verify the effectiveness of the proposed method, the embodiments of this invention visualized the large-scene image visual localization results of the proposed method. The experimental results are as follows: Figure 2 As shown in the figure. Experiments demonstrate that the proposed method achieves approximately four times the inference speed while maintaining accuracy comparable to the current highest-accuracy mainstream scheme (SAHI).
[0118] As shown in the figure, under the setting of a large-scene visual localization task, the proposed method can quickly locate the target in a very small number of steps. For example... Figure 2 The correct target was located in 4 and 9 steps respectively.
[0119] The specific reasoning process is as follows: Figure 3 The sample shown is an example. For instance... Figure 3As shown in (a), the target appearance text is "middle-aged woman, wearing a light pink or pinkish-red knee-length dress, with a lighter-colored area on the upper body, and wearing light-colored flat shoes." The agent receives the original large-scene image and the target appearance text, starts the search from a low-resolution, large-field-of-view perspective, and generates branch outputs based on actions, performing movement, zooming, high-precision confirmation, or termination actions at each time step. Figure 3 As shown in (b), at the 10th time step, the first high-precision verification action is performed, inputting the image patch of the current local view and the target appearance text into the high-precision visual localization model. The high-precision visual localization model outputs candidate target box A, which is mapped to the original large-scene image coordinate system and written into the candidate target set. Subsequently, the agent continues to move and zoom the local view. At the 19th time step, the second high-precision verification action is performed, obtaining candidate target box B and writing it into the candidate target set. When the high-precision verification action is performed at the 30th time step, no candidate box matching the target appearance text is obtained, so the candidate target set remains {A,B}, and the agent continues searching. At the 39th time step, the agent performs a termination action, stopping the update of the current local view. Figure 3 As shown in (c), after the agent executes the termination action, it crops option A and option B from the original large-scene image based on the coordinates of candidate target boxes A and B in the coordinate system of the original large-scene image. Option A, option B, and the target appearance text are then input into a high-precision visual localization model for unified re-evaluation. The model determines that option B best matches the target appearance text, therefore option B is selected, and the coordinates corresponding to option B are used as the final localization result of this search.
[0120] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A visual localization method for large-scene images, characterized in that, The method includes: The agent selects actions from the action set according to the policy and outputs the probability distribution of each candidate action based on the current observation; The local vision branch network is used as the local perceptual channel of the active search network, with the current local field of view as the input. At the image pyramid level Cropping the corresponding high-resolution image and outputting local visual features; The global vision branch network is used as the global perception channel of the active search network. It takes a low-resolution thumbnail of the entire large scene image as input and outputs global visual features. A spatial heatmap centered on the current local visual field center is generated based on local visual features. Based on the spatial heatmap, the spatial memory is recursively updated according to the time decay method. The historical memory encoder encodes the multi-layer spatial memory to obtain historical memory features. The multimodal fusion module integrates complementary information from local visual features, global visual features, and historical memory features with the target appearance text into a single decision representation; it concatenates the transformed four types of features according to feature dimensions and then passes them through a multilayer perceptron. Obtain fusion features; An action evaluation output module consisting of an action generation branch and a state evaluation branch is constructed. When the action generation branch outputs a preset action, the agent performs low-cost continuous search by moving or scaling the action, calls a high-precision visual positioning model by confirming the action with high precision, and outputs the positioning result after the termination condition is met.
2. The large-scene image visual positioning method according to claim 1, characterized in that, The set of actions consists of four categories of behaviors; The "move" action used to change the view position at the current level. This includes up, down, left, and right; the "zoom" action used to change the viewing resolution. This includes zooming in and out; and the "high-precision confirmation" action used to invoke a high-precision visual positioning model. ; and the "terminate" action used to end the search and output the results. ; Actions can be represented as , ; in, , , , .
3. The large-scene image visual positioning method according to claim 1, characterized in that, The spatial memory is recursively updated according to a time decay method as follows: in, The time decay factor, For hierarchical indicator functions, This represents a spatial heatmap of the current local field of view. Indicates time step The updated version Spatial memory of an image pyramid hierarchy, This represents the spatial memory of the level corresponding to the previous time step.
4. The large-scene image visual positioning method according to claim 1, characterized in that, When the action generation branch outputs a preset action, the agent performs corresponding processing, specifically including: When the action generation branch outputs a movement or scaling action, the agent executes the movement or scaling action, updates the current local field of view and historical memory, and re-extracts local visual features and historical memory features in the next time step. When the action generation branch outputs a high-precision confirmation action, the current local field of view remains unchanged, and the image block and target appearance text corresponding to the current local field of view are input into the high-precision visual positioning model, and the candidate target local field of view box in the current local field of view coordinate system is output. When the action generation branch output terminates the action, the agent outputs a comparable matching confidence score based on whether the high-precision visual positioning model can be used.
5. The large-scene image visual positioning method according to claim 1, characterized in that, The method further includes: employing behavior cloning learning-based cold start training, wherein the cold start training includes: generating demonstration search trajectory data based on the target ground bounding box, the current local field of view, and the current image pyramid hierarchy in each training sample.
6. The large-scene image visual positioning method according to claim 1, characterized in that, The method further includes: fine-tuning training using reinforcement learning based on a proximal policy optimization algorithm, including: The design incorporates a dense reward system consisting of rewards for achieving the goal, rewards for challenging and disruptive lessons, rewards for exploring new areas, and action costs. in, The reward for a successful match between a candidate bounding box obtained from the agent's field of vision and a real target; The course reward for an agent hitting a difficult distractor with a similar appearance in its field of vision is used to indicate that the agent has learned the basic appearance attributes of the target. This is an exploration reward for determining that the current local view belongs to a new area based on historical memory. The sum of the costs of an agent making an incorrect action, corresponding to the number of steps penalized. Repeat access penalty Penalties for crossing boundaries or invalid actions .
