Multimodal image classification method, system, storage medium and electronic device

Through the multi-modal image classification method, the Transformer model and text description information are used, combined with special character features, to solve the problem of insufficient accuracy of existing deep learning models in image classification, achieve higher accuracy and speed, and are suitable for multiple applications. kind of electronic equipment.

CN118314409BActive Publication Date: 2024-09-13SHANGHAI MIDU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410733358.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-13
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

Existing deep learning models have insufficient accuracy in image classification tasks and cannot meet the needs of practical applications.

Method used

A multi-modal image classification method is adopted, by setting special characters and extracting character features and image features, and using multi-layer perceptron and Transformer models for encoding and decoding, combined with text description information, and inputting the classification model to improve image classification accuracy.

Benefits of technology

It significantly improves the accuracy and speed of image classification, improves the level of intelligence, and is suitable for a variety of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118314409B
    Figure CN118314409B
Patent Text Reader

Abstract

The present invention provides a multimodal image classification method, system, storage medium and electronic device, including: extracting character features of special characters representing image convergence; extracting image features of the image to be classified; obtaining a first character vector, a second character vector and a third character vector based on the character features and the image features; obtaining text description information of the image to be classified; obtaining a first text vector, a second text vector and a third text vector based on the text description information; inputting the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector into a classification model to obtain a classification result of the image to be classified. The multimodal image classification method, system, storage medium and electronic device of the present invention realize image classification based on multimodal information such as images and texts, and effectively improve the classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of deep learning, and in particular relates to a multimodal image classification method, system, storage medium and electronic device. Background Art

[0002] Image classification is a core task in computer vision. Its goal is to distinguish images of different categories based on the different features reflected in the image information. A category label is selected for a given input image from a known set of category labels.

[0003] In the existing technology, deep learning models can automatically learn feature representations from a large amount of data and can handle nonlinear relationships of high-dimensional data, which makes it easier to solve complex image classification problems. In deep learning, Convolutional Neural Networks (CNN) is one of the most popular image classification methods. CNN treats the pixels of the input image as a two-dimensional matrix and extracts the features of the image through convolutional layers and pooling layers. These features are then input into the fully connected layer for classification. In addition to CNN, there are other deep learning methods that can be used for image classification, such as Recurrent Neural Networks (RNN), Residual Networks (ResNet), and so on.

[0004] However, the accuracy of image classification results obtained by existing deep learning models still cannot meet the needs of practical applications and needs to be further improved. Summary of the invention

[0005] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a multimodal image classification method, system, storage medium and electronic device, which can realize image classification based on multimodal information such as images and texts, and effectively improve the classification accuracy.

[0006] In a first aspect, the present invention provides a multimodal image classification method, which includes the following steps: setting a special character for representing image convergence, and extracting character features of the special character; extracting image features of the image to be classified; inputting the character features and the image features into a first transformer encoder, and obtaining a first character vector corresponding to the position of the character features in the output vector of the first transformer encoder; inputting the first character vector and the image features into a second transformer encoder, and obtaining a second character vector corresponding to the position of the first character vector in the output vector of the second transformer encoder; inputting the second character vector and the image features into a third transformer encoder, and obtaining a second character vector corresponding to the position of the first character vector in the output vector of the third transformer encoder. A third character vector at a position corresponding to the second character vector; obtaining text description information of the image to be classified; inputting the text description information into the fourth transformer decoder to obtain a first decoding vector, and obtaining a first text vector by performing maximum pooling on the first decoding vector; inputting the first decoding vector into the fifth transformer decoder to obtain a second decoding vector, and obtaining a second text vector by performing maximum pooling on the second decoding vector; inputting the second decoding vector into the sixth transformer decoder to obtain a third decoding vector, and obtaining a third text vector by performing maximum pooling on the third decoding vector; inputting the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector into a classification model to obtain a classification result of the image to be classified.

[0007] In an implementation of the first aspect, character features of the special characters are extracted based on a multi-layer perceptron; and image features of the image to be classified are extracted based on a VIT model.

[0008] In an implementation manner of the first aspect, text description information of the image to be classified is obtained based on a visual language model.

[0009] In an implementation of the first aspect, inputting the first character vector, the second character vector, the third character vector, the first text vector, the second text vector, and the third text vector into a classification model to obtain a classification result of the image to be classified includes the following steps:

[0010] Performing average pooling on the first character vector, the second character vector, and the third character vector to obtain a first average pooling result;

[0011] Performing average pooling on the first text vector, the second text vector, and the third text vector to obtain a second average pooling result;

