Target detection model updating method and device, storage medium and program product
Patent Information
- Application Number
- CN202611098633.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-07-23
AI Technical Summary
[0004]本申请的主要目的在于提供一种目标检测模型的更新方法、装置、存储介质及程序产品,以解决相关技术中采用对目标检测模型进行重新训练的方式对目标检测模型进行优化,效果差的问题
[0022]在本申请中,采用以下方式:获取提示图片,其中,提示图片包括:目标检测模型的识别结果有误或漏识别的图片;将提示图片输入上下文提示模块,得到第一提示特征,其中,上下文提示模块用于对提示图片进行特征提取;对第一提示特征进行特征增强,得到目标提示特征;对目标提示特征和跨尺度特征进行融合,得到融合后的特征,其中,跨尺度特征包括:目标检测模型的骨干网络输出的特征;基于融合后的特征,对目标检测模型中检测头内分类分支的参数和上下文提示模块的参数进行在线更新,进而解决了相关技术中采用对目标检测模型进行重新训练的方式对目标检测模型进行优化,效果差的技术问题。在本申请中,通过上下文提示模块在识别有误或漏识别的提示图片中提取提示特征,并基于提示特征对目标检测模型和上下文提示模块的局部参数进行在线增量更新,避免了相关技术中对目标检测模型进行重新离线训练的情况,达到了无需重新离线训练即可解决目标检测模型识别不准确的目的,实现了提高目标检测模型的识别精准度的技术效果。
Smart Images

