A data processing method and apparatus

By introducing cross-modal feature fusion with target holistic constraints into a language-driven precise instance segmentation method, the problems of inaccurate target localization and mask prediction are solved, and the processing accuracy of the model is improved.

CN115757692BActive Publication Date: 2026-07-10HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2022-10-20
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing language-driven methods for accurate instance segmentation suffer from inaccurate target localization and mask prediction, especially when multiple crowded objects of the same type are present, making it difficult to accurately locate a single instance object. Furthermore, bounding box predictions tend to overflow onto adjacent objects of the same type.

Method used

By acquiring image and text features, cross-modal feature fusion is performed using neural networks and bidirectional attention mechanisms. The overall constraint of the target is introduced, transforming image features from pixel-level granularity to target object-level granularity. Instance regions are activated and fused using the target as the unit.

Benefits of technology

The model's processing accuracy has been improved, enhancing the accuracy of target object localization and mask prediction, while reducing errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757692B_ABST
    Figure CN115757692B_ABST
Patent Text Reader

Abstract

A data processing method applied to image processing, such as image segmentation or object detection, the method comprising: obtaining a first image feature corresponding to an image and a text feature corresponding to a text; obtaining a plurality of second embedding vectors by a neural network according to a plurality of first embedding vectors and the first image feature, each second embedding vector corresponding to a candidate region of a target object; each second embedding vector and the first image feature are used to fuse to obtain a corresponding second image feature; determining a weight corresponding to each second embedding vector according to the similarity between the text feature and the plurality of second embedding vectors, and the plurality of weights are used to weight the plurality of second image features to determine a predicted region corresponding to the target object. The present application changes the image feature from pixel granularity to target object granularity, and fuses the pixels belonging to the same target object as a whole with language coding, which can improve the processing accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more particularly to a data processing method and apparatus thereof. Background Technology

[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0003] Language-driven precise instance segmentation is a special semantic segmentation technique that refers to accurately segmenting the instance target described by the language in an image based on natural language guidance. Its characteristics are: 1) Traditional semantic segmentation models predict the same label for all targets belonging to the same category, without distinguishing between different targets within the same category. In contrast, language-driven precise instance segmentation needs to accurately identify the instance target corresponding to the language description from multiple targets of the same category; 2) Semantic segmentation models need to predefine a set of semantic category labels in order to learn to segment targets of these categories. In contrast, language-driven precise instance segmentation can accept more flexible natural language input and is not limited to the target category.

[0004] Due to the flexibility of natural language input, language-driven instance segmentation methods mainly rely on fusing natural language sentence encoding and image visual encoding to activate regions on the visual feature map that are highly correlated with language encoding. However, this cross-modal feature fusion approach faces challenges in two main aspects. First, instance target localization is inaccurate, failing to accurately lock a single instance target among multiple crowded similar targets. Second, the predicted mask is not accurate enough, easily overflowing onto adjacent similar targets. These problems also exist in object detection tasks. Summary of the Invention

[0005] This application provides a data processing method that can effectively solve the problems of inaccurate target localization, mask prediction, or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving the processing accuracy of the model.

[0006] In a first aspect, this application provides a data processing method, comprising: acquiring a first image feature corresponding to an image and a text feature corresponding to text; the semantics of the text corresponds to a target object, and the text indicates a region corresponding to the target object to be predicted from the image; obtaining a plurality of second embedding vectors through a neural network based on a plurality of preset first embedding vectors and the first image features, each second embedding vector corresponding to an object in the image; fusing each second embedding vector and the first image feature to obtain a corresponding second image feature; determining a weight corresponding to each second embedding vector based on the similarity between the text feature and the plurality of second embedding vectors, wherein the plurality of weights are fused (e.g., weighted) with the plurality of second image features to determine the predicted region corresponding to the target object.

[0007] The image may include multiple objects, including the target object. Each second embedding vector corresponds to one object in the image, and one or more of the multiple second embedding vectors may correspond to the target object. It should be understood that "corresponds" here means that the second embedding vector is used to describe the features of an object in the image. The second embedding vector obtained by the neural network can distinguish different objects in the image so that subsequent prediction can be performed at the object level.

[0008] This is equivalent to changing image features from pixel-level granularity to target-object-level granularity. In other words, it introduces the overall constraint of the target in cross-modal feature fusion, treating pixels belonging to the same target as a whole and fusing them with language encoding. By activating instance regions on a target-by-target basis, it can effectively solve the problem of inaccurate target localization and mask prediction or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving the processing accuracy of the model.

[0009] In one possible implementation, the prediction region is a mask region or a detection box.

[0010] In one possible implementation, the semantics of the text corresponds to the target object, specifically including: the semantics of the text is used to describe the characteristics of the target object.

[0011] In one possible implementation, obtaining the first image features corresponding to the image and the text features corresponding to the text includes:

[0012] The image is processed by an image encoder to obtain the image features corresponding to the image;

[0013] The text is processed by a text encoder to obtain the first text feature corresponding to the text;

[0014] By fusing the third image features and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

[0015] In one possible implementation, the first image feature is a feature upsampled to the same size as the image.

[0016] In one possible implementation, the neural mesh comprises multiple transformer layers.

[0017] Secondly, a data processing method includes:

[0018] The first image feature corresponding to the image and the text feature corresponding to the text are obtained; the semantics of the text correspond to the target object, and the text indicates the region corresponding to the target object predicted from the image; the first image feature and the text feature are obtained based on a feature extraction network;

[0019] Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature;

[0020] Based on the similarity between the text features and the plurality of second embedding vectors, a weight corresponding to each second embedding vector is determined, and the plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object;

[0021] The feature extraction network and the neural network are updated based on the difference between the predicted region and the real region corresponding to the target object in the image.

[0022] The image may include multiple objects, including the target object. Each second embedding vector corresponds to one object in the image, and one or more of the multiple second embedding vectors may correspond to the target object. It should be understood that "corresponds" here means that the second embedding vector is used to describe the features of an object in the image. The second embedding vector obtained by the neural network can distinguish different objects in the image so that subsequent prediction can be performed at the object level.

[0023] This is equivalent to changing image features from pixel-level granularity to target-object-level granularity. In other words, it introduces the overall constraint of the target in cross-modal feature fusion, treating pixels belonging to the same target as a whole and fusing them with language encoding. By activating instance regions on a target-by-target basis, it can effectively solve the problem of inaccurate target localization and mask prediction or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving the processing accuracy of the model.

[0024] In one possible implementation, the prediction region is a mask region or a detection box.

[0025] In one possible implementation, the semantics of the text corresponds to the target object, specifically including: the semantics of the text is used to describe the characteristics of the target object.

[0026] In one possible implementation, obtaining the first image features corresponding to the image and the text features corresponding to the text includes:

[0027] The image is processed by an image encoder to obtain the image features corresponding to the image;

[0028] The text is processed by a text encoder to obtain the first text feature corresponding to the text;

[0029] By fusing the third image features and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

[0030] Thirdly, this application provides a data processing apparatus, comprising:

[0031] The processing module is used to acquire the first image features corresponding to the image and the text features corresponding to the text; the semantics of the text corresponds to the target object, and the text indicates the region corresponding to the target object to be predicted from the image;

[0032] Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature;

[0033] Based on the similarity between the text features and the plurality of second embedding vectors, a weight is determined for each second embedding vector. The plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object.

[0034] The image may include multiple objects, including the target object. Each second embedding vector corresponds to one object in the image, and one or more of the multiple second embedding vectors may correspond to the target object. It should be understood that "corresponds" here means that the second embedding vector is used to describe the features of an object in the image. The second embedding vector obtained by the neural network can distinguish different objects in the image so that subsequent prediction can be performed at the object level.

[0035] This is equivalent to changing image features from pixel-level granularity to target-object-level granularity. In other words, it introduces the overall constraint of the target in cross-modal feature fusion, treating pixels belonging to the same target as a whole and fusing them with language encoding. By activating instance regions on a target-by-target basis, it can effectively solve the problem of inaccurate target localization and mask prediction or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving the processing accuracy of the model.

