Text image matching method, device, equipment and storage medium

By performing type recognition and fusion feature extraction on the text image matching method, the problem of low matching accuracy in the existing technology is solved and higher text image matching accuracy is achieved.

CN114723986BActive Publication Date: 2024-10-29PING AN TECH (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210256789.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2024-10-29
Estimated Expiration
2042-03-16

AI Technical Summary

Technical Problem

In existing text-image matching methods, the matching accuracy after feature extraction of images and natural language texts is low, resulting in inaccurate matching results.

Method used

By identifying the type of objects to be matched, the candidate object set is determined, and fusion feature extraction and similarity calculation are performed to avoid direct matching of image and text features, and fusion features are used for matching operations.

Benefits of technology

The accuracy and precision of text-image matching are improved, and the reliability of matching results is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723986B_ABST
    Figure CN114723986B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and discloses a text image matching method, device, equipment and storage medium, wherein the method comprises: performing type recognition on the object to be matched to obtain a type recognition result; determining a candidate object set from a preset candidate object library according to the type recognition result; performing fusion feature extraction on the object to be matched and each candidate object in the candidate object set; performing feature extraction on each candidate object in the candidate object set to obtain candidate object features; performing similarity calculation on the fusion features and candidate object features corresponding to the same candidate object to obtain single object similarity; determining a target matching result corresponding to the object to be matched according to each single object similarity and the candidate object set. Avoiding direct matching operations of image features and text features, using fusion features for text image matching can increase the matching accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text image matching method, device, equipment and storage medium. Background Art

[0002] Text-image matching refers to a cross-modal matching search method. Given a natural language text, images that match the text description are retrieved; or given an image, text that matches the image content is retrieved.

[0003] As a cross-modal matching search method, the system needs to process the two types of information, image and natural language text, separately, and then match them based on the processing results. There are already some data sets and algorithms in this area, but in these algorithms, the image and natural language text are first extracted through the feature extraction network, and then the two extracted features are matched. Because there are huge differences between images and texts, the features between these two modalities are often difficult to match, resulting in low matching accuracy. Summary of the invention

[0004] The main purpose of the present application is to provide a text image matching method, device, equipment and storage medium, aiming to solve the technical problem of low matching accuracy in the current text image matching, in which the image and natural language text are firstly extracted through a feature extraction network respectively, and then the two extracted features are matched.

[0005] In order to achieve the above-mentioned invention object, the present application proposes a text image matching method, the method comprising:

[0006] Get the object to be matched;

[0007] Performing type identification on the to-be-matched object to obtain a type identification result;

[0008] Determining a candidate object set from a preset candidate object library according to the type recognition result;

[0009] Extracting fusion features based on the object to be matched and each candidate object in the candidate object set;

[0010] Extracting features from each candidate object in the candidate object set to obtain candidate object features;

[0011] Calculating similarity between the fused feature and the candidate object feature corresponding to the same candidate object to obtain a single object similarity;

[0012] According to each of the single object similarities and the candidate object set, a target matching result corresponding to the object to be matched is determined.

[0013] Furthermore, the step of performing type identification on the to-be-matched object to obtain a type identification result includes:

[0014] Inputting the to-be-matched object into a preset text image classification model for classification prediction to obtain a classification prediction result;

[0015] When the vector element corresponding to the text label in the classification prediction result is greater than the vector element corresponding to the image label in the classification prediction result, determining that the type recognition result is a text type;

[0016] When the vector element corresponding to the text label in the classification prediction result is smaller than the vector element corresponding to the image label in the classification prediction result, it is determined that the type recognition result is an image type.

[0017] Furthermore, the step of determining a candidate object set from a preset candidate object library according to the type recognition result includes:

[0018] When the type recognition result is a text type, using the image sub-library in the candidate object library as the candidate object set;

[0019] When the type recognition result is an image type, the text sub-library in the candidate object library is used as the candidate object set.

[0020] Furthermore, the step of extracting fusion features based on the object to be matched and each candidate object in the candidate object set includes:

[0021] Taking any one of the candidate objects in the candidate object set as a target object;

[0022] Inputting the target object into a coding model corresponding to the type of the candidate object set for encoding to obtain a first code;

[0023] Inputting the to-be-matched object into the coding model corresponding to the type recognition result for coding to obtain a second code;

[0024] Concatenate the first code and the second code in dimension to obtain a fused code;

[0025] The fusion code is input into a preset fusion feature extraction model for feature extraction to obtain the fusion feature corresponding to the target object.

[0026] Furthermore, the step of extracting features from each candidate object in the candidate object set to obtain features of the candidate object includes:

[0027] Each of the candidate objects in the candidate object set is respectively input into a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, so as to obtain the candidate object feature corresponding to each of the candidate objects.

[0028] Furthermore, the step of calculating the similarity between the fusion feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity includes:

[0029] Taking any candidate object in the candidate object set as an object to be calculated;

[0030] Taking the fused feature corresponding to the object to be calculated as the first feature;

[0031] Taking the candidate object feature corresponding to the object to be calculated as the second feature;

[0032] The cosine similarity calculation is performed on the first feature and the second feature to obtain the single object similarity corresponding to the object to be calculated.

[0033] Furthermore, the single object similarity is cosine similarity, and the step of determining the target matching result corresponding to the object to be matched according to each of the single object similarities and the candidate object set includes:

[0034] Find the single object similarity with the largest value from each of the single object similarities as the target similarity;

[0035] Determining whether the target similarity is greater than a preset similarity threshold;

[0036] If yes, determining that the target matching result is successful, and taking the candidate object corresponding to the target similarity in the candidate object set as the hit object of the target matching result;

[0037] If not, the result of determining the target matching result is a failure.

[0038] The present application also proposes a text image matching device, the device comprising:

[0039] A data acquisition module, used to acquire objects to be matched;

[0040] A type identification result determination module is used to perform type identification on the to-be-matched object to obtain a type identification result;

[0041] A candidate object set determination module, used to determine a candidate object set from a preset candidate object library according to the type recognition result;

[0042] A fusion feature extraction module, used for performing fusion feature extraction based on the object to be matched and each candidate object in the candidate object set;

[0043] A candidate object feature determination module, used for extracting features from each candidate object in the candidate object set to obtain candidate object features;

[0044] A single object similarity determination module is used to calculate the similarity between the fusion feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity;

[0045] The target matching result determination module is used to determine the target matching result corresponding to the to-be-matched object according to each of the single object similarities and the candidate object set.

[0046] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0047] The present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0048] The text image matching method, device, equipment and storage medium of the present application, wherein the method obtains a type recognition result by performing type recognition on the object to be matched; determines a candidate object set from a preset candidate object library according to the type recognition result; extracts fusion features according to the object to be matched and each candidate object in the candidate object set; extracts features from each candidate object in the candidate object set to obtain candidate object features; calculates similarity between the fusion features and the candidate object features corresponding to the same candidate object to obtain single object similarity; determines a target matching result corresponding to the object to be matched according to each single object similarity and the candidate object set. By first performing fusion feature extraction on the object to be matched and the candidate object, and then performing matching operations on the fusion features and the candidate object features, direct matching operations of image features and text features are avoided, and the use of fusion features for text image matching can increase the matching precision, thereby improving the accuracy of text image matching. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flowchart of a text image matching method according to an embodiment of the present application;

