Image processing method, image processing model training method, device and equipment

By setting up task coding submodels and task decoding submodels corresponding to multiple preset task types in the image processing model, as well as a shared image coding submodel and feature interaction coding submodel, the problem that visual big models in the prior art can only handle specific tasks, and the accuracy of multi-task processing is improved.

CN117351330BActive Publication Date: 2025-04-25BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311282976.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-04-25
Estimated Expiration
2043-09-28

AI Technical Summary

Technical Problem

Existing visual mockups can only handle a specific number of tasks and are difficult to meet the needs of multiple image processing tasks.

Method used

In the image processing model, the task coding submodel and task decoding submodel corresponding to multiple preset task types are set, and the first image coding submodel and feature interaction coding submodel shared by multiple preset task types are set to realize that a single general image processing model can handle various image processing tasks.

Benefits of technology

A single universal image processing model is realized that can handle multiple image processing tasks, improving the accuracy of image processing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117351330B_ABST
    Figure CN117351330B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, a training method, a device and an apparatus for an image processing model, in the field of artificial intelligence technology, specifically in the fields of computer vision, deep learning, large models and the like, and can be applied to scenarios such as smart cities. The image processing method includes: obtaining task description information of a target image and an image processing task, and determining a target task type corresponding to the image processing task from a plurality of preset task types; and processing the target image and the task description information using an image processing model to obtain a processing result of the target image, wherein the image processing model includes a plurality of task encoding sub-models and a plurality of task decoding sub-models corresponding to a plurality of preset task types, and includes a first image encoding sub-model and a feature interaction encoding sub-model shared by a plurality of preset task types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically computer vision, deep learning, large models and other technical fields, which can be applied to scenarios such as smart cities, and in particular to an image processing method, a training method for an image processing model, an image processing device, a training device for an image processing model, an electronic device, a computer-readable storage medium and a computer program product. Background Art

[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0003] It has gradually become an industry consensus that large models in the field of computer vision serve as the model base to empower a large number of downstream tasks. Currently, large visual models are only designed for one or a limited number of capabilities (such as dedicated to recognition) and can only handle a specific number of tasks.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0005] The present disclosure provides an image processing method, a training method for an image processing model, an image processing device, a training device for an image processing model, an electronic device, a computer-readable storage medium, and a computer program product.

[0006] According to one aspect of the present disclosure, an image processing method is provided, including: obtaining task description information of a target image and an image processing task of the target image, and determining a target task type corresponding to the image processing task from a plurality of preset task types; and processing the target image and the task description information using an image processing model to obtain a processing result of the target image, wherein the image processing model includes a plurality of task encoding sub-models and a plurality of task decoding sub-models corresponding to the plurality of preset task types, and includes a first image encoding sub-model and a feature interaction encoding sub-model shared by the plurality of preset task types, wherein the processing includes: extracting features of the task description information using the task encoding sub-model corresponding to the target task type to obtain task encoding features; extracting features of the target image using the first image encoding sub-model to obtain target image features; encoding the task encoding features and the target image features using the feature interaction encoding sub-model to obtain features to be decoded; and decoding the features to be decoded using the task decoding sub-model corresponding to the target task type to obtain a processing result of the target image.

[0007] According to another aspect of the present disclosure, a training method for an image processing model is provided, comprising: obtaining a sample image, sample task description information of a sample image processing task of the sample image, and a true label, and determining a sample task type corresponding to the sample image processing task from a plurality of preset task types; processing the sample image and the sample task description information using a deep learning model to obtain a prediction result of the sample image, wherein the deep learning model comprises a plurality of task encoding sub-models and a plurality of task decoding sub-models corresponding to the plurality of preset task types, and comprises a first image encoding sub-model and a feature interaction encoding sub-model shared by tasks of the plurality of preset task types, and the processing comprises: extracting features of the sample task description information using the task encoding sub-model corresponding to the sample task type to obtain sample task encoding features; extracting features of the sample image using the first image encoding sub-model to obtain sample image features; encoding the sample task encoding features and the sample image features using the feature interaction encoding sub-model to obtain sample features to be decoded; and decoding the sample features to be decoded using the task decoding sub-model corresponding to the sample task type to obtain a prediction result of the sample image; and training the deep learning model based on the prediction results and the true label to obtain the image processing model.

[0008] According to one aspect of the present disclosure, an image processing device is provided, comprising: a first acquisition unit, configured to acquire a target image and task description information of an image processing task of the target image, and determine a target task type corresponding to the image processing task from a plurality of preset task types; and an image processing model, configured to process the target image and the task description information to obtain a processing result of the target image, wherein the image processing model comprises: a plurality of task encoding sub-models corresponding to the plurality of preset task types, the task encoding sub-model being configured to, in response to determining that the target task type is the preset task type corresponding to the task encoding sub-model, extract features from the task description information to obtain task encoding features; a first image encoding sub-model being configured to extract features from the target image to obtain target image features; a feature interaction encoding sub-model being configured to encode task encoding features and target image features to obtain features to be decoded; and a plurality of task decoding sub-models corresponding to the plurality of preset task types, the task decoding sub-model being configured to, in response to determining that the target task type is the preset task type corresponding to the task decoding sub-model, decode the features to be decoded to obtain a processing result of the target image.