[0012] Performing matrix multiplication on the first average pooling result and the second average pooling result to obtain a matrix multiplication result;

[0013] The matrix multiplication result is passed through a self-attention mechanism and a multi-layer perceptron to obtain a pre-classification result;

[0014] The pre-classification result is passed through a multi-layer perceptron and a softmax function to obtain the classification result.

[0015] In a second aspect, the present invention provides a multimodal image classification system, the system comprising a first extraction module, a second extraction module, a first encoding module, a second encoding module, a third encoding module, an acquisition module, a first decoding module, a second decoding module, a third decoding module and a classification module;

[0016] The first extraction module is used to set a special character for representing image convergence and extract the character features of the special character;

[0017] The second extraction module is used to extract image features of the image to be classified;

[0018] The first encoding module is used to input the character feature and the image feature into a first transformer encoder, and obtain a first character vector corresponding to the position of the character feature in the output vector of the first transformer encoder;

[0019] The second encoding module is used to input the first character vector and the image feature into a second transformer encoder, and obtain a second character vector at a position corresponding to the first character vector in an output vector of the second transformer encoder;

[0020] The third encoding module is used to input the second character vector and the image feature into a third transformer encoder, and obtain a third character vector at a position corresponding to the second character vector in an output vector of the third transformer encoder;

[0021] The acquisition module is used to acquire text description information of the image to be classified;

[0022] The first decoding module is used to input the text description information into a fourth transformer decoder to obtain a first decoding vector, and perform maximum pooling on the first decoding vector to obtain a first text vector;

[0023] The second decoding module is used to input the first decoding vector into a fifth transformer decoder to obtain a second decoding vector, and perform maximum pooling on the second decoding vector to obtain a second text vector;

[0024] The third decoding module is used to input the second decoding vector into the sixth transformer decoder to obtain a third decoding vector, and obtain a third text vector by performing maximum pooling on the third decoding vector;

[0025] The classification module is used to input the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector into a classification model to obtain a classification result of the image to be classified.

[0026] In an implementation of the second aspect, character features of the special characters are extracted based on a multi-layer perceptron; and image features of the image to be classified are extracted based on a VIT model.

[0027] In an implementation manner of the second aspect, text description information of the image to be classified is obtained based on a visual language model.

[0028] In an implementation of the second aspect, inputting the first character vector, the second character vector, the third character vector, the first text vector, the second text vector, and the third text vector into a classification model to obtain a classification result of the image to be classified includes the following steps:

[0029] Performing average pooling on the first character vector, the second character vector, and the third character vector to obtain a first average pooling result;

[0030] Performing average pooling on the first text vector, the second text vector, and the third text vector to obtain a second average pooling result;

[0031] Performing matrix multiplication on the first average pooling result and the second average pooling result to obtain a matrix multiplication result;

[0032] The matrix multiplication result is passed through a self-attention mechanism and a multi-layer perceptron to obtain a pre-classification result;

[0033] The pre-classification result is passed through a multi-layer perceptron and a softmax function to obtain the classification result.

[0034] In a third aspect, the present invention provides an electronic device, the electronic device comprising: a processor and a memory;

[0035] The memory is used to store computer programs;

[0036] The processor is used to execute the computer program stored in the memory so that the electronic device performs the above-mentioned multimodal image classification method.

[0037] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned multimodal image classification method when executed by an electronic device.

[0038] As described above, the multimodal image classification method, system, storage medium and electronic device described in the present invention have the following beneficial effects.

[0039] (1) Image classification is achieved based on multimodal information such as images and texts, which effectively improves the classification accuracy.

[0040] (2) It greatly improves the speed of image classification, has a high degree of intelligence, and is extremely practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 Shown is a schematic diagram of a scene of an electronic device in an embodiment of the present invention.

[0042] Figure 2 Shown is a flow chart of a multimodal image classification method in one embodiment of the present invention.

[0043] Figure 3 FIG. 4 is a schematic diagram showing the architecture of a multimodal image classification method in one embodiment of the present invention.

[0044] Figure 4 FIG. 4 is a schematic diagram showing the structure of a multimodal image classification system in one embodiment of the present invention.

[0045] Figure 5 It is a schematic structural diagram of an electronic device of the present invention in one embodiment. DETAILED DESCRIPTION

[0046] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0047] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0048] The following embodiments of the present invention provide a multimodal image classification method, which can be applied to Figure 1 The electronic device shown. The electronic device described in the present invention may include a mobile phone 11 with a wireless charging function, a tablet computer 12, a laptop computer 13, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present invention does not impose any restrictions on the specific type of the electronic device.