[0050] Figure 2 A schematic block diagram of the structure of a text image matching device according to an embodiment of the present application;

[0051] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0052] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] Reference Figure 1 In an embodiment of the present application, a text image matching method is provided, the method comprising:

[0055] S1: Get the object to be matched;

[0056] S2: Perform type identification on the to-be-matched object to obtain a type identification result;

[0057] S3: determining a candidate object set from a preset candidate object library according to the type recognition result;

[0058] S4: extracting fusion features according to the object to be matched and each candidate object in the candidate object set;

[0059] S5: extracting features from each candidate object in the candidate object set to obtain candidate object features;

[0060] S6: Calculate the similarity between the fusion feature and the candidate object feature corresponding to the same candidate object to obtain a single object similarity;

[0061] S7: Determine a target matching result corresponding to the object to be matched according to each of the single object similarities and the candidate object set.

[0062] This embodiment obtains a type recognition result by performing type recognition on the object to be matched; determines a candidate object set from a preset candidate object library based on the type recognition result; performs fusion feature extraction on the object to be matched and each candidate object in the candidate object set; performs feature extraction on each candidate object in the candidate object set to obtain candidate object features; performs similarity calculation on the fusion features and candidate object features corresponding to the same candidate object to obtain single object similarity; determines a target matching result corresponding to the object to be matched based on each single object similarity and the candidate object set. By first performing fusion feature extraction on the object to be matched and the candidate object, and then performing matching operations on the fusion features and the candidate object features, direct matching operations of image features and text features are avoided, and the use of fusion features for text image matching can increase the matching precision and improve the accuracy of text image matching.