[0009] According to one aspect of the present disclosure, a training device for an image processing model is provided, comprising: a second acquisition unit, configured to acquire a sample image, sample task description information of a sample image processing task of the sample image, and a true label, and determine a sample task type corresponding to the sample image processing task from a plurality of preset task types; a deep learning model, configured to process the sample image and the sample task description information to obtain a prediction result of the sample image, wherein the deep learning model comprises: a plurality of task encoding sub-models corresponding to the plurality of preset task types, the task encoding sub-model being configured to, in response to determining that the sample task type is a preset task type corresponding to the task encoding sub-model, process the sample task description information Perform feature extraction to obtain sample task coding features; a first image coding sub-model is configured to perform feature extraction on the sample image to obtain sample image features; a feature interaction coding sub-model is configured to encode the sample task coding features and the sample image features to obtain sample features to be decoded; and a plurality of task decoding sub-models corresponding to a plurality of preset task types, the task decoding sub-model is configured to decode the sample features to be decoded in response to determining that the sample task type is a preset task type corresponding to the task coding sub-model, to obtain a prediction result of the sample image; and a training unit is configured to train the deep learning model based on the prediction result and the true label to obtain an image processing model.

[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above method.

[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.

[0012] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method when executed by a processor.

[0013] According to one or more embodiments of the present disclosure, by setting task encoding submodels and task decoding submodels corresponding to multiple preset image processing tasks in an image processing model, and setting a first image encoding submodel and a feature interaction submodel shared by multiple preset image processing tasks, a single universal image processing model is deployed that can be used to process various image processing tasks. In addition, since multiple different types of image processing tasks share the first image encoding submodel and the feature interaction encoding submodel, multiple different types of tasks can promote each other, thereby improving the accuracy of the image processing results.

[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0016] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0017] Figure 2 A flowchart of an image processing method according to an exemplary embodiment of the present disclosure is shown;

[0018] Figure 3 A flowchart of extracting features from task description information using a task encoding submodel corresponding to a target task type according to an exemplary embodiment of the present disclosure is shown;

[0019] Figure 4 A schematic diagram showing an image processing model processing a task of a first task type according to an exemplary embodiment of the present disclosure;

[0020] Figure 5 A flowchart of extracting features from task description information using a task encoding submodel corresponding to a target task type according to an exemplary embodiment of the present disclosure is shown;

[0021] Figure 6 A schematic diagram showing an image processing model processing a task of a second task type according to an exemplary embodiment of the present disclosure;

[0022] Figure 7 A flowchart of a method for training an image processing model according to an exemplary embodiment of the present disclosure is shown;

[0023] Figure 8 A structural block diagram of an image processing device according to an exemplary embodiment of the present disclosure is shown;

[0024] Fig. 9 A structural block diagram of a training device for an image processing model according to an exemplary embodiment of the present disclosure is shown; and

[0025] Fig.10 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0027] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0028] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0029] In the related art, a single image processing model is difficult to cover all the needs of users.

[0030] In order to solve the above problems, the present disclosure sets task encoding submodels and task decoding submodels corresponding to multiple preset image processing tasks in the image processing model, and sets a first image encoding submodel and a feature interaction submodel shared by multiple preset image processing tasks, thereby realizing that a single universal image processing model can be deployed to process various image processing tasks. In addition, since multiple different types of image processing tasks share the first image encoding submodel and the feature interaction encoding submodel, multiple different types of tasks can promote each other, thereby improving the accuracy of the image processing results.

[0031] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0032] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0033] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the methods of the present disclosure.

[0034] In some embodiments, server 120 may also provide other services or software applications that may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) network.

[0035] exist Figure 1In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0036] The user can use client devices 101, 102, 103, 104, 105 and / or 106 to perform human-computer interaction. The client device can provide an interface that enables the user of the client device to interact with the client device. The client device can also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0037] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0038] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0039] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0040] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0041] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.

[0042] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0043] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the data repository used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the database used by the server 120 may be a database, such as a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to a command.

[0044] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0045] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0046] According to one aspect of the present disclosure, an image processing method is provided. Figure 2 As shown, the image processing method includes: step S201, obtaining the target image and the task description information of the image processing task of the target image, and determining the target task type corresponding to the image processing task in multiple preset task types; and step S202, using the image processing model to process the target image and the task description information to obtain the processing result of the target image, wherein the image processing model includes multiple task encoding sub-models and multiple task decoding sub-models corresponding to the multiple preset task types, and includes a first image encoding sub-model and a feature interaction encoding sub-model shared by multiple preset task types. The processing may include: step S2021, using the task encoding sub-model corresponding to the target task type to extract features from the task description information to obtain task encoding features; step S2022, using the first image encoding sub-model to extract features from the target image to obtain target image features; step S2023, using the feature interaction encoding sub-model to encode the task encoding features and the target image features to obtain features to be decoded; and step S2024, using the task decoding sub-model corresponding to the target task type to decode the features to be decoded to obtain the processing result of the target image.

[0047] Thus, by setting task encoding submodels and task decoding submodels corresponding to multiple preset image processing tasks in the image processing model, and setting a first image encoding submodel and a feature interaction submodel shared by multiple preset image processing tasks, it is achieved that a single universal image processing model can be deployed to process various image processing tasks. In addition, since multiple different types of image processing tasks share the first image encoding submodel and the feature interaction encoding submodel, multiple different types of tasks can promote each other, thereby improving the accuracy of the image processing results.

[0048] The target image is the image to be processed. The target image can be an image input by the user or an image obtained by other means, which is not limited here. The image processing task for the target image can be a conventional task in the field of image processing or computer vision (for example, target detection, image description, etc.), or a more specific task (for example, detecting pedestrians running red lights in an image, answering whether the manhole cover in the image is closed), which is not limited here.

