An image target detection and recognition method based on size model hierarchical cooperation

By employing a hierarchical collaboration method based on size models, combining a visual language understanding model and a lightweight object detection model, and utilizing high, medium, and low confidence candidate boxes for region of interest pre-sensing prompts and cross-validation, the problems of interference, false alarms, and missed detections in image object detection and recognition by lightweight object detection models and visual language models are solved, thereby improving the completeness and reliability of detection results.

CN123160872APending Publication Date: 2026-11-24HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611673337.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-28
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing technologies, lightweight target detection models and visual language models suffer from problems such as interference, false alarms, and missed detections in image target detection and recognition, and are difficult to coordinate effectively, affecting the integrity and reliability of the detection results.

Method used

A hierarchical collaboration approach based on size models is adopted. By combining a first visual language understanding model and a lightweight object detection model, a set of visual understanding categories and a set of lightweight detection categories are generated. High, medium and low confidence candidate boxes are used to provide pre-perception prompts for regions of interest. Detection is performed category by category, and cross-validation is performed in combination with a second visual language detection model to output the final object box coordinates and category.

Benefits of technology

It improves the completeness and reliability of image target detection and recognition results, reduces false alarms and missed detections, and enhances the targeting and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160872A_ABST
    Figure CN123160872A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image target detection and multi-modal intelligent processing, and particularly relates to an image target detection and recognition method based on size model layered cooperation. A first visual language understanding model is used to obtain a visual understanding category set, a lightweight target detection model is used to generate candidate boxes, which are divided into three groups of high, medium and low confidence; based on the high and medium confidence candidate boxes, a lightweight detection category set is formed, and a union set is obtained with the visual understanding category set; a visual prompt image is generated using the high and medium confidence boxes, so that a second visual language detection model generates and summarizes a complete detection candidate box set by category; the high confidence box is used to initialize a to-be-output candidate set, and the medium confidence box category is updated according to the complete detection candidate box set, and the medium confidence box with relevant evidence is added to the to-be-output candidate set. The present application forms a cooperative relationship of category and spatial input guidance, complete detection result summarization and layered candidate updating.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image target detection and multimodal intelligent processing technology, and more specifically, relates to an image target detection and recognition method based on hierarchical collaboration of large and small models. Background Technology

[0002] Image target detection and recognition is used to determine the location and category of a target from an image to be detected. It is a fundamental visual perception technology in scenarios such as intelligent transportation and security inspection. Affected by factors such as imaging spectrum, target scale, degree of occlusion, background complexity and image quality, the target to be detected may exhibit low contrast, incomplete contour information, significant scale changes or unstable category discrimination features, thereby increasing the difficulty of target localization and category discrimination.

[0003] Lightweight object detection models have a relatively small parameter size, and their object localization and class prediction mainly rely on local texture, contour, and multi-scale visual features learned from training data. When the distribution of the image to be detected is similar to that of the training data, this type of model can obtain relatively stable detection results. However, when the appearance of the target or imaging conditions change, or when there are complex textures, local highlights, occlusions, and imaging noise in the background, the target features are easily disturbed, leading to false alarms and missed detections. In this case, the setting of the detection threshold directly affects the target recall and false alarm suppression: a higher threshold will filter out low-contrast, occluded, or small-scale real targets; a lower threshold will retain more low-confidence candidates, increasing false alarms and duplicate detections.

[0004] Visual language models, through pre-training on large-scale image and text data and joint modeling of global image information and text semantics, achieve strong target representation generalization and scene semantic understanding capabilities. Therefore, guided by text instructions and combined with scene context, they can determine the target category and location, providing supplementary information to the detection results of lightweight object detection models. However, if the model is required to detect multiple categories of targets simultaneously in a single inference, the semantic understanding and target localization tasks of different categories can easily interfere with each other, diverting the model's attention from each category and thus reducing the detection performance of each category. Furthermore, if only the candidate regions generated by the lightweight object detection model are individually reviewed by the visual language model, the detection range will be limited by the existing candidates, making it difficult to cover targets not recalled by the lightweight object detection model.

[0005] In existing collaborative detection schemes using both lightweight and large models, some first generate candidates using a lightweight object detection model, then call a visual language model for secondary discrimination; others have the two models perform detection separately, and then correlate and fuse the detection results based on spatial overlap, semantic consistency, or confidence information. However, lightweight object detection models and visual language models differ in output format, confidence information, and error characteristics. During collaboration, it is still necessary to determine whether the two types of detection results can corroborate each other, and to handle issues such as category conflicts, duplicate candidates, and whether to accept supplementary targets. Therefore, how to leverage the respective detection and recognition advantages of the two models to form a clearly hierarchical and mutually verifying detection and recognition process is a technical problem that needs to be solved. Summary of the Invention

[0006] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides an image target detection and recognition method based on hierarchical collaboration of large and small models. The aim is to leverage the complementary advantages of lightweight target detection models in target localization and visual language models in scene understanding and target representation generalization, thereby improving the completeness and reliability of image target detection and recognition results.