[0049] 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).

[0050] For example, the electronic device can communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (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, etc. The GNSS can include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Satellite Navigation System (BDS), Quasi-Zenith Satellite System (QZSS) and / or Satellite Based Augmentation Systems (SBAS).

[0051] The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0052] like Figure 2 and Figure 3 As shown, in one embodiment, the multimodal image classification method of the present invention includes steps S1 to S10.

[0053] Step S1, setting a special character for representing image aggregation, and extracting character features of the special character.

[0054] Specifically, set a special character <embedding>, the special character is used to represent image convergence. The corresponding character features can be obtained by passing the characteristic characters through a multi-layer perceptron (MLP). Among them, the multi-layer perceptron is a forward-structured artificial neural network, which includes an input layer, an output layer and multiple hidden layers. The different layers of the multi-layer perceptron are fully connected, that is, any neuron in the previous layer is connected to all neurons in the next layer.

[0055] Step S2: extracting image features of the image to be classified.

[0056] Specifically, the image features of the image to be classified are extracted based on the VIT (Vision Transformer) model. The VIT model is a fusion of natural language processing and computer vision. It can achieve good results in image classification tasks without relying on convolution operations. The main structure of the VIT model is based on the Encoder part of the Transformer model.

[0057] Step S3: input the character feature and the image feature into a first transformer encoder, and obtain a first character vector corresponding to the position of the character feature in the output vector of the first transformer encoder.

[0058] Specifically, the transformer model consists of two parts: the encoder and the decoder. Both the encoder and the decoder contain 6 blocks. The transformer encoder is responsible for feature encoding, that is, extracting abstract feature information with obvious semantic characteristics from the original, relatively low-level input sequence signal (taking audio as an example, such as a sequence composed of single sampling point data in the original audio, or the manually designed MFCC and Fbank features of the audio). The transformer decoder is responsible for "decoding" the content of the target sequence from the feature information of the original sequence obtained by the transformer encoder (for example, "decoding" the corresponding text information from the features of the audio sequence).

[0059] Step S4: input the first character vector and the image feature into a second transformer encoder, and obtain a second character vector at a position corresponding to the first character vector in an output vector of the second transformer encoder.

[0060] Step S5: input the second character vector and the image feature into a third transformer encoder, and obtain a third character vector at a position corresponding to the second character vector in an output vector of the third transformer encoder.

[0061] It should be noted that the structures of the first transformer encoder, the second transformer encoder and the third transformer encoder in the present invention are the same.

[0062] Step S6: Obtain text description information of the image to be classified.

[0063] Specifically, the text description information of the image to be classified is obtained based on the Vision and Language Model (VLM). The Vision and Language Model is a multimodal model that aims to simultaneously understand and generate natural language text and image information. The Vision and Language Model builds a bridge between images and text to better understand visual and language information and integrate them into a unified semantic space. This integration allows it to perform well in a variety of tasks, including image description generation, visual question answering, cross-modal retrieval, etc.

[0064] Step S7: input the text description information into the fourth transformer decoder to obtain a first decoding vector, and perform maximum pooling on the first decoding vector to obtain a first text vector.

[0065] Step S8: input the first decoding vector into the fifth transformer decoder to obtain a second decoding vector, and perform maximum pooling on the second decoding vector to obtain a second text vector.

[0066] Step S9: input the second decoding vector into the sixth transformer decoder to obtain a third decoding vector, and perform maximum pooling on the third decoding vector to obtain a third text vector.

[0067] Step S10: input the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector into a classification model to obtain a classification result of the image to be classified.

[0068] Specifically, the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector are all used as inputs of the classification model. The first character vector, the second character vector and the third character vector represent character information of three levels: high, medium and low, respectively; the first text vector, the second text vector and the third text vector represent text information of three levels: high, medium and low, respectively.

[0069] Among them, in the classification model, average pooling is performed on the first character vector, the second character vector and the third character vector to obtain a first average pooling result. Average pooling is performed on the first text vector, the second text vector and the third text vector to obtain a second average pooling result. The first average pooling result and the second average pooling result are matrix multiplied to obtain a matrix multiplication result; the matrix multiplication result is then passed through a self-attention mechanism and a multilayer perceptron to obtain a pre-classification result; finally, the pre-classification result is passed through a multilayer perceptron and a softmax function to obtain the classification result.

[0070] The protection scope of the multimodal image classification method described in the embodiment of the present invention 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 prior art based on the principles of the present invention are included in the protection scope of the present invention.