[0049] The task description information can be used to describe the image processing task, and can be in text form, image form, or a combination of the two. In an exemplary embodiment, the task description information may include the text "Detect defects in the image", may also include example images (for example, example images with defects marked out to guide the model to perform defect detection), and may also include both text and example images. When the task description information only has text, the image processing task corresponds to instruction learning; when the task description information only has an image, the image processing task corresponds to in-context learning. Therefore, the image processing model used in the image processing method of the present disclosure is a large visual multi-task model with instruction learning capabilities and context learning capabilities.

[0050] In some embodiments, multiple preset task types of image processing tasks can be preset, and for each preset task type, a corresponding task encoding submodel and task decoding submodel can be set in the image processing model, and different preset task types can share the first image encoding submodel and feature interaction encoding submodel. In step S201, the target task type of the current image processing task can be determined from multiple preset task types, and then in step S202, the target image and task description information can be processed using the task encoding submodel and task decoding submodel corresponding to the target task type, as well as the first image encoding submodel and feature interaction encoding submodel shared by different preset task types, to obtain a processing result of the target image.

[0051] Understandably, Figure 2Steps S2021 to S2024 in the process may be, for example, sub-steps of step S202.

[0052] In step S2021, the task coding sub-models in the image processing model can be selected and used. For the target task type corresponding to the current image processing task, the task coding sub-model corresponding to the target task type is selected to extract features from the task description information to obtain task coding features representing relevant information of the image processing task.

[0053] It should be noted that the features in the present disclosure (e.g., task encoding features, as well as image features, features to be decoded, etc. to be introduced below) can all refer to feature vectors generated by a deep learning model as implicit representations of specific objects or information. These features can be subjected to feature extraction to extract information related to some aspects of a specific object or information, such as extracting task encoding features related to the current image processing task from example image features that characterize the visual information of an example image; these features can also be decoded / predicted to obtain explicit information, such as text related to high-level semantic information of the image to be processed, or images related to objects in the image to be processed.

[0054] In step S2022, the first image coding submodel in the image processing model can be used to extract features of the target image to obtain target image features. The first image coding submodel can use a commonly used image feature extraction backbone model, or can be built by itself according to needs, which is not limited here. In an exemplary embodiment, the first image coding submodel can use a vision transformer (Vision Transformer, Vit) model.

[0055] In step S2023, the task coding features and the target image features may be encoded using a feature interaction coding sub-model to achieve fusion interaction of the information included in each of the task coding features and the target image features, and obtain features to be decoded that fuse the information of the two.

[0056] According to some embodiments, the feature interaction encoding sub-model may be a large-scale model based on an attention mechanism. A large-scale model may refer to a model trained on large-scale data. By adopting a large-scale model based on an attention mechanism, it is possible to fully integrate and interact the information included in the task encoding features and the target image features, and obtain features to be decoded with strong predictive capabilities, thereby obtaining accurate image processing results.

[0057] In step S2024, the task decoding sub-models in the image processing model can be selected and used. For the target task type corresponding to the current image processing task, the task decoding sub-model corresponding to the target task type is selected to decode the above-mentioned features to be decoded to obtain the image processing result.

[0058] According to some embodiments, the plurality of preset task types may include a first task type, and the task decoding submodel corresponding to the first task type may be a text decoding submodel. The processing result output by the text decoding submodel may include predicted text related to high-level semantic information of the target image.

[0059] Therefore, by setting the first task type and setting the task decoder corresponding to the first task type as a text decoding sub-model, the general image processing model can be used for image processing tasks that output predicted text related to the high-level semantic information of the image (for example, visual question and answer results, image description content).

[0060] In some embodiments, the text decoding sub-model can adopt a commonly used text decoder, such as a generative pre-trained Transformer (GPT) model, or it can adopt other structures or build it according to needs, which is not limited here.

[0061] According to some embodiments, the task description information corresponding to the first task type includes a first task description text. Figure 3 As shown, step S2021 in the image processing method described above, using the task coding sub-model corresponding to the target task type to extract features of the task description information to obtain task coding features may include: step S301, in response to determining that the target task type is a first task type, using the first text coding sub-model in the task coding sub-model to extract features of the first task description text included in the task description information to obtain a first text coding feature; and step S302, using the first task type coding sub-model in the task coding sub-model to encode the first text coding feature to obtain a task coding feature.

[0062] Therefore, through the above method, it is possible to convert the explicit task description information into an implicit representation related to the current image processing task through text encoding, thereby obtaining task encoding features with stronger expressive power and improving the accuracy of downstream task processing results.

[0063] In some embodiments, the first text encoding sub-model may use a Transformer-based text encoder. The first text encoding sub-model and the first image encoding sub-model may be a text encoder and an image encoder in a pre-trained text-image comparison model (eg, a CLIP model).

[0064] In some embodiments, Figure 4 FIG. 2 shows a schematic diagram of an image processing model processing a task of a first task type according to an exemplary embodiment of the present disclosure. Figure 4 As shown, when processing a task of the first task type, the first task description text 402 can be input into the first text encoding submodel 404, and the obtained first text encoding features can be further input into the first task type encoding submodel 406 to obtain the task encoding features. The target image 408 can be input into the first image encoding submodel 410 to obtain the target image features. The feature interaction encoding submodel 412 can receive the task encoding features and the target image features to output the features to be decoded. The text decoding submodel 414 can receive the features to be decoded to output the predicted text 416 related to the high-level semantic information of the target image.

[0065] According to some embodiments, the first task type may include an object recognition task, an image description task, and a visual question answering task. Thus, a general image processing model can be used to process the above image processing tasks.