[0007] To achieve the above objectives, according to one aspect of the present invention, an image target detection and recognition method based on size model hierarchical cooperation is provided, comprising: The first visual language understanding model is used to analyze the image to be detected. Perform category recognition to obtain a set of visual understanding categories. Input the same image to be detected into a lightweight object detection model to obtain an initial lightweight model candidate box set with category and detection confidence; determine a high-confidence set from the initial lightweight model candidate box set according to the confidence level and its preset threshold. Medium confidence set and low confidence sets ;extract and The category names in the dataset are used to obtain a lightweight detection category set; the visual understanding category set is then used to... The candidate category set is obtained by taking the union of the lightweight detection category set and the candidate category set. calculate and The scale-normalized Gaussian response of any lightweight model candidate box in the image is used as the independent region response of that box. For each pixel location in the image to be detected, the maximum value of the independent region response of each lightweight model candidate box at that pixel location is taken as the region of interest pre-sensing cue representing the probability that the pixel location is located in the target region. The image to be detected is blurred and smoothed to obtain a smoothed image; the image to be detected and the smoothed image are then fused pixel-by-pixel with weighted fusion to obtain a visual cue image; wherein, at each pixel position, weighted fusion is performed using weighted fusion of ... As the weights of the image to be detected, with 1 and The difference is used as the smoothing image weight; the detection instruction corresponding to each candidate category in the candidate category set is combined with the visual cue image to form a text-image input pair, which is then input into the second visual language detection model to obtain the second visual language detection candidate box set of the corresponding candidate category, thereby obtaining the complete second visual language detection candidate box set corresponding to the candidate category set; Establish a candidate set to be output, Add to the set of candidates to be output; for For each medium-confidence lightweight model candidate box, calculate its intersection-union ratio (IU) with each candidate box in the complete second visual language detection candidate box set; form an association evidence set for the medium-confidence lightweight model candidate box by including all candidate boxes with an IU not lower than a preset medium-confidence association IU threshold; group the second visual language detection candidate boxes in the association evidence set according to category, determine the updated category of the medium-confidence lightweight model candidate box based on the number of candidate boxes in each category group, maintain the coordinates of the medium-confidence lightweight model candidate box, and add the updated medium-confidence lightweight model candidate box to the output candidate set; output the image target detection and recognition result including the target box coordinates and target category based on the output candidate set.

[0008] Furthermore, visual understanding category set The construction method is as follows: The image to be detected and the preset target category understanding instructions are input into the first visual language understanding model to generate a structured target category text answer. The structured target category text answer is then subjected to structural validity verification. If the text answer passes the validity verification, the category name is parsed from the text answer. The parsed category name is matched with the names in a unified category vocabulary, and the matched categories are retained while duplicates are removed to obtain the visual understanding category set. If the text answer fails the validity check or there is no matching category, the visual understanding category set will be used. Set to an empty set; wherein, the unified category vocabulary includes all original names of target categories used for training the lightweight target detection model.

[0009] Furthermore, the step of determining a high-confidence set from the initial lightweight model candidate box set according to the confidence level and its preset threshold is further described. Medium confidence set and low confidence sets The implementation methods include: Filter out candidates with confidence levels below the minimum detection threshold from the initial lightweight model candidate box set. The initial lightweight model candidate boxes are generated; the remaining candidate boxes are grouped according to the predicted category, and within each category group, the cross-union ratio (CUI) is performed in descending order of detection confidence, with a preset threshold. Non-maximum suppression is applied, and then the retained candidate boxes for each category group are aggregated. All retained and aggregated candidate boxes are then divided into three sets based on confidence level: high, medium, and low. The set with confidence level not lower than the high confidence threshold is further defined. Candidate boxes are assigned to the high-confidence set. The confidence level is not lower than the medium confidence threshold. Candidate boxes below the high confidence threshold are categorized into the medium confidence set. The remaining candidate boxes, after being filtered by the lowest detection threshold, are categorized into the low-confidence set. The three thresholds are satisfied: .

[0010] Furthermore, based on the center position, width, and height of each lightweight model candidate box in the high and medium confidence sets, the scale-normalized Gaussian response of that lightweight model candidate box is calculated, expressed as:

[0011] in, Indicates the image to be detected The A lightweight model candidate box at a certain pixel position The normalized Gaussian response at the point, Image to be detected The The center coordinates of the candidate boxes in the lightweight model , The images to be detected are respectively The Width and height of a lightweight model candidate box. This parameter represents the Gaussian standard deviation in scale-normalized coordinates of the candidate bounding box, used to control the Gaussian response as a function of a given pixel position. The rate at which the normalized distance from the center of the candidate box decays as it increases is used to control the spread range of the Gaussian response.

[0012] Furthermore, the step of forming a text-image input pair between the detection instruction corresponding to each candidate category in the candidate category set and the visual cue image, and inputting it into the second visual language detection model to obtain a set of second visual language detection candidate boxes for the corresponding candidate category, is implemented as follows: the shorter side of the visual cue image is lengthened on both sides to make the visual cue image a square image, and then scaled proportionally to the input size of the second visual language detection model; the detection instruction corresponding to each candidate category in the candidate category set and the lengthened and scaled visual cue image are formed into a text-image input pair, and input into the second visual language detection model to obtain a structured detection output that corresponds to the candidate category and contains target location information; the target location is parsed from the structured detection output, and the target location is associated with the corresponding candidate category to form a second visual language detection candidate box with category information, i.e., a set of second visual language detection candidate boxes for the corresponding candidate category.

[0013] Furthermore, the method for parsing the target position from the structured detection output is as follows: The structured detection output is a coordinate text answer, which includes a category field, a field separator following the category field, and a target record field. The target record field is either empty or includes one or more coordinate records separated by a predetermined separator. Each coordinate record includes the coordinates of the top-left corner and the bottom-right corner of the target bounding box encoded according to a predetermined coordinate scale. When decoding the coordinate text answer, the consistency of the category field, the field separator, and the category with the candidate category in the detection instruction is first verified. After the verification passes, if the target record field is empty, the decoding result corresponding to the current candidate category is set to an empty set. If the target record field is not empty, the coordinate record structure, number of fields, and integer type are verified. For the coordinate records that pass the verification, the input image coordinate inverse mapping based on the predetermined coordinate scale encoding, the model input scale inverse transformation, the offset elimination, and the positive area verification are performed to obtain the coordinates of the second visual language detection candidate box in the image to be detected, complete the target position parsing, and thus obtain the second visual language detection candidate box with category information.

[0014] Furthermore, the step of determining the updated category of the lightweight model candidate box based on the degree of evidence support for each category group is implemented as follows: For each non-empty set of association evidence corresponding to a medium-confidence lightweight model candidate box, the candidate boxes are grouped according to the category of the second visual language detection candidate box, and the number of second visual language detection candidate boxes in each category group is counted. The category with the highest number of candidate boxes is determined as the updated category of the medium-confidence lightweight model candidate box. When the number of candidate boxes in two or more categories is tied for the highest, the sum of the intersection-union ratios (IUR) of the second visual language detection candidate boxes and the medium-confidence lightweight model candidate boxes for each tied category is calculated, and the category with the highest IUR is determined as the updated category.