[0063] For S1, the object to be matched may be obtained from a user input, from a database, or from a third-party application.

[0064] The object to be matched is the object that needs to be matched with the text image.

[0065] The object to be matched is a piece of text or an image.

[0066] For S2, the type of the object to be matched is identified to determine whether the object to be matched is text or image.

[0067] There is only one value for the type recognition result. The value range of the type recognition result includes: text type and image type.

[0068] For S3, the type recognition result is matched with the type identifier in the candidate object library, and the character library corresponding to the sub-library identifier of the matched type identifier in the candidate object library is taken as the candidate object set.

[0069] The candidate object library includes: a type identifier and a sub-library identifier.

[0070] For S4, the intermediate features between the text and the image are extracted according to the object to be matched and each candidate object in the candidate object set, and the extracted intermediate features are used as fusion features.

[0071] Wherein, feature extraction is performed according to the code of the object to be matched and the code of each candidate object in the candidate object set, and the extracted features are used as fusion features.

[0072] The number of fused features is the same as the number of candidate objects in the candidate object set.

[0073] For S5, feature extraction is performed on each candidate object in the candidate object set, and the extracted features are used as candidate object features. It can be understood that the candidate object features correspond to the candidate objects one by one.

[0074] For S6, the cosine similarity or Euclidean distance calculation is performed on the fusion feature and the candidate object feature corresponding to the same candidate object, and the calculated data is used as a single object similarity.

[0075] That is, the number of single-object similarities is the same as the number of candidate objects in the candidate object set.

[0076] For S7, when the single-object similarity is cosine similarity, find the single-object similarity with the largest value from each of the single-object similarities, and use the candidate object corresponding to the found single-object similarity in the candidate object set as the hit object of the target matching result corresponding to the object to be matched; when the single-object similarity is Euclidean distance, find the single-object similarity with the smallest value from each of the single-object similarities, and use the candidate object corresponding to the found single-object similarity in the candidate object set as the hit object of the target matching result corresponding to the object to be matched.

[0077] In one embodiment, the step of performing type identification on the to-be-matched object to obtain a type identification result includes:

[0078] S21: inputting the to-be-matched object into a preset text image classification model for classification prediction to obtain a classification prediction result;

[0079] S22: when the vector element corresponding to the text label in the classification prediction result is greater than the vector element corresponding to the image label in the classification prediction result, determining that the type recognition result is a text type;

[0080] S23: When the vector element corresponding to the text label in the classification prediction result is smaller than the vector element corresponding to the image label in the classification prediction result, determining that the type recognition result is an image type.

[0081] This embodiment performs classification prediction through a text image classification model, thereby improving the classification prediction result and thus improving the accuracy of text image matching.

[0082] For S21, the object to be matched is input into a preset text image classification model for classification prediction, and the data obtained by the classification prediction is used as the classification prediction result.

[0083] The text image classification model can use a binary classifier.

[0084] The classification prediction result is a vector with two vector elements, which correspond to the text label and the image label respectively. The vector elements in the vector are probability values.

[0085] For S22, when the vector element corresponding to the text label in the classification prediction result is greater than the vector element corresponding to the image label in the classification prediction result, it means that the vector element corresponding to the text label is the largest. At this time, the object to be matched is a piece of text, so the type recognition result is determined to be a text type.

[0086] For S23, when the vector element corresponding to the text label in the classification prediction result is smaller than the vector element corresponding to the image label in the classification prediction result, it means that the vector element corresponding to the image label is the largest. At this time, the object to be matched is an image, so the type recognition result is determined to be an image type.

[0087] In one embodiment, the step of determining a candidate object set from a preset candidate object library according to the type recognition result includes:

[0088] S31: when the type recognition result is a text type, taking the image sub-library in the candidate object library as the candidate object set;

[0089] S32: When the type recognition result is an image type, the text sub-library in the candidate object library is used as the candidate object set.

[0090] This embodiment uses the image sub-library as the candidate object set when the type recognition result is a text type, and uses the text sub-library as the candidate object set when the type recognition result is an image type, thereby providing a basis for generating fusion features and matching text and images.

[0091] For S31, when the type recognition result is a text type, it means that the object to be matched is a piece of text, so the image sub-library corresponding to the sub-library identifier corresponding to the text type in the candidate object library is used as the candidate object set. At this time, the candidate objects in the candidate object set are images.