[0036] In one possible implementation, the prediction region is a mask region or a detection box.

[0037] In one possible implementation, the semantics of the text corresponds to the target object, specifically including: the semantics of the text is used to describe the characteristics of the target object.

[0038] In one possible implementation, the processing module is specifically used for:

[0039] The image is processed by an image encoder to obtain the image features corresponding to the image;

[0040] The text is processed by a text encoder to obtain the first text feature corresponding to the text;

[0041] By fusing the third image features and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

[0042] In one possible implementation, the first image feature is a feature upsampled to the same size as the image.

[0043] In one possible implementation, the neural mesh comprises multiple transformer layers.

[0044] Fourthly, this application provides a data processing apparatus, comprising:

[0045] The processing module is used to acquire first image features corresponding to an image and text features corresponding to text; the semantics of the text corresponds to a target object, and the text indicates the region corresponding to the target object predicted from the image; the first image features and the text features are obtained based on a feature extraction network;

[0046] Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature;

[0047] Based on the similarity between the text features and the plurality of second embedding vectors, a weight corresponding to each second embedding vector is determined, and the plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object;

[0048] An update module is used to update the feature extraction network and the neural network based on the difference between the predicted region and the real region corresponding to the target object in the image.

[0049] In one possible implementation, the prediction region is a mask region or a detection box.

[0050] In one possible implementation, the semantics of the text corresponds to the target object, specifically including: the semantics of the text is used to describe the characteristics of the target object.

[0051] In one possible implementation, the processing module is specifically used for:

[0052] The image is processed by an image encoder to obtain the image features corresponding to the image;

[0053] The text is processed by a text encoder to obtain the first text feature corresponding to the text;

[0054] By fusing the third image features and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

[0055] Fifthly, embodiments of this application provide a data processing apparatus, which may include a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform the methods described in the first aspect and any optional methods described in the first aspect and any optional methods described in the second aspect.

[0056] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any optional methods thereof, as well as the methods described in the second aspect and any optional methods thereof.

[0057] In a seventh aspect, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any optional methods thereof, as well as the methods described in the second aspect and any optional methods thereof.

[0058] Eighthly, this application provides a chip system including a processor for supporting an execution data processing device in performing the functions involved in the foregoing aspects, such as transmitting or processing data involved in the foregoing methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the execution device or training device. This chip system may be composed of chips or may include chips and other discrete devices. Attached Figure Description

[0059] Figure 1A A structural diagram illustrating the main framework of artificial intelligence;

[0060] Figure 1B Hezhi Figure 1C This is a schematic diagram of the application system framework of this application;

[0061] Figure 1D This is a schematic diagram of an optional hardware structure for a terminal.

[0062] Figure 2 This is a schematic diagram of the structure of a server;

[0063] Figure 3 This is a schematic diagram of a system architecture according to this application;

[0064] Figure 4 A process for providing a cloud service;

[0065] Figure 5 This is a schematic diagram of a network structure;

[0066] Figure 6 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0067] Figures 7 to 10 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0068] Figure 11A and Figure 11B This is a schematic diagram illustrating one of the beneficial effects of this application;

[0069] Figure 12 A schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application;

[0070] Figure 13 A schematic diagram of the structure of the execution device provided in the embodiments of this application;

[0071] Figure 14 A schematic diagram of the structure of the training device provided in the embodiments of this application;

[0072] Figure 15 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation

[0073] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0074] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0075] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0076] The terms “substantially,” “about,” and similar terms used herein are used as approximations, not as terms of degree, and are intended to take into account the inherent biases of measurements or calculations known to those skilled in the art. Furthermore, the term “may” used in describing embodiments of this application means “one or more possible embodiments.” The terms “use,” “using,” and “used” used herein are to be considered synonymous with the terms “utilize,” “utilizing,” and “utilized,” respectively. Additionally, the term “exemplary” is intended to refer to an instance or illustration.

[0077] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1A , Figure 1A The diagram illustrates a structural framework for artificial intelligence (AI). The framework is further elaborated below along two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that AI brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed through technological means) to the industrial ecosystem of the system.

[0078] (1) Infrastructure

[0079] Infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. This communication occurs through sensors; computing power is provided by intelligent chips (hardware acceleration chips such as CPUs, NPUs, GPUs, ASICs, and FPGAs); and the basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.

[0080] (2) Data

[0081] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.

[0082] (3) Data processing

[0083] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.

[0084] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training on data, including symbolization and formalization.

[0085] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.

[0086] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.

[0087] (4) General ability

[0088] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.

[0089] (5) Smart Products and Industry Applications

[0090] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent terminals, intelligent transportation, intelligent healthcare, autonomous driving, smart cities, etc.

[0091] This application can be applied to the field of image processing in the field of artificial intelligence. The following will take image processing as an example to introduce several application scenarios that have been implemented in products.

[0092] First, let's introduce the application scenarios of this application.

[0093] In some scenarios, image processing capabilities can serve as a core algorithm module in a robot's visual-language navigation system. For example, a user might command a home robot to walk to a chair and retrieve a vase using verbal instructions. The robot needs to accurately segment or detect both the chair and the vase described in the language before it can complete the task of retrieving the vase.

[0094] In some scenarios, image processing capabilities can be applied to autonomous driving platforms. When a user interacts with the intelligent driving system using natural language, and the user requests to stop behind the yellow car on the right front, the recognition module of the intelligent driving system needs to first understand the user's natural language command and accurately segment or detect the yellow car to fulfill the user's request.

[0095] In some scenarios, image processing functions can be applied to interactive image editing systems. These systems need to modify images based on the user's natural language descriptions. Image processing functions can locate the areas the user wants to modify and then combine them with existing image editing tools to modify the image content.

[0096] This application may be used, but is not limited to, in applications with image processing functions (hereinafter referred to as image processing applications) or cloud services provided by cloud-side servers, which will be described in detail below:

[0097] I. Language-driven image processing applications

[0098] The product form of this application embodiment can be an image processing application, and more particularly, a language-driven image processing application. Language-driven image processing applications can run on terminal devices or cloud-based servers.

[0099] In one possible implementation, a language-driven image processing application can perform tasks such as image segmentation or object detection based on the input image and text, and obtain processing results. The processing results can be image segmentation results (masked regions) and detection boxes. The image segmentation results (masked regions) and detection boxes can contain objects indicated by the semantics of the text (such as the target object in the embodiments of this application).

[0100] In one possible implementation, a user can open an image processing application installed on a terminal device and input images and text. The image processing application can process the images and text using the methods provided in the embodiments of this application and present the processing results to the user (the presentation method may include, but is not limited to, displaying, saving, uploading to the cloud, etc.).

[0101] In one possible implementation, a user can open an image processing application installed on a terminal device and input an image. The image processing application can then send the image to a cloud-based server. The cloud-based server processes the image and text using the method provided in this application embodiment and sends the processing result back to the terminal device. The terminal device can then present the processing result to the user (the presentation method may include, but is not limited to, displaying, saving, or uploading to the cloud).

[0102] The image processing application in this application will be described below, focusing on its functional architecture and the product architecture that implements its functions.

[0103] Reference Figure 1B , Figure 1B This is a schematic diagram of the functional architecture of the image processing application in the embodiments of this application:

[0104] In one possible implementation, such as Figure 1B As shown, the image processing application 102 can receive input parameters 101 (e.g., including an image) and generate a processing result 103. The image processing application 102 can be executed on at least one computer system (for example) and includes computer code that, when executed by one or more computers, causes the computers to perform the methods provided in the embodiments of this application.

[0105] Reference Figure 1C , Figure 1CThis is a schematic diagram of the entity architecture for running an image processing application in this embodiment of the application:

[0106] See Figure 1C , Figure 1C A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers (…). Figure 1C (The example includes a server), and the server 200 can provide the methods provided in the embodiments of this application to one or more terminals.