[0015] Furthermore, after adding the updated medium-confidence lightweight model candidate boxes to the candidate set to be output, the method further includes: The candidate boxes in the candidate set to be output are grouped according to their current category. Within each category group, the candidate boxes are sorted from high to low according to the confidence of the lightweight model. Non-maximum suppression is then performed using a preset non-maximum suppression cross-union ratio threshold, and the candidate set to be output is updated.

[0016] Furthermore, after obtaining by And updated by category After the final candidate set to be output is formed, the method also includes: Second visual language detection candidate boxes whose intersection-union ratio with any candidate box in the current candidate set to be output is not lower than the preset candidate overlap exclusion intersection-union ratio threshold are included in the processed second visual language detection candidate box set; candidate boxes in the processed second visual language detection candidate box set are removed from the complete second visual language detection candidate box set to obtain the second visual language detection candidate box set to be supplemented and verified. For each candidate box in the set of candidate boxes for the second visual language detection to be supplemented and verified, if If there is a low-confidence lightweight model candidate box that matches its category and has an intersection-union ratio (IU) not lower than the preset supplementary verification IU threshold, then the second visual language detection candidate box is added to the candidate set to be output. Based on the final candidate set to be output, the output includes the object bounding box coordinates and the object category of the image object detection and recognition result.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium includes a stored computer program, wherein the computer program, when executed by a processor, controls the device where the storage medium is located to perform the steps of the method described above.

[0018] In summary, compared with the prior art, the technical solutions conceived by this invention have the following main advantages: 1. This invention proposes an image target detection and recognition method based on hierarchical collaboration of large and small models. By combining the visual understanding category set obtained from a first visual language understanding model with the lightweight detection category set obtained from a lightweight target detection model, the candidate categories that the second visual language detection model needs to process are limited. Furthermore, high- and medium-confidence lightweight model candidate boxes are used to generate region-of-interest (ROI) pre-perception cues, enabling the second visual language detection model to perform category-by-category detection under the joint guidance of candidate categories and key spatial regions. Thus, category-by-category detection reduces mutual interference that occurs when multi-category target detection tasks are concentrated in the same inference. The RIO pre-perception cues ensure that the regions corresponding to the lightweight model candidate boxes retain more image details in the visual cue image, thereby improving the targeting accuracy of the second visual language detection model. In addition, by dividing the lightweight model candidates into high, medium, and low confidence sets, high-confidence candidates are used to initialize the candidate set to be output, while medium-confidence candidates determine whether to retain and confirm or update the category based on the association evidence provided by the complete second visual language detection candidate box set. Therefore, cross-validation is performed using the category and spatial information of the two models to reduce the impact of false alarms, missed detections, and misclassifications caused by a single model on the final result, thereby improving the completeness and reliability of the detection and recognition results.

[0019] 2. This invention also proposes to include low-confidence sets The set of initial lightweight model candidate boxes with low confidence is used to validate the supplementary second visual language detection candidate boxes. These supplementary candidate boxes are obtained by removing candidate boxes from the processed second visual language detection candidate box set from the complete second visual language detection candidate box set. The processed second visual language detection candidate box set consists of candidate boxes whose intersection-union ratio (IU) with any candidate box in the current output candidate set is not lower than a preset candidate overlap exclusion IU threshold. This process, on the one hand, reduces the re-entry of candidate boxes that highly overlap with existing output candidate boxes into the supplementary validation process, and on the other hand, constrains the acceptance of the remaining second visual language detection candidate boxes by low-confidence candidate boxes, further reducing the impact of false alarms, missed detections, and misclassifications generated by a single model on the final result. Attached Figure Description

[0020] Figure 1 The flowchart illustrates the image target detection and recognition method based on size model hierarchical collaboration provided in this embodiment of the invention.

[0021] Figure 2 This is a schematic diagram of the processing structure of the image target detection and recognition method based on size model hierarchical cooperation provided in an embodiment of the present invention.

[0022] Figure 3 This is a flowchart illustrating the construction process of the region of interest pre-sensing prompt and visual cue image provided in an embodiment of the present invention.

[0023] Figure 4 This is a flowchart illustrating the hierarchical result processing between the complete set of second visual language detection candidate boxes and the candidate boxes of high, medium, and low confidence lightweight models provided in this embodiment of the invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0025] To address the challenges of lightweight object detection models in simultaneously achieving object recall and false alarm suppression, and the difficulty in effectively coordinating detection results between lightweight object detection models and visual language models, this invention provides an image object detection and recognition method based on hierarchical collaboration between large and small models. The aim is to leverage the complementary advantages of lightweight object detection models in object localization and visual language models in scene understanding and object representation generalization, thereby improving the completeness and reliability of image object detection and recognition results.

[0026] Example 1 An image target detection and recognition method based on size model hierarchical collaboration includes: The first visual language understanding model is used to analyze the image to be detected. Perform category recognition to obtain a set of visual understanding categories. Input the same image to be detected into a lightweight object detection model to obtain an initial lightweight model candidate box set with category and detection confidence; determine a high-confidence set from the initial lightweight model candidate box set according to the confidence level and its preset threshold. Medium confidence set and low confidence sets ;extract and The category names in the dataset are used to obtain a lightweight detection category set; the visual understanding category set is then used to... The candidate category set is obtained by taking the union of the lightweight detection category set and the candidate category set. calculate and The scale-normalized Gaussian response of any lightweight model candidate box in the image is used as the independent region response of that box. For each pixel location in the image to be detected, the maximum value of the independent region response of each lightweight model candidate box at that pixel location is taken as the region of interest pre-sensing cue representing the probability that the pixel location is located in the target region. The image to be detected is blurred and smoothed to obtain a smoothed image; the image to be detected and the smoothed image are then fused pixel-by-pixel with weighted fusion to obtain a visual cue image; wherein, at each pixel position, weighted fusion is performed using weighted fusion of ... As the weights of the image to be detected, with 1 and The difference is used as the smoothing image weight; the detection instruction corresponding to each candidate category in the candidate category set is combined with the visual cue image to form a text-image input pair, which is then input into the second visual language detection model to obtain the second visual language detection candidate box set of the corresponding candidate category, thereby obtaining the complete second visual language detection candidate box set corresponding to the candidate category set; Establish a candidate set to be output, Add to the set of candidates to be output; for For each medium-confidence lightweight model candidate box, calculate its intersection-union ratio (IU) with each candidate box in the complete second visual language detection candidate box set; form an association evidence set for the medium-confidence lightweight model candidate box by including all candidate boxes with an IU not lower than a preset medium-confidence association IU threshold; group the second visual language detection candidate boxes in the association evidence set according to category, determine the updated category of the medium-confidence lightweight model candidate box based on the number of candidate boxes in each category group, maintain the coordinates of the medium-confidence lightweight model candidate box, and add the updated medium-confidence lightweight model candidate box to the output candidate set; output the image target detection and recognition result including the target box coordinates and target category based on the output candidate set.

