WO2025148657A1 - 一种图像识别方法、装置、设备、存储介质及产品 - Google Patents

一种图像识别方法、装置、设备、存储介质及产品

Info

Publication number
WO2025148657A1
WO2025148657A1 PCT/CN2024/141101 CN2024141101W WO2025148657A1 WO 2025148657 A1 WO2025148657 A1 WO 2025148657A1 CN 2024141101 W CN2024141101 W CN 2024141101W WO 2025148657 A1 WO2025148657 A1 WO 2025148657A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
image
sample
processing model
vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/141101
Other languages
English (en)
French (fr)
Inventor
陈祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bigo Technology Pte Ltd
Original Assignee
Bigo Technology Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bigo Technology Pte Ltd filed Critical Bigo Technology Pte Ltd
Publication of WO2025148657A1 publication Critical patent/WO2025148657A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19147Obtaining sets of training patterns; Bootstrap methods, e.g. bagging or boosting

Definitions

  • FIG2 is a flow chart of another image recognition method provided by an embodiment of the present application.
  • FIG4 is a schematic diagram of data flow during the training process of a multimodal alignment network provided in an embodiment of the present application
  • the image recognition method includes:
  • S110 Obtain an image to be recognized, a question text, and a description rule text, wherein the question text and the description rule text are configured based on a set query category.
  • an image to be identified that needs to be reviewed or labeled, as well as a question text and a description rule text corresponding to the image to be identified are obtained.
  • the image to be identified provided by this solution may be one or more, and the question text and the description rule text corresponding to each image to be identified may be the same or different.
  • the question text and description rule text provided by the present solution are configured based on the set query category.
  • the question text can be used to describe the type of answer that needs to be output by the multimodal alignment network.
  • the content corresponding to the question text can be asking for the label corresponding to the to-be-identified image, or asking for the label corresponding to the specified person or object in the to-be-identified image.
  • the description rule text can be used to describe the form of the answer output by the multimodal alignment network.
  • S120 Input the image to be identified, the question text, and the description rule text into the trained multimodal alignment network, obtain the image feature vector of the image to be identified by using the visual processing model through the multimodal alignment network, and obtain the text feature vectors of the question text and the description rule text by using the language processing model, and determine the target label corresponding to the image to be identified in the set query category based on the image feature vector and the text feature vector by using the language processing model.
  • the image to be identified, the question text and the description rule text are input into the trained multimodal alignment network, and the image to be identified, the question text and the description rule text are analyzed and processed by the multimodal alignment network to output the target label corresponding to the set query category of the image to be identified.
  • the multimodal alignment network provided by the present invention is configured with trained visual processing models and language processing models. After receiving the image to be identified, the question text and the description rule text, the multimodal alignment network uses the visual processing model to obtain the image feature vector of the image to be identified, and uses the language processing model to obtain the text feature vectors of the question text and the description rule text, and uses the language processing model to determine the target label corresponding to the image to be identified in the set query category based on the image feature vector and the text feature vector.
  • the visual processing model provided by this solution can be a large vision model (LVM), and the language processing model provided by this solution can be a large language model (LLM).
  • the visual processing model and language processing model provided by this solution can be built based on a Transformer network (a neural network based on a self-attention mechanism), an RNN network (recurrent neural network) or a CNN network (convolutional neural network).
  • the image feature vector of the image to be recognized is obtained by using the visual processing model through the multimodal alignment network
  • the text feature vectors of the question text and the description rule text are obtained by using the language processing model
  • the target label corresponding to the image to be recognized in the set query category is determined according to the image feature vector and the text feature vector by using the language processing model.
  • FIG2 shows a flow chart of another image recognition method provided by the embodiment of the present application, which is a specific implementation of the above image recognition method.
  • the image recognition method includes:
  • S210 Acquire an image-text data pair, where the image-text data pair includes a sample image, a sample description text describing the sample image, and sample object coordinate information.
  • image-text data pairs before using a multimodal alignment network to determine the target label corresponding to a set query category for an image to be identified, image-text data pairs may be collected first, and after optimizing and training the multimodal alignment network using the image-text data pairs, the optimized multimodal alignment network may be configured in an image recognition device, so that the image recognition device can determine the target label corresponding to the set query category for the image to be identified based on the trained multimodal alignment network.
  • the data sources of the audit business can be sorted, and the sample images corresponding to the data sources can be annotated, such as the sample description, object coordinates, etc. in the sample images, and the corresponding sample images and the corresponding sample description, object coordinates and other annotated data can be used as image-text data pairs.
  • an image-text data pair includes a sample image, a sample description text describing the sample image, and sample object coordinate information (i.e., the annotated sample description and object coordinates).
  • corresponding sample question-and-answer data may be configured for each image-text data pair as a supervisory signal in the multimodal alignment network training process, wherein the sample question-and-answer data includes sample question data on the corresponding content in the sample image, and sample answer data that answers the sample question data based on the sample image.
  • the sample answer data in the sample question-and-answer data may be used as the true label corresponding to the sample image.
  • S220 Using image-text data to train a multimodal alignment network, wherein the multimodal alignment network uses a visual processing model to obtain a sample image vector of a sample image, and uses a language processing model to obtain a sample text vector of sample description text and sample object coordinate information, and uses a language processing model to determine a predicted label corresponding to the sample image based on the sample image vector and the sample text vector, and optimizes network parameters of the visual processing model and the language processing model based on the predicted label and the true label corresponding to the sample image vector.
  • the multimodal alignment network uses a visual processing model to obtain a sample image vector of a sample image, and uses a language processing model to obtain a sample text vector of sample description text and sample object coordinate information, and uses a language processing model to determine a predicted label corresponding to the sample image based on the sample image vector and the sample text vector, and optimizes network parameters of the visual processing model and the language processing model based on the predicted label and the true label corresponding to the sample image vector.
  • the collected image-text data pairs are used to train the multimodal alignment network, wherein during the training process, the multimodal alignment network provided by the present solution can process the image-text data pairs through the visual processing model and the language processing model configured by the multimodal alignment network.
  • the multimodal alignment network analyzes and processes the sample images in the image-text data pairs through the visual processing model to determine the sample image vector corresponding to the sample image, and analyzes and processes the sample description text and sample object coordinate information in the image-text data pairs through the Q-Benz model to determine the sample text vector of the sample description text and the sample object coordinate information.
  • the sample image vector and the sample text vector are analyzed and processed using a language processing model to obtain the predicted label corresponding to the sample image, and the network parameters of the visual processing model and the language processing model are optimized based on the predicted label and the true label corresponding to the sample image vector (for example, the sample answer data in the sample question and answer data, and the true label annotated separately).
  • This solution uses image-text data pairs to train the multimodal alignment network, and uses the massive image-text pair data in business scenarios to obtain a multimodal alignment network that semantically aligns text and image information, so that the multimodal alignment network has the ability to recognize images under specified questions and description rules, without the need to collect sample data and train new recognition models for different recognition types, effectively improving the versatility of image recognition.
  • the multimodal alignment network uses a visual processing model to obtain a sample image vector of a sample image, uses a language processing model to obtain a sample text vector of sample description text and sample object coordinate information, and uses the language processing model to determine a predicted label corresponding to the sample image according to the sample image vector and the sample text vector, including:
  • S221 Obtain a sample image vector of a sample image using an image encoding module in a visual processing model.
  • the multimodal alignment network uses the visual processing model to obtain the sample image vector of the sample image
  • it can use the image encoding module in the visual processing model to analyze and process the sample image to obtain the sample image vector of the sample image.
  • the multimodal alignment network uses a language processing model to obtain a sample text vector of sample description text and sample object coordinate information
  • it can use the text decoding module in the language processing model to analyze and process the sample description text and sample object coordinate information to obtain a sample text vector of the sample description text and sample object coordinate information.
  • the sample image vector and the sample text vector are input into the prediction output layer in the language processing model, and the sample image vector and the sample text vector are analyzed and processed by the prediction output layer in the language processing model to obtain the prediction label corresponding to the sample image.
  • This scheme obtains the sample image vector of the sample image by using the image encoding module in the visual processing model and obtains the sample text vector of the sample description text and the sample object coordinate information by using the text decoding module in the language processing model, and analyzes and processes the sample image vector and the sample text vector by using the prediction output layer in the language processing model to obtain the prediction label, so that the multimodal alignment network can accurately learn the recognition ability of images under the specified problems and description rules, and effectively improve the versatility of image recognition.
  • S2222 Use the text decoding module in the language processing model to obtain the text feature vector of the sample integration matrix.
  • the corresponding text in each image-text data pair is integrated, for example, the sample description text and the sample object coordinate information text in the image-text data pair are integrated to obtain a sample integration matrix, and the sample integration matrix is sent to the text decoding module in the language processing model, and the text decoding module analyzes and processes the sample integration matrix to obtain the text feature vector of the sample integration matrix.
  • This solution improves the extraction efficiency of the sample text vector and improves the training and data processing efficiency of the multimodal alignment network by integrating the sample description text and the sample object coordinate information text into a sample integration matrix and using the text decoding module in the language processing model to obtain the text feature vector of the sample integration matrix.
  • the loss function can be determined according to the predicted label and the real label corresponding to the sample image vector, and the network parameters of the visual processing model and the language processing model can be optimized based on the loss function.
  • the network parameters can be optimized by stochastic gradient descent or non-heuristic optimization algorithm to improve the network convergence speed.
  • the loss function is determined based on the predicted label and the true label corresponding to the sample image vector, and the network parameters of the visual processing model and the language processing model are optimized based on the loss function, and the network parameters of the visual processing model and the language processing model are continuously updated (the network parameters corresponding to the image encoding module in the visual processing model, the text decoding module in the language processing model, and the prediction output layer are continuously updated) so that the loss function of the converged multimodal alignment network reaches the minimum or is less than the set loss threshold.
  • the loss function corresponding to the predicted label and the true label can be determined according to the predicted probability corresponding to the predicted label and the true probability corresponding to the true label, and the true probability can be a numerical representation of the true answer, for example, represented by a one-hot vector.
  • P(A) is the predicted probability corresponding to the predicted label
  • y is the true probability corresponding to the true label.
  • 1 is a sample image corresponding to the image-text data pair
  • 2 and 3 are the sample description text and sample object coordinate information corresponding to the image-text data pair, respectively.
  • the content corresponding to the sample description text may be "four dogs set on a stone in a wild. from left to right, a white dog, a black dog. a head of a black-striped white dog and the right is a brown-color dog", which describes the sample image.
  • the content corresponding to the object coordinate information can be "tag:dog bbox:(194, 43, 624, 1055); tag:dog bbox:(1206, 176, 1705, 1033); tag:dog bbox:(776, 399, 1245, 1025); tag:dog bbox:(560, 479, 848, 1014); tag:grass bbox:(728, 997, 1022, 1078); tag:tree bbox:(1739, 0, 1848, 718)", which respectively records the coordinates of the positioning boxes corresponding to the 4 dogs, grass, and trees in the sample image.
  • the sample image may be standardized into a tensor matrix of set size and dimension, and then the tensor matrix obtained after the standardization is sent to the visual processing model to extract the sample image vector.
  • the sample description text and sample object coordinate information may be standardized into a matrix of a set dimension, and then the matrix obtained after the standardization process is sent to the language processing model to extract the sample text vector.
  • the sample description text and sample object coordinate information are aggregated and standardized into a matrix of 1024*512 dimensions, and the sample text vector ET (T) ⁇ R 1024 ⁇ 512 of 1024*512 dimensions is obtained by processing the text decoding module (Language-Decoder) of the language processing model shown in 5 in the figure, i.e., the sample text vector (Text Embedding) shown in Figure 3.
  • the sample image vector and the sample text vector are input into the prediction output layer (Generation Layer shown in 8 in Figure 4) in the language processing model for analysis and processing, and the vocabulary probability distribution (the predicted label corresponding to the sample image and the corresponding predicted probability) is output.
  • the network parameters of the visual processing model and the language processing model can be optimized based on the loss function corresponding to the predicted label and the true label corresponding to the sample image vector.
  • P(A) is the probability of the answer output by the language processing model (prediction probability), which is calculated as a probability distribution on the speech processing model dictionary (e.g., the language model dictionary), that is, a non-negative vector whose sum is 1 and whose length is the dictionary length.
  • ⁇ LLM and ⁇ vision represent the language processing model and the vision processing model, respectively.
  • [x describtion ,x objects ,x Question ,x image ] concat([ ET (Descrbtion), ET (Objects), ET (Question)], EI (Image)) is the concatenation of the text vectors and image vectors corresponding to the sample description text, sample object coordinate information, set question text and sample image.
  • the network parameters of the visual processing model and the language processing model are continuously updated. After the converged optimal network is obtained, the network weights are no longer updated. That is, the network parameters of the image encoding module, text decoding module and prediction output layer corresponding to 4, 5 and 8 in Figure 4 are fixed as the feature extractors of the image and text and the generation parameters of the predicted text, respectively.
  • S230 Obtain an image to be recognized, a question text, and a description rule text, wherein the question text and the description rule text are configured based on a set query category.
  • S240 Input the image to be identified, the question text, and the description rule text into the trained multimodal alignment network, obtain the image feature vector of the image to be identified by using the visual processing model through the multimodal alignment network, and obtain the text feature vectors of the question text and the description rule text by using the language processing model, and determine the target label corresponding to the image to be identified in the set query category based on the image feature vector and the text feature vector by using the language processing model.
  • the multimodal alignment network uses a visual processing model to obtain an image feature vector of an image to be identified, uses a language processing model to obtain text feature vectors of a question text and a text describing a rule, and uses the language processing model to determine a target label corresponding to a query category for the image to be identified based on the image feature vector and the text feature vector, including:
  • S241 Utilize the image encoding module in the visual processing model to obtain the image feature vector of the image to be identified.
  • S242 Utilize the text decoding module in the language processing model to obtain the text feature vector of the question text and the text describing the rule.
  • S243 Analyze and process the image feature vector and the text feature vector using the prediction output layer in the language processing model to determine the target label corresponding to the set query category of the image to be identified.
  • the multimodal alignment network uses the visual processing model to obtain the image feature vector of the image to be identified, it can use the image encoding module in the visual processing model to analyze and process the image to be identified and obtain the image feature vector of the image to be identified.
  • the multimodal alignment network uses the language processing model to obtain the text feature vectors of the question text and the description rule text, it can use the text decoding module in the language processing model to analyze and process the question text and the description rule text to obtain the text feature vectors of the question text and the description rule text.
  • the image feature vector and text feature vector are input into the prediction output layer in the language processing model, and the prediction output layer in the language processing model is used to analyze and process the image and text feature vectors to be identified, and obtain the target label corresponding to the set query category of the image to be identified.
  • This solution obtains the image feature vector of the image to be identified by using the image encoding module in the visual processing model and obtains the text feature vectors of the question text and the description rule text by using the text decoding module in the language processing model, and obtains the target label corresponding to the set query category by using the prediction output layer in the language processing model to analyze and process the image and text feature vectors to be identified, so that the multimodal alignment network accurately outputs the target label corresponding to the set query category, thereby improving the image recognition accuracy.
  • the multimodal alignment network when using the text decoding module in the language processing model to obtain the text feature vector of the question text and the text describing the rule text, includes:
  • S2422 Utilize the text decoding module in the language processing model to obtain the text feature vector of the text integration matrix.
  • the problem text and the description rule text are integrated to obtain a text integration matrix
  • the text integration matrix is sent to the text decoding module in the language processing model, and the text decoding module analyzes and processes the text integration matrix to obtain the text feature vector of the text integration matrix.
  • This solution improves the extraction efficiency of sample text vectors and image recognition efficiency by integrating the problem text and the description rule text into a text integration matrix and using the text decoding module in the language processing model to obtain the text feature vector of the text integration matrix.
  • the content corresponding to the description rule text may be "Tongue Out: by judging the person's tongue, if tongue is out of the mouth, then image can be labeled as tongue out.” That is, it describes the description rule of labeling an image as tongue sticking out.
  • the image corresponding to the description rule text in the figure is an example of "tongue sticking out", which will not be input as a description rule text.
  • the content corresponding to the question text may be "what is the man's label?” That is, it asks the label corresponding to the man in the image to be identified.
  • the image to be identified is input into the image encoding module (Image-Encoder) of the visual processing model shown in FIG5 4, and the image encoding module analyzes and processes the image feature vector corresponding to the image to be identified (as shown in FIG5 6).
  • the question text and the description rule text are integrated and sent to the text decoding module (Language-Decoder) in the language processing model shown in FIG5 5, and the text decoding module analyzes and processes the text feature vectors corresponding to the question text and the description rule text (as shown in FIG5 7).
  • the image feature vector and the text feature vector are input into the prediction output layer (Generation Layer) in the language processing model shown in FIG5 8, and the prediction output layer analyzes and processes the image feature vector and the text feature vector to output the corresponding target label.
  • the target label is expressed as "by judging the person's tongue, the man tongue out, so this picture's label is "tongue out”", that is, after analyzing the tongue of the person in the image to be identified, the man in the image to be identified sticks out his tongue, so the target label of the image to be identified can be "sticking out tongue".
  • the image feature vector of the image to be identified is obtained by the multimodal alignment network using the visual processing model
  • the text feature vector of the question text and the description rule text is obtained by using the language processing model
  • the target label corresponding to the image to be identified in the set query category is determined by the language processing model according to the image feature vector and the text feature vector.
  • a multimodal alignment network with semantic alignment of text and image information is obtained by using a large amount of image-text pair data in business scenarios, so that the multimodal alignment network has the ability to recognize images under specified questions and description rules, and there is no need to collect sample data and train new recognition models for different recognition types separately, which effectively improves the versatility of image recognition.
  • FIG6 is a schematic diagram of the structure of an image recognition device provided in an embodiment of the present application.
  • the image recognition device includes an information acquisition module 61 and an image recognition module 62 .
  • the information acquisition module 61 is configured to obtain the image to be identified, the question text and the description rule text, and the question text and the description rule text are configured based on the set query category;
  • the image recognition module 62 is configured to input the image to be identified, the question text and the description rule text into the trained multimodal alignment network, and obtain the image feature vector of the image to be identified by using the visual processing model through the multimodal alignment network, and obtain the text feature vector of the question text and the description rule text by using the language processing model, and determine the target label corresponding to the image to be identified in the set query category according to the image feature vector and the text feature vector by using the language processing model.
  • the multimodal alignment network uses a visual processing model to obtain an image feature vector of an image to be identified, uses a language processing model to obtain text feature vectors of a question text and a text describing a rule, and uses the language processing model to determine a target label corresponding to a query category for the image to be identified based on the image feature vector and the text feature vector.
  • the configuration is as follows:
  • the image encoding module in the visual processing model is used to obtain the image feature vector of the image to be identified;
  • the prediction output layer in the language processing model is used to analyze and process the image feature vector and the text feature vector to determine the target label corresponding to the set query category of the image to be identified.
  • the configuration is as follows:
  • the text decoding module in the language processing model is used to obtain the text feature vector of the text integration matrix.
  • the image recognition device further includes a sample acquisition module and a model training module.
  • the sample acquisition module is configured to acquire an image-text data pair, the image-text data pair including a sample image, a sample description text describing the sample image, and sample object coordinate information;
  • the model training module is configured to train a multimodal alignment network using image-text data pairs, wherein the multimodal alignment network uses a visual processing model to obtain sample image vectors of sample images, and uses a language processing model to obtain sample text vectors of sample description text and sample object coordinate information, and uses a language processing model to determine the predicted label corresponding to the sample image based on the sample image vector and the sample text vector, and optimizes the network parameters of the visual processing model and the language processing model based on the predicted label and the true label corresponding to the sample image vector.
  • the multimodal alignment network uses the visual processing model to obtain the sample image vector of the sample image, uses the language processing model to obtain the sample text vector of the sample description text and the sample object coordinate information, and uses the language processing model to determine the predicted label corresponding to the sample image according to the sample image vector and the sample text vector, the configuration is as follows:
  • the prediction output layer in the language processing model is used to analyze and process the sample image vector and the sample text vector to obtain the prediction label corresponding to the sample image.
  • the configuration is as follows:
  • the text decoding module in the language processing model is used to obtain the text feature vector of the sample integration matrix.
  • the model training module when the model training module optimizes the network parameters of the visual processing model and the language processing model based on the predicted label and the real label corresponding to the sample image vector, the model training module is configured as follows:
  • the loss function is determined according to the predicted label and the true label corresponding to the sample image vector, and the network parameters of the visual processing model and the language processing model are optimized based on the loss function.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