[0107] The terminal 100 may have an image processing application installed. The application and webpage can provide an interface. The terminal 100 can receive relevant parameters input by the user on the language-driven image processing interface and send the parameters to the server 200. The server 200 can obtain the processing result based on the received parameters and return the processing result to the terminal 100.

[0108] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters on its own, without the need for the server to cooperate. This application embodiment is not limited to this.

[0109] The following description Figure 1C The product form of the mid-terminal 100;

[0110] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc., and this application embodiment does not impose any restrictions on it.

[0111] Figure 1D A schematic diagram of an optional hardware structure for terminal 100 is shown.

[0112] refer to Figure 1D As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), a processor 170, an external interface 180, a power supply 190, and other components. Those skilled in the art will understand that... Figure 1DThese are merely examples of terminals or multi-functional devices and do not constitute a limitation on terminals or multi-functional devices. They may include more or fewer components than shown in the illustration, or combine certain components, or use different components.

[0113] The input unit 130 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the portable multi-functional device. Specifically, the input unit 130 may include a touchscreen 131 (optional) and / or other input devices 132. The touchscreen 131 can collect touch operations performed by the user on or near it (such as operations performed by the user using fingers, knuckles, styluses, or any suitable object on or near the touchscreen), and drive the corresponding connection devices according to a pre-set program. The touchscreen can detect the user's touch actions, convert the touch actions into touch signals and send them to the processor 170, and can receive and execute commands sent by the processor 170; the touch signal includes at least touch point coordinate information. The touchscreen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, various types of touchscreens, such as resistive, capacitive, infrared, and surface acoustic wave, can be used to implement the touchscreen. Besides the touchscreen 131, the input unit 130 may also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0114] The input device 132 can receive input images, text, etc.

[0115] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In this embodiment, the display unit 140 can be used to display the interface of an image processing application, processing results, etc.

[0116] The memory 120 can be used to store instructions and data. The memory 120 may primarily include an instruction storage area and a data storage area. The data storage area can store various types of data, such as multimedia files and text. The instruction storage area can store software units such as operating systems, applications, and instructions required for at least one function, or subsets or extended sets thereof. It may also include non-volatile random access memory. It provides the processor 170 with hardware, software, and data resources for managing the computing device, supporting control software and applications. It is also used for storing multimedia files, as well as storing running programs and applications.

[0117] The processor 170 is the control center of the terminal 100. It connects various parts of the terminal 100 via various interfaces and lines. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it performs various functions and processes data of the terminal 100, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 170. In some embodiments, the processor and memory can be implemented on a single chip; in some embodiments, they can also be implemented separately on independent chips. The processor 170 can also be used to generate corresponding operation control signals, send them to the corresponding components of the computing processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that the various functional modules therein perform corresponding functions, thereby controlling the corresponding components to act according to the instructions.

[0118] The memory 120 can be used to store software code related to the data processing method, and the processor 170 can execute the steps of the chip's data processing method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve the corresponding functions.

[0119] The radio frequency unit 110 (optional) can be used for receiving and transmitting signals during information transmission or calls. For example, it can receive downlink information from the base station and process it for the processor 170; additionally, it can transmit uplink data to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the radio frequency unit 110 can also communicate wirelessly with network devices and other devices. This wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0120] In this embodiment of the application, the radio frequency unit 110 can send an image to the server 200 and receive the processing result sent by the server 200.

[0121] It should be understood that the radio frequency unit 110 is optional and can be replaced with other communication interfaces, such as a network port.

[0122] The terminal 100 also includes a power supply 190 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0123] Terminal 100 also includes an external interface 180, which can be a standard Micro USB interface or a multi-pin connector, which can be used to connect terminal 100 to other devices for communication or to connect a charger to charge terminal 100.

[0124] Although not shown, terminal 100 may also include a flash, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with various functions, etc., which will not be described in detail here. Some or all of the methods described below can be applied to, for example... Figure 1D In the terminal 100 shown.

[0125] The following description Figure 1C The product form of the mid-range server 200;

[0126] Figure 2 A structural diagram of a server 200 is provided, as follows: Figure 2 As shown, server 200 includes bus 201, processor 202, communication interface 203, and memory 204. Processor 202, memory 204, and communication interface 203 communicate with each other via bus 201.

[0127] Bus 201 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 2 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0128] The processor 202 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).

[0129] Memory 204 may include volatile memory, such as random access memory (RAM). Memory 204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0130] The memory 204 can be used to store software code related to the data processing method, and the processor 202 can execute the steps of the chip's data processing method, and can also schedule other units to achieve corresponding functions.

[0131] It should be understood that the aforementioned terminal 100 and server 200 can be centralized or distributed devices. The processors (e.g., processor 170 and processor 202) in the aforementioned terminal 100 and server 200 can be hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the processor can be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0132] It should be understood that the steps related to the model inference process in the embodiments of this application involve AI-related operations. When performing AI operations, the instruction execution architecture of the terminal device and server is not limited to the processor-memory architecture described above. The following section will further explain... Figure 3 The system architecture provided in the embodiments of this application will be described in detail.

[0133] Figure 3 This is a schematic diagram of the system architecture provided for an embodiment of this application. Figure 3 As shown, the system architecture 500 includes an execution device 510, a training device 520, a database 530, a client device 540, a data storage system 550, and a data acquisition system 560.

[0134] The execution device 510 includes a calculation module 511, an I / O interface 512, a preprocessing module 513, and a preprocessing module 514. The calculation module 511 may include a target model / rule 501, while the preprocessing modules 513 and 514 are optional.

[0135] The execution device 510 can be a terminal device or a server that runs the aforementioned image processing applications.

[0136] The data acquisition device 560 is used to acquire training samples. Training samples can be multiple images, etc. After acquiring the training samples, the data acquisition device 560 stores these training samples in the database 530.

[0137] The training device 520 can maintain training samples in the database 530 and obtain the target model / rule 501 from the neural network to be trained (e.g., the cross-modal language model in the embodiments of this application (e.g., including text encoder, image encoder, target encoder, etc.)).

[0138] It should be understood that the training device 520 can perform a pre-training process on the neural network to be trained based on the training samples maintained in the database 530, or fine-tune the model based on the pre-training.

[0139] It should be noted that in practical applications, the training samples maintained in database 530 may not all come from the data acquisition device 560; they may also be received from other devices. Furthermore, it should be noted that training device 520 may not necessarily train the target model / rule 501 entirely based on the training samples maintained in database 530; it may also obtain training samples from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0140] The target model / rule 501 trained using training device 520 can be applied to different systems or devices, such as... Figure 3 The execution device 510 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server, etc.

[0141] Specifically, the training device 520 can transfer the trained model to the execution device 510.

[0142] exist Figure 3 In the execution device 510, an input / output (I / O) interface 512 is configured for data interaction with external devices. Users can input data (such as images in this embodiment) into the I / O interface 512 through the client device 540.

[0143] Preprocessing modules 513 and 514 are used to preprocess the input data received from the I / O interface 512. It should be understood that preprocessing modules 513 and 514 may be absent, or only one preprocessing module may be used. When preprocessing modules 513 and 514 are absent, the calculation module 511 can be used directly to process the input data.

[0144] During the preprocessing of input data by the execution device 510, or during the calculation module 511 of the execution device 510 performing calculations and other related processes, the execution device 510 can call data, code, etc. in the data storage system 550 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 550.

[0145] Finally, the I / O interface 512 provides the processing result to the client device 540, thereby providing it to the user.

[0146] exist Figure 3 In the illustrated scenario, the user can manually provide input data, which can be done through the interface provided by I / O interface 512. Alternatively, the client device 540 can automatically send input data to I / O interface 512. If user authorization is required for the client device 540 to automatically send input data, the user can set the corresponding permissions in the client device 540. The user can view the output results of the execution device 510 on the client device 540, which can be presented in various forms such as display, sound, or animation. The client device 540 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530. Alternatively, data can be collected directly from the I / O interface 512 without going through the client device 540, using the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530.