[0092] For S32, when the type recognition result is an image type, it means that the object to be matched is an image, so the image sub-library corresponding to the sub-library identifier corresponding to the image type in the candidate object library is used as the candidate object set. At this time, the candidate object in the candidate object set is text.

[0093] In one embodiment, the step of extracting fusion features based on the object to be matched and each candidate object in the candidate object set includes:

[0094] S41: taking any one of the candidate objects in the candidate object set as a target object;

[0095] S42: inputting the target object into a coding model corresponding to the type of the candidate object set for coding to obtain a first code;

[0096] S43: inputting the to-be-matched object into the coding model corresponding to the type recognition result for coding to obtain a second code;

[0097] S44: concatenate the first code and the second code in dimension to obtain a fused code;

[0098] S45: Inputting the fusion code into a preset fusion feature extraction model to perform feature extraction to obtain the fusion feature corresponding to the target object.

[0099] In this embodiment, the object to be matched and the candidate object are first encoded and dimensionally spliced ​​respectively, and then the result of the dimension splicing is input into the fusion feature extraction model for feature extraction, thereby extracting the intermediate features between the image and the text, providing a basis for matching the fusion features with the candidate object features.

[0100] For S42, when the type of the candidate object set is a text type, the target object is input into a coding model corresponding to the text type for encoding, and the encoded data is used as the first code; when the type of the candidate object set is an image type, the target object is input into a coding model corresponding to the image type for encoding, and the encoded data is used as the first code.

[0101] Optionally, the encoding model uses a fully connected layer. Since the encoding model is a shallow information encoding, a large amount of original information in the target object will be retained.

[0102] It is understandable that the encoding model may also adopt other models that can be used for encoding, which is not limited here.

[0103] For S43, when the type recognition result is a text type, the object to be matched is input into the encoding model corresponding to the text type for encoding, and the encoded data is used as the second code; when the type recognition result is an image type, the object to be matched is input into the encoding model corresponding to the image type for encoding, and the encoded data is used as the second code.

[0104] For S44, optionally, the first code and the second code are spliced ​​in dimension in the order of text first and then image, and the spliced ​​data is used as a fused code. At this time, the fused code is text code and image code in dimension respectively.

[0105] Optionally, the first code and the second code are spliced ​​in dimension in the order of image first and then text, and the spliced ​​data is used as a fused code. In this case, the fused code is image code and text code in dimension respectively.

[0106] For S45, the fusion code is input into a preset fusion feature extraction model to perform feature extraction, and the extracted features are used as the fusion features corresponding to the target object.

[0107] The fusion feature extraction model is a model trained based on the Rresnet50 network or the Unet network. The Rresnet50 network is a deep residual network. The Unet network is a semantic segmentation network.

[0108] It can be understood that by repeating steps S41 to S45, the fusion feature corresponding to each candidate object in the candidate object set can be determined.

[0109] In one embodiment, the step of extracting features from each candidate object in the candidate object set to obtain candidate object features includes:

[0110] S51: Input each candidate object in the candidate object set into a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, and obtain the candidate object feature corresponding to each candidate object.

[0111] This embodiment uses a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, thereby improving the accuracy of the extracted features and improving the accuracy of text-image matching.

[0112] For S51, each candidate object in the candidate object set is input into a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, and the extracted feature is used as a candidate object feature.

[0113] When the type of the candidate object set is a text type, the single object feature extraction model corresponding to the type of the candidate object set is a model obtained by training the LSTM network with multiple text training samples; when the type of the candidate object set is an image type, the single object feature extraction model corresponding to the type of the candidate object set is a model obtained by training the Rresnet50 network or the Unet network with multiple image training samples.

[0114] LSTM network refers to long short-term memory artificial neural network.

[0115] The text training samples include: text samples and text feature calibration data.

[0116] Image training samples include: image samples and image feature calibration data.

[0117] In one embodiment, the step of calculating the similarity between the fusion feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity includes:

[0118] S61: taking any candidate object in the candidate object set as an object to be calculated;

[0119] S62: Using the fused feature corresponding to the object to be calculated as the first feature;

[0120] S63: taking the candidate object feature corresponding to the object to be calculated as the second feature;

[0121] S64: Calculate the cosine similarity of the first feature and the second feature to obtain the single object similarity corresponding to the object to be calculated.

[0122] This embodiment uses cosine similarity to calculate similarity. Since cosine similarity tends to provide a better solution, the accuracy of text image matching is further improved.