[0066] According to some embodiments, the plurality of preset task types may include a second task type, and the task decoding submodel corresponding to the second task type may be a detection decoding submodel. The processing result output by the detection decoding submodel may include a prediction result related to an object in the target image.

[0067] Therefore, by setting the second task type and setting the task decoder corresponding to the second task type as the detection decoding sub-model, the general image processing model can be used for image processing tasks that output prediction results related to objects in the image (for example, detection boxes, semantic segmentation results).

[0068] In some embodiments, the detection and decoding sub-model may adopt a commonly used detection head for target detection or semantic segmentation, or may adopt other structures to be built according to needs, which is not limited here.

[0069] According to some embodiments, the task description information corresponding to the second task type may include at least one of a second task description text and an example image. Figure 5As shown, step S2021 in the image processing method described above, using the task coding submodel corresponding to the target task type to extract features from the task description information to obtain task coding features may include: step S501, in response to determining that the target task type is a second task type, and in response to determining that the task description information includes a second task description text, using the second text coding submodel in the task coding submodel to extract features from the second task description text information to obtain second text coding features; step S502, in response to determining that the task description information includes an example image, using the second image coding submodel in the task coding submodel to extract features from the example image to obtain example image features; and step S503, using the second task type coding submodel in the task coding submodel to encode at least one coding feature output by the second text coding submodel and the second image coding submodel to obtain a task coding feature.

[0070] Therefore, through the above method, it is possible to convert explicit task description information into implicit representation related to the current image processing task through text encoding and / or image encoding, so as to obtain task coding features with stronger expressive power and improve the accuracy of downstream task processing results.

[0071] In some embodiments, the second text encoding sub-model may adopt a Transformer-based text encoder, and the second image encoding sub-model may adopt a commonly used image feature extraction backbone model, or may be built by itself according to needs, which is not limited here. In an exemplary embodiment, the second image encoding sub-model may adopt a vision Transformer (Vit) model.

[0072] In some embodiments, the second text encoding submodel and the second image encoding submodel may be a text encoder and an image encoder in a pre-trained text-image comparison model (e.g., a CLIP model). The second text encoding submodel and the first text encoding submodel may have the same parameters, and the second image encoding submodel and the first image encoding submodel may have the same parameters.

[0073] In some embodiments, Figure 6 FIG. 2 shows a schematic diagram of an image processing model processing a task of a second task type according to an exemplary embodiment of the present disclosure. Figure 6As shown, when processing a task of the second task type, the second task description text 602 can be input into the second text encoding submodel 604 to obtain the second text encoding feature. The example image 618 can be input into the second image encoding submodel 620 to obtain the example image feature. The second text encoding feature and the example image feature can be input into the second task type encoding submodel 606 to obtain the task encoding feature. The target image 608 can be input into the first image encoding submodel 610 to obtain the target image feature. The feature interaction encoding submodel 612 can receive the task encoding feature and the target image feature to output the feature to be decoded. The detection decoding submodel 614 can receive the feature to be decoded to output the prediction result 616 related to the object in the target image.

[0074] According to some embodiments, the second task type includes an object detection task and an image segmentation task. Thus, a general image processing model can be used to process the above image processing tasks.

[0075] In some embodiments, different task decoding sub-models may be set for target detection tasks and image segmentation tasks. For target detection tasks, the detection decoding sub-model described above may be used; for image segmentation tasks, a segmentation decoding sub-model that can output semantic segmentation results may be used. The segmentation decoding sub-model may also be obtained through pre-training, and may be jointly trained with the task encoding sub-model and the feature interaction sub-model.

[0076] In some embodiments, the first task type encoding submodel, the second task type encoding submodel, and the feature interaction encoding submodel can all be implemented based on the attention mechanism, that is, using the Transformer structure. In an exemplary embodiment, the image features output by the first image encoding submodel and the task encoding features output by the task encoding submodel can be input into the feature interaction encoding submodel together, and the feature interaction encoding submodel fuses and interactively encodes the image features and the task encoding features based on the self-attention mechanism to obtain enhanced image features and enhanced task encoding features. The enhanced image features and the enhanced task encoding features can be selected as features to be decoded and input into the downstream task decoding submodel, or they can be input into the downstream task decoding submodel together as features to be decoded, which is not limited here. It can be understood that the feature interaction encoding submodel can also process the image features output by the first image encoding submodel and the task encoding features output by the task encoding submodel in other ways to obtain features to be decoded, and the output of the task decoding submodel can also include other features (for example, task encoding features) in addition to the features to be decoded, which are not limited here.

[0077] In some embodiments, the text decoding submodel can generate text based on the features to be decoded in an autoregressive manner to obtain predicted text related to the high-level semantic information of the image. The detection decoding submodel can decode the features to be decoded based on multiple pre-trained object queries to obtain prediction results related to the objects in the image.

[0078] According to another aspect of the present disclosure, a method for training an image processing model is provided. Figure 7 As shown, the training method includes: step S701, obtaining a sample image, sample task description information of a sample image processing task of the sample image, and a true label, and determining a sample task type corresponding to the sample image processing task from multiple preset task types; step S702, using a deep learning model to process the sample image and the sample task description information to obtain a prediction result of the sample image, wherein the deep learning model includes multiple task encoding sub-models and multiple task decoding sub-models corresponding to multiple preset task types, and includes a first image encoding sub-model and a feature interaction encoding sub-model shared by tasks of multiple preset task types. The above-mentioned processing includes: step S7021, using the task encoding submodel corresponding to the sample task type to extract features from the sample task description information to obtain sample task encoding features; step S7022, using the first image encoding submodel to extract features from the sample image to obtain sample image features; step S7023, using the feature interaction encoding submodel to encode the sample task encoding features and the sample image features to obtain sample features to be decoded; and step S7024, using the task decoding submodel corresponding to the sample task type to decode the sample features to obtain the prediction results of the sample image. The training method also includes: step S703, based on the prediction results and the true labels, training the deep learning model to obtain the image processing model.