[0147] It is worth noting that, Figure 3 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 3 In this context, the data storage system 550 is an external storage device relative to the execution device 510. However, in other cases, the data storage system 550 may also be placed within the execution device 510. It should be understood that the aforementioned execution device 510 may be deployed within the client device 540.

[0148] From the inference side of the model:

[0149] In this embodiment, the computing module 511 of the execution device 520 can obtain the code stored in the data storage system 550 to implement the steps related to the model reasoning process in this embodiment.

[0150] In this embodiment of the application, the computing module 511 of the execution device 520 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0151] Specifically, the computing module 511 of the execution device 520 can be a hardware system with the function of executing instructions. The steps related to the model inference process provided in this application embodiment can be software code stored in the memory. The computing module 511 of the execution device 520 can obtain the software code from the memory and execute the obtained software code to implement the steps related to the model inference process provided in this application embodiment.

[0152] It should be understood that the computing module 511 of the execution device 520 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the model reasoning process provided in the embodiments of this application can also be implemented by the hardware system in the computing module 511 of the execution device 520 without the function of executing instructions, which is not limited here.

[0153] From the training side of the model:

[0154] In this embodiment of the application, the training device 520 can access the memory ( Figure 3 (Not shown in the diagram, but can be integrated into the training device 520 or deployed separately from the training device 520) The code stored in the diagram can be used to implement the steps related to model training in the embodiments of this application.

[0155] In this embodiment of the application, the training device 520 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0156] It should be understood that the training device 520 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the training of the neutralization model provided in the embodiments of this application can also be implemented by the hardware system in the training device 520 without the function of executing instructions, which is not limited here.

[0157] II. Language-driven image processing cloud services provided by the server:

[0158] In one possible implementation, the server can provide language-driven image processing services to the client side via an application programming interface (API).

[0159] In this process, the terminal device can send relevant parameters (such as images) to the server through the API provided by the cloud. The server can obtain the processing results based on the received parameters and return the processing results to the terminal.

[0160] The description of the terminal and server can be found in the above embodiments, and will not be repeated here.

[0161] like Figure 4 The process of using a language-driven image processing cloud service provided by a cloud platform is illustrated.

[0162] 1. Activate and purchase content moderation services.

[0163] 2. Users can download the software development kit (SDK) corresponding to the content moderation service. Cloud platforms usually provide multiple development versions of the SDK for users to choose from according to their development environment needs, such as JAVA version SDK, Python version SDK, PHP version SDK, Android version SDK, etc.

[0164] 3. After downloading the corresponding version of the SDK to their local machine according to their needs, users can import the SDK project into their local development environment, configure and debug it in the local development environment, and develop other functions in the local development environment, thus forming an application that integrates language-driven image processing capabilities.

[0165] 4. When a language-driven image processing application is used, it can trigger a language-driven image processing API call when language-driven image processing is required. When the application triggers the language-driven image processing function, it initiates an API request to the running instance of the language-driven image processing service in the cloud environment. The API request carries the image, which is then processed by the running instance in the cloud environment to obtain the processing result.

[0166] 5. The cloud environment returns the processing result to the application, thereby completing one method call provided in this embodiment of the application.

[0167] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts such as neural networks involved in the embodiments of this application will be introduced below.

[0168] (1) Neural Network

[0169] A neural network can be composed of neural units, which can be defined as a computational unit that takes xs (i.e., input data) and an intercept of 1 as input. The output of this computational unit can be:

[0170]

[0171] Where s = 1, 2, ..., n, where n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer, and the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple of the above-mentioned individual neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.

[0172] (2) Transformer layer

[0173] Reference Figure 5 , Figure 5 This is a schematic diagram of a transformer layer architecture, such as Figure 5 As shown, the neural network includes an embedding layer and at least one transformer layer. The at least one transformer layer can be N transformer layers (N being an integer greater than 0). Each transformer layer includes sequentially adjacent attention layers, add and normalize layers, feed-forward layers, and add and normalize layers. In the embedding layer, the current input is embedded to obtain multiple embedding vectors. In the attention layer, P input vectors are obtained from the layer above the first transformer layer. Using any first input vector among the P input vectors as the center, based on the correlation between each input vector within a preset attention window and the first input vector, an intermediate vector corresponding to the first input vector is obtained. This process determines P intermediate vectors corresponding to the P input vectors. In the pooling layer, the P intermediate vectors are merged into Q output vectors, where the multiple output vectors obtained from the last transformer layer are used as feature representations of the current input.

[0174] (3) Attention mechanism

[0175] Attention mechanisms mimic the internal processes of biological observation—aligning internal experience with external senses to increase the precision of observation in specific areas. They enable the rapid sifting of high-value information from a large volume of data using limited attentional resources. Attention mechanisms can quickly extract important features from sparse data and are therefore widely used in natural language processing tasks, particularly machine translation. Self-attention mechanisms, an improvement on attention mechanisms, reduce reliance on external information and are better at capturing the internal correlations of data or features. The core idea of ​​attention mechanisms can be rewritten as follows:

[0176] In this formula, Lx = ||Source|| represents the length of the Source. The meaning is that the elements in the Source are imagined as a series of data pairs. Given a Query element in the Target, the similarity or relevance between the Query and each Key is calculated to obtain the weight coefficient of the Value corresponding to each Key. Then, the Values ​​are weighted and summed to obtain the final Attention value. Therefore, the Attention mechanism essentially performs a weighted sum of the Values ​​of the elements in the Source, while the Query and Key are used to calculate the weight coefficients of their corresponding Values. Conceptually, Attention can be understood as selectively filtering a small amount of important information from a large amount of information and focusing on this important information, ignoring most of the unimportant information. The focusing process is reflected in the calculation of the weight coefficients; the larger the weight, the more focused it is on its corresponding Value. That is, the weight represents the importance of the information, and the Value is the corresponding information. Self-attention can be understood as intra attention. The attention mechanism occurs between the elements of the Target (Query) and all elements of the Source. Self-attention refers to the attention mechanism that occurs between elements within the Source or between elements within the Target. It can also be understood as the attention calculation mechanism in the special case where Target = Source. The specific calculation process is the same, only the calculation object changes.

[0177] (4) Natural Language Processing (NLP)

[0178] Natural language is human language, and Natural Language Processing (NLP) is the processing of human language. NLP is a systematic process of analyzing, understanding, and extracting information from text data in an intelligent and efficient manner. By using NLP and its components, it is possible to manage very large amounts of text data, perform numerous automated tasks, and solve a wide variety of problems, such as automatic summarization, machine translation (MT), named entity recognition (NER), relation extraction (RE), information extraction (IE), sentiment analysis, speech recognition, question answering systems, and topic segmentation, among others.

[0179] (5) Pre-trained language model

[0180] A pre-trained language model is a natural language sequence encoder that encodes each word in a natural language sequence into a vector representation for prediction tasks. Its training consists of two phases. In the pre-training phase, the model is trained on a large-scale unsupervised text environment to learn word representations. In the fine-tuning phase, the model is initialized using the parameters learned in the pre-training phase and then trained on downstream tasks such as text classification and sequence labeling with fewer steps, successfully transferring the semantic information obtained in pre-training to downstream tasks.

[0181] (6) Backpropagation algorithm

[0182] Convolutional neural networks can employ backpropagation (BP) to correct the parameters in the initial super-resolution model during training, thereby reducing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates an error loss; this error loss information is then propagated back to update the parameters in the initial super-resolution model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the super-resolution model, such as the weight matrix.

[0183] (7) Loss Function

[0184] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.

[0185] Language-driven precise instance segmentation is a special semantic segmentation technique that refers to accurately segmenting the instance target described by the language in an image based on natural language guidance. Its characteristics are: 1) Traditional semantic segmentation models predict the same label for all targets belonging to the same category, without distinguishing between different targets within the same category. In contrast, language-driven precise instance segmentation needs to accurately identify the instance target corresponding to the language description from multiple targets of the same category; 2) Semantic segmentation models need to predefine a set of semantic category labels in order to learn to segment targets of these categories. In contrast, language-driven precise instance segmentation can accept more flexible natural language input and is not limited to the target category.

