Target detection method and device, equipment, product and storage medium

By generating low-quality images and image description texts under a variety of severe weather conditions, combined with the BLIP-2 image and text large model and feature fusion module, the performance degradation of severe weather detection methods in the existing technology under new conditions and the utilization of semantic information are solved. It solves the problem of deficiencies and achieves efficient target detection in various harsh weather environments.

CN118799547APending Publication Date: 2024-10-18CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410282155.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing target detection methods in severe weather scenes are difficult to adapt to a variety of severe weather conditions, resulting in a significant drop in performance under new weather conditions, and fail to fully utilize the semantic information described in image content, limiting the target detection effect.

Method used

A target detection method in the second scene based on multi-modal graphics and text is proposed. By generating low-quality images and corresponding image description texts under various severe weather conditions, the BLIP-2 large graphics and text model is used to fine-tune the model. Combined with the IR-Former and IT-Former feature fusion modules, visual representation and text information are integrated for target detection.

Benefits of technology

It improves the target detection efficiency and model generalization, alleviates the problem of performance degradation under new severe weather conditions, enhances the detection capabilities of a variety of severe weather environments, and saves manpower and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799547A_ABST
    Figure CN118799547A_ABST
Patent Text Reader

Abstract

The invention discloses a target detection method and device, electronic equipment, a product and a storage medium. The method comprises the steps of obtaining a first image data set in a first scene and a first image description text and first image data corresponding to the first image-text data set; performing operation processing on the first image data set and the first image data in a second scene to generate second image data; determining a second image description text based on the first image data set and the first image data; inputting the first image description text and the second image data into an initial image-text large model to obtain a target image-text large model; and performing target detection based on the first image description text, the second image data, the second image description text and the target image-text large model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a target detection method, device, electronic device, product and storage medium. Background Art

[0002] The existing target detection methods for severe weather scenarios have the following main problems:

[0003] 1. Most of the current target detection methods for severe weather scenarios can only handle a single weather condition. When migrating their models to other severe weather conditions, the performance will drop significantly. They need to be used as pre-trained models and fine-tuned or retrained under new severe weather conditions to meet the needs of new weather conditions, which will consume more time and computing resources.

[0004] 2. Existing methods for target detection at the image feature level have achieved certain results. However, since they do not take into account more rich semantic information such as image content description, the model's ability to understand target detection tasks is reduced, limiting the target detection effect in severe weather scenarios. Summary of the invention

[0005] In order to solve the existing technical problems, the embodiments of the present application provide a target detection method, device, electronic device, product and storage medium in a second scenario.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] The present application embodiment provides a target detection method in a second scenario, including:

[0008] Acquire a first image data set under a first scene and a first image description text and first image data corresponding to the first image-text data set;

[0009] performing operation processing on the first image data set and the first image data in a second scenario to generate second image data;

[0010] determining a second image description text based on the first image data set and the first image data;

[0011] Inputting the first image description text and the second image data into an initial image-text macromodel to obtain a target image-text macromodel;

[0012] Target detection is performed based on the first image description text, the second image data, the second image description text and the target image-text large model.

[0013] In the above solution, the first scene represents a scene in non-bad weather; the second scene represents a scene in multiple bad weather; the multiple bad weathers include at least fog, rain, and snow; the operation and processing of the first image data set and the first image data in the second scene to generate the second image data includes:

[0014] The first image data set and the first image data are subjected to fogging, raining or snowing operations to generate second image data.

[0015] In the above solution, the step of performing fogging, raining or snowing operations on the first image data set and the first image data to generate the second image data includes:

[0016] Performing fogging operation on the first image data set and the first image data based on a preset atmospheric light scattering model to generate second image data; or,

[0017] Performing a rain-adding operation on the first image data set and the first image data based on a preset rainy day imaging model to generate second image data; or,

[0018] Based on a preset snow imaging model, a snow adding operation is performed on the first image data set and the first image data to generate second image data.

[0019] In the above solution, the determining of the second image description text based on the first image data set and the first image data includes:

[0020] Inputting the first image data set and the first image data into the initial image-text large model to generate initial image description text;

[0021] The second image description text is constructed based on the initial image description text and an image in at least one preset severe weather scenario.

[0022] In the above solution, the target detection based on the first image description text, the second image data, the second image description text and the target image and text large model includes:

[0023] Inputting the second image data into the target graphic model to generate third image data with visual representation;

[0024] Inputting the second image data and the third image data into a preset image and representation IR-Former model to obtain fused fourth image data having image and representation multimodal features;

[0025] Inputting the second image data, the first image description text and the second image description text into a preset image and text IT-Former model to obtain fused fifth image data having multimodal features of image and text;

[0026] The second image data, the fourth image data and the fifth image data are input into a preset target detection model for target detection.

[0027] In the above solution, the step of inputting the second image data into the target graphic model to generate third image data with visual representation includes:

[0028] Extracting features of the second image data through an image encoder in the target image-text model to obtain target features corresponding to the second image data;

[0029] Inputting the target feature and the first image description text into the multimodal model Q-Former in the target image-text large model for training to obtain a trained Q-Former; the weights in the trained Q-Former are determined based on the weights in the initial image-text large model;

[0030] A third image data having a visual representation is generated based on the trained Q-Former.

[0031] In the above scheme, the Q-Former includes a forward network, a cross attention network and a self-attention network; the multimodal model Q-Former inputting the target feature and the first image description text into the target image-text large model for training to obtain a trained Q-Former includes:

[0032] The target feature and the first image description text are subjected to information interaction training through the forward network, the cross attention network and the self-attention network to obtain a trained Q-Former.

[0033] The embodiment of the present application further provides an object detection device in a second scenario, including:

[0034] An acquisition unit, used to acquire a first image data set in a first scene and a first image description text and first image data corresponding to the first image-text data set;

[0035] a processing unit, configured to perform an operation on the first image data set and the first image data in a second scenario to generate second image data;

[0036] a determining unit, configured to determine a second image description text based on the first image data set and the first image data;

[0037] An input unit, used for inputting the first image description text and the second image data into an initial image-text macromodel to obtain a target image-text macromodel;

[0038] A detection unit is used to perform target detection based on the first image description text, the second image data, the second image description text and the target image and text large model.

[0039] The present application also provides an electronic device, including:

[0040] A memory for storing executable instructions;