[0079] Therefore, by adopting the above-mentioned training method, the trained image processing model can be used to process various image processing tasks. In addition, since samples of multiple different types of image processing tasks can jointly train the first image encoding sub-model and feature interaction encoding sub-model shared by these tasks, multiple different types of tasks can promote each other, thereby improving the prediction ability of the trained image processing model.

[0080] Understandably, Figure 7 The operations and effects of steps S701-S702 and their sub-steps in the above description can be referred to. Figure 2 The description of steps S201-S202 in will not be repeated here. Figure 2 The image processing model used in the image processing method described in the embodiment can be composed of Figure 7The image processing model is trained using the training method described in the text. The classification and description of the image processing tasks and the description of the model structure are also applicable in the embodiments corresponding to the training method.

[0081] According to some embodiments, multiple preset task types may include a first task type, the task decoding submodel corresponding to the first task type may be a pre-trained text decoding submodel, and the prediction result output by the text decoding submodel may include predicted text related to high-level semantic information of the sample image.

[0082] Therefore, by setting the first task type and setting the task decoder corresponding to the first task type as a text decoding sub-model, the general image processing model obtained after training can be used for image processing tasks that output predicted text related to the high-level semantic information of the image (for example, visual question and answer results, image description content).

[0083] In some embodiments, the text decoding sub-model can adopt a commonly used text decoder, such as a generative pre-trained Transformer (GPT) model, or it can adopt other structures or build it according to needs, which is not limited here.

[0084] According to some embodiments, the sample task description information corresponding to the first task type includes a first task description text. Step S7021 in the training method of the image processing model described above, using the task encoding submodel corresponding to the sample task type to extract features from the sample task description information to obtain sample task encoding features may include: in response to determining that the sample task type is the first task type, using the pre-trained first text encoding submodel in the task encoding submodel to extract features from the first task description text included in the sample task description information to obtain a first text encoding feature; and using the first task type encoding submodel in the task encoding submodel to encode the first text encoding feature to obtain a sample task encoding feature.

[0085] Therefore, through the above method, it is possible to convert the explicit task description information into an implicit representation related to the current image processing task through text encoding, thereby obtaining task encoding features with stronger expressive power and improving the accuracy of downstream task processing results.

[0086] According to some embodiments, the pre-trained first text encoding sub-model and the first image encoding sub-model are obtained by pre-training the data set using images and texts. In some embodiments, the first text encoding sub-model may use a Transformer-based text encoder. The first text encoding sub-model and the first image encoding sub-model may be a text encoder and an image encoder in a pre-trained image-text comparison model (e.g., a CLIP model).

[0087] In some embodiments, step S703, training the deep learning model based on the prediction results and the true labels to obtain the image processing model may include: adjusting the parameters of the first task type encoding submodel and the feature interaction encoding submodel based on the prediction results and the true labels.

[0088] Therefore, by using the first text encoding submodel and the first image encoding submodel obtained by pre-training the data set using images and texts, and using the pre-trained text decoding submodel, the parameters of the first task type encoding submodel and the feature interaction encoding submodel are adjusted, so that the first task type encoding submodel and the feature interaction encoding submodel are adapted to the semantic space of the already trained first text encoding submodel, the first image encoding submodel and the text decoding submodel, thereby achieving full utilization of the knowledge learned by these models in the pre-training stage and improving the accuracy of the image processing results.

[0089] According to some embodiments, the first task type may include an object recognition task, an image description task, and a visual question answering task. Thus, the general image processing model obtained after training can be used to process the above image processing tasks.

[0090] According to some embodiments, the multiple preset task types may include a second task type, the task decoding submodel corresponding to the second task type may be a detection decoding submodel, and the prediction results output by the detection decoding submodel may include prediction results related to objects in the sample image.

[0091] Therefore, by setting the second task type and setting the task decoder corresponding to the second task type as the detection decoding sub-model, the general image processing model obtained after training can be used for image processing tasks that output prediction results related to objects in the image (for example, detection boxes, semantic segmentation results).

[0092] In some embodiments, the detection and decoding sub-model may adopt a commonly used detection head for target detection or semantic segmentation, or may adopt other structures to be built according to needs, which is not limited here.

[0093] According to some embodiments, the sample task description information corresponding to the second task type may include at least one of a second task description text and an example image. Step S7021, using the task encoding submodel corresponding to the sample task type to perform feature extraction on the sample task description information to obtain the sample task encoding feature may include: in response to determining that the sample task type is the second task type, and in response to determining that the sample task description information includes the second task description text, using the pre-trained second text encoding submodel in the task encoding submodel to perform feature extraction on the second task description text to obtain the second text encoding feature; in response to determining that the sample task description information includes the example image, using the pre-trained second image encoding submodel in the task encoding submodel to perform feature extraction on the example image to obtain the example image feature; and using the second task type encoding submodel in the task encoding submodel to encode at least one encoding feature output by the pre-trained second text encoding submodel and the pre-trained second image encoding submodel to obtain the sample task encoding feature.