[0186] Due to the flexibility of natural language input, language-driven instance segmentation methods mainly rely on fusing natural language sentence encoding and image visual encoding to activate regions on the visual feature map that are highly correlated with language encoding. However, this cross-modal feature fusion scheme faces challenges in two main aspects. First, instance target localization is inaccurate, failing to accurately lock a single instance target among multiple crowded similar targets. Second, the predicted mask is not accurate enough, easily overflowing onto adjacent similar targets.

[0187] To address the aforementioned problems, embodiments of this application provide a data processing method. The data processing method of this application embodiment will be described in detail below with reference to the accompanying drawings.

[0188] Reference Figure 6 , Figure 6This is a flowchart illustrating a data processing method provided in an embodiment of this application, such as... Figure 6 As shown in the embodiment of this application, a data processing method may include steps 601 to 603, which are described in detail below.

[0189] 601. Obtain the first image features corresponding to the image and the text features corresponding to the text; the semantics of the text corresponds to the target object, and the text indicates the region corresponding to the target object predicted from the image.

[0190] In one possible implementation, the semantics of the text can indicate the masked region (image segmentation task) or the detection box (object detection task) corresponding to the target object in the image.

[0191] In one possible implementation, the semantics of the text are used to describe the characteristics of the target object. For example, if an image includes two vases, one red and one yellow, the text could be "the red vase." Or, if an image includes two vases, one on the left and one on the right, the text could be "the left vase."

[0192] In one possible implementation, after obtaining the image and text, features can be extracted and aligned to obtain the first image features corresponding to the image and the text features corresponding to the text.

[0193] In one possible implementation, obtaining the first image feature corresponding to the image and the text feature corresponding to the text specifically includes: processing the image through an image encoder to obtain the image feature corresponding to the image, processing the text through a text encoder to obtain the first text feature corresponding to the text, and fusing the third image feature and the first text feature through a bidirectional attention mechanism to obtain the first image feature corresponding to the image and the text feature corresponding to the text.

[0194] For example, image encoder f v (Or it can be called a visual encoder) For a given visual image I, the Swing Transformer can be used as a visual encoder to extract multi-level visual features. The multi-scale visual features generated by multiple stages (taking four stages as an example) in the Swing Transformer are denoted as...

[0195] For example, text encoder f l (Or it could be called a language encoder) A multi-layer BERT (taking 12 layers as an example) can be used as a language encoder, for a given language expression W = {w i} i=1,…,TWhere T is the length of the expression. First, the BERT word segmenter based on WordPiece is used to obtain embedded word vectors E. E is then fed into the hidden encoding layer of BERT to extract language features. To align with the visual features output from the four stages of the Swin Transformer, every three layers in BERT can be aggregated into a single stage. This allows us to obtain the same number of language features as the visual features, denoted as . Reference Figure 7 Furthermore, the corresponding language features can be labeled with [CLS] later, making it a global semantic representation vector, denoted as L. g .

[0196] In one possible implementation, a word-pixel alignment module can be used to implement a bidirectional attention mechanism. This module is a cross-modal, gated bidirectional attention module that promotes the alignment of visual and linguistic features in the feature space during the image and sentence encoding stages. The learnable feature threshold mechanism prevents the original feature information from being overwhelmed when updating the fused features. The alignment effect of word-pixel alignment can be as follows: Figure 8 As shown, the Word-Pixel Alignment module integrates language information into visual encoding and vice versa during the visual and language information encoding stages, thereby establishing a correlation between the word features of a sentence and the corresponding pixel features in the image in the cross-modal feature space.

[0197] In one possible implementation, the cross-modal bidirectional attention module BiAttn interacts visual and linguistic features in the feature space. This module is used to fuse visual and linguistic features from each stage of the dual encoder. Optionally, its operation is defined as follows:

[0198] V′ i ,L′ i =BiAttn(V i ,L i ),i∈P1,…,4};

[0199] The specific calculation process of the BiAttn function is as follows:

[0200]

[0201]

[0202]

[0203] Where d kIt is the dimension of the visual language joint embedding space, W v W l ,W′ v ,W′ l All are projection matrices. Optional, to prevent feature fusion V′ i ,L′ i It will completely cover the original feature V i and L i Based on this information, a multilayer perceptron (MLP) was designed as a gate to control the amount of information flowing into the fused features:

[0204] V′ i ←Gate(V′ i ),L′ i ←Gate(L′ i );

[0205] F′ i =GATE(F i ) = MLP(F i )⊙F i ;

[0206] Where F i F′ represents the fusion feature in the BCA module. i The symbol represents the fused feature after suppression, and ⊙ represents element-wise matrix multiplication. An MLP is a two-layer perceptron: the first layer is a linear layer followed by a ReLU activation function, and the second layer is also a linear layer followed by a hyperbolic tangent activation function.

[0207] In one possible implementation, to better capture high-level semantics and generate pixel-level fused features, a multi-head attention layer can be used to fuse high-level features from the visual language encoder. First, the high-level visual features V... o and language features L o All features are projected onto the same feature space, and then concatenated into a fused feature F. o Then it is fed into the cross-attention layer. Before concatenation, a learnable position vector e is... p This is added to the projected visual features. Finally, the cross-attention layer outputs feature S. o The above calculation can be expressed as the following formula:

[0208]

[0209] S o =CrossAttn(F o )+V o ,F o =[V′ o ;L′ o ],;

[0210] in Let be the projection matrix, and [;] represent the tensor splicing operation.

[0211] In one possible implementation, a segmentation head can be constructed to upsample pixel-level features to the original image size to obtain the final segmentation map. For example, the input to the segmentation head can be S. o and multi-scale visual features Then the following output is obtained:

[0212]

[0213] Where ρ is a two-layer convolutional network, each layer being a 3×3 convolution plus ReLU and batch normalization, Up represents bilinear interpolation upsampling, and γ represents a 1×1 convolution. Each pixel is subjected to feature projection, and the output of the segmentation head is denoted as Y1.

[0214] 602. Based on a plurality of preset first embedding vectors and the first image feature, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image feature are fused to obtain a corresponding second image feature.

[0215] The neural network can process multiple first embedding vectors into multiple second embedding vectors based on the first image features. Each second embedding vector can correspond to a candidate region of the target object, and different second embedding vectors can correspond to different or overlapping candidate regions of the target object.

[0216] This is equivalent to changing image features from pixel-level granularity to target-object-level granularity. In other words, it introduces the overall constraint of the target in cross-modal feature fusion, treating pixels belonging to the same target as a whole and fusing them with language encoding. By activating instance regions on a target-by-target basis, it can effectively solve the problem of inaccurate target localization and mask prediction or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving segmentation accuracy.

[0217] In one possible implementation, the neural mesh comprises multiple transformer layers.

[0218] For example, taking image segmentation, the Sentence-object alignment module first generates potential target masks based on word-pixel aligned features, and then aligns the natural language sentence features with the target masks to more accurately locate the target instance. Figure 9As shown. This application embodiment designs a mask generator, MaskGenerator, based on the encoder output S. o Predict N possible target masks. The mask generator consists of a 6-layer Transformer decoder. Its input is S. o The first learnable embedding vector (i.e., the query vector Q) is given by N, and the output is N second embedding vectors (i.e., the target mask feature vector encoding Q). o ),Right now:

[0219] Q o =MaskGenerator(Q,S o ).;

[0220] 603. Based on the similarity between the text features and the plurality of second embedding vectors, determine the weight corresponding to each second embedding vector, and use the plurality of weights to fuse with the plurality of second image features to determine the prediction region corresponding to the target object.

[0221] Since only a portion of the multiple second embedding vectors correspond to the target object, after obtaining multiple second embedding vectors, a weight can be assigned to each second embedding vector based on the text features. The second embedding vector with the higher weight is most likely to contain the target object referred to by the text.