[0027] Please see Figures 1 to 4 In practice, the method of this embodiment can be divided into operations S1 to S5. Figure 2 This illustrates the data transfer relationships between each processing stage. The first visual language understanding model and the second visual language detection model can use independent model instances, or they can share a common infrastructure or basic parameters, and achieve their respective processing responsibilities through different task adaptation parameters or task instructions.

[0028] Operation S1 to acquire the image to be detected ,in, Indicates the image number.

[0029] Operation S2 inputs the same image to be detected into the first visual language understanding model and the lightweight object detection model.

[0030] Preferably, operation S2 includes sub-operations S21 to S26.

[0031] Sub-operation S21 inputs the image to be detected and the fixed target category understanding instruction into the first visual language understanding model, enabling it to generate a structured target category text answer. (Visual understanding category set) The construction method is as follows: The image to be detected and the preset target category understanding instructions are input into the first visual language understanding model to generate a structured target category text answer. The structured target category text answer is then subjected to structural validity verification. If the text answer passes the validity verification, the category name is parsed from the text answer. The parsed category name is matched with the names in a unified category vocabulary, and the matched categories are retained while duplicates are removed to obtain the visual understanding category set. If the text answer fails the validity check or there is no matching category, the visual understanding category set will be used. Set to an empty set; wherein, the unified category vocabulary includes all original names of target categories used for training the lightweight target detection model.

[0032] In this implementation, the structured target category text answer adopts a format that begins with a fixed starting string; if the answer lacks this string or is empty after it, the visual understanding category set is directly set to empty; the remaining answers undergo full-segment validity verification, and only when the subsequent content consists of one or more non-empty category names separated by a predetermined delimiter, the category names are extracted, matched with category names in the unified category thesaurus, the matched categories are retained and duplicates are removed, resulting in the visual understanding category set; if the answer fails the validity verification or has no matching category, the visual understanding category set is set to empty.

[0033] In one implementation example, the fixed target category understanding instruction is: 'Please identify target categories in the image'.

[0034] The answers from the first visual language understanding model begin with a fixed starting string 'Categories:'.

[0035] If the target category does not exist, the string after the answer will be empty, and the visual understanding category set will be set to empty.

[0036] Answers without a target category are in the form of 'Categories:'.

[0037] When there are one or more target categories, the output format is, for example, 'Categories:drone.bird'.

[0038] If the fixed starting string is not empty, perform a full-segment validity check on the structured target category text answer. An answer passes validity only if it begins with the fixed starting string 'Categories:' and the following content consists solely of one or more non-empty category names and a predetermined separator used to separate adjacent category names; this example uses a period as the separator. An answer fails validity if there are empty category names, consecutive separators, incorrect separator format, or additional text outside the protocol.

[0039] A unified category vocabulary includes the original names of all target categories used in training the lightweight object detection model, and associates them with their category numbers. For answers that pass validity checks, the category names are extracted, matched against the names in the vocabulary, and the matched categories are retained while deduplication, resulting in a visual understanding category set. If an answer fails the validity check or has no matching category, the set is set to empty.

[0040] Sub-operation S22 involves inputting the same image to be detected into a lightweight object detection model to obtain an initial set of lightweight model candidate boxes with categories and detection confidence scores. In one implementation example, a YOLO series detection model is used, whose parameter count or single inference computation is smaller than that of the visual language model. The categories of the candidate boxes are predicted by the lightweight object detection model, and its output category number corresponds one-to-one with the category name predicted by the model.

[0041] Sub-operation S23, in a preferred embodiment, filters out items with a confidence level lower than the minimum detection threshold. The initial lightweight model candidate boxes are generated. The remaining candidates are grouped according to their predicted categories, and within each category group, an intersection-union (IU) threshold is set based on the detection confidence level from highest to lowest. Non-maximum suppression is performed, and then the retained candidate boxes for each category group are summarized.

[0042] Sub-operation S24 divides all retained candidate boxes into three sets: high, medium, and low, based on their confidence level: the confidence level is not lower than the high confidence threshold. Candidate boxes are assigned to the high-confidence set. The confidence level is not lower than the medium confidence threshold. Candidate boxes below the high confidence threshold are categorized into the medium confidence set. The remaining candidate boxes, after being filtered by the lowest detection threshold, are categorized into the low-confidence set. The three thresholds are satisfied. .

[0043] After being filtered by the lowest detection threshold and subjected to non-maximum suppression by classification, the candidate boxes of the lightweight model are divided into three sets of confidence: high, medium, and low, which are used for subsequent input guidance and result processing, respectively.

[0044] In this implementation, the minimum detection threshold, the medium confidence threshold, and the high confidence threshold increase sequentially. Initial lightweight model candidate boxes are first filtered by the minimum detection threshold, then grouped according to the predicted categories of the lightweight object detection model. Within each category group, non-maximum suppression (NMS) is performed using the first NMS threshold. Subsequently, the remaining candidate boxes are categorized into high, medium, and low confidence levels. The medium confidence association NMS threshold, the second NMS threshold, the candidate overlap exclusion NMS threshold, and the supplementary validation NMS threshold can be set separately; however, for the sake of simplifying threshold configuration, preferably, all four use the same value.