[0123] For S64, the first feature and the second feature are features corresponding to the same candidate object, therefore, cosine similarity is calculated for the first feature and the second feature, and the calculated cosine similarity is used as the single object similarity corresponding to the object to be calculated.

[0124] By repeating steps S61 to S64, the single object similarity corresponding to each candidate object in the candidate object set can be determined.

[0125] In one embodiment, the single object similarity is cosine similarity, and the step of determining the target matching result corresponding to the object to be matched according to each of the single object similarities and the candidate object set includes:

[0126] S71: Finding the single object similarity with the largest value from each of the single object similarities as the target similarity;

[0127] S72: Determine whether the target similarity is greater than a preset similarity threshold;

[0128] S73: If yes, determining that the target matching result is successful, and taking the candidate object corresponding to the target similarity in the candidate object set as the hit object of the target matching result;

[0129] S74: If not, determining that the target matching result is a failure.

[0130] This embodiment further improves the accuracy of the determined target matching result by taking the single object similarity having a value greater than a preset similarity threshold as the maximum and the corresponding candidate object in the candidate object set as the hit object of the target matching result.

[0131] For S71, the single object similarity with the largest value is found from each of the single object similarities, and the found single object similarity is used as the target similarity.

[0132] For S73, if yes, that is, the target similarity is greater than the preset similarity threshold, it means that there is a single object similarity that meets the requirements, then the result of the target matching result is determined to be successful, and the candidate object corresponding to the target similarity in the candidate object set is used as the hit object of the target matching result.

[0133] For S74, if no, that is, the target similarity is less than or equal to the preset similarity threshold, it means that there is no single object similarity that meets the requirement, and the result of determining the target matching result is failure.

[0134] Reference Figure 2 , the present application also proposes a text image matching device, the device comprising:

[0135] The data acquisition module 100 is used to acquire the object to be matched;

[0136] The type identification result determination module 200 is used to perform type identification on the to-be-matched object to obtain a type identification result;

[0137] A candidate object set determination module 300, configured to determine a candidate object set from a preset candidate object library according to the type recognition result;

[0138] A fusion feature extraction module 400 is used to extract fusion features based on the object to be matched and each candidate object in the candidate object set;

[0139] A candidate object feature determination module 500 is used to extract features from each candidate object in the candidate object set to obtain candidate object features;

[0140] A single object similarity determination module 600 is used to calculate the similarity between the fusion feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity;

[0141] The target matching result determination module 700 is used to determine the target matching result corresponding to the to-be-matched object according to each of the single object similarities and the candidate object set.

[0142] This embodiment obtains a type recognition result by performing type recognition on the object to be matched; determines a candidate object set from a preset candidate object library based on the type recognition result; performs fusion feature extraction on the object to be matched and each candidate object in the candidate object set; performs feature extraction on each candidate object in the candidate object set to obtain candidate object features; performs similarity calculation on the fusion features and candidate object features corresponding to the same candidate object to obtain single object similarity; determines a target matching result corresponding to the object to be matched based on each single object similarity and the candidate object set. By first performing fusion feature extraction on the object to be matched and the candidate object, and then performing matching operations on the fusion features and the candidate object features, direct matching operations of image features and text features are avoided, and the use of fusion features for text image matching can increase the matching precision and improve the accuracy of text image matching.

[0143] In one embodiment, the above-mentioned type recognition result determination module 200 includes: a classification prediction result determination submodule, a first result determination submodule, and a second result determination submodule;

[0144] The classification prediction result determination submodule is used to input the to-be-matched object into a preset text image classification model for classification prediction to obtain a classification prediction result;

[0145] The first result determination submodule is used to determine that the type recognition result is a text type when the vector element corresponding to the text label in the classification prediction result is greater than the vector element corresponding to the image label in the classification prediction result;

[0146] The second result determination submodule is used to determine that the type recognition result is an image type when the vector element corresponding to the text label in the classification prediction result is smaller than the vector element corresponding to the image label in the classification prediction result.

[0147] In one embodiment, the candidate object set determination module 300 comprises: a first candidate object set determination submodule and a second candidate object set determination submodule;

[0148] The first candidate object set determination submodule is configured to use the image sub-library in the candidate object library as the candidate object set when the type recognition result is a text type;

[0149] The second candidate object set determination submodule is configured to use a text sub-library in the candidate object library as the candidate object set when the type recognition result is an image type.

[0150] In one embodiment, the fusion feature extraction module 400 includes: a fusion feature extraction submodule;

