Target semantic segmentation method, system, storage medium and electronic device
By acquiring multi-modal information and utilizing specific models and mechanisms, it solves the problem of fixed category mask limitations in the existing technology, achieves efficient semantic segmentation of any target area in the image, and improves segmentation accuracy.
Patent Information
- Application Number
- CN202410578909.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-05-11
AI Technical Summary
Existing semantic segmentation networks are limited by fixed category masks and cannot segment arbitrary target areas in images.
By obtaining multi-modal information, including the image to be segmented, prompt text and starting characters, the VIT model and CLIP text encoder are used to obtain image and text features, combined with the cross-attention mechanism and multi-layer perceptron, to generate the target operation output results and update Input information until the end character is output, achieving semantic segmentation of any target area in the image.
It lifts the restrictions of fixed category masks, improves the efficiency and accuracy of semantic segmentation, and can segment any target area in the image.
Smart Images

Figure CN118154883B
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of computer vision, and in particular relates to a method, system, storage medium and electronic device for target semantic segmentation. Background Art
[0002] Semantic segmentation is a typical computer vision problem that can be applied to many application areas, including geographic information, autonomous driving, medical image analysis, robotics, and other fields. In practice, semantic segmentation technology involves taking some raw data (e.g., a planar image) as input and assigning a category ID to each pixel in the image according to the object of interest to which it belongs. This converts the input image into a mask with highlighted target areas, thereby performing semantic segmentation.
[0003] Currently, most mainstream semantic segmentation networks are based on an encoder-decoder architecture, which downsamples the input image to generate a lower-resolution feature map for efficient classification. Upsampling is then used to restore the features to a full-resolution segmentation map. However, current techniques are often limited by fixed category masks, making it impossible to segment any target region in the image. Summary of the Invention
[0004] The purpose of this application is to provide a target semantic segmentation method, system, storage medium and electronic device that can segment any target area in an image.
[0005] In a first aspect, the present application provides a target semantic segmentation method, the method comprising: obtaining multimodal information; the multimodal information comprises an image to be segmented, a prompt text and a start character; obtaining a first image feature and a second image feature of the image to be segmented; obtaining a text feature of the prompt text; obtaining a fusion feature based on the first image feature, the second image feature and the text feature; using the start character as target operation input information to perform a target operation; the target operation comprises obtaining a target operation output result based on the target operation input information and the fusion feature; updating the target operation input information based on the target operation output result, and repeatedly performing the target operation until an end character is output; obtaining a target semantic segmentation result based on the output results of all the target operations.
[0006] In an implementation of the first aspect, obtaining the first image feature and the second image feature of the image to be segmented includes: obtaining the first image feature based on a VIT model; and fusing the first image feature based on a transformer encoder model to obtain the second image feature.
[0007] In an implementation of the first aspect, obtaining the text features of the prompt text includes: obtaining the text features based on a CLIP text encoder.
[0008] In an implementation of the first aspect, obtaining a fusion feature based on the first image feature, the second image feature, and the text feature includes: obtaining a text image matrix based on the text feature and the second image feature; and obtaining the fusion feature based on the text image matrix, the first image feature, and the second image feature.
[0009] In an implementation of the first aspect, the target operation includes: obtaining a cross-attention result based on the target operation input information and the fusion feature; inputting the cross-attention result into a multi-layer perceptron, and obtaining the target operation output result through a softmax function; the target operation output result includes the coordinate information and special characters of the target area in the image to be segmented.
[0010] In an implementation of the first aspect, updating the target operation input information based on the output result of the target operation includes: adding the coordinate information of the target area and the special character to the target operation input information to update the target operation input information.
[0011] In an implementation of the first aspect, obtaining a target semantic segmentation result based on the output results of all the target operations includes: obtaining a target area based on coordinate information of all the target areas; and generating a mask based on the target area to obtain a target semantic segmentation result.
[0012] In the second aspect, the present application provides a target semantic segmentation system, which includes: a first acquisition module for acquiring multimodal information; the multimodal information includes an image to be segmented, a prompt text and a start character; a second acquisition module for acquiring a first image feature and a second image feature of the image to be segmented; a third acquisition module for acquiring a text feature of the prompt text; a fusion module for acquiring a fusion feature based on the first image feature, the second image feature and the text feature; a target operation module for using the start character as target operation input information to perform a target operation; the target operation includes acquiring a target operation output result based on the target operation input information and the fusion feature; an update module for updating the target operation input information based on the target operation output result, and repeatedly executing the target operation until the end character is output; a segmentation module for acquiring a target semantic segmentation result based on the output results of all the target operations.
[0013] In a third aspect, the present application provides an electronic device comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above-mentioned target semantic segmentation method.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned target semantic segmentation method when executed by an electronic device.
[0015] As described above, the target semantic segmentation method, system, storage medium and electronic device described in this application have the following beneficial effects: by introducing prompt text and special characters, this application can perform semantic segmentation on any target in the image, remove the limitations of fixed category masks, and improve the efficiency and accuracy of segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Shown is a schematic diagram of a scene of an electronic device in an embodiment of the present application.
[0017] Figure 2 Shown is a flowchart of an embodiment of the object semantic segmentation method described in an embodiment of the present application.
[0018] Figure 3 Shown is a flowchart of an embodiment of the object semantic segmentation method described in an embodiment of the present application.
[0019] Figure 4 Shown is a flowchart of an embodiment of the object semantic segmentation method described in an embodiment of the present application.
[0020] Figure 5 Shown is a flowchart of an embodiment of the object semantic segmentation method described in an embodiment of the present application.
[0021] Figure 6 Shown is a structural diagram of an object semantic segmentation system according to an embodiment of the present application.
[0022] Figure 7 Shown is a schematic structural diagram of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION
[0023] The following describes the embodiments of the present application through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0024] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. Therefore, the illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0025] In addition, the descriptions of "first", "second", etc. in this application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0026] The following embodiments of the present application provide a target semantic segmentation method, which can be applied to Figure 1 The electronic device described in this application may include a mobile phone 11 with wireless charging function, a tablet computer 12, a laptop computer 13, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiments of this application do not impose any restrictions on the specific type of electronic device.
[0027] For example, the electronic device may be a station (STAION, ST) in a WLAN with a wireless charging function, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a personal digital assistant (PDA) device, a handheld device with a wireless charging function, a computing device or other processing device, a computer, a laptop computer, a handheld communication device, a handheld computing device, and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network, a mobile terminal in a future-evolved public land mobile network (PLMN), or a mobile terminal in a future-evolved non-terrestrial network (NTN).
[0028] For example, the electronic device can communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of 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), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS can include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS) and / or Satellite Based Augmentation System (SBAS).
[0029] The technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings in the embodiments of the present application.
[0030] like Figure 2 As shown, in one embodiment, the target semantic segmentation method of the present application includes steps S1 to S7.
[0031] S1: Acquire multimodal information; the multimodal information includes an image to be segmented, a prompt text, and a start character.
[0032] Specifically, the target to be segmented is determined by the prompt text, such as "the second giraffe from left to right", "a woman in a red skirt", etc.
[0033] Specifically, the starting character is <sos>.
[0034] S2: Acquire a first image feature and a second image feature of the image to be segmented.
[0035] Specifically, the first image features are obtained based on the VIT model. The VIT (Vision Transformer) model applies the Transformer architecture to the visual field. It divides the input image into patches and linearly maps the flattened parcels to a lower-dimensional space. The patches are then encoded as an embedding sequence with an additional [CLS] tag to represent global image features. Compared to using pre-trained object detectors for visual feature extraction, using the VIT model is more computationally efficient and has gradually become mainstream.
[0036] In some embodiments, the image to be segmented is input into a VIT model, and the VIT model outputs a first image feature.
[0037] Specifically, the first image features are fused based on a transformer encoder model to obtain the second image features.
[0038] In some embodiments, the first image feature is input into a transformer encoder model to deeply fuse information between local regions of the image, thereby outputting a second image feature. The shape of the second image feature is (784, 512).
[0039] S3: Acquire text features of the prompt text.
[0040] Specifically, the text features are obtained based on the CLIP text encoder. The CLIP (Contrastive Language-Image Pre-training) model is a multimodal model based on contrastive learning. Through contrastive learning, it can learn the matching relationship between text and image pairs. The CLIP model inputs the image and text into an image encoder and a text encoder, respectively, to obtain vector representations of the image and text. The image and text vector representations are then mapped into a joint multimodal space to obtain new image and text vectors that can be directly compared. The text encoder can adopt the text transformer model commonly used in natural language processing (NLP).
[0041] In some embodiments, the prompt text is input into a CLIP text encoder, which outputs a text feature having a shape of (1, 512).
[0042] S4: Acquire fusion features based on the first image features, the second image features, and the text features.
[0043] Specifically, such as Figure 3 As shown, step S4 includes steps S41 and S42.
[0044] S41: Acquire a text image matrix based on the text feature and the second image feature.
[0045] Specifically, the text features and the second image features are concatenated to obtain a concatenated matrix with a shape of (1 + 784, 512). This concatenated matrix is then input into a transformer encoder model, which fuses the information between the modalities in the concatenated matrix and outputs the text-image matrix. The text-image matrix has the same shape as the concatenated matrix: (1 + 784, 512).
[0046] S42: Acquire the fusion feature based on the text image matrix, the first image feature, and the second image feature.
[0047] Specifically, the vector at the last moment in the text image matrix is taken as Q, the first image feature is taken as V, and the second image feature is taken as K, and they are input into the cross-attention mechanism together to fuse the shallow image information, deep image information and text information to obtain the fused feature.
[0048] S5: Using the start character as target operation input information to perform a target operation; the target operation includes obtaining a target operation output result based on the target operation input information and the fusion feature.
[0049] Specifically, such as Figure 4 As shown, step S5 includes steps S51 and S52.
[0050] S51: Obtain a cross-attention result based on the target operation input information and the fusion feature.
[0051] Specifically, the starting character <sos>Input the multi-head self-attention mechanism and obtain Q after layer normalization, and input the fusion features obtained in step S4 as K and V into the cross attention mechanism together to obtain the cross attention result.
[0052] S52: Input the cross attention result into a multi-layer perceptron, and obtain a target operation output result through a softmax function; the target operation output result includes coordinate information and special characters of the target area in the image to be segmented.
[0053] Specifically, inputting the cross attention result into a multi-layer perceptron and obtaining the target operation output result through a softmax function includes the following steps:
[0054] (1) Input the cross attention result into the first multi-layer perceptron, and obtain the horizontal coordinate information in the coordinate information, that is, the X coordinate, through the softmax function.
[0055] It should be noted that the X coordinate value is between 0 and the image width.
[0056] (2) Inputting the cross attention result into the second multi-layer perceptron, and obtaining the vertical coordinate information in the coordinate information, that is, the Y coordinate, through the softmax function.
[0057] It should be noted that the Y coordinate value is between 0 and the image height.
[0058] (3) Inputting the cross attention result into the third multi-layer perceptron, and obtaining the special character through the softmax function.
[0059] In some embodiments, the special characters include <sep> , <continue> , <eos>.
[0060] in, <sep>The coordinate information output of the previous target area is completed. Since there may be multiple target areas in the image to be segmented, when the coordinate information output of each target area is completed, <sep>To separate.
[0061] in, <continue>For the continuation character. If the special character obtained is <continue>, then continue to add the coordinate information of the target area; if the output special character is not <continue>, the special characters ( <sep>or <eos>) is added to the result set.
[0062] in, <eos>When the coordinate information of all target areas in the image to be segmented is output, the end character is output to end the target operation.
[0063] It should be noted that the result set is the output result of each target operation collected in the order of the target operations.
[0064] S6: updating the target operation input information based on the target operation output result, and repeatedly executing the target operation until the end character is output.
[0065] Specifically, the coordinate information of the target area and the special character are added to the target operation information to update the target operation input information. That is, for each target operation input, the output result of the previous target operation needs to be added to the end of the previous target operation input information to serve as the new target operation input information, and the target operation is executed.
[0066] It should be noted that when the end character appears <eos>, the target operation is no longer executed repeatedly. At this time, all the target operation output results obtained previously are output as a result set. The result set includes the coordinate information of all target areas. The coordinate information of multiple target areas is connected by <sep>To separate.
[0067] It should be noted that when <sep>When the coordinate information and <sep>They will be added to the previous target operation information as new input to perform the new target operation.
[0068] It should be noted that when <continue>When a character is input, the previous coordinate information is added to the previous target operation input information as a new input, and a new target operation is performed, thereby continuing to supplement the coordinate information of a certain target area.
[0069] For example, the first input is " <sos>", the second input is " <sos>X coordinate Y coordinate", the third input is " <sos>X coordinate Y coordinate X coordinate Y coordinate", the fourth input is " <sos>X coordinate Y coordinate X coordinate Y coordinate X coordinate Y coordinate <sep>”.
[0070] S7: Obtain a target semantic segmentation result based on the output results of all the target operations.
[0071] Specifically, a target region is acquired based on the coordinate information of all the target regions, and a mask is generated based on the target region to acquire a target semantic segmentation result.
[0072] In some embodiments, when step S6 outputs the end character <eos>When , step S7 generates an all-zero matrix of the same size as the input image, and according to all the coordinate information in the result set, multiple sets of coordinate information corresponding to multiple target areas can be determined (the multiple sets of coordinate information are separated by <sep>Separation), that is, multiple target regions are determined. Then, the elements in the target region are replaced with 1 to generate a mask, where 1 represents the target of interest and 0 represents the background, thus performing semantic segmentation.
[0073] like Figure 5 , which is a flow chart of the target semantic segmentation method provided by the present application in one embodiment.
[0074] The protection scope of the target semantic segmentation method described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing, or replacing steps in the existing technology based on the principles of the present application are included in the protection scope of the present application.
[0075] An embodiment of the present application also provides a target semantic segmentation system, which can implement the target semantic segmentation method described in the present application. However, the implementation device of the target semantic segmentation system described in the present application includes but is not limited to the structure of the target semantic segmentation system listed in this embodiment. All structural deformations and replacements of the existing technology made according to the principles of the present application are included in the scope of protection of the present application.
[0076] like Figure 6 As shown, in one embodiment, the target semantic segmentation system of the present application includes a first acquisition module 41, a second acquisition module 42, a third acquisition module 43, a fusion module 44, a target operation module 45, an update module 46 and a segmentation module 47.
[0077] The first acquisition module 41 is used to acquire multimodal information; the multimodal information includes the image to be segmented, the prompt text and the start character.
[0078] The second acquisition module 42 is configured to acquire the first image feature and the second image feature of the image to be segmented.
[0079] The third acquisition module 43 is used to acquire text features of the prompt text.
[0080] The fusion module 44 is configured to obtain a fusion feature based on the first image feature, the second image feature, and the text feature.
[0081] The target operation module 45 is configured to use the start character as target operation input information to perform a target operation; the target operation includes obtaining a target operation output result based on the target operation input information and the fusion feature.
[0082] The updating module 46 is configured to update the target operation input information based on the target operation output result, and repeatedly perform the target operation until an end character is output.
[0083] The segmentation module 47 is configured to obtain a target semantic segmentation result based on the output results of all the target operations.
[0084] Among them, the structures and principles of the first acquisition module 41, the second acquisition module 42, the third acquisition module 43, the fusion module 44, the target operation module 45, the update module 46 and the segmentation module 47 correspond one to one with the steps in the above-mentioned target semantic segmentation method, so they will not be repeated here.
[0085] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices or methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0086] The modules / units described as separate components may or may not be physically separate, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into a processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into a single module / unit.
[0087] Those skilled in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0088] The present application also provides a computer-readable storage medium. Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments can be performed by instructing a processor through a program. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, a hard disk, a solid-state drive, magnetic tape, a floppy disk, an optical disc, or any combination thereof. The storage medium can be any available medium accessible by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0089] An embodiment of the present application further provides an electronic device comprising a processor and a memory.
[0090] The memory is used to store computer programs.
[0091] The memory includes various media that can store program codes, such as ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk.
[0092] The processor is connected to the memory and is used to execute the computer program stored in the memory so that the electronic device performs the above-mentioned target semantic segmentation method.
[0093] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0094] like Figure 7 As shown, the electronic device of the present application is implemented as a general-purpose computing device. Components of the electronic device may include, but are not limited to, one or more processors or processing units 51, a memory 52, and a bus 53 connecting different system components (including the memory 52 and the processing unit 51).
[0095] Bus 53 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0096] Electronic devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0097] The memory 52 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 521 and / or cache memory 522. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 523 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 Not shown, usually called a "hard drive"). Although Figure 7 Although not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), as well as an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 53 via one or more data media interfaces. Memory 52 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present application.
[0098] A program / utility 524 having a set (at least one) of program modules 5241 may be stored, for example, in memory 52. Such program modules 5241 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 5241 generally implement the functions and / or methods of the embodiments described herein.
[0099] The electronic device may also communicate with one or more external devices (e.g., a keyboard, a pointing device, a display, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via input / output (I / O) interface 54. Furthermore, the electronic device may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via network adapter 55. Figure 7 As shown, the network adapter 55 communicates with other modules of the electronic device via the bus 53. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0100] The embodiments of the present application may also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiments of the present application is generated in whole or in part. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0101] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product can be a software installation package. When the above method is needed, the computer program product can be downloaded and executed on the computer.
[0102] The present application provides a target semantic segmentation method, system, storage medium and electronic device. By introducing prompt text and special characters, it can perform semantic segmentation on any target in an image, remove the limitations of fixed category masks, and improve the efficiency and accuracy of segmentation.
[0103] The descriptions of the processes or structures corresponding to the above figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0104] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.< / sep> < / eos> < / sep> < / sos> < / sos> < / sos> < / sos> < / continue> < / sep> < / sep> < / sep> < / eos> < / eos> < / eos> < / sep> < / continue> < / continue> < / continue> < / sep> < / sep> < / eos> < / continue> < / sep> < / sos> < / sos>
Claims
1. A target semantic segmentation method, characterized in that: The method comprises: Acquire multimodal information; the multimodal information includes an image to be segmented, a prompt text, and a start character; Acquire a first image feature and a second image feature of the image to be segmented; Obtaining text features of the prompt text; Acquire a fusion feature based on the first image feature, the second image feature and the text feature; The starting character is used as target operation input information to perform a target operation; the target operation includes obtaining a target operation output result based on the target operation input information and the fusion feature; the target operation output result includes coordinate information of a target area in the image to be segmented and a special character; The target operation input information is updated based on the target operation output result, and the target operation is repeatedly performed until an end character is output; wherein updating the target operation input information based on the output result of the target operation includes: adding the coordinate information of the target area and the special character to the target operation input information to update the target operation input information; Obtain the target semantic segmentation result based on all the target operation output results.
2. The target semantic segmentation method according to claim 1, characterized in that: Acquiring the first image feature and the second image feature of the image to be segmented includes: Acquire the first image feature based on the VIT model; The first image features are fused based on a transformer encoder model to obtain the second image features.
3. The target semantic segmentation method according to claim 1, characterized in that: The text features of the prompt text are obtained as follows: The text features are obtained based on a CLIP text encoder.
4. The target semantic segmentation method according to claim 1, characterized in that: Acquiring a fusion feature based on the first image feature, the second image feature, and the text feature includes: Acquire a text image matrix based on the text feature and the second image feature; The fusion feature is obtained based on the text image matrix, the first image feature and the second image feature.
5. The target semantic segmentation method according to claim 1, characterized in that: The target operations include: Acquire a cross attention result based on the target operation input information and the fusion feature; The cross attention result is input into a multi-layer perceptron, and the target operation output result is obtained through a softmax function.
6. The target semantic segmentation method according to claim 5, characterized in that: Obtaining the target semantic segmentation result based on the output results of all the target operations includes: Acquire the target area based on the coordinate information of all the target areas; A mask is generated based on the target region to obtain a target semantic segmentation result.
7. A target semantic segmentation system, characterized in that: The system comprises: A first acquisition module is used to acquire multimodal information; the multimodal information includes an image to be segmented, a prompt text and a start character; A second acquisition module, used to acquire a first image feature and a second image feature of the image to be segmented; A third acquisition module is used to acquire text features of the prompt text; A fusion module, configured to obtain a fusion feature based on the first image feature, the second image feature and the text feature; a target operation module, configured to use the start character as target operation input information to perform a target operation; the target operation includes obtaining a target operation output result based on the target operation input information and the fusion feature; the target operation output result includes coordinate information of a target area in the image to be segmented and a special character; An updating module, configured to update the target operation input information based on the target operation output result, and repeatedly perform the target operation until an end character is output; wherein updating the target operation input information based on the output result of the target operation comprises: adding the coordinate information of the target area and the special character to the target operation input information to update the target operation input information; The segmentation module is used to obtain the target semantic segmentation result based on the output results of all the target operations.
8. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the electronic device performs the target semantic segmentation method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, the target semantic segmentation method described in any one of claims 1 to 6 is implemented.