[0041] The processor is used to implement any step of the above-mentioned method when executing the executable instructions stored in the memory.

[0042] An embodiment of the present application also provides a computer program product, which implements any step of the above-mentioned method when executed by a processor.

[0043] An embodiment of the present application also provides a computer-readable storage medium storing executable instructions for implementing any step of the above-described method when executed by a processor.

[0044] The embodiments of the present application provide a method, device, electronic device, product and storage medium for target detection in a second scenario, wherein the method comprises: obtaining a first image data set in a first scenario and a first image description text and first image data corresponding to the first image data set; operating and processing the first image data set and the first image data in a second scenario to generate second image data; determining a second image description text based on the first image data set and the first image data; inputting the first image description text and the second image data into an initial image-text large model to obtain a target image-text large model; performing target detection based on the first image description text, the second image data, the second image description text and the target image-text large model. The solution of the embodiments of the present application generates second image data by operating and processing the first image data set and the corresponding first image data in the first scenario in a second scenario; determining a second image description text based on the first image data set and the first image data; inputting the first image description text and the second image data into the initial image-text large model to obtain a target image-text large model; performing target detection based on the first image description text, the second image data, the second image description text and the target image-text large model. That is, by batch generating low-quality images and corresponding image description texts under various severe weather conditions, the scale and diversity of the data are greatly enriched, manpower and time costs are saved, and target detection in images under severe weather conditions is realized, which alleviates the problem that the performance of traditional target detection methods under single weather conditions is greatly reduced in new weather scenarios, and improves the generalization of the model and the efficiency of target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic diagram of a target detection method flow in a second scenario is provided for an embodiment of the present application;

[0046] Figure 2 This is a flow chart of the target detection method in the second scenario based on image-text multimodality in this application;

[0047] Figure 3 A schematic diagram of the overall structure of the BLIP-2-w model according to an embodiment of the present application;

[0048] Figure 4 A schematic diagram of the Q-Former structure in the BLIP-2-w model of an embodiment of the present application;

[0049] Figure 5 It is a schematic diagram of the structure of the IR-Former model and the IT-Former model in the embodiment of the present application;

[0050] Figure 6 This is a schematic diagram of a target detection device in a second scenario according to an embodiment of the present application;

[0051] Figure 7 A schematic diagram of a hardware entity structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0052] Most of the existing target detection methods for severe weather scenes are limited to a single weather scene, such as performing target detection only in a single haze weather scene. There are few target detection methods that can handle multiple severe weather scenes. In particular, it is more difficult for target detection methods to adapt to multiple severe weather scenes than to a single weather scene. For target detection methods for a single severe weather scene, the method of first enhancing the process and then performing target detection or domain adaptive detection is often used. The first method of first enhancing the process and then performing target detection is to first restore the severe weather image using a traditional image enhancement method or a method based on a deep learning model, that is, to perform image defogging, image deraining, image desnowing, etc., and then perform target detection on the image after preliminary restoration. The second domain adaptive detection method uses images in clear non-severe weather scenes as the source domain and images in severe weather scenes as the target domain, and uses methods such as gradient reversal layers in the model to maintain the domain invariance of the target detection network, and migrate the relatively excellent target detection capabilities of the source domain to the target domain, narrowing the difference between the two domains, thereby improving the detection effect of the target domain.

[0053] In addition, most of the existing target detection methods for severe weather scenes only perform detection processing at the image feature level, that is, only feature extraction is performed on the input image of the severe weather scene for target detection.

[0054] The existing target detection methods for severe weather scenarios have the following main problems:

[0055] 1. Most of the current target detection methods for severe weather scenarios can only handle a single weather condition. When migrating their models to other severe weather conditions, the performance will drop significantly. They need to be used as pre-trained models and fine-tuned or retrained under new severe weather conditions to meet the needs of new weather conditions, which will consume more time and computing resources.

[0056] 2. Existing methods for target detection at the image feature level have achieved certain results. However, since they do not take into account more rich semantic information such as image content description, the model's ability to understand target detection tasks is reduced, limiting the target detection effect in severe weather scenarios.

[0057] Based on this, the embodiment of the present application provides a target detection method in the second scenario, which is applied to an electronic device. The function implemented by the method can be implemented by calling a program code by a processor in the electronic device. Of course, the program code can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium. As an example, the electronic device can be a mobile phone, a computer, a terminal, an information transceiver device, a tablet device, a personal digital assistant, etc.

[0058] Figure 1 A schematic diagram of a target detection method flow in a second scenario is provided for an embodiment of the present application; Figure 1 As shown, the method includes:

[0059] Step 101: Acquire a first image data set in a first scene and a first image description text and first image data corresponding to a first image-text data set;

[0060] Step 102: performing operation processing on the first image data set and the first image data in a second scenario to generate second image data;

[0061] Step 103: determining a second image description text based on the first image data set and the first image data;

[0062] Step 104: inputting the first image description text and the second image data into an initial image-text macro model to obtain a target image-text macro model;

[0063] Step 105: Perform target detection based on the first image description text, the second image data, the second image description text and the target image-text large model.

[0064] It should be noted that the second scene can be determined according to actual conditions and is not limited here. As an example, the second scene represents a variety of scenes under severe weather; the second scene can also be referred to as a variety of severe weather scenes. The target detection method in the second scene can be determined according to actual conditions and is not limited here. As an example, the target detection method in the second scene can be a target detection method in a variety of severe weather scenes based on graphic multimodality.

[0065] The specific acquisition process of obtaining the first image data set in the first scene in step 101 can be determined according to actual conditions and is not limited here. As an example, the first image data set can be collected on the Internet; wherein the first image data set can be understood as a large number of clear and non-low-quality images; in actual applications, the first image data set can be clear image data collected from the network. A large number of clear and non-low-quality images collected on the Internet do not have corresponding image description texts. The first scene can be determined according to actual conditions and is not limited here. As an example, the first scene represents a scene in non-bad weather; the first scene can also be referred to as a non-bad weather scene.

[0066] The specific acquisition process of obtaining the first image and text data set in the first scenario can be determined according to the actual situation and is not limited here. As an example, the first image and text data set in the first scenario can be obtained through a public image and text data set. Among them, the public image and text data set can be a target data set (Microsoft Common Objects inContext, COCO), a picture semantic understanding data set (Visual Genome, VG), a image and text data set (SBU Captions, SBU), etc. In practical applications, the first image and text data set can be understood as a public image and text data set.