[0222] For example, taking image segmentation as an example, it can be based on text features L g For Q o Each mask vector (second embedding vector) is assigned a weight Q. w Q w A higher weight in the mask indicates that the corresponding mask is most likely to contain the object referred to by the language. Then, by using Q... o Multiplying by Y1 yields N masks for predicting Y. N Finally, Y N and Q w Multiplying them yields the final mask prediction M, a process that can be represented as follows:

[0223] Q w =softmax(sim(L) g Q o )),

[0224]

[0225] Where sim(,) represents the cosine similarity function. This represents broadcast tensor multiplication.

[0226] Figure 7This is a schematic diagram of a network architecture according to an embodiment of this application. The overall architecture follows the classic encoder-decoder paradigm. The encoder part consists of a visual encoder and a language encoder to extract visual and language features. A Word-Pixel Alignment (WPA) module acts as an intermediate layer between the visual and language encoders, enabling cross-modal interaction. A cross-attention layer then fuses the outputs of the visual and language encoders across modalities. The decoder part consists of a mask generator that generates N mask query vectors, a segmentation head that upsamples pixel features, and a Sentence-Object Alignment (SOA) module. SOA assigns weights to the output mask query vectors based on sentence features and uses these weights to perform a weighted summation of the segmentation features generated by the segmentation head to obtain the final segmentation mask.

[0227] Regarding the training process of the above model, taking image segmentation as an example, for reference image segmentation, each pixel in the image must be classified as either foreground or background. Therefore, this task can be regarded as a pixel-level binary classification task. Specifically, bilinear interpolation is used to upsample M to the original image size, resulting in M′. Let M′ and... (True mask) The value of each point i is m′. i and The segmentation loss takes the following form:

[0228]

[0229] Where σ represents the sigmoid function, and j represents the j-th image in the training batch.

[0230] Furthermore, to enhance the model's ability to separate foreground and background, a pixel-level contrastive loss function can be used as an auxiliary function for segmentation loss. This function reduces the distance between pixel features within the target object and increases the distance between pixel features within the target object and pixel features outside the object, such as... Figure 10 As shown.

[0231] Real mask Scaling the image to the same size as the segmentation feature map Y1. Let the vector of each point i in Y1 be y. i Then use The prior will y i Divide the data into positive and negative samples. For each point i, if... If y equals 0, then y i It belongs to the negative sample set N, denoted as Otherwise y i It belongs to the positive sample set P, denoted as Then, the mean vectors of the positive and negative samples are denoted as follows: and The auxiliary loss function takes the following form:

[0232]

[0233]

[0234]

[0235] Where τ is the temperature coefficient, and finally, the total loss function is as follows:

[0236]

[0237] After the model training is completed, during the inference phase, the input is an image and a natural language sentence describing an instance target in the image. The model will directly predict the mask M or detection box of the instance target, upsample and interpolate it back to the original image size, and perform binarization to segment the instance target.

[0238] The following section will introduce the beneficial effects of this application in conjunction with experiments:

[0239] Three commonly used datasets for reference image segmentation are RefCOCO, RefCOCO+, and RefCOCOg (also known as G-Ref). The images in these three datasets are all from the MSCOCO dataset, each with its own language annotations. The language annotations for RefCOCO and RefCOCO+ are generated through a game called ReferitGame. RefCOCO consists of 142,209 natural language annotations and 19,994 images, while RefCOCO+ consists of 141,564 natural language annotations and 19,992 images. The main difference between RefCOCO and RefCOCO+ is that RefCOCO+ does not allow the use of locator terms like "left" or "front" in the language annotations. Therefore, the RefCOCO+ dataset is more challenging than RefCOCO. The language annotations on the G-Ref dataset come from Amazon Mechanical Truk, which contains 85,474 language annotations and 26,711 images. This dataset also has two partitioning methods: UMD partitioning and Google partitioning. Compared to RefCOCO and RefCOCO+, G-Ref's language annotations are more complex and varied, and the average sentence length is also greater than that of the RefCOCO and RefCOCO+ datasets, making G-Ref a more challenging dataset.

[0240] The original input data consists of RGB images, a 0-1 mask matrix, and language-annotated strings. The image data preprocessing is as follows: for training data, the RGB images are normalized and regularized, then scaled to a uniform resolution of 448*448 using bilinear interpolation. Simultaneously, the 0-1 mask matrix is ​​scaled to the same resolution as the RGB images using nearest-neighbor interpolation. For test data, only the RGB images require the above processing; nearest-neighbor interpolation of the 0-1 mask matrix is ​​not necessary. The language data preprocessing uses BertTokenizer from the HuggingFace library to tokenize the input strings. BertTokenizer is based on the WordPiece embedding method, and its dictionary size is 30,000. For each tokenized sequence, the first token is a special [CLS] token. If the input consists of multiple sentences, another special [SEP] token is inserted between the sentences.

[0241] Three commonly used metrics for reference image segmentation are employed to evaluate model performance: Global Intersection over Union (oIoU), Average Intersection over Union (mIoU), and prec@X. ​​These three metrics are commonly used in object recognition, with IoU primarily representing the similarity between the predicted and ground truth regions. In reference image segmentation, calculating IoU can be simplified as follows: Given the predicted mask M and the ground truth mask... Its intersection-union ratio is defined as follows:

[0242]

[0243] The global intersection-over-union ratio (CIU) is the sum of the intersections of all test images divided by the sum of their unions. The average CIU is the average of the CIUs of all test images. prec@X is the percentage of images with a CIU greater than a certain threshold X among all test images. In experiments, the value of X is usually 0.5, 0.6, 0.7, 0.8, or 0.9.

[0244] Table 1 compares the results with existing methods on the RefCOCO and G-Ref datasets.

[0245]

[0246] Table 1 compares the oIoU of CoupAlign with previous state-of-the-art (SOTA) methods on RefCOCO and G-Ref. The RefCOCO dataset provides language annotations containing many location words, such as "The closest girl on the right." This requires the model to understand not only the correspondence between nouns and objects but also the positional relationships between objects represented by location words. Compared to the state-of-the-art method LAVT, CoupAlign achieves improvements of 1.97%, 1.94%, and 1.79% on RefCOCO's val, testA, and testB, respectively. Language annotations on G-Ref have more complex grammatical structures and longer average sentence lengths compared to RefCOCO. For example, sentences like "chocolate dessert directly in front of us in the center" require finer-grained word-pixel alignment, more accurate sentence-mask alignment, and a more comprehensive understanding of the language. As shown in Table 1, on G-Ref, CoupAlign outperforms LAVT by approximately 1.6% on val and 0.13% on test. Results on various subsets of both datasets surpass existing SOTA methods, demonstrating the effectiveness of the approach.

[0247] Word pixel alignment enables cross-modal interactions to occur simultaneously at both the lower and higher levels of encoding. Table 2 shows that removing the word pixel alignment module resulted in a decrease of approximately 4.3% in the oIoU metric, indicating the necessity of this module during the encoding phase. Similarly, replacing the bidirectional attention mechanism with a unidirectional attention mechanism resulted in a decrease of approximately 2% in the oIoU metric. This demonstrates the importance of attention not only from language to vision but also from vision to language. Removing the sentence target alignment module resulted in a decrease of approximately 1.7% in the oIoU metric. This indicates that the sentence target alignment module's constraint on the mask contributes to improving the accuracy of CoupAlign predictions. The last two rows of Table 2 show the comparison after removing the auxiliary loss function. Removing the auxiliary loss function resulted in a decrease of approximately 1% in the oIoU metric, demonstrating that the auxiliary loss function's enhanced foreground-background separation capability helps CoupAlign achieve better multi-level alignment.

[0248] Table 2 Ablation Experiment

[0249]