[0045] In a preferred implementation example, the minimum detection threshold A value of 0.10 is acceptable, representing a medium confidence threshold. A value of 0.30 can be used as a high confidence threshold. A value of 0.70 can be used as the non-maximum suppression threshold for the first classification. A value of 0.25 is acceptable. The above values ​​are used to illustrate a parameter configuration for scenarios such as infrared detection, and can be adjusted according to imaging distance, target scale, number of categories, image type, and the confidence calibration results of a lightweight target detection model.

[0046] Sub-operation S25, from the high confidence set The high-confidence lightweight model candidate box set and the medium-confidence set Extracting category names from the candidate box set of the medium-confidence lightweight model and removing duplicates yields the lightweight detection category set. The candidate category set is obtained by taking the union of the visual understanding category set and the lightweight detection category set.

[0047] By employing a union relationship, categories that are only discovered by the first visual language understanding model or only by the high- and medium-confidence candidate categories of the lightweight object detection model can enter the category-by-category detection process of the second visual language detection model. When the visual understanding category set is empty, a candidate category set is formed from the lightweight detection category set; when the lightweight detection category set is empty, a candidate category set is formed from the visual understanding category set; when both are empty, the category-by-category inference of the second visual language detection model can be skipped, and the detection and recognition results of the image to be detected are set to an empty set.

[0048] Sub-operation S26, which sets low confidence levels... As a low-confidence verification candidate set, it is used for supplementary verification in operation S4.

[0049] Operation S3 constructs a visual cue image based on the spatial location information of the high-confidence lightweight model candidate boxes and the medium-confidence lightweight model candidate boxes, forming spatial input guidance for the second visual language detection model, and targeting the candidate category set. Perform category-by-category detection. Preferably, operation S3 includes sub-operations S31 to S35.

[0050] Sub-operation S31 calculates the scale-normalized Gaussian response for each lightweight model candidate box in the high and medium confidence sets.

[0051] As a preferred implementation, for each high-confidence lightweight model candidate box and each medium-confidence lightweight model candidate box, the scale-normalized Gaussian response of the candidate box is calculated based on the center position, width, and height of the candidate box, which serves as the independent region response for each candidate box. The maximum response value of all independent region responses is selected at each pixel position of the image to be detected to obtain the region of interest pre-sensing cue. The region of interest pre-sensing cue is used to preserve the image details of the high-response region and to gently smooth the low-response region, forming a visual cue image.

[0052] The scale-normalized Gaussian response of the candidate bounding boxes in the lightweight model is expressed as:

[0053] in, Indicates the image to be detected The A lightweight model candidate box at a certain pixel position The normalized Gaussian response at the point, Image to be detected The The center coordinates of the candidate boxes in the lightweight model , The images to be detected are respectively The Width and height of a lightweight model candidate box. This parameter represents the Gaussian standard deviation in scale-normalized coordinates of the candidate bounding box, used to control the Gaussian response as a function of a given pixel position. The rate at which the normalized distance from the center of the candidate box decays as it increases is used to control the diffusion range of the Gaussian response. More preferably, .

[0054] Sub-operation S32: For each pixel location in the image, take the maximum value of the Gaussian response of each candidate box at that pixel location to obtain the region of interest pre-sensing cue representing the probability that the pixel location is located in the target region. :

[0055] in, Iterate through the candidate bounding boxes of the high- and medium-confidence lightweight models that participated in the suggestion construction. The suggestion response is between 0 and 1. The value is (0, 1).

[0056] Sub-operation S33, based on region of interest pre-sensing prompts for the image to be detected Perform spatial weighting, such as Figure 3 As shown. Preferably, this embodiment uses a full-image smoothing method to construct the visual cue image:

[0057] in, Indicates visual cue images, The standard deviation is expressed as Gaussian smoothing kernel, The value should satisfy the following condition: smaller values ​​should be selected first, while retaining key background information, under the premise of being able to moderately weaken local background details. This represents the convolution operation. This represents pixel-wise multiplication. At each pixel position, the weight of the original image is... The smoothed image weights are The sum of the two is 1. Therefore, the high-response region retains more original image details, while the low-response region is moderately smoothed.

[0058] When both the high-confidence and medium-confidence lightweight model candidate box sets are empty, the image to be detected is directly used as the visual cue image. The constructed visual cue image is used as the image input for the second visual language detection model.

[0059] In sub-operation S34, in a preferred embodiment, the shorter side of the visual cue image is first lengthened on both sides to make it a square image, and then scaled proportionally to the input size of the second visual language detection model.

[0060] In one specific implementation example, the input size is 672×672 pixels. The scaling factor, as well as the position and width of the padding before scaling, are recorded for use in output coordinate decoding.

[0061] For each candidate category, for example, use the following instruction template, replacing 'class_name' with the name of that candidate category: 'Please detect<|object_ref_start|>{class_name}<|object_ref_end|>inthe image'.

[0062] The same visual cue image, after being stretched and scaled, is combined with each category detection instruction to form a text-image input pair. Each input pair contains an image and a category detection request.

[0063] Sub-operation S35 inputs each image and text pair into the second visual language detection model to obtain the structured detection output of the corresponding candidate categories.

[0064] As a preferred implementation, the target position is obtained by parsing the structured detection output, which is achieved as follows: The structured detection output is a coordinate text answer, which includes a category field, a field separator following the category field, and a target record field. The target record field is either empty or includes one or more coordinate records separated by a predetermined separator. Each coordinate record includes the coordinates of the top-left corner and the bottom-right corner of the target bounding box encoded according to a predetermined coordinate scale. When decoding the coordinate text answer, the consistency of the category field, the field separator, and the candidate category in the detection instruction is first verified. After the verification passes, if the target record field is empty, the decoding result corresponding to the current candidate category is set to an empty set. If the target record field is not empty, the coordinate record structure, number of fields, and integer type are verified. For the coordinate records that pass the verification, the input image coordinate inverse mapping based on the predetermined coordinate scale encoding, the model input scale inverse transformation, the offset elimination, and the positive area verification are performed to obtain the coordinates of the second visual language detection candidate box in the image to be detected, complete the target position parsing, and thus obtain the second visual language detection candidate box with category information.