[0067] The first image description text may be determined according to actual conditions and is not limited here. As an example, the first image description text may be the original image description text, which may be denoted as t o In practical applications, the public image and text dataset already has clear images without severe weather conditions and the corresponding original image description text t o .

[0068] The first image data may be determined according to actual conditions and is not limited here. As an example, the first image data may be public clear image data.

[0069] In step 102, the second scene may be determined according to actual conditions, which is not limited here. As an example, the multiple types of severe weather may include fog, rain, snow, etc.

[0070] The specific operation process of operating and processing the first image data set and the first image data in the second scenario to generate the second image data can be determined according to actual conditions and is not limited here. As an example, the operation and processing of the first image data set and the first image data in the second scenario to generate the second image data may include adding fog, rain or snow to the first image data set and the first image data to generate the second image data. The second image data can be understood as low-quality image data. In practical applications, operations such as adding fog, rain and snow are performed on the original clear image to generate a low-quality image.

[0071] In step 103, the specific determination process of determining the second image description text based on the first image data set and the first image data can be determined according to actual conditions and is not limited here. As an example, the determination of the second image description text based on the first image data set and the first image data may include inputting the first image data set and the first image data into the initial image-text model to generate an initial image description text; and constructing the second image description text based on the initial image description text and at least one preset image under a severe weather scenario. The second image description text may be understood as a new image description text.

[0072] In step 104, the specific determination process of performing target detection based on the first image description text, the second image data, the second image description text and the target image-text large model can be determined according to actual conditions and is not limited here. As an example, the target detection based on the first image description text, the second image data, the second image description text and the target image-text large model may include inputting the second image data into the target image-text large model to generate third image data with visual representation; inputting the second image data and the third image data into a preset image and representation IR-Former model to obtain a fused fourth image data with image and representation multimodal features; inputting the second image data, the first image description text and the second image description text into a preset image and text IT-Former model to obtain a fused fifth image data with image and text multimodal features; and inputting the second image data, the fourth image data and the fifth image data into a preset target detection model for target detection.

[0073] The solution of the embodiment of the present application generates second image data by operating and processing the first image data set and the corresponding first image data in the first scene in the second scene; determines the second image description text based on the first image data set and the first image data; inputs the first image description text and the second image data into the initial image-text model to obtain the target image-text model; and performs target detection based on the first image description text, the second image data, the second image description text and the target image-text model. That is, by batch-generating low-quality images and corresponding image description texts under a variety of severe weather conditions, the scale and diversity of the data are greatly enriched, manpower and time costs are saved, and target detection of images under severe weather conditions is realized, which alleviates the problem that the performance of traditional single-weather target detection methods is greatly reduced in new weather scenes, and improves the generalization of the model and the efficiency of target detection.

[0074] In one embodiment, the first scene represents a scene in non-bad weather; the second scene represents a scene in multiple bad weather; the multiple bad weathers include at least fog, rain, and snow; the operating and processing the first image data set and the first image data in the second scene to generate the second image data includes:

[0075] The first image data set and the first image data are subjected to fogging, raining or snowing operations to generate second image data.

[0076] In this embodiment, the first scene represents a scene in non-bad weather; the first scene may also be referred to as a non-bad weather scene. The second scene represents scenes in multiple bad weather; the second scene may also be referred to as multiple bad weather scenes.

[0077] The first image data set and the first image data are subjected to fogging, raining or snowing operations to generate the second image data, which can be understood as the three operations of fogging, raining and snowing to generate a low-quality image from a clear non-low-quality image.

[0078] The specific processing process of performing fogging, raining or snowing operations on the first image data set and the first image data to generate the second image data can be determined according to actual conditions and is not limited here. As an example, the performing fogging, raining or snowing operations on the first image data set and the first image data to generate the second image data may include performing fogging operations on the first image data set and the first image data based on a preset atmospheric light scattering model to generate the second image data; or, performing raining operations on the first image data set and the first image data based on a preset rainy day imaging model to generate the second image data; or, performing snowing operations on the first image data set and the first image data based on a preset snowy day imaging model to generate the second image data.

[0079] In one embodiment, the step of performing fogging, raining or snowing operations on the first image data set and the first image data to generate second image data includes:

[0080] Performing fogging operation on the first image data set and the first image data based on a preset atmospheric light scattering model to generate second image data; or,

[0081] Performing a rain-adding operation on the first image data set and the first image data based on a preset rainy day imaging model to generate second image data; or,

[0082] Based on a preset snow imaging model, a snow adding operation is performed on the first image data set and the first image data to generate second image data.

[0083] The preset atmospheric light scattering model can be determined according to actual conditions and is not limited here. As an example, the preset atmospheric light scattering model can be referred to as the atmospheric light scattering model, and the atmospheric light scattering model can refer to the following formula (1):

[0084] I(x)=J(x)t(x)+A(1-t(x)) (1)

[0085] In formula (1), x represents the position information of the pixel in the image, J(x) represents a clear fog-free image, I(x) represents a foggy image, A represents the global atmospheric light value, and t(x) represents the scene transmittance, which is related to the scene depth information. It can be further referred to the following formula (2):

[0086] t(x)=e -βd(x) (2)

[0087] In formula (2), β represents the atmospheric scattering coefficient, and d(x) represents the scene depth information. In the present invention, the calculation expression of d(x) can refer to the following formula (3):

[0088]

[0089] In formula (3), ρ represents the Euclidean distance from a certain position in the image to the center of the image, and h and w represent the height and width of the image. In this patent, foggy images I(x) with different haze concentrations can be synthesized by setting two parameters: the global atmospheric light value A and the atmospheric scattering coefficient β.

[0090] The preset rainy day imaging model can be determined according to actual conditions and is not limited here. As an example, the preset rainy day imaging model can be referred to as the rainy day imaging model, and the raining operation is performed based on the rainy day imaging model. The rainy day imaging model can refer to the following formula (4):

[0091]

[0092] In formula (4), O represents a rainy image, B represents a clear rainless image, n represents the number of rain layers, and R i In this patent, the rain layer R is generated by adding noise in different directions to simulate rain marks. i Then, a rainy image O is generated.

[0093] The preset snow imaging model can be determined according to actual conditions and is not limited here. As an example, the preset snow imaging model can be referred to as the snow imaging model. The snow adding operation is performed based on the snow imaging model. The snow imaging model can refer to the following formula (5):