本申请实施例提供了一种图像识别方法、装置、设备、存储介质及产品。本申请实施例提供的技术方案通过将待识别图像、问题文本以及描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签,不需要重新收集样本数据训练新的识别模型,基于设定查询类别配置问题文本和描述规则文本即可得到待识别图像在设定查询类别对应的目标标签,有效提高图像识别的通用性。

Description

一种图像识别方法、装置、设备、存储介质及产品
本申请要求在2024年01月11日提交中国专利局,申请号为202410048426.8的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及图像处理技术领域,尤其涉及一种图像识别方法、装置、设备、存储介质及产品。
背景技术
目前,对图像的审核一般是通过图像识别模型的识别结果进行的,即通过基于大量样本和标注标签的监督学习的方式进行训练得到的图像识别模型进行图像识别。
图像识别模型需要积累较大的训练数据才可保证具备较好的泛化能力和实际应用价值,需要从大量的数据中获取所关注的正样本,此类正样本在应用到大规模的审核数据上时往往需要数十万或者数万的累积量。然而在一些训练数据中未曾明确定义的类别识别上,目前通用的解决案是通过人工收集更多所关注类别的数据以缓解数据不足的问题,同时进一步训练一个单独的图像识别模实现对新类别的有效识别。但是重新训练一个图像识别模型需要投入极大的时间成本,并且由于审核的规则随着业务和尺度的变更,往往要求重新收集数据并进行标注,图像识别的通用性较低。
发明内容
本申请实施例提供一种图像识别方法、装置、设备、存储介质及产品,以解决现有图像识别方案的通用性较低的技术问题,有效提高图像识别的通用性。
在第一方面,本申请实施例提供了一种图像识别方法,包括:
获取待识别图像、问题文本以及描述规则文本,所述问题文本以及所述描述规则文本基于设定查询类别进行配置得到;
将所述待识别图像、所述问题文本以及所述描述规则文本输入至训练完成的多模态对齐网络中,通过所述多模态对齐网络利用视觉处理模型获取所述待识别图像的图像特征向量,以及利用语言处理模型获取所述问题文本和所述描述规则文本的文本特征向量,并利用所述语言处理模型根据所述图像特征向量和所述文本特征向量确定所述待识别图像在所述设定查询类别对应的目标标签。
在第二方面,本申请实施例提供了一种图像识别装置,包括信息获取模块和图像识别模块,其中:
所述信息获取模块,配置为获取待识别图像、问题文本以及描述规则文本,所述问题文本以及所述描述规则文本基于设定查询类别进行配置得到;
所述图像识别模块,配置为将所述待识别图像、所述问题文本以及所述描述规则文本输入至训练完成的多模态对齐网络中,通过所述多模态对齐网络利用视觉处理模型获取所述待识别图像的图像特征向量,以及利用语言处理模型获取所述问题文本和所述描述规则文本的文本特征向量,并利用所述语言处理模型根据所述图像特征向量和所述文本特征向量确定所述待识别图像在所述设定查询类别对应的目标标签。
在第三方面,本申请实施例提供了一种图像识别设备,包括:存储器以及一个或多个处理器;
所述存储器,用于存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的图像识别方法。
在第四方面,本申请实施例提供了一种存储计算机可执行指令的非易失性存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如第一方面所述的图像识别方法。
在第五方面,本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中,设备的至少一个处理器从计算机可读存储介质读取并执行计算机程序,使得设备执行如第一方面所述的图像识别方法。
本申请实施例通过将待识别图像、问题文本以及描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签,不需要重新收集样本数据训练新的识别模型,基于设定查询类别配置问题文本和描述规则文本即可得到待识别图像在设定查询类别对应的目标标签,有效提高图像识别的通用性。
附图说明
图1是本申请实施例提供的一种图像识别方法的流程图;
图2是本申请实施例提供的另一种图像识别方法的流程图;
图3是本申请实施例提供的一种基于自注意力机制的神经网络结构示意图;
图4是本申请实施例提供的一种多模态对齐网络在训练过程中的数据流向示意图;
图5是本申请实施例提供的一种多模态对齐网络在训练过程中的数据流向示意图;
图6是本申请实施例提供的一种图像识别装置的结构示意图;
图7是本申请实施例提供的一种图像识别设备的结构示意图。
具体实施方式
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时上述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。上述处理可以对应于方法、函数、规程、子例程、子程序等等。
本申请提供的图像识别方法可应用于对图像的审核、打标场景,旨在基于设定查询类别配置问题文本和描述规则文本,通过多模态对齐网络中的视觉处理模型和语言处理模型对待识别图像、问题文本以及描述规则文本进行分析处理,得到待识别图像在设定查询类别对应的目标标签,有效提高图像识别的通用性。
在现有的图像识别方案中,在需要对训练数据中未曾明确定义的类别进行识别时,一般是需要重新收集该类别的正样本数据重新训练一个新的识别模型,即要求重新收集数据并进行标注,而收集数据和标注的过程往往耗费巨大的时间和人力成本,从原始数据中收集目标数据需要耗费十分庞大的人力成本,同时,由于没有专用的算法模型对目标类别进行识别,需要进一步研发新的视觉识别深度模型,图像识别通用性较差。基于此,提供本申请实施例的一种图像识别方法,以解决现有图像识别方案图像识别通用性较差的技术问题。
图1给出了本申请实施例提供的一种图像识别方法的流程图,本申请实施例提供的图像识别方法可以由图像识别装置来执行,该图像识别装置可以通过硬件和/或软件的方式实现,并集成在图像识别设备中。
下述以图像识别装置执行图像识别方法为例进行描述。参考图1,该图像识别方法包括:
S110:获取待识别图像、问题文本以及描述规则文本,问题文本以及描述规则文本基于设定查询类别进行配置得到。
示例性的,获取需要进行审核或打标签的待识别图像,以及待识别图像对应的问题文本和描述规则文本。其中,本方案提供的待识别图像可以是一个或多个,各个待识别图像对应的问题文本以及描述规则文本可以相同,也可以不同。
在一个实施例中,本方案提供的问题文本以及描述规则文本基于设定查询类别进行配置得到。其中,问题文本可用于描述需要多模态对齐网络输出的答案类型,例如问题文本对应的内容可以是询问待识别对应的标签,或询问待识别图像中指定人物或物体对应的标签。描述规则文本可用于描述多模态对齐网络输出的答案形式。
S120:将待识别图像、问题文本以及描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签。
示例性的,将待识别图像、问题文本和描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络对待识别图像、问题文本和描述规则文本进行分析处理并输出待识别图像在设定查询类别对应的目标标签。
本方案提供的多模态对齐网络中配置有训练完成的视觉处理模型和语言处理模型,其中,多模态对齐网络在接收到待识别图像、问题文本以及描述规则文本后,利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签。
可选的,本方案提供的视觉处理模型可以是视觉大模型(LVM,Large Vision Model),本方案提供的语言处理模型可以是语言大模型(LLM,Large Language Model),本方案提供给的视觉处理模型和语言处理模型可基于Transformer网络(基于自注意力机制的神经网络)、RNN网络(循环神经网络)或CNN网络(卷积神经网络)进行搭建得到。
上述,通过将待识别图像、问题文本以及描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签,不需要重新收集样本数据训练新的识别模型,基于设定查询类别配置问题文本和描述规则文本即可得到待识别图像在设定查询类别对应的目标标签,有效提高图像识别的通用性。
在上述实施例的基础上,图2给出了本申请实施例提供的另一种图像识别方法的流程图,该图像识别方法是对上述图像识别方法的具体化。参考图2,该图像识别方法包括:
S210:获取图像文本数据对,图像文本数据对包括样本图像,以及对样本图像进行描述的样本描述文本和样本物体坐标信息。
在一个实施例中,在利用多模态对齐网络确定待识别图像在设定查询类别对应的目标标签之前,可先收集图像文本数据对,利用图像文本数据对对多模态对齐网络进行优化训练后,再将优化完成的多模态对齐网络配置到图像识别设备中,以供图像识别设备基于训练完成的多模态对齐网络确定待识别图像在设定查询类别对应的目标标签。
示例性的,可对审核业务上的数据源进行整理,对数据源对应的样本图像进行标注,例如标注样本图像中的样本描述、物体坐标等,并将对应的样本图像和对应的样本描述、物体坐标等标注数据作为图像文本数据对。其中,一个图像文本数据对包括样本图像,以及对样本图像进行描述的样本描述文本和样本物体坐标信息(即标注的样本描述和物体坐标)。
可选的,可为每个图像文本数据对配置对应的样本问答数据,作为多模态对齐网络训练过程中的监督信号,其中样本问答数据包括对样本图像中对应内容的样本提问数据,以及基于样本图像,对样本提问数据进行解答的样本回答数据。可选的,样本问答数据中的样本回答数据可作为样本图像对应的真实标签。
S220:利用图像文本数据对对多模态对齐网络进行训练,其中,多模态对齐网络利用视觉处理模型获取样本图像的样本图像向量,以及利用语言处理模型获取样本描述文本和样本物体坐标信息的样本文本向量,并利用语言处理模型根据样本图像向量和样本文本向量确定样本图像对应的预测标签,并基于预测标签和样本图像向量对应的真实标签对视觉处理模型和语言处理模型进行网络参数优化。
示例性的,利用收集的图像文本数据对对多模态对齐网络进行训练,其中,本方案提供的多模态对齐网络在训练过程中,其对图像文本数据对的处理可通过多模态对齐网络配置的视觉处理模型和语言处理模型进行。例如,多模态对齐网络通过视觉处理模型对图像文本数据对中的样本图像进行分析处理,确定样本图像对应的样本图像向量,并通过问奔驰利模型对图像文本数据对中的样本描述文本和样本物体坐标信息进行分析处理,确定样本描述文本和样本物体坐标信息的样本文本向量。
在一个实施例中,在得到样本图像向量以及样本文本向量后,利用语言处理模型对样本图像向量以及样本文本向量进行分析处理,得到样本图像对应的预测标签,并基于预测标签和样本图像向量对应的真实标签(例如样本问答数据中的样本回答数据,与另外标注的真实标签)对视觉处理模型和语言处理模型进行网络参数优化。本方案通过利用图像文本数据对对多模态对齐网络进行训练,利用业务场景下海量的图文对数据获得文本和图像信息语义对齐的多模态对齐网络,使得多模态对齐网络具备对指定问题和描述规则下对图像的识别能力,不需要单独为不同的识别类型收集样本数据和训练新的识别模型,有效提高图像识别的通用性。
在一个可能的实施例中,本方案提供的多模态对齐网络在利用视觉处理模型获取样本图像的样本图像向量,以及利用语言处理模型获取样本描述文本和样本物体坐标信息的样本文本向量,并利用语言处理模型根据样本图像向量和样本文本向量确定样本图像对应的预测标签时,包括:
S221:利用视觉处理模型中的图像编码模块获取样本图像的样本图像向量。
S222:利用语言处理模型中的文本解码模块获取样本描述文本和样本物体坐标信息的样本文本向量。
S223:利用语言处理模型中的预测输出层对样本图像向和样本文本向量进行分析处理,得到样本图像对应的预测标签。
示例性的,多模态对齐网络在利用视觉处理模型获取样本图像的样本图像向量时,可以是利用视觉处理模型中的图像编码模块对样本图像进行分析处理,并得到样本图像的样本图像向量。
多模态对齐网络在利用语言处理模型获取样本描述文本和样本物体坐标信息的样本文本向量时,可以是利用语言处理模型中的文本解码模块对样本描述文本和样本物体坐标信息进行分析处理,并得到样本描述文本和样本物体坐标信息的样本文本向量。
在确定样本图像向量和样本文本向量后,将样本图像向量和样本文本向量输入到语言处理模型中的预测输出层中,利用语言处理模型中的预测输出层对样本图像向和样本文本向量进行分析处理,得到样本图像对应的预测标签。本方案通过利用视觉处理模型中的图像编码模块获取样本图像的样本图像向量以及利用语言处理模型中的文本解码模块获取样本描述文本和样本物体坐标信息的样本文本向量,并利用语言处理模型中的预测输出层对样本图像向和样本文本向量进行分析处理得到预测标签,使得多模态对齐网络准确学习对指定问题和描述规则下对图像的识别能力,有效提高图像识别的通用性。
如图3提供的一种基于自注意力机制的神经网络结构示意图所示,以基于自注意力机制的神经网络搭建视觉处理模型和语言处理模型为例,该自注意力机制的神经网络为12层的自注意力和残差神经网络,由5个阶段(stage)共16层组成,其中①为接收图像或文本的输入层,②为对图像或文本进行标准化处理的标准化层。图3中③为自注意力机制的神经网络的核心结构,主要通过多头自注意力方式和short-cut残差链接提取信息,同时也包含了可学习的前向网络,图3中③部分形成自注意力机制的神经网络的编码块Encoder-Block,每个编码块的信息输入和信息输出可以是固定为768维度的矩阵输出,保持维度不变。一个自注意力机制的神经网络配置有级联编排的12个编码块,可有效提取图像和文本中的高层次语义信息,图3中④所示的全联接层网络可对文本或者视觉信息进行编码,图3中①-④可形成自注意力机制的神经网络的编码模块。
在一个可能的实施例中,本方案提供的多模态对齐网络在利用语言处理模型中的文本解码模块获取样本描述文本和样本物体坐标信息的样本文本向量时,包括:
S2221:对样本描述文本和样本物体坐标信息文本进行整合处理,得到样本整合矩阵。
S2222:利用语言处理模型中的文本解码模块获取样本整合矩阵的文本特征向量。
示例性的,对每个图像文本数据对中对应的文本进行整合处理,例如将图像文本数据对中样本描述文本和样本物体坐标信息文本进行整合处理,得到样本整合矩阵,并将样本整合矩阵发送至语言处理模型中的文本解码模块中,由文本解码模块对样本整合矩阵进行分析处理,得到样本整合矩阵的文本特征向量。本方案通过将样本描述文本和样本物体坐标信息文本整合为样本整合矩阵,并利用语言处理模型中的文本解码模块获取样本整合矩阵的文本特征向量,提高对样本文本向量的提取效率,提高多模态对齐网络的训练和数据处理效率。
在一个可能的实施例中,本方案提供的图像识别方法在基于预测标签和样本图像向量对应的真实标签对视觉处理模型和语言处理模型进行网络参数优化时,可以是根据预测标签和样本图像向量对应的真实标签确定损失函数,并基于损失函数对视觉处理模型和语言处理模型进行网络参数优化。可选的,可通过随机梯度下降或非启发式的优化算法进行网络参数的优化,提高网络收敛速度。
示例性的,在对多模态对齐网络进行训练过程中,根据预测标签和样本图像向量对应的真实标签确定损失函数,并根据损失函数对视觉处理模型和语言处理模型进行网络参数优化,不断更新视觉处理模型和语言处理模型的网络参数(不断更新视觉处理模型中图像编码模块、语言处理模型中文本解码模块和预测输出层对应的网络参数),使得收敛的多模态对齐网络的损失函数达到最小或小于设定损失阈值。
在一个实施例中,预测标签和真实标签对应的损失函数可根据预测标签对应的预测概率和真实标签对应的真实概率进行确定,真实概率可以是真实答案的数值表示,例如通过one-hot向量表示。可选的,预测标签和真实标签对应的损失函数可表示为:
L(P(A),y)=-ylog(P(A))
其中,P(A)为预测标签对应的预测概率,y为真实标签对应的真实概率。本方案通过根据预测标签和真实标签确定损失函数对视觉处理模型和语言处理模型进行网络参数优化,有效提高多模态对齐网络的图像识别准确率。
如图4提供的一种多模态对齐网络在训练过程中的数据流向示意图所示,图4中①为图像文本数据对对应的样本图像,②和③分别为图像文本数据对对应的样本描述文本和样本物体坐标信息,例如样本描述文本对应的内容可以是“four dogs set on a stone in a wild.from left to right,a white dog,a black dog.a head black-striped white dog and the right is a brown-color dog”描述了样本图像中4只狗以及对应的颜色,本物体坐标信息对应的内容可以是“tag:dog bbox:(194,43,624,1055);tag:dog bbox:(1206,176,1705,1033);tag:dog bbox:(776,399,1245,1025);tag:dog bbox:(560,479,848,1014);tag:grass bbox:(728,997,1022,1078);tag:tree bbox:(1739,0,1848,718)”,分别记录了样本图像中4只狗、草地、树木对应的定位框的坐标。
可选的,可对样本图像进行标准化处理,将样本图像标准化为设定尺寸和维度的张量矩阵,再将标准化处理后得到的张量矩阵发送至视觉处理模型进行样本图像向量的提取。例如将样本图像标准化处理为224*224*3d的张量矩阵,随后通过图4中④所示的视觉处理模型的图像编码模块(Image-Encoder)处理得到192*512维度的样本图像向量xI=P(x;θvision)=EI(I)∈R192×512,即图4中⑥所示的样本图像向量(Image Embedding)。
可选的,可对样本描述文本和样本物体坐标信息进行标准化处理,将样本描述文本和样本物体坐标信息标准化为设定维度的矩阵,再将标准化处理后得到的矩阵发送至语言处理模型进行样本文本向量的提取。例如将样本描述文本和样本物体坐标信息聚合并标准化处理为长度为1024*512维度的矩阵,通过图中⑤所示的语言处理模型的文本解码模块(Language-Decoder)处理得到1024*512维度的样本文本向量ET(T)∈R1024×512,即图3中所示的样本文本向量(Text Embedding)。
在得到样本图像向量和样本文本向量后,将样本图像向量和样本文本向量输入到语言处理模型中的预测输出层(图4中⑧所示的Generation Layer)进行分析处理,输出词表概率分布(样本图像对应的预测标签以及对应的预测概率)。可基于预测标签和样本图像向量对应的真实标签对应的损失函数对视觉处理模型和语言处理模型进行网络参数优化。可选的,词表概率分布可表示为:
P(A)=P(xanswer|xdescribtion,xobjects,xQuestion,xI;θLLMvision)
其中,P(A)为语言处理模型输出的答案概率(预测概率),该概率计算方式为在语音处理模型词典(例如语言大模型词典)上的概率分布,即为求和为1,长度为词典长度的非负向量。θLLM和θvision本别表示语言处理模型和视觉处理模型。
[xdescribtion,xobjects,xQuestion,ximage]=concat([ET(Descrbtion),ET(Objects),ET(Qustion)],EI(Image))为样本描述文本、样本物体坐标信息、设定问题文本和样本图像对应的各个文本向量和图像向量的拼接。利用图像文本数据对对多模态对齐网络进行训练后,不断更新视觉处理模型和语言处理模型的网络参数后,得到收敛的最优网络后变不再更新网络权重,即固定图4中④、⑤和⑧对应的图像编码模块、文本解码模块和预测输出层的网络参数,分别作为图像和文本的特征提取器和预测文本的生成参数。
S230:获取待识别图像、问题文本以及描述规则文本,问题文本以及描述规则文本基于设定查询类别进行配置得到。
S240:将待识别图像、问题文本以及描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签。
在一个可能的实施例中,本方案提供的多模态对齐网络在利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签时,包括:
S241:利用视觉处理模型中的图像编码模块获取待识别图像的图像特征向量。
S242:利用语言处理模型中的文本解码模块获取问题文本以及描述规则文本的文本特征向量。
S243:利用语言处理模型中的预测输出层对图像特征向量和文本特征向量进行分析处理,确定待识别图像在设定查询类别对应的目标标签。
示例性的,多模态对齐网络在利用视觉处理模型获取待识别图像的图像特征向量时,可以是利用视觉处理模型中的图像编码模块对待识别图像进行分析处理,并得到待识别图像的图像特征向量。
多模态对齐网络在利用语言处理模型获取问题文本和描述规则文本的文本特征向量时,可以是利用语言处理模型中的文本解码模块对问题文本和描述规则文本进行分析处理,并得到问题文本和描述规则文本的文本特征向量。
在确定图像特征向量和文本特征向量后,将图像特征向量和文本特征向量输入到语言处理模型中的预测输出层中,利用语言处理模型中的预测输出层对待识别图像向和文本特征向量进行分析处理,得到待识别图像在设定查询类别对应的目标标签。本方案通过利用视觉处理模型中的图像编码模块获取待识别图像的图像特征向量以及利用语言处理模型中的文本解码模块获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型中的预测输出层对待识别图像向和文本特征向量进行分析处理得到在设定查询类别对应的目标标签,使得多模态对齐网络准确输出在设定查询类别下对应的目标标签,提高图像识别准确度。
在一个可能的实施例中,本方案提供的多模态对齐网络在利用语言处理模型中的文本解码模块获取问题文本以及描述规则文本的文本特征向量时,包括:
S2421:对问题文本以及描述规则文本进行整合处理,得到文本整合矩阵。
S2422:利用语言处理模型中的文本解码模块获取文本整合矩阵的文本特征向量。
示例性的,对问题文本以及描述规则文本进行整合处理得到文本整合矩阵,并将文本整合矩阵发送至语言处理模型中的文本解码模块中,由文本解码模块对文本整合矩阵进行分析处理,得到文本整合矩阵的文本特征向量。本方案通过将问题文本以及描述规则文本整合为文本整合矩阵,并利用语言处理模型中的文本解码模块获取文本整合矩阵的文本特征向量,提高对样本文本向量的提取效率,图像识别效率。
如图5提供的一种多模态对齐网络在训练过程中的数据流向示意图所示,图5中①为描述规则文本,②为待识别图像,③为问题文本,例如描述规则文本对应的内容可以是“Tongue Out:by judging the person's tongue,if tongue is out of the mouth,then image can labeled as tongue out.”即描述了将图像标注为伸出舌头的描述规则,图中描述规则文本对应的图像为“伸出舌头”的示例,不会作为描述规则文本输入。问题文本对应的内容可以是“what is the man's label?”即询问待识别图像中的男人对应的标签。
将待识别图像输入到图5中④所示的视觉处理模型的图像编码模块(Image-Encoder)中,经图像编码模块分析处理得到待识别图像对应的图像特征向量(如图5中⑥所示)。将问题文本和描述规则文本进行整合处理并发送至图5中⑤所示的语言处理模型中的文本解码模块(Language-Decoder)中,经文本解码模块分析处理得到问题文本和描述规则文本对应的文本特征向量(如图5中⑦所示)。将图像特征向量和文本特征向量输入至图5中⑧所示的语言处理模型中的预测输出层(Generation Layer)中,经预测输出层对图像特征向量和文本特征向量进行分析处理输出对应的目标标签。如图5中⑨提供的目标标签所示,目标标签表示为“by judging the person's tongue,the man tongue out,so this picture's label is"tongue out"”,即经过分析待识别图像中人物的舌头,待识别图像中的男人伸出了舌头,所以待识别图像的目标标签可以是“伸出舌头”。
上述,通过将待识别图像、问题文本以及描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签,不需要重新收集样本数据训练新的识别模型,基于设定查询类别配置问题文本和描述规则文本即可得到待识别图像在设定查询类别对应的目标标签,有效提高图像识别的通用性。通过利用图像文本数据对对多模态对齐网络进行训练,利用业务场景下海量的图文对数据获得文本和图像信息语义对齐的多模态对齐网络,使得多模态对齐网络具备对指定问题和描述规则下对图像的识别能力,不需要单独为不同的识别类型收集样本数据和训练新的识别模型,有效提高图像识别的通用性。
图6是本申请实施例提供的一种图像识别装置的结构示意图。参考图6,该图像识别装置包括信息获取模块61和图像识别模块62。
其中,信息获取模块61,配置为获取待识别图像、问题文本以及描述规则文本,问题文本以及描述规则文本基于设定查询类别进行配置得到;图像识别模块62,配置为将待识别图像、问题文本以及描述规则文本输入至训练完成的多模态对齐网络中,通过多模态对齐网络利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签。
在一个可能的实施例中,多模态对齐网络在利用视觉处理模型获取待识别图像的图像特征向量,以及利用语言处理模型获取问题文本和描述规则文本的文本特征向量,并利用语言处理模型根据图像特征向量和文本特征向量确定待识别图像在设定查询类别对应的目标标签时,配置为:
利用视觉处理模型中的图像编码模块获取待识别图像的图像特征向量;
利用语言处理模型中的文本解码模块获取问题文本以及描述规则文本的文本特征向量;
利用语言处理模型中的预测输出层对图像特征向量和文本特征向量进行分析处理,确定待识别图像在设定查询类别对应的目标标签。
在一个可能的实施例中,多模态对齐网络在利用语言处理模型中的文本解码模块获取问题文本以及描述规则文本的文本特征向量时,配置为:
对问题文本以及描述规则文本进行整合处理,得到文本整合矩阵;
利用语言处理模型中的文本解码模块获取文本整合矩阵的文本特征向量。
在一个可能的实施例中,图像识别装置还包括样本获取模块和模型训练模块。
其中,样本获取模块配置为获取图像文本数据对,图像文本数据对包括样本图像,以及对样本图像进行描述的样本描述文本和样本物体坐标信息;
模型训练模块配置为利用图像文本数据对对多模态对齐网络进行训练,其中,多模态对齐网络利用视觉处理模型获取样本图像的样本图像向量,以及利用语言处理模型获取样本描述文本和样本物体坐标信息的样本文本向量,并利用语言处理模型根据样本图像向量和样本文本向量确定样本图像对应的预测标签,并基于预测标签和样本图像向量对应的真实标签对视觉处理模型和语言处理模型进行网络参数优化。
在一个可能的实施例中,多模态对齐网络在利用视觉处理模型获取样本图像的样本图像向量,以及利用语言处理模型获取样本描述文本和样本物体坐标信息的样本文本向量,并利用语言处理模型根据样本图像向量和样本文本向量确定样本图像对应的预测标签时,配置为:
利用视觉处理模型中的图像编码模块获取样本图像的样本图像向量;
利用语言处理模型中的文本解码模块获取样本描述文本和样本物体坐标信息的样本文本向量;
利用语言处理模型中的预测输出层对样本图像向和样本文本向量进行分析处理,得到样本图像对应的预测标签。
在一个可能的实施例中,多模态对齐网络在利用语言处理模型中的文本解码模块获取样本描述文本和样本物体坐标信息的样本文本向量时,配置为:
对样本描述文本和样本物体坐标信息文本进行整合处理,得到样本整合矩阵;
利用语言处理模型中的文本解码模块获取样本整合矩阵的文本特征向量。
在一个可能的实施例中,模型训练模块在基于预测标签和样本图像向量对应的真实标签对视觉处理模型和语言处理模型进行网络参数优化时,配置为:
根据预测标签和样本图像向量对应的真实标签确定损失函数,并基于损失函数对视觉处理模型和语言处理模型进行网络参数优化。
值得注意的是,上述图像识别装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。
本申请实施例还提供了一种图像识别设备,该图像识别设备可集成本申请实施例提供的图像识别装置。图7是本申请实施例提供的一种图像识别设备的结构示意图。参考图7,该图像识别设备包括:输入装置73、输出装置74、存储器72以及一个或多个处理器71;存储器72,用于存储一个或多个程序;当一个或多个程序被一个或多个处理器71执行,使得一个或多个处理器71实现如上述实施例提供的图像识别方法。上述提供的图像识别装置、设备和计算机可用于执行上述任意实施例提供的图像识别方法,具备相应的功能和有益效果。
本申请实施例还提供一种存储计算机可执行指令的非易失性存储介质,计算机可执行指令在由计算机处理器执行时用于执行如上述实施例提供的图像识别方法。当然,本申请实施例所提供的一种存储计算机可执行指令的非易失性存储介质,其计算机可执行指令不限于如上提供的图像识别方法,还可以执行本申请任意实施例所提供的图像识别方法中的相关操作。上述实施例中提供的图像识别装置、设备及存储介质可执行本申请任意实施例所提供的图像识别方法,未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的图像识别方法。
在上述实施例的基础上,本申请实施例还提供一种计算机程序产品,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机程序产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备、移动终端或其中的处理器执行本申请各个实施例所提供的图像识别方法的全部或部分步骤。