[0065] In this embodiment, when the sequence generated by the second visual language detection model is converted into text, special markers are removed to obtain the coordinate text answer for subsequent parsing.

[0066] As an example, when there is a target, the answer is in the form of: '{class}:[x1,y1,x2,y2].[x1,y1,x2,y2]'.

[0067] When there is no target, the answer will be in the form of '{class}:'.

[0068] Where '{class}' is the target category name, a colon separates the category field from the target record field, square brackets enclose a coordinate record, and multiple records are separated by a period. Each coordinate record contains four integers in the order of top-left x-coordinate, top-left y-coordinate, bottom-right x-coordinate, and bottom-right y-coordinate.

[0069] When decoding the coordinate text answer, first check if the answer contains a category field and a field separator following the category field, and check if the category in the category field matches the candidate category specified in the current detection instruction; if the above checks fail, the decoding result of the current candidate category is set to an empty set. If the above checks pass but the target record field is empty, the validity check of non-empty coordinate records is not performed, and the decoding result of the current candidate category is directly set to an empty set; if the target record field is not empty, first check the record separator method and square bracket pairing; if the record structure does not conform to the predetermined format, the decoding result of the current candidate category is set to an empty set.

[0070] Perform field count and integer type validation on each coordinate record that passes the overall validation. If the number of fields is not four or any field cannot be converted to an integer, only the current coordinate record is discarded, without affecting other valid coordinate records in the same coordinate text answer.

[0071] The four coordinate values ​​output by the model represent the positions of the top-left and bottom-right corners of the target bounding box in the coordinate system of the model's input image. This embodiment uses a thousandth-scale: the horizontal coordinate is obtained by multiplying the horizontal value by the model's input width and then dividing by 1000; the vertical coordinate is obtained by multiplying the vertical value by the model's input height and then dividing by 1000. After eliminating the effects of scaling and edge padding on the coordinates, the coordinates of the target bounding box in the image to be detected are obtained.

[0072] in, , These are the horizontal and vertical coordinate values ​​read from the model's answer. , Input the width and height of the image into the model. This is the scaling factor for the edge-padding image to the model input image. , This refers to the padding width of the left and top edges before scaling. , These are the coordinates in the image to be detected. This calculation is performed on the top-left and bottom-right corners respectively.

[0073] In a coordinate system with the top left corner as the origin, only those satisfying the following conditions are retained. and The positive area candidate boxes are identified and associated with the candidate categories specified in the current detection instruction. The candidate boxes corresponding to each candidate category are then aggregated to obtain a complete set of second visual language detection candidate boxes, denoted as . Among them, the first The coordinates and categories of each candidate box are denoted as follows: , .

[0074] Operation S4 utilizes the complete second visual language detection candidate box set and high, medium, and low confidence lightweight model candidate boxes to perform hierarchical updates on the output candidate set, such as... Figure 4 As shown.

[0075] For example, any two candidate boxes and The crossover ratio is defined as:

[0076] in, The intersection represents the area of ​​the region; the union represents the area covered by both frames.

[0077] Preferably, operation S4 includes sub-operations S41 to S45. The confidence level is associated with the cross-union threshold. Used to filter association evidence for candidate boxes in the medium-confidence lightweight model; second non-maximum suppression cross-union ratio threshold. This is used to process the candidate set consisting of high-confidence boxes and medium-confidence boxes after class updates. It suppresses duplicate candidates whose cross-union ratio (CUI) reaches a certain threshold among candidate boxes of the same current class; candidate overlap excludes candidates from the CUI threshold. Used to exclude second visual language detection candidate boxes whose overlap with the candidate boxes to be output reaches this threshold; supplementary verification of the intersection-union ratio threshold. This is used to determine whether the spatial overlap between the candidate bounding box to be supplemented and the candidate bounding box of the low-confidence lightweight model, assuming class consistency, meets the acceptance criteria. All four thresholds are located at... These can be set separately.

[0078] Sub-operation S41: Establish a candidate set to be output and add the candidate boxes of the high-confidence lightweight model to the set.

[0079] Sub-operation S42: For each candidate box in the confidence set, calculate its intersection-union ratio (IU) with all boxes in the complete second visual language detection candidate box set. Ensure the IU is not lower than [a certain value]. All candidate boxes constitute the set of associated evidence for the confidence box, denoted as:

[0080] in, For the first The coordinates of the candidate boxes in the lightweight model with high confidence. Record the candidate bounding box numbers of the second visual language detection that meet the association conditions. Represents the complete set of candidate boxes for second visual language detection. The v-th candidate box in the [reference box].

[0081] Each medium-confidence lightweight model candidate box independently collects associated evidence, and the same second visual language detection candidate box can enter the associated evidence set of multiple medium-confidence boxes.

[0082] when If the value is empty, discard the confidence box in that box.

[0083] when When not empty, the candidate bounding boxes for second visual language detection are grouped according to category, and the number of candidate bounding boxes in each category group is counted:

[0084] in, This indicates an indicator function that takes the value 1 if the condition is true and 0 otherwise. Represents a unified category thesaurus; Indicate category Number of frames and votes obtained; This represents the set of categories with the highest number of votes.

[0085] When the category with the highest number of candidate boxes is unique, that category is determined as the updated category for the corresponding medium-confidence lightweight model candidate box. When two or more categories have the same number of candidate boxes, the sum of the intersection-over-union ratios (IoU) of the second visual language detection candidate boxes and the current medium-confidence lightweight model candidate boxes for each of the tied categories is calculated:

[0086] Then, select the category with the highest unique sum from the set of categories with the highest votes and compare them to find the updated category.