[0094] K(x)=zS(x)+J(x)(1-z) (5)

[0095] In formula (5), K(x) represents the snow image, z represents the binary mask, which can reflect the position of snowflakes, S(x) represents snowflakes, and J(x) represents a clear snow-free image. In this patent, the snow image K(x) can be generated by setting the binary mask z and snowflakes S(x).

[0096] In one embodiment, determining the second image description text based on the first image data set and the first image data includes:

[0097] Inputting the first image data set and the first image data into the initial image-text large model to generate initial image description text;

[0098] The second image description text is constructed based on the initial image description text and an image in at least one preset severe weather scenario.

[0099] In this embodiment, the initial image-text model can be determined according to actual conditions and is not limited here. As an example, the initial image-text model can be a BLIP-2 image-text model, which can be referred to as a BLIP-2 model.

[0100] The initial image description text may be determined according to actual conditions and is not limited here. As an example, the initial image description text may be an image description text t blip2 .

[0101] The second image description text may be determined according to actual conditions and is not limited here. As an example, the second image description text may be the new image description text t s .

[0102] For ease of understanding, a large number of clear non-low-quality images are collected on the Internet. These images do not have corresponding image description texts. Therefore, the present invention uses the same method as the above-mentioned public image and text dataset to generate low-quality images under severe weather conditions and new image description texts. s , that is, add fog, rain and snow to the clear images collected on the Internet. In addition, the clear images collected on the Internet are input into the original BLIP-2 image-text model to generate image description text t blip2 , then construct a new image description text t s In this way, for a large number of clear non-low-quality images collected on the Internet, the generated low-quality images under severe weather conditions and the generated new image description text t s .

[0103] In one embodiment, the performing target detection based on the first image description text, the second image data, the second image description text and the target image-text large model includes:

[0104] Inputting the second image data into the target graphic model to generate third image data with visual representation;

[0105] Inputting the second image data and the third image data into a preset image and representation IR-Former model to obtain fused fourth image data having image and representation multimodal features;

[0106] Inputting the second image data, the first image description text and the second image description text into a preset image and text IT-Former model to obtain fused fifth image data having multimodal features of image and text;

[0107] The second image data, the fourth image data and the fifth image data are input into a preset target detection model for target detection.

[0108] In this embodiment, the target image and text model can be determined according to actual conditions, and is not limited here. As an example, the target image and text model can be a BLIP-2-w model; the third image data can be determined according to actual conditions, and is not limited here. As an example, the third image data can be a visual representation R.

[0109] The specific generation process of inputting the second image data into the target large image model to generate the third image data with visual representation can be determined according to the actual situation and is not limited here. As an example, the inputting the second image data into the target large image model to generate the third image data with visual representation can include extracting features from the second image data through an image encoder in the target large image model to obtain target features corresponding to the second image data; inputting the target features and the first image description text into the multimodal model Q-Former in the target large image model for training to obtain a trained Q-Former; the weights in the trained Q-Former are determined based on the weights in the initial large image model; and generating the third image data with visual representation based on the trained Q-Former.

[0110] The second image data and the third image data are input into a preset image and representation IR-Former model to obtain fused fourth image data having image and representation multimodal features; wherein the second image data may be low-quality image data; and the third image data may be a visual representation R.

[0111] The second image data, the first image description text and the second image description text are input into the preset image and text IT-Former model to obtain the fifth image data with multimodal features of image and text after fusion. It can be understood as the low-quality image data, the original image description text t o And the generated new image description text t s Input into the preset image and text IT-Former model to obtain the fused fifth image data with multimodal features of image and text.

[0112] In practical applications, in order to better combine semantic information to perform target detection in various severe weather environments and enable the model to understand the target detection task more comprehensively and deeply, in addition to low-quality image data, the present invention also combines the generated new visual representation R, the original image description text t oAnd the generated new image description text t s The new visual representation R has the most relevant visual information to the image text description, and the original image description text t o With the new image description text t s It provides global understanding information of the image, which is very helpful for the object detection task. This application designs two feature fusion modules of Transformer structure: IR-Former and IT-Former. The input of IR-Former is low-quality image data and new visual representation R, and the input of IT-Former is low-quality image data and original image description text t o And the generated new image description text t s . Through the two feature fusion modules, multi-feature fusion can be obtained to obtain more information-rich fusion features, and then the low-quality image data, the output of IR-Former and the output of IT-Former are concatenated, and finally the concat result is input into the target detection model (Faster RCNN, YOLO, etc.) for prediction. Since the target detection model has more inputs, it has richer and more comprehensive information. Compared with the traditional method of only inputting images for target detection, the method of the present invention has the macro text description information of the image and the visual representation information related to the text, so it can more thoroughly understand the low-quality images in severe weather environments and perform target detection.

[0113] In one embodiment, the step of inputting the second image data into the target graphic model to generate third image data having visual representation includes:

[0114] Extracting features of the second image data through an image encoder in the target image-text model to obtain target features corresponding to the second image data;

[0115] Inputting the target feature and the first image description text into the multimodal model Q-Former in the target image-text large model for training to obtain a trained Q-Former; the weights in the trained Q-Former are determined based on the weights in the initial image-text large model;

[0116] A third image data having a visual representation is generated based on the trained Q-Former.

[0117] The specific determination process of the weights in the trained Q-Former based on the weights in the initial large image-text model can be determined according to actual conditions, and is not limited here. As an example, the initial large image-text model can be the original BLIP-2 model, and the weights in the trained Q-Former based on the weights in the initial large image-text model can be understood as the weights of the Q-Former in the BLIP-2-w model are initialized by the weights of the Q-Former in the original BLIP-2 model.

[0118] In practical applications, the second image data can be understood as a low-quality image; the input low-quality image is first subjected to feature extraction by an image encoder with fixed parameters, and then the output features of the image encoder, the learnable Queries, and the original image description text corresponding to the low-quality image are extracted. o The trained Q-Former is then input into the Q-Former for training. The trained Q-Former has learned how to better extract rich information from low-quality images under various severe weather conditions based on the image description text. In particular, in this application, the weights of the Q-Former in the BLIP-2-w model are initialized by the weights of the Q-Former in the original BLIP-2 model.