[0071] An embodiment of the present invention further provides a multimodal image classification system, which can implement the multimodal image classification method described in the present invention. However, the implementation device of the multimodal image classification system described in the present invention includes but is not limited to the structure of the multimodal image classification system listed in this embodiment. All structural deformations and replacements of the prior art made according to the principles of the present invention are included in the protection scope of the present invention.

[0072] like Figure 4 As shown, in one embodiment, the multimodal image classification system of the present invention includes a first extraction module 401, a second extraction module 402, a first encoding module 403, a second encoding module 404, a third encoding module 405, an acquisition module 406, a first decoding module 407, a second decoding module 408, a third decoding module 409 and a classification module 410.

[0073] The first extraction module 401 is used to set a special character for representing image aggregation and extract character features of the special character.

[0074] The second extraction module 402 is used to extract image features of the image to be classified.

[0075] The first encoding module 403 is connected to the first extraction module 401 and the second extraction module 402, and is used to input the character features and the image features into a first transformer encoder to obtain a first character vector corresponding to the position of the character features in the output vector of the first transformer encoder.

[0076] The second encoding module 404 is connected to the first encoding module 403, and is used to input the first character vector and the image feature into a second transformer encoder to obtain a second character vector at a position corresponding to the first character vector in an output vector of the second transformer encoder.

[0077] The third encoding module 405 is connected to the second encoding module 404, and is used to input the second character vector and the image feature into a third transformer encoder to obtain a third character vector at a position corresponding to the second character vector in an output vector of the third transformer encoder.

[0078] The acquisition module 406 is used to acquire text description information of the image to be classified.

[0079] The first decoding module 407 is connected to the acquisition module 406, and is used to input the text description information into the fourth transformer decoder to obtain a first decoding vector, and obtain a first text vector by performing maximum pooling on the first decoding vector.

[0080] The second decoding module 408 is connected to the first decoding module 407, and is used to input the first decoding vector into the fifth transformer decoder to obtain a second decoding vector, and obtain a second text vector by performing maximum pooling on the second decoding vector.

[0081] The third decoding module 409 is connected to the second decoding module 408, and is used to input the second decoding vector into a sixth transformer decoder to obtain a third decoding vector, and obtain a third text vector by performing maximum pooling on the third decoding vector;

[0082] The classification module 410 is connected to the first encoding module 403, the second encoding module 404, the third encoding module 405, the first decoding module 407, the second decoding module 408 and the third decoding module 409, and is used to input the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector into a classification model to obtain a classification result of the image to be classified.

[0083] Among them, the structures and principles of the first extraction module 401, the second extraction module 402, the first encoding module 403, the second encoding module 404, the third encoding module 405, the acquisition module 406, the first decoding module 407, the second decoding module 408, the third decoding module 409 and the classification module 410 correspond one by one to the steps in the above-mentioned multimodal image classification method, so they are not repeated here.

[0084] In the several embodiments provided by the present invention, it should be understood that the disclosed system, device or method 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, and there may be other division methods in actual implementation, such as 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.

[0085] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. For example, the functional modules / units in the various embodiments of the present invention may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.

[0086] Those of ordinary skill 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 composition and steps of each example have been generally described in terms of function in the above description. 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 the present invention.

[0087] The embodiment of the present invention also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.

[0088] An embodiment of the present invention further provides an electronic device, which includes a processor and a memory.

[0089] The memory is used to store computer programs.

[0090] The memory includes: ROM, RAM, disk, USB flash drive, memory card or CD and other media that can store program codes.

[0091] The processor is connected to the memory and is used to execute the computer program stored in the memory so that the electronic device executes the above-mentioned multimodal image classification method.

[0092] 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 gates or transistor logic devices, discrete hardware components.

[0093] like Figure 5 As shown, the electronic device of the present invention is in the form of a general computing device. The 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).

[0094] 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. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0095] 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.

[0096] 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 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 53 via one or more data medium interfaces. The memory 52 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0097] A program / utility 524 having a set (at least one) of program modules 5241 may be stored, for example, in the memory 52, such program modules 5241 including but 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. The program modules 5241 generally perform the functions and / or methods of the embodiments described herein.

[0098] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, displays, 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., network cards, modems, 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., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 55. Figure 5 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 figure, other hardware and / or software modules can 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.

[0099] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.< / embedding>

Claims