[0250] The word pixel alignment module and sentence target alignment module were tested to verify that they provide accurate and persistent alignment. Figure 11AThe attention graph of the intermediate layer of the alignment module is visualized in the image, such as... Figure 11A As shown, the word pixel alignment module highlights the pixel regions most relevant to the word's semantics. It's worth noting that the vocabulary for language annotation in reference image segmentation is much larger than that of traditional semantic segmentation. In this case, CoupAlign not only captures words that distinguish different parts of speech but also has a good ability to differentiate synonyms. For example, it can distinguish synonyms such as "child," "man," and "lady," which are often vaguely defined as the "person" category in semantic segmentation datasets. Regarding the sentence target alignment module, the mask predictions are visualized in descending order of semantic similarity to the sentence. Masks with higher similarity overlap more with the target object, while masks with lower similarity overlap less. Figure 11A In the diagram, we can see the sentence target alignment module, which allows the model to focus on different objects and thus perceive the positional relationships between them. Furthermore, the introduction of target integrity constraints reduces the occurrence of gaps and fragmentation in the model's segmentation predictions.

[0251] exist Figure 11B The image shows some examples of the final prediction results from the visualization model. CoupAlign has a strong localization capability in scenes with many similar targets.

[0252] This application provides a data processing method, which includes: acquiring first image features corresponding to an image and text features corresponding to text; the semantics of the text corresponds to a target object, and the text indicates the region corresponding to the target object to be predicted from the image; obtaining multiple second embedding vectors through a neural network based on multiple preset first embedding vectors and the first image features, each second embedding vector corresponding to an object in the image; fusing each second embedding vector and the first image features to obtain a corresponding second image feature; determining the weight corresponding to each second embedding vector based on the similarity between the text features and the multiple second embedding vectors, and fusing the multiple weights with the multiple second image features to determine the predicted region corresponding to the target object. This is equivalent to changing image features from pixel-level granularity to target object-level granularity, that is, introducing a target-holistic constraint in cross-modal feature fusion, treating pixels belonging to the same target as a whole for fusion with language encoding, and activating instance regions on a target-by-target basis. This can effectively solve the problem of inaccurate target localization and mask prediction or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving the processing accuracy of the model.

[0253] In addition, this application also provides a data processing method, the method comprising:

[0254] The first image feature corresponding to the image and the text feature corresponding to the text are obtained; the semantics of the text correspond to the target object, and the text indicates the region corresponding to the target object predicted from the image; the first image feature and the text feature are obtained based on a feature extraction network;

[0255] Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature;

[0256] Based on the similarity between the text features and the plurality of second embedding vectors, a weight corresponding to each second embedding vector is determined, and the plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object;

[0257] The feature extraction network and the neural network are updated based on the difference between the predicted region and the real region corresponding to the target object in the image.

[0258] In one possible implementation, the prediction region is a mask region or a detection box.

[0259] In one possible implementation, the semantics of the text corresponds to the target object, specifically including: the semantics of the text is used to describe the characteristics of the target object.

[0260] In one possible implementation, obtaining the first image features corresponding to the image and the text features corresponding to the text includes:

[0261] The image is processed by an image encoder to obtain the image features corresponding to the image;

[0262] The text is processed by a text encoder to obtain the first text feature corresponding to the text;

[0263] By fusing the third image features and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

[0264] Reference Figure 12 , Figure 12 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application, such as... Figure 12 As shown in the figure, an embodiment of this application provides a data processing apparatus 1200, comprising:

[0265] The processing module 1201 is used to acquire first image features corresponding to the image and text features corresponding to the text; the semantics of the text corresponds to the target object, and the text indicates the region corresponding to the target object to be predicted from the image;

[0266] Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature;

[0267] Based on the similarity between the text features and the plurality of second embedding vectors, a weight is determined for each second embedding vector. The plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object.

[0268] The specific description of the processing module 1201 can be found in the description of steps 601 to 603 in the above embodiments, and will not be repeated here.

[0269] The image may include multiple objects, including the target object. Each second embedding vector corresponds to one object in the image, and one or more of the multiple second embedding vectors may correspond to the target object. It should be understood that "corresponds" here means that the second embedding vector is used to describe the features of an object in the image. The second embedding vector obtained by the neural network can distinguish different objects in the image so that subsequent prediction can be performed at the object level.

[0270] This is equivalent to changing image features from pixel-level granularity to target-object-level granularity. In other words, it introduces the overall constraint of the target in cross-modal feature fusion, treating pixels belonging to the same target as a whole and fusing them with language encoding. By activating instance regions on a target-by-target basis, it can effectively solve the problem of inaccurate target localization and mask prediction or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving the processing accuracy of the model.

[0271] In one possible implementation, the prediction region is a mask region or a detection box.

[0272] In one possible implementation, the semantics of the text corresponds to the target object, specifically including: the semantics of the text is used to describe the characteristics of the target object.

[0273] In one possible implementation, the processing module is specifically used for:

[0274] The image is processed by an image encoder to obtain the image features corresponding to the image;

[0275] The text is processed by a text encoder to obtain the first text feature corresponding to the text;

[0276] By fusing the third image features and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

[0277] In one possible implementation, the first image feature is a feature upsampled to the same size as the image.

[0278] In one possible implementation, the neural mesh comprises multiple transformer layers.

[0279] Furthermore, embodiments of this application also provide a data processing apparatus, including:

[0280] The processing module is used to acquire first image features corresponding to an image and text features corresponding to text; the semantics of the text corresponds to a target object, and the text indicates the region corresponding to the target object predicted from the image; the first image features and the text features are obtained based on a feature extraction network;

[0281] Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature;

[0282] Based on the similarity between the text features and the plurality of second embedding vectors, a weight corresponding to each second embedding vector is determined, and the plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object;

[0283] An update module is used to update the feature extraction network and the neural network based on the difference between the predicted region and the real region corresponding to the target object in the image.

[0284] The image may include multiple objects, including the target object. Each second embedding vector corresponds to one object in the image, and one or more of the multiple second embedding vectors may correspond to the target object. It should be understood that "corresponds" here means that the second embedding vector is used to describe the features of an object in the image. The second embedding vector obtained by the neural network can distinguish different objects in the image so that subsequent prediction can be performed at the object level.

[0285] This is equivalent to changing image features from pixel-level granularity to target-object-level granularity. In other words, it introduces the overall constraint of the target in cross-modal feature fusion, treating pixels belonging to the same target as a whole and fusing them with language encoding. By activating instance regions on a target-by-target basis, it can effectively solve the problem of inaccurate target localization and mask prediction or bounding box prediction in existing language-driven accurate instance segmentation methods, thereby improving the processing accuracy of the model.

[0286] In one possible implementation, the prediction region is a mask region or a detection box.

[0287] In one possible implementation, the semantics of the text corresponds to the target object, specifically including: the semantics of the text is used to describe the characteristics of the target object.

[0288] In one possible implementation, the processing module is specifically used for:

[0289] The image is processed by an image encoder to obtain the image features corresponding to the image;

[0290] The text is processed by a text encoder to obtain the first text feature corresponding to the text;

[0291] By fusing the third image features and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

[0292] The following describes an execution device provided in an embodiment of this application. Please refer to [link / reference]. Figure 13 , Figure 13 This is a schematic diagram of an execution device provided in an embodiment of this application. The execution device 1300 can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop, a smart wearable device, a monitoring data processing device, or a server, etc., and is not limited thereto. Specifically, the execution device 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303, and a memory 1304 (wherein the execution device 1300 may have one or more processors 1303). Figure 13 (Taking a processor as an example), processor 1303 may include application processor 13031 and communication processor 13032. In some embodiments of this application, receiver 1301, transmitter 1302, processor 1303 and memory 1304 may be connected via bus or other means.

[0293] Memory 1304 may include read-only memory and random access memory, and provides instructions and data to processor 1303. A portion of memory 1304 may also include non-volatile random access memory (NVRAM). Memory 1304 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0294] Processor 1303 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0295] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1303. The processor 1303 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1303 or by instructions in software form. The processor 1303 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1303 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1304. Processor 1303 reads the information from memory 1304 and, in conjunction with its hardware, completes the steps involved in the model inference process described above.