[0119] In one embodiment, the Q-Former includes a forward network, a cross attention network and a self-attention network; the inputting the target feature and the first image description text into the multimodal model Q-Former in the target image-text large model for training to obtain a trained Q-Former includes:

[0120] The target feature and the first image description text are subjected to information interaction training through the forward network, the cross attention network and the self-attention network to obtain a trained Q-Former.

[0121] Q-Former consists of two Transformer modules. The first Transformer module interacts with the output features of the image encoder. Its structure includes a self-attention network, a cross-attention network, and a forward network. The self-attention network realizes the information interaction between learnable queries, the cross-attention network realizes the information interaction between learnable queries and low-quality image features, and the forward network obtains the output of the first Transformer module. The structure of the second Transformer module includes a self-attention network and a forward network. The self-attention network realizes the original image description text t oThe information interaction between the two Transformer modules is used to obtain the output of the second Transformer module. In particular, the parameters of the self-attention networks in the two Transformer modules are shared, which means that learnable queries can be realized with the original image description text t o The information interaction between them is achieved through the trained Queries, so that the low-quality image visual feature information that is most relevant to the image description text can be extracted.

[0122] The loss function of the first step of training for the BLIP-2-w model consists of three parts: image-text contrast learning loss, image-based text generation loss, and image-text matching loss. Among them, the image-text contrast learning loss will bring the distance between matching image-text pairs closer, while increasing the distance between mismatched image-text pairs, maximizing the mutual information between low-quality images and text. During training, it does not allow learnable queries to be compared with the original image description text. o See each other; the image-based text generation loss allows the original image to describe the text t o See the learnable queries and their previous text tokens, while the learnable queries cannot see the original image description text t o Information; The image-text matching loss aligns the features between low-quality images and texts in a more fine-grained manner by performing binary classification on the image-text pairs, which allows learnable queries to be compared with the original image description text t o See each other.

[0123] In the second step of training the BLIP-2-w model, the low-quality image is input into the image encoder with fixed parameters, and the features obtained by the encoder are sent together with the Queries to the Q-Former trained in the first step. The output is sent to the fully connected layer to obtain the new visual representation R, and finally the representation R is input into the large language model decoder to obtain the output.

[0124] In order to better combine semantic information to perform target detection in various severe weather environments and enable the model to understand the target detection task more comprehensively and deeply, the present invention combines the generated new visual representation R, the original image description text t, and the low-quality image data in target detection training. o And the generated new image description text t s The new visual representation R has the most relevant visual information to the image text description, and the original image description text t o With the new image description text t s It provides global understanding information of the image, which is very helpful for target detection tasks.

[0125] For ease of understanding, the target detection method in the second scenario illustrated here is specifically a target detection method in the second scenario based on image and text multimodality.

[0126] The target detection task in the second scenario is to detect targets in images under bad weather conditions such as fog, rain, and snow, locate the position of the target, and identify the category of the target. Due to the negative impact of bad weather conditions, target detection is also difficult. In order to improve the target detection capabilities in bad environments, this patent uses deep learning, convolutional neural networks, Transformer networks, large multimodal models of images and text, and other technologies to generate low-quality images and image description text pairs, and then perform target detection after fusing multimodal information. This patent belongs to the fields of computer vision, target detection, large multimodal models of images and text, and harsh natural environment processing technology, and specifically relates to a target detection method in the second scenario based on multimodal images and text. The powerful visual comprehension and text generation capabilities of the BLIP-2 large image and text model are utilized, combined with fine-tuning of severe weather image data to obtain the BLIP-2-w model, which combines low-quality image generation, text description generation, a large image and text multimodal model, and Transformer feature fusion with a target detection model. This allows target detection to be performed on images in three severe weather environments: fog, rain, and snow. The present invention designs a method for acquiring pairs of low-quality image data and corresponding image description texts, enriching the data type and scale. The present invention designs two feature fusion modules, IR-Former and IT-Former, which can better fuse and utilize multimodal information.

[0127] Based on the analysis of the target detection method in the above-mentioned bad weather scenario, the present invention proposes a target detection method in the second scenario based on image-text multimodality, specifically as follows: Figure 2 As shown, Figure 2 is a flow chart of the target detection method in the second scenario based on multi-modality of images and texts in this application. Figure 2 The process involves 2(a) the generation of low-quality images, text data and BLIP-2-w model and 2(b) the low-quality image object detection process. Specifically, Figure 2 As shown in (a), firstly, the low-quality image data under bad weather conditions and the corresponding image description text are generated, and then the generated low-quality image data and the corresponding original image description text are compared. o The BLIP-2 image-text model is input for model fine-tuning training, and the BLIP-2-w model fine-tuned on the severe weather image data is obtained. Figure 2 As shown in (b), (1) low-quality image data, (2) the low-quality image data is input into the BLIP-2-w model, and the new visual representation R generated after the Q-Former and the fully connected layer, and (3) the original image description text t oAnd the generated new image description text t s The three parts are combined and input into the designed IR-Former and IT-Former. Then the low-quality image data, the output of IR-Former and the output of IT-Former are concatenated. Finally, the concat result is input into the target detection model (Faster RCNN, YOLO, etc.) for prediction.

[0128] In view of the lack of low-quality image data and corresponding image description text pairs under severe weather conditions, the present invention designs a method for obtaining low-quality image data and corresponding image description text pairs. Specifically, Figure 2 As shown in (a), these data come from two parts. One part is public image and text datasets, such as COCO, Visual_Genome, SBU, etc. These datasets already have clear images and corresponding original image description texts under non-bad weather conditions. o The present invention first generates low-quality images for this type of data set, that is, fog, rain and snow are added to the original clear image. In addition, the original clear image is input into the original BLIP-2 image-text model to generate image description text again. blip2 , then construct a new image description text t s , specifically, the new image description text t s The construction method is: "The weather in this image is (hazy / rainy / snowy)," + the image description text generated by BLIP-2 blip2 . New image description text t s The weather category information is contained in it, which is helpful for the target detection work of the model. At the same time, the new image description text can be used as a supplement to the original image description text, effectively enriching the text description content of the low-quality image. In this way, for the public image and text dataset, the generated low-quality images under severe weather conditions and the corresponding original image description text can be obtained. o And the generated new image description text t s .