[0094] Therefore, through the above method, it is possible to convert explicit task description information into implicit representation related to the current image processing task through text encoding and / or image encoding, so as to obtain task coding features with stronger expressive power and improve the predictive ability of the trained image processing model.

[0095] In some embodiments, the pre-trained second text encoding sub-model may adopt a Transformer-based text encoder, and the pre-trained second image encoding sub-model may adopt a commonly used image feature extraction backbone model, or may be built by itself according to needs, which is not limited here. In an exemplary embodiment, the pre-trained second image encoding sub-model may adopt a vision Transformer (Vit) model.

[0096] According to some embodiments, the pre-trained second text encoding sub-model and the pre-trained second image encoding sub-model may be obtained by pre-training a data set using images and texts, and the pre-trained second text encoding sub-model and the pre-trained second image encoding sub-model may be a text encoder and an image encoder in a pre-trained image-text comparison model (e.g., a CLIP model). The pre-trained second image encoding sub-model may share parameters with the first image encoding sub-model.

[0097] In some embodiments, step S703, training the deep learning model based on the prediction results and the true labels to obtain the image processing model may include: adjusting the parameters of the second task type encoding sub-model, the feature interaction encoding sub-model and the detection decoding sub-model based on the prediction results and the true labels.

[0098] Therefore, by using the second text encoding submodel and the first / second image encoding submodel obtained by pre-training the data set using images and text, and then adjusting the parameters of the first task type encoding submodel and the feature interaction encoding submodel, the first task type encoding submodel and the feature interaction encoding submodel are adapted to the semantic space of the trained second text encoding submodel and the first / second image encoding submodel, thereby achieving full utilization of the knowledge learned by these models in the pre-training stage and improving the accuracy of the image processing results.

[0099] According to some embodiments, the detection decoding sub-model may be obtained by pre-training using a target detection dataset. The target detection dataset may be, for example, an open source Object365 dataset, or other datasets, which are not limited herein. Thus, by pre-training the detection decoding sub-model, it may initially have a certain ability to extract information about the target (object) in the image, thereby reducing the training difficulty of the above training method.

[0100] In some embodiments, the following training strategy can be used to train the image processing capabilities of the second task type. In the first stage, a fixed large data set can be used to train the detection decoding submodel to give the model a good initialization. The fixed data set may include hundreds of thousands of sample data, but the number of tasks is small and they are more conventional tasks (for example, only target detection tasks). In the second stage, the detection decoding submodel and the task encoding submodel can be trained using a large amount of data from downstream tasks. The data used in the second stage may include tens of thousands of sample data of various specific downstream tasks (for example, detecting flaws in the image, detecting pedestrians running red lights, and detecting not wearing helmets), but the number of samples for each specific task is relatively small (on the order of hundreds to thousands).

[0101] According to some embodiments, the second task type includes an object detection task and an image segmentation task. Thus, the trained general image processing model can be used to process the above image processing tasks.

[0102] According to some embodiments, the feature interaction encoding sub-model may be a large-scale model based on an attention mechanism. A large-scale model may refer to a model trained on large-scale data. By adopting a large-scale model based on an attention mechanism, it is possible to fully integrate and interact the information included in the task encoding features and the target image features, and obtain features to be decoded with strong predictive capabilities, thereby obtaining accurate image processing results.

[0103] In some embodiments, the true label may be the result generated by the desired image processing model. In step S703, a loss value may be calculated based on the predicted result and the true label, and the deep learning model may be trained based on the loss value to obtain a trained image processing model. Different loss values ​​may be designed and used for different types of tasks.

[0104] According to another aspect of the present disclosure, an image processing device is provided. Figure 8 As shown, the device 800 includes: a first acquisition unit 810, configured to acquire a target image and task description information of an image processing task of the target image, and determine a target task type corresponding to the image processing task from a plurality of preset task types; and an image processing model 820, configured to process the target image and the task description information to obtain a processing result of the target image. The image processing model 820 includes: a plurality of task encoding sub-models 822 corresponding to a plurality of preset task types, the task encoding sub-model being configured to, in response to determining that the target task type is the preset task type corresponding to the task encoding sub-model, extract features from the task description information to obtain task encoding features; a first image encoding sub-model 824 being configured to extract features from the target image to obtain target image features; a feature interaction encoding sub-model 826 being configured to encode task encoding features and target image features to obtain features to be decoded; and a plurality of task decoding sub-models 828 corresponding to a plurality of preset task types, the task decoding sub-model being configured to, in response to determining that the target task type is the preset task type corresponding to the task decoding sub-model, decode the features to be decoded to obtain a processing result of the target image.

[0105] It is understood that the operations and effects of the units 810-unit (model) 820 and their subunits (submodels) in the device 800 can be referred to the above description of Figure 2 The description of steps S201-S202 and their sub-steps in are not repeated here.

[0106] According to another aspect of the present disclosure, a training device for an image processing model is provided. Fig. 9As shown, the device 900 includes: a second acquisition unit 910, configured to acquire a sample image, sample task description information of a sample image processing task for the sample image, and a true label, and determine a sample task type corresponding to the sample image processing task from multiple preset task types; a deep learning model 920, configured to process the sample image and the sample task description information to obtain a prediction result of the sample image. The deep learning model 920 includes: a plurality of task encoding sub-models 922 corresponding to a plurality of preset task types, the task encoding sub-model is configured to extract features from the sample task description information in response to determining that the sample task type is the preset task type corresponding to the task encoding sub-model, so as to obtain sample task encoding features; a first image encoding sub-model 924, configured to extract features from the sample image, so as to obtain sample image features; a feature interaction encoding sub-model 926, configured to encode the sample task encoding features and the sample image features, so as to obtain sample features to be decoded; and a plurality of task decoding sub-models 928 corresponding to a plurality of preset task types, the task decoding sub-model is configured to decode the sample features to be decoded in response to determining that the sample task type is the preset task type corresponding to the task encoding sub-model, so as to obtain a prediction result of the sample image. The device 900 also includes: a training unit 930, configured to train the deep learning model based on the prediction result and the true label, so as to obtain an image processing model.