[0296] Receiver 1301 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1302 can be used to output digital or character information through the first interface; transmitter 1302 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1302 may also include a display device such as a display screen.

[0297] This application also provides a training device; please refer to [link / reference]. Figure 14 , Figure 14 This is a schematic diagram of a training device provided in an embodiment of this application. Specifically, the training device 1400 is implemented by one or more servers. The training device 1400 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1414 (e.g., one or more processors) and memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) for storing application programs 1442 or data 1444. The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the training device. Furthermore, the CPU 1414 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the training device 1400.

[0298] The training device 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458; or, one or more operating systems 1441, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0299] In this embodiment, the central processing unit 1414 is used to perform actions related to model training in the above embodiments.

[0300] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0301] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0302] The execution device, training device, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip within the execution device to execute the data processing method described in the above embodiments, or to cause the chip within the training device to execute the data processing method described in the above embodiments. Optionally, the storage unit can be a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).

[0303] For details, please refer to Figure 15 , Figure 15 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1500. The NPU 1500 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1503, which is controlled by the controller 1504 to extract matrix data from the memory and perform multiplication operations.

[0304] In some implementations, the arithmetic circuit 1503 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1503 is a two-dimensional pulsating array. The arithmetic circuit 1503 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1503 is a general-purpose matrix processor.

[0305] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1502 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1501 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1508.

[0306] Unified memory 1506 is used to store input and output data. Weight data is directly transferred to weight memory 1502 via Direct Memory Access Controller (DMAC) 1505. Input data is also transferred to unified memory 1506 via DMAC.

[0307] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1509.

[0308] The Bus Interface Unit (BIU) 1510 is used by the instruction fetch memory 1509 to fetch instructions from external memory, and also by the memory access controller 1505 to fetch the original data of the input matrix A or the weight matrix B from external memory.

[0309] The DMAC is mainly used to move input data from external memory DDR to unified memory 1506, or to weight data to weight memory 1502, or to input data to input memory 1501.

[0310] The vector computation unit 1507 includes multiple arithmetic processing units that, when needed, further process the output of the computation circuit 1503, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.

[0311] In some implementations, the vector computation unit 1507 can store the processed output vector in the unified memory 1506. For example, the vector computation unit 1507 can apply a linear function, or a nonlinear function, to the output of the computation circuit 1503, such as linear interpolation of feature planes extracted by a convolutional layer, or, for example, a vector of accumulated values, to generate activation values. In some implementations, the vector computation unit 1507 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as activation input to the computation circuit 1503, for example, for use in subsequent layers of the neural network.

[0312] The instruction fetch buffer 1509 connected to the controller 1504 is used to store the instructions used by the controller 1504;

[0313] Unified memory 1506, input memory 1501, weighted memory 1502, and instruction fetch memory 1509 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0314] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.

[0315] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0316] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0317] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0318] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A data processing method, characterized in that, include: Obtain the first image features corresponding to the image and the text features corresponding to the text; The semantics of the text correspond to the target object, and the text indicates the region corresponding to the target object to be predicted from the image; Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature; Based on the similarity between the text features and the plurality of second embedding vectors, a weight is determined for each second embedding vector. The plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object.

2. The method according to claim 1, characterized in that, The prediction region is either a mask region or a detection box.

3. The method according to claim 1 or 2, characterized in that, The semantics of the text correspond to the target object, specifically including: the semantics of the text are used to describe the characteristics of the target object.

4. The method according to claim 1 or 2, characterized in that, The acquisition of the first image feature corresponding to the image and the text feature corresponding to the text includes: The image is processed by an image encoder to obtain the image features corresponding to the image; The text is processed by a text encoder to obtain the first text feature corresponding to the text; By fusing the image features corresponding to the image and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

5. The method according to claim 1 or 2, characterized in that, The first image feature is a feature upsampled to the same size as the image.

6. The method according to claim 1 or 2, characterized in that, The neural mesh comprises multiple transformer layers.

7. A data processing method, characterized in that, include: The first image feature corresponding to the image and the text feature corresponding to the text are obtained; the semantics of the text correspond to the target object, and the text indicates the region corresponding to the target object predicted from the image; the first image feature and the text feature are obtained based on a feature extraction network; Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature; Based on the similarity between the text features and the plurality of second embedding vectors, a weight corresponding to each second embedding vector is determined, and the plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object; The feature extraction network and the neural network are updated based on the difference between the predicted region and the real region corresponding to the target object in the image.

8. The method according to claim 7, characterized in that, The prediction region is either a mask region or a detection box.

9. The method according to claim 7 or 8, characterized in that, The semantics of the text correspond to the target object, specifically including: the semantics of the text are used to describe the characteristics of the target object.

10. The method according to claim 7 or 8, characterized in that, The acquisition of the first image feature corresponding to the image and the text feature corresponding to the text includes: The image is processed by an image encoder to obtain the image features corresponding to the image; The text is processed by a text encoder to obtain the first text feature corresponding to the text; By fusing the image features corresponding to the image and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

11. A data processing apparatus, characterized in that, include: The processing module is used to obtain the first image features corresponding to the image and the text features corresponding to the text. The semantics of the text correspond to the target object, and the text indicates the region corresponding to the target object to be predicted from the image; Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature; Based on the similarity between the text features and the plurality of second embedding vectors, a weight is determined for each second embedding vector. The plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object.

12. The apparatus according to claim 11, characterized in that, The prediction region is either a mask region or a detection box.

13. The apparatus according to claim 11 or 12, characterized in that, The semantics of the text correspond to the target object, specifically including: the semantics of the text are used to describe the characteristics of the target object.

14. The apparatus according to claim 11 or 12, characterized in that, The processing module is specifically used for: The image is processed by an image encoder to obtain the image features corresponding to the image; The text is processed by a text encoder to obtain the first text feature corresponding to the text; By fusing the image features corresponding to the image and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

15. The apparatus according to claim 11 or 12, characterized in that, The first image feature is a feature upsampled to the same size as the image.

16. The apparatus according to claim 11 or 12, characterized in that, The neural mesh comprises multiple transformer layers.

17. A data processing apparatus, characterized in that, include: The processing module is used to acquire first image features corresponding to an image and text features corresponding to text; the semantics of the text corresponds to a target object, and the text indicates the region corresponding to the target object predicted from the image; the first image features and the text features are obtained based on a feature extraction network; Based on a plurality of preset first embedding vectors and the first image features, a plurality of second embedding vectors are obtained through a neural network, each second embedding vector corresponding to an object in the image; each second embedding vector and the first image features are fused to obtain a corresponding second image feature; Based on the similarity between the text features and the plurality of second embedding vectors, a weight corresponding to each second embedding vector is determined, and the plurality of weights are used to fuse with the plurality of second image features to determine the prediction region corresponding to the target object; An update module is used to update the feature extraction network and the neural network based on the difference between the predicted region and the real region corresponding to the target object in the image.

18. The apparatus according to claim 17, characterized in that, The prediction region is either a mask region or a detection box.

19. The apparatus according to claim 17 or 18, characterized in that, The semantics of the text correspond to the target object, specifically including: the semantics of the text are used to describe the characteristics of the target object.

20. The apparatus according to claim 17 or 18, characterized in that, The processing module is specifically used for: The image is processed by an image encoder to obtain the image features corresponding to the image; The text is processed by a text encoder to obtain the first text feature corresponding to the text; By fusing the image features corresponding to the image and the first text features through a bidirectional attention mechanism, the first image features corresponding to the image and the text features corresponding to the text are obtained.

21. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which, when executed by one or more computers, cause the one or more computers to perform the operation of the method according to any one of claims 1 to 10.

22. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 10.

23. A system comprising at least one processor and at least one memory; the processor and the memory are connected via a communication bus and communicate with each other. The at least one memory is used to store code; The at least one processor is used to execute the code to perform the method as described in any one of claims 1 to 10.