[0129] The other part is a large number of clear non-low-quality images collected on the Internet. These images do not have corresponding image description texts. Therefore, the present invention uses the same method as the above-mentioned public image and text dataset to generate low-quality images under severe weather conditions and new image description texts. s , that is, add fog, rain and snow to the clear images collected on the Internet. In addition, the clear images collected on the Internet are input into the original BLIP-2 image-text model to generate image description text t blip2, then construct a new image description text t s In this way, for a large number of clear non-low-quality images collected on the Internet, the generated low-quality images under severe weather conditions and the generated new image description text t s .

[0130] For the above clear non-low-quality image, three operations of adding fog, adding rain and adding snow are used to generate low-quality images. Among them, the fogging operation is based on the atmospheric light scattering model. The expression of the atmospheric light scattering model can refer to the previous formula (1).

[0131] In formula (1), x represents the position information of the pixel in the image, J(x) represents a clear fog-free image, I(x) represents a foggy image, A represents the global atmospheric light value, and t(x) represents the scene transmittance, which is related to the scene depth information. For further reference, please refer to the previous formula (2).

[0132] In formula (2), β represents the atmospheric scattering coefficient, d(x) represents the scene depth information, and the calculation expression of d(x) in the present invention can refer to the above formula (3).

[0133] In formula (3), ρ represents the Euclidean distance from a certain position in the image to the center of the image, and h and w represent the height and width of the image. In this patent, foggy images I(x) with different haze concentrations can be synthesized by setting two parameters: the global atmospheric light value A and the atmospheric scattering coefficient β.

[0134] The raining operation is performed based on a rainy day imaging model, and the expression of the rainy day imaging model can refer to the previous formula (4).

[0135] In formula (4), O represents a rainy image, B represents a clear rainless image, n represents the number of rain layers, and R i In this patent, the rain layer R is generated by adding noise in different directions to simulate rain marks. i Then, a rainy image O is generated.

[0136] The snow adding operation is performed based on the snow imaging model. The expression of the snow imaging model can refer to the previous formula (5).

[0137] In formula (5), K(x) represents the snow image, z represents the binary mask, which can reflect the position of snowflakes, S(x) represents snowflakes, and J(x) represents a clear snow-free image. In this patent, the snow image K(x) can be generated by setting the binary mask z and snowflakes S(x).

[0138] like Figure 2As shown in (a), after obtaining the low-quality image and image description text under bad weather conditions in the above manner, it is necessary to compare the obtained low-quality image with the corresponding original image description text t o The model is input into the BLIP-2 image and text large model for model fine-tuning training, and the BLIP-2-w model fine-tuned on the severe weather image data is obtained.

[0139] like Figure 3 As shown, Figure 3 Schematic diagram of the overall structure of the BLIP-2-w model of the present application embodiment, which has the same structure as the BLIP-2 model, except that the BLIP-2-w model after fine-tuning can be applied to low-quality image data under various severe weather conditions. Figure 2 As shown in the figure, the training of the BLIP-2-w model is divided into two steps. In the first step, the input low-quality image is firstly passed through a fixed parameter image encoder for feature extraction, and then the output features of the image encoder, the learnable Queries and the original image description text corresponding to the low-quality image are combined. o The trained Q-Former is inputted together for training, and the trained Q-Former is obtained. At this time, the Q-Former learns how to better extract rich information from low-quality images under various severe weather conditions according to the image description text. In particular, in the present invention, the weight of the Q-Former in the BLIP-2-w model is initialized by the weight of the Q-Former in the original BLIP-2 model.

[0140] like Figure 4 As shown, Figure 4 This is a schematic diagram of the Q-Former structure in the BLIP-2-w model of the embodiment of the present application. It can be seen that the Q-Former consists of two Transformer modules. The first Transformer module interacts with the output features of the image encoder, and its structure includes a self-attention network, a cross-attention network, and a forward network. Among them, the self-attention network realizes information interaction between learnable queries, the cross-attention network realizes information interaction between learnable queries and low-quality image features, and the forward network obtains the output of the first Transformer module. The structure of the second Transformer module includes a self-attention network and a forward network, wherein the self-attention network realizes the original image description text t o The information interaction between the two Transformer modules is used to obtain the output of the second Transformer module. In particular, the parameters of the self-attention networks in the two Transformer modules are shared, which means that learnable queries can be realized with the original image description text t oThe information interaction between them is achieved through the trained Queries, so that the low-quality image visual feature information that is most relevant to the image description text can be extracted.

[0141] like Figure 4 As shown in the figure, the loss function of the first step of BLIP-2-w model training consists of three parts: image-text contrast learning loss, image-based text generation loss, and image-text matching loss. Among them, the image-text contrast learning loss will bring the distance between matching image-text pairs closer, while increasing the distance between mismatched image-text pairs, maximizing the mutual information between low-quality images and text. During training, it does not allow learnable queries to be compared with the original image description text. o See each other; the image-based text generation loss allows the original image to describe the text t o See the learnable queries and their previous text tokens, while the learnable queries cannot see the original image description text t o Information; The image-text matching loss aligns the features between low-quality images and texts in a more fine-grained manner by performing binary classification on the image-text pairs, which allows learnable queries to be compared with the original image description text t o See each other.

[0142] In the second step of training the BLIP-2-w model, the low-quality image is input into the image encoder with fixed parameters, and the features obtained by the encoder are sent together with the Queries to the Q-Former trained in the first step. The output is sent to the fully connected layer to obtain the new visual representation R, and finally the representation R is input into the large language model decoder to obtain the output.

[0143] In order to better combine semantic information to perform target detection in various severe weather environments and enable the model to understand the target detection task more comprehensively and deeply, the present invention combines the generated new visual representation R, the original image description text t, and the low-quality image data in target detection training. o And the generated new image description text t s The new visual representation R has the most relevant visual information to the image text description, and the original image description text t o With the new image description text t s It provides global understanding information of the image, which is very helpful for target detection tasks.

[0144] like Figure 5 As shown, Figure 5The schematic diagram of the IR-Former model and IT-Former model structure in the embodiment of the present application. The present invention also designs two feature fusion modules of Transformer structure: IR-Former and IT-Former. The input of IR-Former is low-quality image data and new visual representation R, and the input of IT-Former is low-quality image data and original image description text t o And the generated new image description text t s . Through the two feature fusion modules, multi-feature fusion can be obtained to obtain more information-rich fusion features, and then the low-quality image data, the output of IR-Former and the output of IT-Former are concatenated, and finally the concat result is input into the target detection model (FasterRCNN, YOLO, etc.) for prediction. Since the target detection model has more inputs, it has richer and more comprehensive information. Compared with the traditional method of only inputting images for target detection, the method of the present invention has the macro text description information of the image and the visual representation information related to the text, so it can more thoroughly understand the low-quality images in severe weather environments and perform target detection.