[0087] The updated medium-confidence lightweight model candidate boxes retain the original coordinates and original confidence, adopt the updated category as the current category, and are added to the candidate set to be output.

[0088] When neither the number of candidate boxes nor the sum of the intersection-union ratios can uniquely determine the updated category, this embodiment retains the original category. As an optional approach, the category-wise response vectors output by the lightweight model for each candidate box can be saved before the first non-maximum suppression; when there are still ties in the above two levels of statistics, the response values ​​of the middle confidence box to each ties are compared, and the category with the uniquely highest response value is taken as the updated category; if there are still ties, the original category is retained.

[0089] As a preferred option, sub-operation S43 regroups the candidate boxes in the candidate set to be output according to their current category. Within each category group, a second non-maximum suppression is performed according to the lightweight model confidence level from high to low: the candidate box with the highest confidence level is retained, and the candidate box with an intersection-union ratio of not less than 1 is suppressed. The remaining candidate boxes. Update the candidate set to be output with the retained results.

[0090] As a preferred option, sub-operation S44 examines each candidate box in the complete second visual language detection candidate box set. If its intersection-union ratio with any candidate box to be output is not lower than... If the result is not found, it will be added to the already processed second visual language detection candidate box set. This process is used to reduce the number of candidate boxes that highly overlap with existing candidate boxes to be output from re-entering the supplementary verification.

[0091] Sub-operation S45 removes processed candidate boxes from the complete second visual language detection candidate box set, resulting in a supplementary verification set. For each candidate box in this set, a query is performed in the low-confidence verification candidate set to find boxes with consistent categories and an intersection-union ratio (IU) of at least 1. Lightweight model candidate boxes; if at least one lightweight model candidate box meets the conditions, the candidate box to be supplemented for verification is added to the candidate set to be output with its own coordinates and category.

[0092] In a preferred embodiment, the mid-confidence association cross-union ratio (CUNR) threshold, the second non-maximum suppression CUNR threshold, the candidate overlap exclusion CUNR threshold, and the supplementary verification CUNR threshold are all set to 0.5. In other embodiments, four thresholds can be set according to the mid-confidence association evidence density, the spatial tolerance of the second non-maximum suppression, the spatial coverage of existing output candidates, and the stringency of the low-confidence supplementary verification.

[0093] Through the above operations, the lightweight model candidates perform continuous but distinct roles at the input and output ends: the categories of high- and medium-confidence candidates are joined with the visual understanding category set to form the candidate categories of the second visual language detection model; high- and medium-confidence candidate boxes simultaneously provide spatial cues; high-confidence candidates initialize the candidate set to be output; medium-confidence candidates are selectively added after obtaining multi-box category evidence from the complete second visual language detection candidate box set; and low-confidence candidates are used to constrain the supplementary acceptance of the remaining second visual language detection candidate boxes. Overall, the second visual language detection model first detects the entire visual cue image according to the candidate categories, summarizes the complete detection results, and then performs cross-validation with the lightweight model candidate boxes.

[0094] Example 2 This application also relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0095] Specifically, the memory may include high-speed random access memory, as well as non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital (SD) cards, flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.

[0096] The relevant technical solutions are the same as above, and will not be repeated here.

[0097] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An image target detection and recognition method based on hierarchical collaboration using a size model, characterized in that, include: The first visual language understanding model is used to analyze the image to be detected. Perform category recognition to obtain a set of visual understanding categories. Input the same image to be detected into a lightweight object detection model to obtain an initial lightweight model candidate box set with category and detection confidence; determine a high-confidence set from the initial lightweight model candidate box set according to the confidence level and its preset threshold. Medium confidence set and low confidence sets ;extract and The category names in the dataset are used to obtain a lightweight detection category set; the visual understanding category set is then used to... The candidate category set is obtained by taking the union of the lightweight detection category set and the candidate category set. calculate and The scale-normalized Gaussian response of any lightweight model candidate box in the image is used as the independent region response of that box. For each pixel location in the image to be detected, the maximum value of the independent region response of each lightweight model candidate box at that pixel location is taken as the region of interest pre-sensing cue representing the probability that the pixel location is located in the target region. ; The image to be detected is blurred and smoothed to obtain a smoothed image; the image to be detected and the smoothed image are then fused pixel-by-pixel with weighted fusion to obtain a visual cue image; wherein, at each pixel position, weighted fusion is performed using weighted fusion of ... As the weights of the image to be detected, with 1 and The difference is used as the smoothing image weight; the detection instruction corresponding to each candidate category in the candidate category set is combined with the visual cue image to form a text-image input pair, which is then input into the second visual language detection model to obtain the second visual language detection candidate box set of the corresponding candidate category, thereby obtaining the complete second visual language detection candidate box set corresponding to the candidate category set; Establish a candidate set to be output, Add to the set of candidates to be output; for For each medium-confidence lightweight model candidate box, calculate its intersection-union ratio (IU) with each candidate box in the complete second visual language detection candidate box set; form an association evidence set for the medium-confidence lightweight model candidate box by including all candidate boxes with an IU not lower than a preset medium-confidence association IU threshold; group the second visual language detection candidate boxes in the association evidence set according to category, determine the updated category of the medium-confidence lightweight model candidate box based on the evidence support level of each category group for the medium-confidence lightweight model candidate box, keep the coordinates and confidence of the medium-confidence lightweight model candidate box unchanged, and add the updated medium-confidence lightweight model candidate box to the output candidate set; output the image target detection and recognition result including the target box coordinates and target category based on the output candidate set.

2. The image target detection and recognition method as described in claim 1, characterized in that, Visual understanding category set The construction method is as follows: The image to be detected and the preset target category understanding instructions are input into the first visual language understanding model to generate a structured target category text answer. The structured target category text answer is then subjected to structural validity verification. If the text answer passes the validity verification, the category name is parsed from the text answer. The parsed category name is matched with the names in a unified category vocabulary, and the matched categories are retained while duplicates are removed to obtain the visual understanding category set. If the text answer fails the validity check or there is no matching category, the visual understanding category set will be used. Set to an empty set; wherein, the unified category vocabulary includes all original names of target categories used for training the lightweight target detection model.