1. A multimodal image classification method, characterized in that: The method comprises the following steps: Setting a special character for representing image convergence, and extracting character features of the special character; Extract image features of the image to be classified; Input the character feature and the image feature into a first transformer encoder, and obtain a first character vector corresponding to the position of the character feature in the output vector of the first transformer encoder; Input the first character vector and the image feature into a second transformer encoder, and obtain a second character vector at a position corresponding to the first character vector in an output vector of the second transformer encoder; Input the second character vector and the image feature into a third transformer encoder, and obtain a third character vector at a position corresponding to the second character vector in an output vector of the third transformer encoder; Obtaining text description information of the image to be classified; Input the text description information into a fourth transformer decoder to obtain a first decoding vector, and perform maximum pooling on the first decoding vector to obtain a first text vector; Input the first decoded vector into a fifth transformer decoder to obtain a second decoded vector, and perform maximum pooling on the second decoded vector to obtain a second text vector; Input the second decoded vector into a sixth transformer decoder to obtain a third decoded vector, and perform maximum pooling on the third decoded vector to obtain a third text vector; Inputting the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector into a classification model to obtain a classification result of the image to be classified; Inputting the first character vector, the second character vector, the third character vector, the first text vector, the second text vector, and the third text vector into a classification model to obtain a classification result of the image to be classified comprises the following steps: Performing average pooling on the first character vector, the second character vector, and the third character vector to obtain a first average pooling result; Performing average pooling on the first text vector, the second text vector, and the third text vector to obtain a second average pooling result; Performing matrix multiplication on the first average pooling result and the second average pooling result to obtain a matrix multiplication result; The matrix multiplication result is passed through a self-attention mechanism and a multi-layer perceptron to obtain a pre-classification result; The pre-classification result is passed through a multi-layer perceptron and a softmax function to obtain the classification result.

2. The multimodal image classification method according to claim 1, characterized in that: Extracting character features of the special characters based on a multi-layer perceptron; The image features of the image to be classified are extracted based on the VIT model.

3. The multimodal image classification method according to claim 1, characterized in that: The text description information of the image to be classified is obtained based on the visual language model.

4. A multimodal image classification system, characterized in that: The system comprises a first extraction module, a second extraction module, a first encoding module, a second encoding module, a third encoding module, an acquisition module, a first decoding module, a second decoding module, a third decoding module and a classification module; The first extraction module is used to set a special character for representing image convergence and extract the character features of the special character; The second extraction module is used to extract image features of the image to be classified; The first encoding module is used to input the character feature and the image feature into a first transformer encoder, and obtain a first character vector corresponding to the position of the character feature in the output vector of the first transformer encoder; The second encoding module is used to input the first character vector and the image feature into a second transformer encoder, and obtain a second character vector at a position corresponding to the first character vector in an output vector of the second transformer encoder; The third encoding module is used to input the second character vector and the image feature into a third transformer encoder, and obtain a third character vector at a position corresponding to the second character vector in an output vector of the third transformer encoder; The acquisition module is used to acquire text description information of the image to be classified; The first decoding module is used to input the text description information into a fourth transformer decoder to obtain a first decoding vector, and perform maximum pooling on the first decoding vector to obtain a first text vector; The second decoding module is used to input the first decoding vector into a fifth transformer decoder to obtain a second decoding vector, and perform maximum pooling on the second decoding vector to obtain a second text vector; The third decoding module is used to input the second decoding vector into the sixth transformer decoder to obtain a third decoding vector, and obtain a third text vector by performing maximum pooling on the third decoding vector; The classification module is used to input the first character vector, the second character vector, the third character vector, the first text vector, the second text vector and the third text vector into a classification model to obtain a classification result of the image to be classified; Inputting the first character vector, the second character vector, the third character vector, the first text vector, the second text vector, and the third text vector into a classification model to obtain a classification result of the image to be classified comprises the following steps: Performing average pooling on the first character vector, the second character vector, and the third character vector to obtain a first average pooling result; Performing average pooling on the first text vector, the second text vector, and the third text vector to obtain a second average pooling result; Performing matrix multiplication on the first average pooling result and the second average pooling result to obtain a matrix multiplication result; The matrix multiplication result is passed through a self-attention mechanism and a multi-layer perceptron to obtain a pre-classification result; The pre-classification result is passed through a multi-layer perceptron and a softmax function to obtain the classification result.

5. The multimodal image classification system according to claim 4, characterized in that: Extracting character features of the special characters based on a multi-layer perceptron; The image features of the image to be classified are extracted based on the VIT model.

6. The multimodal image classification system according to claim 4, characterized in that: The text description information of the image to be classified is obtained based on the visual language model.

7. 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 multimodal image classification method according to any one of claims 1 to 3.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, the multimodal image classification method according to any one of claims 1 to 3 is implemented.