Claims (11)

  1. 一种图像识别方法,其中,包括:
    获取待识别图像、问题文本以及描述规则文本,所述问题文本以及所述描述规则文本基于设定查询类别进行配置得到;
    将所述待识别图像、所述问题文本以及所述描述规则文本输入至训练完成的多模态对齐网络中,通过所述多模态对齐网络利用视觉处理模型获取所述待识别图像的图像特征向量,以及利用语言处理模型获取所述问题文本和所述描述规则文本的文本特征向量,并利用所述语言处理模型根据所述图像特征向量和所述文本特征向量确定所述待识别图像在所述设定查询类别对应的目标标签。
  2. 根据权利要求1所述的图像识别方法,其中,所述多模态对齐网络在利用视觉处理模型获取所述待识别图像的图像特征向量,以及利用语言处理模型获取所述问题文本和所述描述规则文本的文本特征向量,并利用所述语言处理模型根据所述图像特征向量和所述文本特征向量确定所述待识别图像在所述设定查询类别对应的目标标签时,包括:
    利用视觉处理模型中的图像编码模块获取所述待识别图像的图像特征向量;
    利用语言处理模型中的文本解码模块获取所述问题文本以及所述描述规则文本的文本特征向量;
    利用所述语言处理模型中的预测输出层对所述图像特征向量和所述文本特征向量进行分析处理,确定所述待识别图像在所述设定查询类别对应的目标标签。
  3. 根据权利要求2所述的图像识别方法,其中,所述多模态对齐网络在利用语言处理模型中的文本解码模块获取所述问题文本以及所述描述规则文本的文本特征向量时,包括:
    对所述问题文本以及所述描述规则文本进行整合处理,得到文本整合矩阵;
    利用语言处理模型中的文本解码模块获取所述文本整合矩阵的文本特征向量。
  4. 根据权利要求1所述的图像识别方法,其中,所述多模态对齐网络的训练过程包括:
    获取图像文本数据对,所述图像文本数据对包括样本图像,以及对所述样本图像进行描述的样本描述文本和样本物体坐标信息;
    利用所述图像文本数据对对多模态对齐网络进行训练,其中,所述多模态对齐网络利用视觉处理模型获取所述样本图像的样本图像向量,以及利用语言处理模型获取所述样本描述文本和所述样本物体坐标信息的样本文本向量,并利用所述语言处理模型根据所述样本图像向量和所述样本文本向量确定所述样本图像对应的预测标签,并基于所述预测标签和所述样本图像向量对应的真实标签对所述视觉处理模型和所述语言处理模型进行网络参数优化。
  5. 根据权利要求4所述的图像识别方法,其中,所述多模态对齐网络在利用视觉处理模型获取所述样本图像的样本图像向量,以及利用语言处理模型获取所述样本描述文本和所述样本物体坐标信息的样本文本向量,并利用所述语言处理模型根据所述样本图像向量和所述样本文本向量确定所述样本图像对应的预测标签时,包括:
    利用视觉处理模型中的图像编码模块获取所述样本图像的样本图像向量;
    利用语言处理模型中的文本解码模块获取所述样本描述文本和所述样本物体坐标信息的样本文本向量;
    利用所述语言处理模型中的预测输出层对所述样本图像向和所述样本文本向量进行分析处理,得到所述样本图像对应的预测标签。
  6. 根据权利要求5所述的图像识别方法,其中,所述多模态对齐网络在利用语言处理模型中的文本解码模块获取所述样本描述文本和所述样本物体坐标信息的样本文本向量时,包括:
    对所述样本描述文本和所述样本物体坐标信息文本进行整合处理,得到样本整合矩阵;
    利用语言处理模型中的文本解码模块获取所述样本整合矩阵的文本特征向量。
  7. 根据权利要求4所述的图像识别方法,其中,所述基于所述预测标签和所述样本图像向量对应的真实标签对所述视觉处理模型和所述语言处理模型进行网络参数优化,包括:
    根据所述预测标签和所述样本图像向量对应的真实标签确定损失函数,并基于所述损失函数对所述视觉处理模型和所述语言处理模型进行网络参数优化。
  8. 一种图像识别装置,其中,包括信息获取模块和图像识别模块,其中:
    所述信息获取模块,配置为获取待识别图像、问题文本以及描述规则文本,所述问题文本以及所述描述规则文本基于设定查询类别进行配置得到;
    所述图像识别模块,配置为将所述待识别图像、所述问题文本以及所述描述规则文本输入至训练完成的多模态对齐网络中,通过所述多模态对齐网络利用视觉处理模型获取所述待识别图像的图像特征向量,以及利用语言处理模型获取所述问题文本和所述描述规则文本的文本特征向量,并利用所述语言处理模型根据所述图像特征向量和所述文本特征向量确定所述待识别图像在所述设定查询类别对应的目标标签。
  9. 一种图像识别设备,其中,包括:存储器以及一个或多个处理器;
    所述存储器,用于存储一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7任一项所述的图像识别方法。
  10. 一种存储计算机可执行指令的非易失性存储介质,其中,所述计算机可执行指令在由计算机处理器执行时用于执行如权利要求1-7任一项所述的图像识别方法。
  11. 一种计算机程序产品,包括计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1-7任一项所述的图像识别方法。