3. The image target detection and recognition method as described in claim 1, characterized in that, The high-confidence set is determined from the initial lightweight model candidate box set according to the confidence level and its preset threshold. Medium confidence set and low confidence sets The implementation methods include: Filter out candidates with confidence levels below the minimum detection threshold from the initial lightweight model candidate box set. The initial lightweight model candidate boxes are generated; the remaining candidate boxes are grouped according to the predicted category, and within each category group, the cross-union ratio (CUI) is performed in descending order of detection confidence, with a preset threshold. Non-maximum suppression is applied, and then the retained candidate boxes for each category group are aggregated. All retained and aggregated candidate boxes are then divided into three sets based on confidence level: high, medium, and low. The set with confidence level not lower than the high confidence threshold is further defined. Candidate boxes are assigned to the high-confidence set. The confidence level is not lower than the medium confidence threshold. Candidate boxes below the high confidence threshold are categorized into the medium confidence set. The remaining candidate boxes, after being filtered by the lowest detection threshold, are categorized into the low-confidence set. The three thresholds are satisfied: .

4. The image target detection and recognition method as described in claim 1, characterized in that, Based on the center position, width, and height of each lightweight model candidate box in the high and medium confidence sets, calculate the scale-normalized Gaussian response of that lightweight model candidate box, expressed as: in, Indicates the image to be detected The A lightweight model candidate box at a certain pixel position The normalized Gaussian response at the point, Image to be detected The The center coordinates of the candidate boxes in the lightweight model , The images to be detected are respectively The Width and height of a lightweight model candidate box. This parameter represents the Gaussian standard deviation in scale-normalized coordinates of the candidate bounding box, used to control the Gaussian response as a function of a given pixel position. The rate at which the normalized distance from the center of the candidate box decays as it increases is used to control the spread range of the Gaussian response.

5. The image target detection and recognition method as described in claim 1, characterized in that, The step of forming a text-image input pair between the detection instruction corresponding to each candidate category in the candidate category set and the visual cue image, and inputting it into the second visual language detection model to obtain a set of second visual language detection candidate boxes for the corresponding candidate category, is implemented as follows: the shorter side of the visual cue image is lengthened on both sides to make the visual cue image a square image, and then scaled proportionally to the input size of the second visual language detection model; the detection instruction corresponding to each candidate category in the candidate category set and the lengthened and scaled visual cue image are formed into a text-image input pair, which is input into the second visual language detection model to obtain a structured detection output that corresponds to the candidate category and contains target location information; The target location is parsed from the structured detection output and associated with the corresponding candidate category to form a second visual language detection candidate box with category information, that is, a set of second visual language detection candidate boxes for the corresponding candidate category.

6. The image target detection and recognition method as described in claim 5, characterized in that, The target position is obtained by parsing from the structured detection output, and the method is as follows: The structured detection output is a coordinate text answer, which includes a category field, a field separator following the category field, and a target record field. The target record field is either empty or includes one or more coordinate records separated by a predetermined separator. Each coordinate record includes the coordinates of the top-left corner and the bottom-right corner of the target bounding box encoded according to a predetermined coordinate scale. When decoding the coordinate text answer, the consistency of the category field, the field separator, and the category with the candidate category in the detection instruction is first verified. After the verification passes, if the target record field is empty, the decoding result corresponding to the current candidate category is set to an empty set. If the target record field is not empty, the coordinate record structure, number of fields, and integer type are verified. For the coordinate records that pass the verification, the input image coordinate inverse mapping based on the predetermined coordinate scale encoding, the model input scale inverse transformation, the offset elimination, and the positive area verification are performed to obtain the coordinates of the second visual language detection candidate box in the image to be detected, complete the target position parsing, and thus obtain the second visual language detection candidate box with category information.

7. The image target detection and recognition method as described in claim 1, characterized in that, The step of determining the updated category of a lightweight model candidate box based on the degree of evidence support for the candidate box in each category group is implemented as follows: For each non-empty set of association evidence corresponding to a medium-confidence lightweight model candidate box, the candidate boxes are grouped according to the category of the second visual language detection candidate box, and the number of second visual language detection candidate boxes in each category group is counted. The category with the highest number of candidate boxes is determined as the updated category of the medium-confidence lightweight model candidate box. When the number of candidate boxes in two or more categories is tied for the highest, the sum of the intersection-union ratios (IUR) of the second visual language detection candidate boxes and the medium-confidence lightweight model candidate boxes for each tied category is calculated, and the category with the highest IUR is determined as the updated category.

8. The image target detection and recognition method as described in claim 1, characterized in that, After adding the updated medium-confidence lightweight model candidate boxes to the candidate set to be output, the method further includes: The candidate boxes in the candidate set to be output are grouped according to their current category. Within each category group, the candidate boxes are sorted from high to low according to the confidence of the lightweight model. Non-maximum suppression is then performed using a preset non-maximum suppression cross-union ratio threshold, and the candidate set to be output is updated.

9. The image target detection and recognition method according to any one of claims 1 to 8, characterized in that, In obtaining And updated by category After the final candidate set to be output is formed, the method also includes: Second visual language detection candidate boxes whose intersection-union ratio with any candidate box in the current candidate set to be output is not lower than the preset candidate overlap exclusion intersection-union ratio threshold are included in the processed second visual language detection candidate box set; candidate boxes in the processed second visual language detection candidate box set are removed from the complete second visual language detection candidate box set to obtain the second visual language detection candidate box set to be supplemented and verified. For each candidate box in the set of candidate boxes for the second visual language detection to be supplemented and verified, if If there is a low-confidence lightweight model candidate box that matches its category and has an intersection-union ratio (IU) not lower than the preset supplementary verification IU threshold, then the second visual language detection candidate box is added to the candidate set to be output. Based on the final candidate set to be output, the output includes the object bounding box coordinates and the object category of the image object detection and recognition result.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein the computer program, when executed by a processor, controls the device on which the storage medium is located to perform the steps of the method as described in any one of claims 1 to 9.