[0151] The fusion feature extraction submodule is used to take any candidate object in the candidate object set as a target object, input the target object into a coding model corresponding to the type of the candidate object set for encoding to obtain a first code, input the object to be matched into the coding model corresponding to the type recognition result for encoding to obtain a second code, splice the first code and the second code in dimension to obtain a fusion code, input the fusion code into a preset fusion feature extraction model for feature extraction, and obtain the fusion feature corresponding to the target object.

[0152] In one embodiment, the candidate object feature determination module 500 includes: a candidate object feature determination submodule;

[0153] The candidate object feature determination submodule is used to input each candidate object in the candidate object set into a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, so as to obtain the candidate object feature corresponding to each candidate object.

[0154] In one embodiment, the above-mentioned single object similarity determination module 600 includes: a cosine similarity calculation submodule;

[0155] The cosine similarity calculation submodule is used to take any candidate object in the candidate object set as the object to be calculated, take the fused feature corresponding to the object to be calculated as the first feature, take the candidate object feature corresponding to the object to be calculated as the second feature, perform cosine similarity calculation on the first feature and the second feature, and obtain the single object similarity corresponding to the object to be calculated.

[0156] In one embodiment, the target matching result determination module 700 includes: a similarity screening submodule and a target matching result determination submodule;

[0157] The similarity screening submodule is used to find the single object similarity with the largest value from each of the single object similarities as the target similarity;

[0158] The target matching result determination submodule is used to determine whether the target similarity is greater than a preset similarity threshold. If so, the first matching result determination submodule is used to determine that the result of the target matching result is successful, and use the candidate object corresponding to the target similarity in the candidate object set as the hit object of the target matching result; if not, determine that the result of the target matching result is a failure.

[0159] Reference Figure 3 In the embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a text image matching method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a text image matching method is implemented. The text image matching method comprises: obtaining an object to be matched; performing type recognition on the object to be matched to obtain a type recognition result; determining a candidate object set from a preset candidate object library according to the type recognition result; performing fusion feature extraction on the object to be matched and each candidate object in the candidate object set; performing feature extraction on each candidate object in the candidate object set to obtain candidate object features; performing similarity calculation on the fusion features and the candidate object features corresponding to the same candidate object to obtain single object similarity; and determining a target matching result corresponding to the object to be matched according to each of the single object similarities and the candidate object set.

[0160] This embodiment obtains a type recognition result by performing type recognition on the object to be matched; determines a candidate object set from a preset candidate object library based on the type recognition result; performs fusion feature extraction on the object to be matched and each candidate object in the candidate object set; performs feature extraction on each candidate object in the candidate object set to obtain candidate object features; performs similarity calculation on the fusion features and candidate object features corresponding to the same candidate object to obtain single object similarity; determines a target matching result corresponding to the object to be matched based on each single object similarity and the candidate object set. By first performing fusion feature extraction on the object to be matched and the candidate object, and then performing matching operations on the fusion features and the candidate object features, direct matching operations of image features and text features are avoided, and the use of fusion features for text image matching can increase the matching precision and improve the accuracy of text image matching.

[0161] In one embodiment, the above-mentioned step of performing type identification on the object to be matched and obtaining a type identification result includes: inputting the object to be matched into a preset text image classification model for classification prediction to obtain a classification prediction result; when the vector element corresponding to the text label in the classification prediction result is greater than the vector element corresponding to the image label in the classification prediction result, determining that the type identification result is a text type; when the vector element corresponding to the text label in the classification prediction result is less than the vector element corresponding to the image label in the classification prediction result, determining that the type identification result is an image type.

[0162] In one embodiment, the step of determining a candidate object set from a preset candidate object library based on the type recognition result includes: when the type recognition result is a text type, using an image sub-library in the candidate object library as the candidate object set; when the type recognition result is an image type, using a text sub-library in the candidate object library as the candidate object set.

[0163] In one embodiment, the above-mentioned step of extracting fused features based on the object to be matched and each candidate object in the candidate object set includes: taking any one of the candidate objects in the candidate object set as the target object; inputting the target object into a coding model corresponding to the type of the candidate object set for encoding to obtain a first code; inputting the object to be matched into the coding model corresponding to the type recognition result for encoding to obtain a second code; splicing the first code and the second code in dimension to obtain a fused code; inputting the fused code into a preset fused feature extraction model for feature extraction to obtain the fused feature corresponding to the target object.