[0107] It is understood that the operations and effects of the units 910 to 930 and their sub-units (sub-models) in the device 900 can be referred to the above description of Figure 7 The description of steps S701 to S703 and their sub-steps are not repeated here.

[0108] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0109] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.

[0110] refer to Fig.10, a block diagram of an electronic device 1000 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0111] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0112] Multiple components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, an output unit 1007, a storage unit 1008, and a communication unit 1009. The input unit 1006 can be any type of device that can input information to the device 1000. The input unit 1006 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a trackpad, a trackball, a joystick, a microphone and / or a remote control. The output unit 1007 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator and / or a printer. The storage unit 1008 can include but is not limited to a disk, an optical disk. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as Bluetooth TM devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0113] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning network algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as image processing methods and / or training methods for image processing models. For example, in some embodiments, the image processing methods and / or training methods for image processing models may be implemented as computer software programs, which are tangibly included in machine-readable media, such as storage units 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the image processing methods and / or training methods for image processing models described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute the image processing method and / or the image processing model training method in any other suitable manner (for example, by means of firmware).

[0114] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0115] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0116] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0117] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0118] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0119] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0121] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. An image processing method, comprising: Acquire a target image and task description information of an image processing task of the target image, and determine a target task type corresponding to the image processing task from a plurality of preset task types; as well as The target image and the task description information are processed using an image processing model to obtain a processing result of the target image, wherein the image processing model includes a plurality of task encoding sub-models and a plurality of task decoding sub-models corresponding to the plurality of preset task types, and includes a first image encoding sub-model and a feature interaction encoding sub-model shared by the plurality of preset task types, wherein the processing includes: Extracting features from the task description information using a task coding sub-model corresponding to the target task type to obtain task coding features; Using the first image coding sub-model to perform feature extraction on the target image to obtain target image features; Encoding the task encoding features and the target image features using the feature interaction encoding submodel to obtain features to be decoded; and The to-be-decoded features are decoded using a task decoding sub-model corresponding to the target task type to obtain a processing result of the target image.

2. The method according to claim 1, wherein: The multiple preset task types include a first task type, and the task decoding submodel corresponding to the first task type is a text decoding submodel. The processing result output by the text decoding submodel includes predicted text related to high-level semantic information of the target image.

3. The method according to claim 2, wherein: The task description information corresponding to the first task type includes a first task description text, and the task description information is subjected to feature extraction using a task coding submodel corresponding to the target task type to obtain task coding features including: In response to determining that the target task type is the first task type, extracting features from a first task description text included in the task description information using a first text encoding submodel in the task encoding submodel to obtain a first text encoding feature; and The first text encoding feature is encoded using a first task type encoding sub-model in the task encoding sub-model to obtain the task encoding feature.

4. The method according to claim 2, wherein: The first task types include target recognition tasks, image description tasks and visual question answering tasks.

5. The method according to any one of claims 1 to 4, wherein: The multiple preset task types include a second task type, and the task decoding sub-model corresponding to the second task type is a detection decoding sub-model. The processing result output by the detection decoding sub-model includes a prediction result related to the object in the target image.

6. The method according to claim 5, wherein: The task description information corresponding to the second task type includes at least one of a second task description text and an example image, and the task description information is subjected to feature extraction using a task encoding submodel corresponding to the target task type to obtain a task encoding feature including: In response to determining that the target task type is the second task type, and in response to determining that the task description information includes a second task description text, extracting features of the second task description text information using a second text encoding submodel in the task encoding submodel to obtain a second text encoding feature; In response to determining that the task description information includes an example image, extracting features from the example image using a second image encoding submodel in the task encoding submodel to obtain example image features; and The second task type encoding submodel in the task encoding submodel is used to encode at least one encoding feature output by the second text encoding submodel and the second image encoding submodel to obtain the task encoding feature.

7. The method according to claim 5, wherein: The second task type includes target detection tasks and image segmentation tasks.

8. The method according to any one of claims 1 to 4, wherein: The feature interaction encoding sub-model is a large-scale model based on the attention mechanism.

9. A method for training an image processing model, comprising: Acquire a sample image, sample task description information of a sample image processing task of the sample image, and a true label, and determine a sample task type corresponding to the sample image processing task from a plurality of preset task types; The sample image and the sample task description information are processed using a deep learning model to obtain a prediction result of the sample image, wherein the deep learning model includes a plurality of task encoding sub-models and a plurality of task decoding sub-models corresponding to the plurality of preset task types, and includes a first image encoding sub-model and a feature interaction encoding sub-model shared by the tasks of the plurality of preset task types, and the processing includes: Extracting features of the sample task description information using a task coding sub-model corresponding to the sample task type to obtain sample task coding features; Using the first image coding sub-model to perform feature extraction on the sample image to obtain sample image features; Encoding the sample task coding features and the sample image features using the feature interaction coding sub-model to obtain sample features to be decoded; and Decoding the sample to-be-decoded features using a task decoding sub-model corresponding to the sample task type to obtain a prediction result of the sample image; and Based on the prediction results and the true labels, the deep learning model is trained to obtain an image processing model.