PCT/CN2024/141101 2024-01-11 2024-12-20 一种图像识别方法、装置、设备、存储介质及产品 Pending WO2025148657A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410048426.8A CN118038201A (zh) 2024-01-11 2024-01-11 一种图像识别方法、装置、设备、存储介质及产品
CN202410048426.8 2024-01-11

Publications (1)

Publication Number Publication Date
WO2025148657A1 true WO2025148657A1 (zh) 2025-07-17

Family

ID=90990301

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/141101 Pending WO2025148657A1 (zh) 2024-01-11 2024-12-20 一种图像识别方法、装置、设备、存储介质及产品

Country Status (2)

Country Link
CN (1) CN118038201A (zh)
WO (1) WO2025148657A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN121392755A (zh) * 2025-12-17 2026-01-23 杭州萤石软件有限公司 一种区域安全的检测方法、门禁设备及存储介质
CN121437502A (zh) * 2025-12-29 2026-01-30 北京航天拓扑高科技有限责任公司 一种基于ca-mll两段推理的航天材料裂纹图像检测方法
CN121527596A (zh) * 2026-01-19 2026-02-13 天翼视联科技股份有限公司 图像处理方法、装置、计算机设备以及存储介质
CN121640486A (zh) * 2026-02-04 2026-03-10 苏州大学 一种时尚偏好预测方法及装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118038201A (zh) * 2024-01-11 2024-05-14 百果园技术(新加坡)有限公司 一种图像识别方法、装置、设备、存储介质及产品

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115759261A (zh) * 2022-11-30 2023-03-07 山东省计算中心(国家超级计算济南中心) 基于图注意力网络的视觉常识推理方法及系统
CN116503877A (zh) * 2023-04-19 2023-07-28 平安科技(深圳)有限公司 文本信息提取方法及装置、存储介质、计算机设备
CN117196858A (zh) * 2023-08-31 2023-12-08 中国人民财产保险股份有限公司 定损内容生成方法、多模态模型、装置、设备及存储介质
CN118038201A (zh) * 2024-01-11 2024-05-14 百果园技术(新加坡)有限公司 一种图像识别方法、装置、设备、存储介质及产品

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115759261A (zh) * 2022-11-30 2023-03-07 山东省计算中心(国家超级计算济南中心) 基于图注意力网络的视觉常识推理方法及系统
CN116503877A (zh) * 2023-04-19 2023-07-28 平安科技(深圳)有限公司 文本信息提取方法及装置、存储介质、计算机设备
CN117196858A (zh) * 2023-08-31 2023-12-08 中国人民财产保险股份有限公司 定损内容生成方法、多模态模型、装置、设备及存储介质
CN118038201A (zh) * 2024-01-11 2024-05-14 百果园技术(新加坡)有限公司 一种图像识别方法、装置、设备、存储介质及产品

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN121392755A (zh) * 2025-12-17 2026-01-23 杭州萤石软件有限公司 一种区域安全的检测方法、门禁设备及存储介质
CN121437502A (zh) * 2025-12-29 2026-01-30 北京航天拓扑高科技有限责任公司 一种基于ca-mll两段推理的航天材料裂纹图像检测方法
CN121527596A (zh) * 2026-01-19 2026-02-13 天翼视联科技股份有限公司 图像处理方法、装置、计算机设备以及存储介质
CN121640486A (zh) * 2026-02-04 2026-03-10 苏州大学 一种时尚偏好预测方法及装置