[0164] In one embodiment, the above-mentioned step of extracting features from each candidate object in the candidate object set to obtain candidate object features includes: inputting each candidate object in the candidate object set into a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, and obtaining the candidate object features corresponding to each candidate object.

[0165] In one embodiment, the above-mentioned step of calculating the similarity of the fused feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity includes: taking any one of the candidate objects in the candidate object set as the object to be calculated; taking the fused feature corresponding to the object to be calculated as the first feature; taking the candidate object feature corresponding to the object to be calculated as the second feature; and performing cosine similarity calculation on the first feature and the second feature to obtain the single object similarity corresponding to the object to be calculated.

[0166] In one embodiment, the single object similarity is a cosine similarity, and the step of determining the target matching result corresponding to the object to be matched based on each of the single object similarities and the candidate object set comprises: finding the single object similarity with the largest value from each of the single object similarities as the target similarity; judging whether the target similarity is greater than a preset similarity threshold; if so, determining that the result of the target matching result is successful, and taking the candidate object corresponding to the target similarity in the candidate object set as the hit object of the target matching result; if not, determining that the result of the target matching result is a failure.

[0167] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a text image matching method is implemented, including the following steps: obtaining an object to be matched; performing type recognition on the object to be matched to obtain a type recognition result; determining a candidate object set from a preset candidate object library based on the type recognition result; performing fusion feature extraction based on the object to be matched and each candidate object in the candidate object set; performing feature extraction on each candidate object in the candidate object set to obtain candidate object features; performing similarity calculation on the fusion features and the candidate object features corresponding to the same candidate object to obtain single object similarity; and determining a target matching result corresponding to the object to be matched based on each of the single object similarities and the candidate object set.

[0168] The above-mentioned text image matching method obtains a type recognition result by performing type recognition on the object to be matched; determines a candidate object set from a preset candidate object library according to the type recognition result; performs fusion feature extraction on the object to be matched and each candidate object in the candidate object set; performs feature extraction on each candidate object in the candidate object set to obtain candidate object features; performs similarity calculation on the fusion feature and the candidate object feature corresponding to the same candidate object to obtain single object similarity; determines the target matching result corresponding to the object to be matched according to each single object similarity and the candidate object set. By first performing fusion feature extraction on the object to be matched and the candidate object, and then performing matching operation on the fusion feature and the candidate object feature, direct matching operation of image features and text features is avoided, and the use of fusion features for text image matching can increase the matching precision and improve the accuracy of text image matching.

[0169] In one embodiment, the above-mentioned step of performing type identification on the object to be matched and obtaining a type identification result includes: inputting the object to be matched into a preset text image classification model for classification prediction to obtain a classification prediction result; when the vector element corresponding to the text label in the classification prediction result is greater than the vector element corresponding to the image label in the classification prediction result, determining that the type identification result is a text type; when the vector element corresponding to the text label in the classification prediction result is less than the vector element corresponding to the image label in the classification prediction result, determining that the type identification result is an image type.

[0170] In one embodiment, the step of determining a candidate object set from a preset candidate object library based on the type recognition result includes: when the type recognition result is a text type, using an image sub-library in the candidate object library as the candidate object set; when the type recognition result is an image type, using a text sub-library in the candidate object library as the candidate object set.

[0171] In one embodiment, the above-mentioned step of extracting fused features based on the object to be matched and each candidate object in the candidate object set includes: taking any one of the candidate objects in the candidate object set as the target object; inputting the target object into a coding model corresponding to the type of the candidate object set for encoding to obtain a first code; inputting the object to be matched into the coding model corresponding to the type recognition result for encoding to obtain a second code; splicing the first code and the second code in dimension to obtain a fused code; inputting the fused code into a preset fused feature extraction model for feature extraction to obtain the fused feature corresponding to the target object.

[0172] In one embodiment, the above-mentioned step of extracting features from each candidate object in the candidate object set to obtain candidate object features includes: inputting each candidate object in the candidate object set into a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, and obtaining the candidate object features corresponding to each candidate object.

[0173] In one embodiment, the above-mentioned step of calculating the similarity of the fused feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity includes: taking any one of the candidate objects in the candidate object set as the object to be calculated; taking the fused feature corresponding to the object to be calculated as the first feature; taking the candidate object feature corresponding to the object to be calculated as the second feature; and performing cosine similarity calculation on the first feature and the second feature to obtain the single object similarity corresponding to the object to be calculated.