10. The method according to claim 9, wherein: The multiple preset task types include a first task type, and the task decoding submodel corresponding to the first task type is a pre-trained text decoding submodel. The prediction result output by the text decoding submodel includes predicted text related to the high-level semantic information of the sample image.

11. The method according to claim 10, wherein: The sample task description information corresponding to the first task type includes a first task description text, and the sample task description information is subjected to feature extraction using the task coding submodel corresponding to the sample task type to obtain sample task coding features including: In response to determining that the sample task type is the first task type, extracting features of the first task description text included in the sample task description information using a pre-trained first text encoding sub-model in the task encoding sub-model to obtain a first text encoding feature; and The first text encoding feature is encoded using a first task type encoding sub-model in the task encoding sub-model to obtain the sample task encoding feature.

12. The method according to claim 11, wherein: The pre-trained first text encoding sub-model and the first image encoding sub-model are obtained by pre-training a data set using images and texts. Wherein, based on the prediction result and the true label, the deep learning model is trained to obtain an image processing model, including: Based on the prediction result and the true label, adjust the parameters of the first task type encoding submodel and the feature interaction encoding submodel.

13. The method according to claim 10, wherein: The first task types include target recognition tasks, image description tasks and visual question answering tasks.

14. The method according to any one of claims 9 to 13, wherein: The multiple preset task types include a second task type, and the task decoding sub-model corresponding to the second task type is a detection decoding sub-model. The prediction results output by the detection decoding sub-model include prediction results related to the objects in the sample image.

15. The method according to claim 14, wherein: The sample task description information corresponding to the second task type includes at least one of a second task description text and an example image, and the task encoding submodel corresponding to the sample task type is used to extract features from the sample task description information to obtain sample task encoding features including: In response to determining that the sample task type is the second task type, and in response to determining that the sample task description information includes a second task description text, extracting features from the second task description text using a pre-trained second text encoding submodel in the task encoding submodel to obtain a second text encoding feature; In response to determining that the sample task description information includes an example image, extracting features of the example image using a pre-trained second image encoding sub-model in the task encoding sub-model to obtain example image features; and The second task type encoding submodel in the task encoding submodel is used to encode at least one encoding feature output by the pre-trained second text encoding submodel and the pre-trained second image encoding submodel to obtain the sample task encoding feature.

16. The method according to claim 15, wherein: The pre-trained second text encoding sub-model and the pre-trained second image encoding sub-model are obtained by pre-training a data set using images and texts, and the pre-trained second image encoding sub-model shares parameters with the first image encoding sub-model. Wherein, based on the prediction result and the true label, the deep learning model is trained to obtain an image processing model, including: Based on the prediction result and the true label, the parameters of the second task type encoding sub-model, the feature interaction encoding sub-model and the detection decoding sub-model are adjusted.

17. The method according to claim 14, wherein: The detection decoding sub-model is obtained by pre-training using a target detection dataset.

18. The method according to claim 14, wherein: The second task type corresponds to target detection tasks and image segmentation tasks.

19. The method according to any one of claims 9 to 13, wherein: The feature interaction encoding sub-model is a large-scale model based on the attention mechanism.

20. An image processing device, comprising: A first acquisition unit is configured to acquire a target image and task description information of an image processing task of the target image, and determine a target task type corresponding to the image processing task from a plurality of preset task types; as well as An image processing model is configured to process the target image and the task description information to obtain a processing result of the target image, wherein the image processing model includes: a plurality of task coding sub-models corresponding to the plurality of preset task types, the task coding sub-model being configured to, in response to determining that the target task type is a preset task type corresponding to the task coding sub-model, perform feature extraction on the task description information to obtain task coding features; A first image coding sub-model is configured to perform feature extraction on the target image to obtain target image features; A feature interaction encoding sub-model, configured to encode the task encoding feature and the target image feature to obtain a feature to be decoded; and Multiple task decoding sub-models corresponding to the multiple preset task types, the task decoding sub-model being configured to, in response to determining that the target task type is a preset task type corresponding to the task decoding sub-model, decode the to-be-decoded features to obtain a processing result of the target image.

21. A training device for an image processing model, comprising: A second acquisition unit is configured to acquire a sample image, sample task description information of a sample image processing task of the sample image, and a true label, and determine a sample task type corresponding to the sample image processing task from a plurality of preset task types; A deep learning model is configured to process the sample image and the sample task description information to obtain a prediction result of the sample image, wherein the deep learning model includes: a plurality of task coding sub-models corresponding to the plurality of preset task types, the task coding sub-model being configured to, in response to determining that the sample task type is a preset task type corresponding to the task coding sub-model, perform feature extraction on the sample task description information to obtain a sample task coding feature; The first image coding sub-model is configured to perform feature extraction on the sample image to obtain sample image features; A feature interaction encoding sub-model is configured to encode the sample task encoding feature and the sample image feature to obtain a sample feature to be decoded; and a plurality of task decoding sub-models corresponding to the plurality of preset task types, the task decoding sub-model being configured to, in response to determining that the sample task type is a preset task type corresponding to the task encoding sub-model, decode the sample to-be-decoded features to obtain a prediction result of the sample image; and A training unit is configured to train the deep learning model based on the prediction result and the true label to obtain an image processing model.

22. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 19.

23. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-19.

24. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 19 is implemented.

Citation Information

Patent Citations

  • Image classification method and device

    CN112633425A

  • Target detection model training method, target detection method and device

    CN115170887A