[0145] This solution has the following features:

[0146] 1. Most existing methods can only handle a single weather condition in the target detection task under bad weather scenes. When migrating their models to other bad weather conditions, the performance will drop significantly. A target detection method based on multimodal images and texts in the second scene is proposed. It can detect images in fog, rain, and snow at the same time, improves the target detection efficiency, and alleviates the catastrophic forgetting problem in new bad weather conditions. In addition, the BLIP-2-w model is obtained by fine-tuning the training based on the BLIP-2 large image and text model and using low-quality image data. The model has strong visual understanding and text generation capabilities. Combining these two capabilities can better assist the target detection task in the second scene.

[0147] 2. In response to the problem of lack of low-quality image data and corresponding image description text pairs under severe weather conditions, a method for obtaining low-quality image data and corresponding image description text pairs was proposed, which expanded the total amount of low-quality image data and enriched the image description text content.

[0148] 3. As existing methods do not take into account more abundant semantic information such as image content description, this solution uses low-quality images, visual representations and image description text multimodal information to perform target detection in the second scenario. At the same time, in order to make better use of this multimodal information, two feature fusion modules, IR-Former and IT-Former, are designed. They can make more effective and full use of multimodal information, enhance the model's ability to understand target detection tasks, and comprehensively improve the target detection model's detection capabilities in various severe weather environments.

[0149] Step analysis:

[0150] This solution includes four models: one is the fine-tuned BLIP-2-w model; one is the IR-Former model; one is the IT-Former model; and one is the target detection model.

[0151] Step 1: Dataset construction. For the public image and text dataset, we first generate low-quality images, that is, add fog, rain, and snow to the original clear image. In addition, we input the original clear image into the original BLIP-2 image and text model to generate image description text. blip2 , then construct a new image description text t s , the original image description text t o No processing is required. For a large number of clear images collected on the Internet, fog, rain and snow are added to the clear images. In addition, the clear images are input into the original BLIP-2 image-text model to generate image description text. blip2 , then construct a new image description text t s .

[0152] Step 2: Compare the generated low-quality image data with the corresponding original image description text t o The model is input into the BLIP-2 image and text large model for model fine-tuning training, and the BLIP-2-w model fine-tuned on the severe weather image data is obtained.

[0153] Step 3: Input the low-quality image data and the new visual representation R generated by the Q-Former and fully connected layers into the BLIP-2-w model and input it into the IR-Former model for feature fusion. o And the generated new image description text t s Input into the IT-Former model for feature fusion.

[0154] Step 4: Concatenate the low-quality image data, the output of IR-Former, and the output of IT-Former, and finally input the concat result into the target detection model (Faster RCNN, YOLO, etc.) for prediction.

[0155] This proposal proposes a new solution for target detection in the second scenario. It uses the powerful visual understanding and text generation capabilities of the BLIP-2 large image and text model, combined with fine-tuning of severe weather image data to obtain the BLIP-2-w model. It innovatively combines low-quality image generation, text description generation, large image and text multimodal models, and Transformer feature fusion with the target detection model. It can simultaneously perform target detection on images in three severe weather environments: fog, rain, and snow, greatly improving the detection efficiency and alleviating the phenomenon that the detection performance of existing target detection models drops significantly under new severe weather conditions.

[0156] This proposal aims to address the problem of lack of low-quality image data and corresponding image description text pairs under severe weather conditions. It proposes a method for obtaining low-quality image data and corresponding image description text pairs, which automatically generates a large number of low-quality images and image description texts, saving a lot of manpower and material costs.

[0157] In response to the fact that existing methods fail to take into account richer semantic information such as image content description, this proposal designs two feature fusion modules, IR-Former and IT-Former, which fully utilize multimodal information of low-quality images, visual representations, and image description text, effectively improving the model's ability to understand target detection tasks.

[0158] This patent has great application prospects in the fields of transportation, aerospace, and military in severe weather environments. For example, in the monitoring of road traffic in cities during smog weather, the images captured by traffic cameras in cities are of poor quality, which will affect the system's judgment of illegal traffic incidents. The use of this solution will greatly improve the detection and recognition capabilities of the camera system in this weather, and can better assist the system in making accurate judgments. For example, in rainy and snowy weather, drones can accurately locate and strike military targets. In rainy and snowy weather, military drones will be negatively affected by weather quality when searching for targets, which will reduce their search capabilities and strike accuracy. The use of this solution can reduce the difficulty of detection and search, and improve the accuracy of striking targets.

[0159] In order to implement the method of the embodiment of the present application, the embodiment of the present application further provides an object detection device 600 in a second scenario, which is arranged on an electronic device. Figure 6 Schematic diagram of a target detection device in a second scenario according to an embodiment of the present application; Figure 6As shown, including:

[0160] An acquisition unit 601 is used to acquire a first image data set in a first scene and a first image description text and first image data corresponding to a first image-text data set;

[0161] A processing unit 602 is used to perform an operation on the first image data set and the first image data in a second scenario to generate second image data;

[0162] A determining unit 603, configured to determine a second image description text based on the first image data set and the first image data;

[0163] An input unit 604, used for inputting the first image description text and the second image data into an initial image-text macromodel to obtain a target image-text macromodel;

[0164] The detection unit 605 is used to perform target detection based on the first image description text, the second image data, the second image description text and the target image-text large model.

[0165] Here, in one embodiment, the first scene represents a scene under non-bad weather; the second scene represents a scene under various bad weather conditions; the various bad weather conditions include at least fog, rain, and snow; the processing unit 602 is further used to perform fog, rain, or snow operations on the first image data set and the first image data to generate second image data.

[0166] Here, in one embodiment, the processing unit 602 is further used to perform a fog operation on the first image data set and the first image data based on a preset atmospheric light scattering model to generate second image data; or, perform a rain operation on the first image data set and the first image data based on a preset rainy day imaging model to generate second image data; or, perform a snow operation on the first image data set and the first image data based on a preset snowy day imaging model to generate second image data.