Also Published As

Publication number Publication date
CN118038201A (zh) 2024-05-14

Similar Documents

Publication Publication Date Title
WO2025148657A1 (zh) 一种图像识别方法、装置、设备、存储介质及产品
CN118861305B (zh) 基于思维聚类规划和领域知识检索的大模型智能代理系统
CN115659966A (zh) 基于动态异构图和多级注意力的谣言检测方法及系统
CN118964648B (zh) 基于人工智能的电力向量知识库增强检索方法及系统
CN117453895B (zh) 一种智能客服应答方法、装置、设备及可读存储介质
CN120216703A (zh) 一种基于大模型的电力工程知识库构建方法及其系统
CN119046433A (zh) 检索增强生成式问答的输出方法、装置、设备及存储介质
CN112287084A (zh) 一种基于集成学习的问答方法及系统
CN115204106A (zh) 基于正则表达式神经网络的文档合规检测方法及系统
CN115660616A (zh) 一种基于知识图谱的电网生产安全管理方法及系统
CN119179955A (zh) 一种多模态融合的数学试题多知识点分类方法
CN118506088A (zh) 一种融合多模态大模型的图像识别方法及系统
CN115359296A (zh) 图像识别方法、装置、电子设备及存储介质
CN117541044B (zh) 基于项目风险分析的项目分类方法、系统、介质及设备
CN113822061A (zh) 一种基于特征图构建的小样本专利分类方法
CN117313737A (zh) 一种基于Fast-Transformer的事件抽取方法
CN113378024B (zh) 一种基于深度学习面向公检法领域的相关事件识别方法
CN118626626B (zh) 信息处理方法、装置、设备、存储介质及计算机程序产品
CN117456279B (zh) 一种融合知识图谱与图像识别的垃圾分类方法
CN120338111A (zh) 基于语义编码模型的产品信息问答方法及系统
CN117271553A (zh) 一种监管报送数据质量规则生成及运行方法
CN117874536A (zh) 一种Ernie孪生网络结构工业应用运行问答匹配方法
CN118747216A (zh) 一种基于卷积神经网络的贷款用途文本分类方法和系统
CN116010566A (zh) 一种基于知识图谱的问答方法和系统
CN116226371A (zh) 一种数字经济专利分类方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24916704

Country of ref document: EP

Kind code of ref document: A1