[0174] In one embodiment, the single object similarity is a cosine similarity, and the step of determining the target matching result corresponding to the object to be matched based on each of the single object similarities and the candidate object set comprises: finding the single object similarity with the largest value from each of the single object similarities as the target similarity; judging whether the target similarity is greater than a preset similarity threshold; if so, determining that the result of the target matching result is successful, and taking the candidate object corresponding to the target similarity in the candidate object set as the hit object of the target matching result; if not, determining that the result of the target matching result is a failure.

[0175] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0176] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0177] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A text image matching method, characterized in that: The method comprises: Get the object to be matched; Performing type identification on the to-be-matched object to obtain a type identification result; Determining a candidate object set from a preset candidate object library according to the type recognition result; Extracting fusion features based on the object to be matched and each candidate object in the candidate object set; Extracting features from each candidate object in the candidate object set to obtain candidate object features; Calculating similarity between the fused feature and the candidate object feature corresponding to the same candidate object to obtain a single object similarity; Determining a target matching result corresponding to the object to be matched according to each of the single object similarities and the candidate object set; The step of determining a candidate object set from a preset candidate object library according to the type recognition result comprises: When the type recognition result is a text type, using the image sub-library in the candidate object library as the candidate object set; When the type recognition result is an image type, the text sub-library in the candidate object library is used as the candidate object set.

2. The text image matching method according to claim 1, characterized in that: The step of performing type identification on the to-be-matched object to obtain a type identification result comprises: Inputting the to-be-matched object into a preset text image classification model for classification prediction to obtain a classification prediction result; When the vector element corresponding to the text label in the classification prediction result is greater than the vector element corresponding to the image label in the classification prediction result, determining that the type recognition result is a text type; When the vector element corresponding to the text label in the classification prediction result is smaller than the vector element corresponding to the image label in the classification prediction result, it is determined that the type recognition result is an image type.

3. The text image matching method according to claim 1, characterized in that: The step of extracting fusion features based on the object to be matched and each candidate object in the candidate object set includes: Taking any one of the candidate objects in the candidate object set as a target object; Inputting the target object into a coding model corresponding to the type of the candidate object set for encoding to obtain a first code; Inputting the to-be-matched object into the coding model corresponding to the type recognition result for coding to obtain a second code; Concatenate the first code and the second code in dimension to obtain a fused code; The fusion code is input into a preset fusion feature extraction model for feature extraction to obtain the fusion feature corresponding to the target object.

4. The text image matching method according to claim 1, characterized in that: The step of extracting features from each candidate object in the candidate object set to obtain features of the candidate object comprises: Each of the candidate objects in the candidate object set is respectively input into a single object feature extraction model corresponding to the type of the candidate object set to perform feature extraction, so as to obtain the candidate object feature corresponding to each of the candidate objects.

5. The text image matching method according to claim 1, characterized in that: The step of calculating the similarity between the fusion feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity comprises: Taking any candidate object in the candidate object set as an object to be calculated; Taking the fused feature corresponding to the object to be calculated as the first feature; Taking the candidate object feature corresponding to the object to be calculated as the second feature; The cosine similarity calculation is performed on the first feature and the second feature to obtain the single object similarity corresponding to the object to be calculated.

6. The text image matching method according to claim 1, characterized in that: The single object similarity is cosine similarity, and the step of determining a target matching result corresponding to the object to be matched according to each of the single object similarities and the candidate object set comprises: Find the single object similarity with the largest value from each of the single object similarities as the target similarity; Determining whether the target similarity is greater than a preset similarity threshold; If yes, determining that the target matching result is successful, and taking the candidate object corresponding to the target similarity in the candidate object set as the hit object of the target matching result; If not, the result of determining the target matching result is a failure.

7. A text image matching device, used to implement the method according to any one of claims 1 to 6, characterized in that: The device comprises: A data acquisition module, used to acquire objects to be matched; A type identification result determination module is used to perform type identification on the to-be-matched object to obtain a type identification result; A candidate object set determination module, used to determine a candidate object set from a preset candidate object library according to the type recognition result; A fusion feature extraction module, used for performing fusion feature extraction based on the object to be matched and each candidate object in the candidate object set; A candidate object feature determination module, used for extracting features from each candidate object in the candidate object set to obtain candidate object features; A single object similarity determination module is used to calculate the similarity between the fusion feature and the candidate object feature corresponding to the same candidate object to obtain the single object similarity; The target matching result determination module is used to determine the target matching result corresponding to the to-be-matched object according to each of the single object similarities and the candidate object set.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Cross-modal data matching method and device, equipment and medium

    CN113656660A