[0167] Here, in one embodiment, the determination unit 603 is also used to input the first image data set and the first image data into the initial graphic model to generate an initial image description text; and construct the second image description text based on the initial image description text and an image of at least one preset severe weather scenario.

[0168] Here, in one embodiment, the detection unit 605 is also used to input the second image data into the target image and text model to generate third image data with visual representation; input the second image data and the third image data into a preset image and representation IR-Former model to obtain fused fourth image data with image and representation multimodal features; input the second image data, the first image description text and the second image description text into a preset image and text IT-Former model to obtain fused fifth image data with image and text multimodal features; input the second image data, the fourth image data and the fifth image data into a preset target detection model for target detection.

[0169] Here, in one embodiment, the detection unit 605 is also used to perform feature extraction on the second image data through the image encoder in the target image-text large model to obtain target features corresponding to the second image data; input the target features and the first image description text into the multimodal model Q-Former in the target image-text large model for training to obtain a trained Q-Former; the weights in the trained Q-Former are determined based on the weights in the initial image-text large model; and third image data with visual representation are generated based on the trained Q-Former.

[0170] Here, in one embodiment, the Q-Former includes a forward network, a cross-attention network and a self-attention network; the detection unit 605 is also used to perform information interaction training on the target feature and the first image description text through the forward network, the cross-attention network and the self-attention network to obtain a trained Q-Former.

[0171] It should be noted that: when the target detection device for the second scenario provided in the above embodiment performs target detection in the second scenario, only the division of the above program modules is used as an example. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the target detection device for the second scenario provided in the above embodiment and the target detection method embodiment for the second scenario belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0172] Based on the hardware implementation of the above-mentioned program module, an embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps of the target detection method in the second scenario provided in the above-mentioned embodiment are implemented.

[0173] Correspondingly, an embodiment of the present application provides a computer program product, which, when executed by a processor, implements the steps in the target detection method in the second scenario provided in the above embodiment.

[0174] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the target detection method in the second scenario provided in the above embodiment are implemented.

[0175] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0176] It should be noted that Figure 7 is a schematic diagram of a hardware entity structure of an electronic device in an embodiment of the present application, such as Figure 7 As shown, the hardware entity of the electronic device 700 includes: a processor 701 and a memory 703 . Optionally, the electronic device 700 may also include a communication interface 702 .

[0177] It can be understood that the memory 703 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 703 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.

[0178] The method disclosed in the above embodiment of the present application can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software. The above processor 701 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 701 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 703, and the processor 701 reads the information in the memory 703 and completes the steps of the above method in combination with its hardware.

[0179] In an exemplary embodiment, the device may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0180] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0181] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0182] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0183] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0184] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0185] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A target detection method in a second scenario, characterized in that: include: Acquire a first image data set under a first scene and a first image description text and first image data corresponding to the first image-text data set; performing operation processing on the first image data set and the first image data in a second scenario to generate second image data; determining a second image description text based on the first image data set and the first image data; Inputting the first image description text and the second image data into an initial image-text macromodel to obtain a target image-text macromodel; Target detection is performed based on the first image description text, the second image data, the second image description text and the target image-text large model.

2. The method according to claim 1, characterized in that The first scene represents a scene in non-bad weather; the second scene represents scenes in multiple bad weather; the multiple bad weathers include at least fog, rain, and snow; The operating and processing the first image data set and the first image data in the second scenario to generate second image data includes: The first image data set and the first image data are subjected to fogging, raining or snowing operations to generate second image data.

3. The method according to claim 2, characterized in that The step of performing fogging, raining or snowing operations on the first image data set and the first image data to generate second image data includes: Performing fogging operation on the first image data set and the first image data based on a preset atmospheric light scattering model to generate second image data; or, Performing a rain-adding operation on the first image data set and the first image data based on a preset rainy day imaging model to generate second image data; or, Based on a preset snow imaging model, a snow adding operation is performed on the first image data set and the first image data to generate second image data.

4. The method according to claim 1, characterized in that The determining of the second image description text based on the first image data set and the first image data comprises: Inputting the first image data set and the first image data into the initial image-text large model to generate initial image description text; The second image description text is constructed based on the initial image description text and an image in at least one preset severe weather scenario.

5. The method according to claim 1, characterized in that: The target detection based on the first image description text, the second image data, the second image description text and the target image-text large model includes: Inputting the second image data into the target graphic model to generate third image data with visual representation; Inputting the second image data and the third image data into a preset image and representation IR-Former model to obtain fused fourth image data having image and representation multimodal features; Inputting the second image data, the first image description text and the second image description text into a preset image and text IT-Former model to obtain fused fifth image data having multimodal features of image and text; The second image data, the fourth image data and the fifth image data are input into a preset target detection model for target detection.

6. The method according to claim 5, characterized in that The step of inputting the second image data into the target graphic model to generate third image data with visual representation includes: Extracting features of the second image data through an image encoder in the target image-text model to obtain target features corresponding to the second image data; Inputting the target feature and the first image description text into the multimodal model Q-Former in the target image-text large model for training to obtain a trained Q-Former; the weights in the trained Q-Former are determined based on the weights in the initial image-text large model; A third image data having a visual representation is generated based on the trained Q-Former.

7. The method according to claim 6, characterized in that The Q-Former includes a forward network, a cross attention network and a self-attention network; the multimodal model Q-Former inputting the target feature and the first image description text into the target image-text large model for training to obtain a trained Q-Former, including: The target feature and the first image description text are subjected to information interaction training through the forward network, the cross attention network and the self-attention network to obtain a trained Q-Former.

8. A target detection device in the second scenario, characterized in that: include: An acquisition unit, used to acquire a first image data set in a first scene and a first image description text and first image data corresponding to the first image-text data set; a processing unit, configured to perform an operation on the first image data set and the first image data in a second scenario to generate second image data; a determining unit, configured to determine a second image description text based on the first image data set and the first image data; An input unit, used for inputting the first image description text and the second image data into an initial image-text macro model to obtain a target image-text macro model; A detection unit is used to perform target detection based on the first image description text, the second image data, the second image description text and the target image and text large model.

9. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor is used to implement the target detection method in the second scenario described in any one of claims 1 to 8 when executing the executable instructions stored in the memory.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the target detection method in the second scenario described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to implement the target detection method in the second scenario described in any one of claims 1 to 8 when executed by a processor.