Figure CN122637097B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and more specifically, to a method, apparatus, storage medium, and program product for updating a target detection model. Background Technology
[0002] In related technologies, video surveillance alarm recognition is directly based on a pre-trained target detection model. However, this method cannot update the model in real time based on user feedback. Instead, the model must be retrained periodically based on new training sample sets. This results in low update efficiency of the target detection model, affecting the accuracy of the recognition results and leading to high false alarm and false negative rates in video surveillance in complex spatial governance scenarios.
[0003] There is currently no effective solution to the problem that optimizing object detection models by retraining them in related technologies yields poor results. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, storage medium, and program product for updating an object detection model, so as to solve the problem that the optimization of object detection models by retraining them in related technologies has poor results.
[0005] To achieve the above objectives, according to one aspect of this application, a method for updating an object detection model is provided. The method includes: acquiring a prompt image, wherein the prompt image includes an image in which the object detection model has incorrect or missed recognition results; inputting the prompt image into a context prompt module to obtain a first prompt feature, wherein the context prompt module is used to extract features from the prompt image; performing feature enhancement on the first prompt feature to obtain a target prompt feature; fusing the target prompt feature and cross-scale features to obtain a fused feature, wherein the cross-scale feature includes features output by the backbone network of the object detection model; and updating online the parameters of the classification branch within the detection head of the object detection model and the parameters of the context prompt module based on the fused feature.
[0006] Furthermore, the context prompting module includes a feature extraction module, a vector generation module, and a feature fusion module. The feature extraction module includes a lightweight convolutional neural network. The feature extraction module inputs the prompt image into the context prompting module to obtain a first prompt feature, including: inputting the prompt image into the lightweight convolutional neural network for feature extraction to obtain initial prompt features; calling the vector generation module to initialize a set of vectors that can participate in model training to obtain a target prompt vector; and fusing the initial prompt features and the target prompt vector using the feature fusion module based on an attention weighting mechanism to obtain the first prompt feature.
[0007] Furthermore, during the online update of the parameters of the classification branch within the detection head of the target detection model and the parameters of the context prompting module based on the fused features, the method further includes: storing the target prompting features and the classification labels of the prompting images into a memory pool, wherein the data in the memory pool includes: the prompting features output by the context prompting module and the classification labels associated with the prompting features, and the data update strategy in the memory pool includes: a first-in-first-out strategy.
[0008] Further, feature enhancement is performed on the first prompt feature to obtain the target prompt feature, including: inputting the first prompt feature into a depthwise separable convolutional unit to obtain a second prompt feature, wherein the depthwise separable convolutional unit includes: depthwise convolution and pointwise convolution; inputting the second prompt feature into a lightweight channel attention unit to obtain a third prompt feature, wherein the lightweight channel attention unit is used to enhance the features of a specified channel; and processing the third prompt feature using a batch normalization layer and an activation function to obtain the target prompt feature.
[0009] Further, the target cue features and cross-scale features are fused to obtain fused features, including: aligning the cross-scale features to obtain aligned cross-scale features; and using a weighted summation strategy to fuse the target cue features and the aligned cross-scale features to obtain the fused features.
[0010] Further, the cross-scale features are aligned to obtain aligned cross-scale features, including: multi-scale sampling of the cross-scale features to obtain sampled features; spatial location calibration of the sampled features using deformable convolution to obtain calibrated features; and cross-scale semantic association of the calibrated features using a bidirectional attention mechanism to obtain the aligned cross-scale features.
[0011] Furthermore, during the online update of the parameters of the classification branch within the detection head of the object detection model and the parameters of the contextual cue module based on the fused features, the method further includes: online updating the parameters of the classification branch within the detection head of the object detection model and the target cue vector based on the fused features and the target loss function; and during the update of the parameters of the classification branch within the detection head and the target cue vector, a target constraint mechanism is used to constrain the parameter update magnitude, wherein the target constraint mechanism includes: a regularization strategy, and the target loss function includes: a loss function determined based on the cross-entropy loss function and the mean squared error loss function.
[0012] To achieve the above objectives, according to another aspect of this application, an apparatus for updating an object detection model is provided. The apparatus includes: an acquisition unit for acquiring a prompt image, wherein the prompt image includes an image in which the object detection model has incorrect or missed recognition results; a processing unit for inputting the prompt image into a context prompt module to obtain a first prompt feature, wherein the context prompt module is used to extract features from the prompt image; an enhancement unit for enhancing the first prompt feature to obtain a target prompt feature; a fusion unit for fusing the target prompt feature and cross-scale features to obtain a fused feature, wherein the cross-scale feature includes features output by the backbone network of the object detection model; and an update unit for updating online the parameters of the classification branch within the detection head of the object detection model and the parameters of the context prompt module based on the fused feature.
[0013] Furthermore, the contextual prompting module includes: a feature extraction module, a vector generation module, and a feature fusion module. The feature extraction module includes: a lightweight convolutional neural network. The processing unit includes: an extraction subunit, used to input the prompt image into the lightweight convolutional neural network for feature extraction to obtain initial prompt features; a calling subunit, used to call the vector generation module to initialize a set of vectors that can participate in model training to obtain a target prompt vector; and a first fusion subunit, used to fuse the initial prompt features and the target prompt vector using the feature fusion module based on an attention weighting mechanism to obtain the first prompt feature.
[0014] Furthermore, the update unit also includes a storage subunit, used to store the target prompt features and the classification labels of the prompt images into a memory pool during the online update of the parameters of the target detection model based on the fused features. The data in the memory pool includes the prompt features output by the context prompt module and the classification labels associated with the prompt features. The data update strategy in the memory pool includes a first-in-first-out strategy.
[0015] Further, the enhancement unit includes: a first input subunit, used to input the first cue feature into a depthwise separable convolutional unit to obtain a second cue feature, wherein the depthwise separable convolutional unit includes depthwise convolution and pointwise convolution; a second input subunit, used to input the second cue feature into a lightweight channel attention unit to obtain a third cue feature, wherein the lightweight channel attention unit is used to enhance a specified channel feature; and a processing subunit, used to process the third cue feature using a batch normalization layer and an activation function to obtain the target cue feature.
[0016] Furthermore, the fusion unit includes: an alignment subunit, used to align the cross-scale features to obtain aligned cross-scale features; and a second fusion subunit, used to fuse the target cue features and the aligned cross-scale features using a weighted summation strategy to obtain the fused features.
[0017] Furthermore, the alignment subunit includes: a sampling module for performing multi-scale sampling on the cross-scale features to obtain sampled features; a calibration module for performing spatial location calibration on the sampled features using deformable convolution to obtain calibrated features; and an association module for performing cross-scale semantic association on the calibrated features using a bidirectional attention mechanism to obtain the aligned cross-scale features.
[0018] Furthermore, the update unit includes an update subunit, used to update the parameters of the classification branch within the detection head and the parameters of the context cue module in the object detection model based on the fused features during the online update process. This update subunit updates the parameters of the classification branch within the detection head and the target cue vector based on the fused features and the target loss function. During the update process, a target constraint mechanism is used to constrain the parameter update magnitude. The target constraint mechanism includes a regularization strategy, and the target loss function includes a loss function determined based on the cross-entropy loss function and the mean squared error loss function.
[0019] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is executed, it controls the device where the computer-readable storage medium is located to perform the target detection model update method.
[0020] According to another aspect of this application, an electronic device is provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the target detection model update method during runtime.
[0021] According to another aspect of this application, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the target detection model update method.
[0022] In this application, the following method is adopted: obtaining prompt images, wherein the prompt images include images whose recognition results of the object detection model are incorrect or missed; inputting the prompt images into a context prompting module to obtain first prompt features, wherein the context prompting module is used to extract features from the prompt images; performing feature enhancement on the first prompt features to obtain target prompt features; fusing the target prompt features and cross-scale features to obtain fused features, wherein the cross-scale features include features output by the backbone network of the object detection model; and based on the fused features, updating the parameters of the classification branch within the detection head of the object detection model and the parameters of the context prompting module online, thereby solving the technical problem of poor performance in related technologies that optimize the object detection model by retraining it. In this application, the context prompting module extracts prompt features from the prompt images that are incorrectly or missed, and updates the local parameters of the object detection model and the context prompting module online incrementally based on the prompt features, avoiding the need for offline retraining of the object detection model in related technologies. This achieves the goal of solving the inaccuracy of object detection model recognition without offline retraining, and realizes the technical effect of improving the recognition accuracy of the object detection model. Attached Figure Description
[0023] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0024] Figure 1 A hardware block diagram of a computer terminal for implementing an update method for a target detection model is shown.
[0025] Figure 2 This is a flowchart of the target detection model update method provided in the embodiments of this application;
[0026] Figure 3 This is a flowchart illustrating the updating of the target detection model according to embodiments of this application;
[0027] Figure 4 This is a schematic diagram of an object detection model update device provided according to an embodiment of this application;
[0028] Figure 5 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws and standards, necessary measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding operation entry points for them to choose to agree to or refuse automated decision results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.
[0032] Example 1
[0033] According to an embodiment of this application, a method embodiment for updating a target detection model is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0034] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1A hardware block diagram of a computer terminal (or mobile device) for implementing an update method for an object detection model is shown. Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1 The processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions may also be included. In addition, it may include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0035] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the target detection model update method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the target detection model update method described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0037] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0038] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0039] Under the aforementioned operating environment, this application provides the following: Figure 2 The updated method for the target detection model is shown. Figure 2 This is a flowchart of the target detection model update method according to Embodiment 1 of this application.
[0040] Step S201: Obtain prompt images, wherein the prompt images include: images in which the object detection model's recognition results are incorrect or have been missed.
[0041] The aforementioned target detection model can be used to identify and locate a specified target in a target image. The model type of the target detection model may include, but is not limited to, the YOLOE (Open Vocabulary Detection and Segmentation) model. The aforementioned prompt image may include images in which the target detection model has incorrect identification results or images that have been missed. In this embodiment, the prompt image may be derived from the evaluation feedback of the target detection model's identification results. Optionally, the prompt image may be an image collected by monitoring equipment through a tower.
[0042] Step S202: Input the prompt image into the context prompt module to obtain the first prompt feature, wherein the context prompt module is used to extract features from the prompt image.
[0043] The Contextual Cueing Module (VCP) can be used to transform incremental false positive / false negative samples (i.e., cue images) into effective cue information (corresponding to the first cue feature) and guide the model to generate discriminative features. Its structure consists of three parts: a cue image feature extraction module (including a lightweight convolutional neural network), a learnable cue vector generation module (vector generation module), and a feature fusion module.
[0044] Step S203: Perform feature enhancement on the first prompt feature to obtain the target prompt feature.
[0045] To avoid excessive computational overhead from contextual cue features, a combination of depthwise separable convolution and channel attention mechanisms can be used to optimize the contextual cue features F. vcp (i.e., the first cue feature) is enhanced using lightweight methods. Depthwise separable convolutions can significantly reduce the number of parameters and computational cost, while channel attention mechanisms can strengthen key feature channels. The two work together to ensure that while improving feature discriminativeness, the real-time inference capability of the object detection model is preserved.
[0046] Step S204: The target cue features and cross-scale features are fused to obtain the fused features, wherein the cross-scale features include the features output by the backbone network of the target detection model.
[0047] The model type of the object detection model can include YOLOE. The aforementioned cross-scale features can include features output by the backbone network of the object detection model. In this embodiment, to address the cross-scale modal feature misalignment problem, the cross-scale features output by the backbone network of the object detection model (e.g., the YOLOE backbone network) (e.g., feature pyramid levels P3, P4, and P5, each with 256 channels) can be aligned to obtain aligned cross-scale features. Then, the object cue features and the aligned cross-scale features can be fused to obtain fused features.
[0048] Step S205: Based on the fused features, update the parameters of the classification branch within the detection head and the parameters of the context hint module in the object detection model online.
[0049] The parameters of the classification branch within the detection head of the object detection model, for example, the parameters of the classification branch of the YOLOE detection head.
[0050] In one alternative example, to avoid catastrophic forgetting caused by a full parameter update, parameters can be fine-tuned only for the classification branch of the YOLOE detector and the learnable cue vector (referred to as the target cue vector) of the context cue module. The loss function can employ a weighted summation strategy, with classification loss (cross-entropy loss) and cue feature alignment loss (mean squared error, MSE) as the core.
[0051] It should be noted that, in this embodiment, online learning enables the object detection model to learn the text semantics corresponding to these visual scenes with only a few samples; while conventional model training in related technologies requires a sufficient number of samples to learn the corresponding recognition capabilities. In this embodiment, the prompt image used in the online learning process can be a single image, or a number of images less than a preset number. That is, the number of prompt images used in online learning can be less than the number of images used in model training in related technologies.
[0052] Through the above steps, in this embodiment, the context suggestion module extracts suggestion features from incorrectly identified or missed suggestion images, and performs online incremental updates to the local parameters of the object detection model and the context suggestion module based on these features. This avoids the need for offline retraining of the object detection model in related technologies, achieving the goal of solving inaccurate object detection model recognition without retraining, and thus improving the recognition accuracy of the object detection model. Furthermore, it solves the technical problem of poor performance when optimizing object detection models by retraining them in related technologies.
[0053] Optionally, in the object detection model update method provided in this application embodiment, the context prompt module includes: a feature extraction module, a vector generation module, and a feature fusion module. The feature extraction module includes: a lightweight convolutional neural network. The prompt image is input into the context prompt module to obtain the first prompt feature, including: inputting the prompt image into the lightweight convolutional neural network for feature extraction to obtain the initial prompt feature; calling the vector generation module to initialize a set of vectors that can participate in model training to obtain the target prompt vector; and using the feature fusion module to fuse the initial prompt feature and the target prompt vector based on the attention weighting mechanism to obtain the first prompt feature.
[0054] The Visual Contextual Cueing (VCP) module (corresponding to the contextual cueing module) can transform incremental false positive / false negative samples (i.e. cue images) into effective cue information, guiding the model to generate discriminative features. Its structure consists of three parts: a cue image feature extraction module (corresponding to the feature extraction module), a learnable cue vector generation module (corresponding to the vector generation module), and a feature fusion module.
[0055] In one alternative example, the cue image feature extraction module can first use a lightweight CNN (such as MobileNetV3) to extract features from incremental false positive samples, obtaining a fine-grained visual feature map Fp (corresponding to the initial cue features), with dimensions H×W×C (H, W, and C represent the height, width, and number of channels of the feature map, respectively). To adapt to the feature scale output by the backbone network of the object detection model (e.g., YOLOE), Fp can be upsampled or downsampled to ensure that the two scales are completely consistent, laying the foundation for subsequent feature fusion.
[0056] Secondly, the learnable cue vector generation module can initialize a set of trainable vectors P (corresponding to the target cue vector) with dimensions of 1×1×C. Through the backpropagation mechanism during model training, the vector parameters are dynamically adjusted to accurately adapt to the feature distribution patterns of different target categories. This learnable cue vector can effectively compensate for the limitations of features in a single cue image, further enhancing the generalization ability and scene adaptability of the cue information.
[0057] Finally, the feature fusion module can employ an attention weighting mechanism, calculating the attention weight α between the visual feature Fp and the learnable cue vector P using an activation function (Sigmoid function), and then adaptively fusing the two based on this weight to generate contextual cue features. (Corresponding to the first prompt feature), the specific fusion logic is as follows:
[0058]
[0059] Where α is the attention weight coefficient, used to adaptively balance the contribution ratio of visual features and learnable cues; Fp is the fine-grained visual feature map of the cue image; and P is the learnable cue vector. It is obtained by superimposing two parts: the first part is the product of α and Fp, and the second part is the product of (1-α) and the result of the broadcast operation; where the broadcast operation is used to expand the one-dimensional learnable cue vector P to the dimension of H×W×C (consistent with the scale of Fp), and α can adaptively balance the contribution ratio of visual features and learnable cues.
[0060] Optionally, in the object detection model update method provided in this application embodiment, during the process of updating the parameters of the classification branch in the detection head and the parameters of the context prompt module in the object detection model online based on the fused features, the method further includes: storing the object prompt features and the classification labels of the prompt images into a memory pool, wherein the data in the memory pool includes: the prompt features output by the context prompt module and the classification labels associated with the prompt features, and the data update strategy in the memory pool includes: a first-in-first-out strategy.
[0061] The memory pool is used to store the key features (i.e., target feature) and corresponding category label y of incremental false positive suggestions. A first-in, first-out (FIFO) strategy can be used to dynamically update the memory pool to avoid overload. The memory pool capacity can be set to a fixed value K. When the number of newly added suggestion samples exceeds K, the oldest stored sample features can be automatically deleted, ensuring that the latest and most critical supervisory information is always provided for parameter updates.
[0062] In one alternative example, the parameters of the classification branch of the detection head and the target cue vector in the object detection model can be incrementally updated online through the Line Incremental Learning (OIL) module. The OIL module can learn the target category of the cue image online without full retraining and includes three parts: dynamic memory pool, local parameter update and forgetting constraint (corresponding to the target constraint mechanism).
[0063] Optionally, in the object detection model update method provided in this application embodiment, feature enhancement is performed on the first prompt feature to obtain the target prompt feature, including: inputting the first prompt feature into a depthwise separable convolutional unit to obtain a second prompt feature, wherein the depthwise separable convolutional unit includes: depthwise convolution and pointwise convolution; inputting the second prompt feature into a lightweight channel attention unit to obtain a third prompt feature, wherein the lightweight channel attention unit is used to enhance the features of a specified channel; and processing the third prompt feature using a batch normalization layer and an activation function to obtain the target prompt feature.
[0064] In this embodiment, the first cue feature can be enhanced using a Lightweight Cue Enhancement (LPE) module to obtain the target cue feature. To avoid introducing excessive computational overhead into the cue feature, the LPE module can employ a combination of depthwise separable convolution and channel attention mechanisms to enhance the contextual cue feature. (Corresponding to the first cue feature) Lightweight enhancements are performed. Depthwise separable convolutions can significantly reduce the number of parameters and computational cost, while channel attention mechanisms can strengthen key feature channels. The two work together to ensure that while improving feature discriminativeness, the model's real-time inference capability is preserved. Details are as follows:
[0065] 1. Core structure of the LPE module: The input is the contextual cue features (256 channels, scale consistent with YOLOE neck features) generated by the upper and lower cue feature module (VCP module), and the output is the enhanced cue features (corresponding to the target cue features). The LPE module as a whole consists of depthwise separable convolutional units, lightweight channel attention units, batch normalization and activation functions, which can be performed without additional dimensional expansion operations, ensuring computational efficiency.
[0066] 2. Key operational details: ① Depthwise separable convolutional unit: It can be divided into two steps: depthwise convolution and pointwise convolution. The depthwise convolution uses a 3×3 convolution kernel (the number of groups = the number of input channels, and only performs spatial convolution on single-channel features), and the pointwise convolution uses a 1×1 convolution kernel (no grouping, achieving channel dimension fusion). Compared with the traditional 3×3 convolution, the number of parameters is reduced to (1 / 9) + (1 / 256) ≈ 11.5% of the original; ② Lightweight channel attention unit: Simplifies SE (Squeeze-and-Excitatio) n, Compression and Activation) Attention Structure: Remove fully connected layers, compress features into 1×1×C vectors through global average pooling, then perform 1×1 convolution (channel compression ratio 8:1), ReLU activation, and reverse 1×1 convolution to restore the number of channels, generating channel attention weights to focus on strengthening key feature channels related to object detection; ③ Regularization and Activation: Add batch normalization (BN) layers after depthwise convolution and pointwise convolution to suppress overfitting. The activation function can be ReLU6 (adapted to lightweight networks, improving numerical stability).
[0067] 3. Forward Process: The contextual cue features are first input into a depthwise separable convolutional unit, which reduces parameters while retaining fine-grained features to obtain the second cue feature; then, the key channel features are enhanced by a lightweight channel attention unit to suppress redundant information, resulting in the third cue feature; finally, the enhanced features (corresponding to the target cue feature) are output through a BN layer and a ReLU6 activation function.
[0068] Finally, the target cue features can be superimposed with the cross-modal fusion features (corresponding to cross-modal features) output by the Dynamic Cross-Modal Attention Fusion (DCMAF) module, and participate in the online learning and detection head inference of the subsequent Online Incremental Learning (OIL) module to update the classification branch of the detection head of the target detection model and the cue vector of the context cue module.
[0069] Optionally, in the target detection model update method provided in this application embodiment, the target cue features and cross-scale features are fused to obtain fused features, including: aligning the cross-scale features to obtain aligned cross-scale features; and using a weighted summation strategy to fuse the target cue features and aligned cross-scale features to obtain fused features.
[0070] In this embodiment, "pyramid scale alignment + deformable convolution fine-tuning + bidirectional attention enhancement" can be used to align cross-scale features, resulting in aligned cross-scale features. Then, weights can be dynamically assigned to the target cue features and the aligned cross-scale features based on an attention mechanism. For multimodal feature weights (i.e., the weights of the target cue features and the aligned cross-scale features), the global attention score of each modality feature can be calculated first to evaluate its contribution, and then normalized using the Softmax (normalized exponential function) function to obtain the fusion weights of each modality feature. The final calculation logic is as follows:
[0071]
[0072] In this embodiment, a weighted summation method can be used to generate dynamic cross-modal fusion features. (corresponding to the fused features), where n represents the total number of modes, F i β represents the feature of the i-th mode. i β represents the dynamic fusion weight corresponding to the i-th modality. i The global attention scores of each modality feature are normalized by the Softmax function, which can reflect the contribution of different modalities to the current detection task in real time, thereby achieving adaptive and accurate fusion of multimodal features.
[0073] In one alternative example, the step of fusing the target cue features and the aligned cross-scale features can be performed through the Dynamic Cross-Modal Attention Fusion (DCMAF) module to obtain the fused features, thereby addressing the problem of fixed weights in the original YOLOE cross-modal fusion in related technologies.
[0074] Optionally, in the object detection model update method provided in this application embodiment, the cross-scale features are aligned to obtain aligned cross-scale features, including: multi-scale sampling of the cross-scale features to obtain sampled features; spatial location calibration of the sampled features using deformable convolution to obtain calibrated features; and cross-scale semantic association of the calibrated features using a bidirectional attention mechanism to obtain aligned cross-scale features.
[0075] To address the issue of cross-scale modal feature misalignment, this embodiment employs a combination of "pyramid scale alignment + deformable convolution fine-tuning + bidirectional attention enhancement" to align cross-scale features. This approach balances spatial alignment accuracy with semantic consistency while maintaining a lightweight structure that avoids excessive computational overhead. For instance, the input cross-scale features are first preprocessed with multi-scale sampling and alignment. Then, deformable convolution fine-tunes the spatial position of the features to eliminate modal misalignment. Subsequently, bidirectional attention flow enhances the cross-scale semantic association, resulting in aligned cross-scale features. Finally, the calibrated features at each scale are concatenated and fused into a unified channel feature using a 1×1 convolution, which is then output to the DCMAF module for cross-modal weight allocation.
[0076] In this embodiment, cross-scale features can be aligned using the Cross-Scale Modality Alignment (CSMA) module.
[0077] Optionally, the CSMA module can adopt a three-layer design of "pyramid-scale alignment + deformable convolution fine-tuning + bidirectional attention enhancement", which balances spatial alignment accuracy and semantic consistency, while maintaining a lightweight structure without introducing excessive computational overhead. The specific design is as follows:
[0078] 1. Core Structure of the CSMA Module: The module is divided into three sub-modules: multi-scale feature sampling, deformable convolutional position calibration, and bidirectional cross-scale attention. The input is the cross-scale features output from the object detection model backbone network (e.g., the YOLOE backbone network) (corresponding to feature pyramid levels P3, P4, and P5, with each level having 256 channels). The output is aligned cross-scale multimodal features (i.e., aligned cross-scale features), with the scale consistent with the input, which can be directly input into the DCMAF module.
[0079] 2. Key operational details include: ① Multi-scale feature sampling: For each input cross-scale feature, it is downsampled to adjacent scales (e.g., P5 downsampled to P4 scale, P3 upsampled to P4 scale), and bilinear interpolation is used to ensure feature smoothness, constructing cross-scale feature pairs (corresponding to the sampled features); ② Deformable convolution position calibration: Grouped deformable convolution (3×3 kernel, number of groups = number of input channels, no bias) is used to fine-tune the spatial position of the sampled feature pairs, adaptively correcting the spatial misalignment of modal features at different scales, and the convolution offset is dynamically learned through backpropagation; ③ Bidirectional cross-scale attention: Includes uplink and downlink attention streams. The uplink attention stream can be guided by high-level semantic features (P5) and passed step by step to mid-level transition features (P4) and low-level detail features (P3). The downlink attention stream can feed back low-level detail features (P3) step by step to mid-level transition features (P4) and high-level semantic features (P5). The attention weights are generated by global average pooling + 1×1 convolution (channel compression ratio 4:1) to strengthen the semantic association of cross-scale modal features.
[0080] Optionally, in the object detection model update method provided in this application embodiment, during the process of updating the parameters of the classification branch within the detection head and the parameters of the context cue module in the object detection model online based on the fused features, the method further includes: updating the parameters of the classification branch within the detection head and the target cue vector in the object detection model online based on the fused features and the target loss function; and during the update process of the parameters of the classification branch within the detection head and the target cue vector, a target constraint mechanism is used to constrain the parameter update magnitude, wherein the target constraint mechanism includes: a regularization strategy, and the target loss function includes: a loss function determined based on the cross-entropy loss function and the mean squared error loss function.
[0081] In this embodiment, to avoid catastrophic forgetting caused by a full parameter update, the parameters can be fine-tuned only for the classification branch of the target detection model (e.g., YOLOE) detection head and the learnable cue vector (i.e., the target cue vector) of the context cue (VCP) module.
[0082] The target loss function described above can be designed using a weighted summation, with classification loss (cross-entropy loss) and cue feature alignment loss (mean squared error, MSE) as the core. The calculation formula is as follows:
[0083]
[0084] in, This is the base loss for the online incremental learning module; , Loss weighting coefficient (can be set) =1.0、 =0.5), used to adjust the contribution ratio of the two losses; The classification loss is calculated using the cross-entropy loss function, which is used to constrain the accuracy of the classification results; To compensate for the feature alignment loss, mean squared error (MSE) loss is used. Its purpose is to constrain the consistency of the distribution of contextual cue features and intermediate features in the detection head, thereby improving feature fit. Parameter updates employ a stochastic gradient descent (SGD) optimizer, with the learning rate set to 1 / 10 of the original training learning rate. Only local parameters are updated to ensure that inference speed is not significantly affected.
[0085] The aforementioned objective constraint mechanism may include a parameter regularization term (corresponding to a regularization strategy). To mitigate catastrophic forgetting during online learning, a parameter regularization term is introduced. The constraint on the local parameter update magnitude, preventing parameters from deviating from the original optimal space, is calculated using the following formula:
[0086]
[0087] in, For parameter regularization terms; This represents the set of all local parameters to be updated. Parameters in Perform summation; These are the local parameters to be updated; These are the original parameters after the model has been initially trained; for and The square of the second-order norm (L2 norm) is used to measure the magnitude of parameter updates. The final total loss of the online incremental learning module employs a three-term superposition design, namely... ( In this embodiment, the regularization weight coefficient can be set to... ), used to control the strength of regularization.
[0088] Figure 3 This is a flowchart illustrating the updating of the target detection model according to the embodiments of this application, such as... Figure 3As shown, the main processing logic includes: (1) a dual-input channel design, which receives conventional multimodal raw data (images / infrared, etc.) for basic detection, and inputs incremental false positive / false negative samples as prompt images into the Visual Context Cueing (VCP) module to achieve efficient reuse of false positive samples; (2) a feature processing link, after the multimodal raw data is processed by the YOLOE backbone network to extract features, the cross-scale modal alignment (CSMA) module corrects the cross-scale modal misalignment problem, and then the dynamic cross-modal attention fusion (DCMAF) module dynamically allocates modal weights to complete the fusion. At the same time, the prompt features generated by the VCP module are processed by the L After the PE is lightweight and enhanced, it is further integrated with the fusion features to strengthen the discriminativeness; (3) Online learning and closed-loop feedback: the integrated features are input into the online incremental learning (OIL) module, which relies on the dynamic memory pool to store key prompt information. Incremental learning is achieved through local parameter fine-tuning and forgetting constraints, without the need for full retraining. Finally, the detection head outputs the results, and the newly generated false detection samples will be fed back to the VCP module to form a continuously adaptable closed-loop learning mechanism. Among them, the OIL module aims to achieve online learning of the target category of the prompt image without the need for full retraining. The core includes three parts: dynamic memory pool, local parameter update and forgetting constraints.
[0089] By designing a visual contextual cue module, the object detection model can receive incremental false positives or missed positives as visual cues. This avoids the situation in related technologies where object detection algorithms can only perform inference on input images after training. This embodiment can learn from local incremental false positives or missed positives online, effectively improving the efficiency and accuracy of algorithm development.
[0090] By designing an online incremental learning module, we can learn the target category of prompt images online without retraining the entire dataset. This solves the problems of slow model training iteration and optimization, as well as untimely response to local customer needs. It improves the accuracy and R&D efficiency of multimodal target detection algorithms, thereby enhancing the competitiveness of VisionLink products and driving business development.
[0091] To improve the performance of multimodal object detection algorithms, a series of auxiliary optimization modules can be included, specifically: (1) Dynamic cross-modal attention fusion (DCMAF) module; (2) Cross-scale modal alignment (CSMA) module; and (3) Lightweight cue enhancement (LPE) module.
[0092] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0093] Example 2
[0094] This application also provides an apparatus for updating a target detection model. It should be noted that this apparatus can be used to execute the target detection model updating method provided in this application. The following describes the apparatus for updating a target detection model provided in this application.
[0095] According to embodiments of this application, an apparatus for implementing the above-described target detection model update method is also provided, such as... Figure 4 As shown, the device includes: an acquisition unit 41, a processing unit 42, an enhancement unit 43, a fusion unit 44, and an update unit 45.
[0096] The acquisition unit 41 is used to acquire prompt images, which include images where the object detection model's recognition results are incorrect or have been missed.
[0097] Processing unit 42 is used to input the prompt image into the context prompt module to obtain the first prompt feature, wherein the context prompt module is used to extract features from the prompt image;
[0098] Enhancement unit 43 is used to enhance the first prompt feature to obtain the target prompt feature;
[0099] Fusion unit 44 is used to fuse target cue features and cross-scale features to obtain fused features, wherein the cross-scale features include features output by the backbone network of the target detection model;
[0100] The update unit 45 is used to update the parameters of the classification branch in the detection head and the parameters of the context hint module in the object detection model online based on the fused features.
[0101] In the target detection model update device provided in this application embodiment, a prompt image can be obtained by the acquisition unit 41. The prompt image includes an image in which the target detection model has incorrect or missed recognition results. The prompt image is input into the context prompt module by the processing unit 42 to obtain a first prompt feature. The context prompt module is used to extract features from the prompt image. The first prompt feature is enhanced by the enhancement unit 43 to obtain target prompt features. The target prompt features and cross-scale features are fused by the fusion unit 44 to obtain fused features. The cross-scale features include features output by the backbone network of the target detection model. The update unit 45 updates the parameters of the classification branch in the detection head of the target detection model and the parameters of the context prompt module online based on the fused features. This solves the technical problem in related technologies where the target detection model is optimized by retraining, resulting in poor performance. In this embodiment, the context prompting module extracts prompt features from the prompt images that are incorrectly or missed, and updates the local parameters of the target detection model and the context prompting module online based on the prompt features. This avoids the need for retraining the target detection model offline in related technologies, and achieves the goal of solving the inaccuracy of the target detection model without retraining offline, thus improving the technical effect of improving the recognition accuracy of the target detection model.
[0102] Optionally, in the object detection model update device provided in this application embodiment, the context prompting module includes: a feature extraction module, a vector generation module, and a feature fusion module. The feature extraction module includes: a lightweight convolutional neural network. The processing unit includes: an extraction subunit, used to input the prompt image into the lightweight convolutional neural network for feature extraction to obtain initial prompt features; a calling subunit, used to call the vector generation module to initialize a set of vectors that can participate in model training to obtain a target prompt vector; and a first fusion subunit, used to fuse the initial prompt features and the target prompt vector using the feature fusion module based on an attention weighting mechanism to obtain a first prompt feature.
[0103] Optionally, in the target detection model update device provided in this application embodiment, the update unit further includes: a storage subunit, used to store the target prompt features and the classification labels of the prompt images into a memory pool during the online update of the parameters of the classification branch in the detection head and the parameters of the context prompt module in the target detection model based on the fused features. The data in the memory pool includes: the prompt features output by the context prompt module and the classification labels associated with the prompt features. The data update strategy in the memory pool includes: a first-in-first-out strategy.
[0104] Optionally, in the target detection model update apparatus provided in this application embodiment, the enhancement unit includes: a first input subunit, used to input a first cue feature into a depthwise separable convolution unit to obtain a second cue feature, wherein the depthwise separable convolution unit includes: depthwise convolution and pointwise convolution; a second input subunit, used to input the second cue feature into a lightweight channel attention unit to obtain a third cue feature, wherein the lightweight channel attention unit is used to enhance a specified channel feature; and a processing subunit, used to process the third cue feature using a batch normalization layer and an activation function to obtain a target cue feature.
[0105] Optionally, in the target detection model update device provided in the embodiments of this application, the fusion unit includes: an alignment subunit, used to align the cross-scale features to obtain aligned cross-scale features; and a second fusion subunit, used to fuse the target cue features and the aligned cross-scale features using a weighted summation strategy to obtain fused features.
[0106] Optionally, in the target detection model update device provided in this application embodiment, the alignment subunit includes: a sampling module, used to perform multi-scale sampling on cross-scale features to obtain sampled features; a calibration module, used to perform spatial position calibration on the sampled features using deformable convolution to obtain calibrated features; and an association module, used to perform cross-scale semantic association on the calibrated features using a bidirectional attention mechanism to obtain aligned cross-scale features.
[0107] Optionally, in the object detection model update device provided in this application embodiment, the update unit includes: an update subunit, used to update the parameters of the classification branch within the detection head and the parameters of the context cue module in the object detection model online based on the fused features during the online update process of the parameters of the classification branch within the detection head and the parameters of the context cue module in the object detection model, based on the fused features and the target loss function, and to constrain the parameter update magnitude by adopting a target constraint mechanism during the update process of the parameters of the classification branch within the detection head and the target cue vector, wherein the target constraint mechanism includes: a regularization strategy, and the target loss function includes: a loss function determined based on the cross-entropy loss function and the mean squared error loss function.
[0108] It should be noted that the aforementioned determination module acquisition unit 41, processing unit 42, enhancement unit 43, fusion unit 44, and update unit 45 correspond to steps S201 to S205 in Embodiment 1. Each unit and its corresponding step implements the same instance and application scenario, but is not limited to the content disclosed in Embodiment 1. It should also be noted that the aforementioned modules or units can be hardware or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). These modules can also run as part of a device in the computer terminal 10 provided in Embodiment 1.
[0109] Example 3
[0110] Embodiments of this application may provide an electronic device. Figure 5 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 (Only one is shown) processor 502, memory 504, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0111] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0112] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: acquiring a prompt image, wherein the prompt image includes an image in which the object detection model has incorrect or missed recognition results; inputting the prompt image into a context prompt module to obtain a first prompt feature, wherein the context prompt module is used to extract features from the prompt image; performing feature enhancement on the first prompt feature to obtain a target prompt feature; fusing the target prompt feature and cross-scale features to obtain a fused feature, wherein the cross-scale features include features output by the backbone network of the object detection model; and updating online the parameters of the classification branch within the detection head of the object detection model and the parameters of the context prompt module based on the fused features.
[0113] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: The context prompting module includes a feature extraction module, a vector generation module, and a feature fusion module. The feature extraction module includes a lightweight convolutional neural network. The prompt image is input into the context prompting module to obtain the first prompt feature, including: inputting the prompt image into the lightweight convolutional neural network for feature extraction to obtain the initial prompt feature; calling the vector generation module to initialize a set of vectors that can participate in model training to obtain the target prompt vector; and using the feature fusion module to fuse the initial prompt feature and the target prompt vector based on an attention weighting mechanism to obtain the first prompt feature.
[0114] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: enhancing the first cue feature to obtain the target cue feature, including: inputting the first cue feature into a depthwise separable convolutional unit to obtain a second cue feature, wherein the depthwise separable convolutional unit includes depthwise convolution and pointwise convolution; inputting the second cue feature into a lightweight channel attention unit to obtain a third cue feature, wherein the lightweight channel attention unit is used to enhance the features of a specified channel; and processing the third cue feature using a batch normalization layer and an activation function to obtain the target cue feature.
[0115] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: fusing the target cue features and cross-scale features to obtain fused features, including: aligning the cross-scale features to obtain aligned cross-scale features; and using a weighted summation strategy to fuse the target cue features and aligned cross-scale features to obtain fused features.
[0116] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: aligning the cross-scale features to obtain aligned cross-scale features, including: multi-scale sampling of the cross-scale features to obtain sampled features; spatially calibrating the sampled features using deformable convolution to obtain calibrated features; and performing cross-scale semantic association on the calibrated features using a bidirectional attention mechanism to obtain aligned cross-scale features.
[0117] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: In the process of updating the parameters of the classification branch within the detection head and the parameters of the context cue module in the object detection model online based on the fused features, the method further includes: updating the parameters of the classification branch within the detection head and the target cue vector online based on the fused features and the target loss function, and in the process of updating the parameters of the classification branch within the detection head, a target constraint mechanism is used to constrain the parameter update magnitude of the classification branch within the detection head, wherein the target constraint mechanism includes: a regularization strategy, and the target loss function includes: a loss function determined based on the cross-entropy loss function and the mean squared error loss function.
[0118] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: In the process of updating the parameters of the classification branch in the detection head and the parameters of the context prompting module in the target detection model based on the fused features, the method further includes: storing the target prompting features and the classification labels of the prompting images into a memory pool, wherein the data in the memory pool includes: the prompting features output by the context prompting module and the classification labels associated with the prompting features, and the data update strategy in the memory pool includes: a first-in-first-out strategy.
[0119] By employing the embodiments of this application, the contextual prompting module extracts prompt features from prompt images that are incorrectly or missed in recognition, and updates the local parameters of the object detection model and the contextual prompting module online based on the prompt features. This avoids the need for retraining the object detection model offline in related technologies, achieving the goal of solving the inaccuracy of object detection model recognition without retraining offline, and realizing the technical effect of improving the recognition accuracy of the object detection model.
[0120] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 5 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 5 The different configurations shown.
[0121] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0122] Example 4
[0123] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the target detection model update method provided in Embodiment 1.
[0124] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0125] This application also provides a computer program product, which, when executed on a data processing device, is adapted to perform the steps of an update method for a target detection model.
[0126] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0127] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0132] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for updating a target detection model, characterized in that, include: Obtain a prompt image, wherein the prompt image includes: an image in which the object detection model has incorrect or missed recognition results; The prompt image is input into the context prompt module to obtain the first prompt feature, wherein the context prompt module is used to extract features from the prompt image; The first prompt feature is enhanced to obtain the target prompt feature; The target cue features and cross-scale features are fused to obtain fused features, wherein the cross-scale features include features output by the backbone network of the target detection model, and the input of the target detection model includes a target image that needs to identify and locate a specified target; Based on the fused features, the parameters of the classification branch within the detection head of the target detection model and the parameters of the context prompting module are updated online. The context prompting module includes a feature extraction module, a vector generation module, and a feature fusion module. The feature extraction module includes a lightweight convolutional neural network. The module inputs the prompt image into the context prompting module to obtain a first prompt feature, including: inputting the prompt image into the lightweight convolutional neural network for feature extraction to obtain initial prompt features; calling the vector generation module to initialize a set of vectors that can participate in model training to obtain a target prompt vector; and fusing the initial prompt features and the target prompt vector using the feature fusion module based on an attention weighting mechanism to obtain the first prompt feature.
2. The update method according to claim 1, characterized in that, In the process of updating the parameters of the classification branch within the detection head of the target detection model and the parameters of the context cueing module online based on the fused features, the method further includes: The target prompt features and the classification labels of the prompt images are stored in a memory pool. The data in the memory pool includes: the prompt features obtained by the context prompt module output and feature enhancement, and the classification labels associated with the prompt features. The data update strategy in the memory pool includes: a first-in-first-out strategy.
3. The update method according to claim 1, characterized in that, The first prompt feature is enhanced to obtain the target prompt feature, including: The first prompt feature is input into a depthwise separable convolutional unit to obtain a second prompt feature, wherein the depthwise separable convolutional unit includes: depthwise convolution and pointwise convolution; The second cue feature is input into the lightweight channel attention unit to obtain the third cue feature, wherein the lightweight channel attention unit is used to enhance the specified channel feature; The third cue feature is processed using a batch normalization layer and an activation function to obtain the target cue feature.
4. The update method according to claim 1, characterized in that, The target cue features and cross-scale features are fused to obtain fused features, including: The cross-scale features are aligned to obtain aligned cross-scale features; A weighted summation strategy is used to fuse the target cue features and the aligned cross-scale features to obtain the fused features.
5. The updating method according to claim 4, characterized in that, The cross-scale features are aligned to obtain aligned cross-scale features, including: The cross-scale features are sampled at multiple scales to obtain the sampled features; The sampled features are spatially calibrated using deformable convolution to obtain calibrated features. By using a bidirectional attention mechanism, cross-scale semantic association is performed on the calibrated features to obtain the aligned cross-scale features.
6. The updating method according to claim 1, characterized in that, In the process of updating the parameters of the classification branch within the detection head of the target detection model and the parameters of the context cueing module online based on the fused features, the method further includes: Based on the fused features and target loss function, the parameters of the classification branch within the detection head and the target cue vector in the target detection model are updated online. During the update process, a target constraint mechanism is used to constrain the parameter update magnitude. The target constraint mechanism includes a regularization strategy, and the target loss function includes a loss function determined based on the cross-entropy loss function and the mean squared error loss function.
7. A device for updating a target detection model, characterized in that, include: An acquisition unit is used to acquire a prompt image, wherein the prompt image includes: an image in which the object detection model has incorrect or missed recognition results; A processing unit is configured to input the prompt image into a context prompt module to obtain a first prompt feature, wherein the context prompt module is configured to extract features from the prompt image; An enhancement unit is used to enhance the first prompt feature to obtain the target prompt feature; The fusion unit is used to fuse the target cue features and cross-scale features to obtain fused features, wherein the cross-scale features include features output by the backbone network of the target detection model, and the input of the target detection model includes a target image that needs to identify and locate a specified target. An update unit is used to update the parameters of the classification branch within the detection head of the target detection model and the parameters of the context prompting module online based on the fused features. The contextual prompting module includes a feature extraction module, a vector generation module, and a feature fusion module. The feature extraction module includes a lightweight convolutional neural network. The processing unit includes an extraction subunit, used to input the prompt image into the lightweight convolutional neural network for feature extraction to obtain initial prompt features; a calling subunit, used to call the vector generation module to initialize a set of vectors that can participate in model training to obtain a target prompt vector; and a first fusion subunit, used to fuse the initial prompt features and the target prompt vector using the feature fusion module based on an attention weighting mechanism to obtain the first prompt feature.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the target detection model update method according to any one of claims 1 to 6.
9. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method for updating the target detection model according to any one of claims 1 to 6.
Citation Information
Patent Citations
On-orbit remote sensing image real-time target detection system and method based on YOLO
CN122223405A
Occluded small target detection method and device based on prototype feature enhancement
CN122336284A