Feature extraction model training methods, apparatus, computer equipment, and storage media

By acquiring samples of similar text units, performing feature extraction and weighted processing, the problem of low accuracy in recognizing similar-looking characters in existing technologies has been solved, thereby improving the accuracy and efficiency of text unit recognition.

CN117197817BActive Publication Date: 2026-04-03GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies for recognizing similar-looking characters reduce inference speed by increasing network depth and width, while setting a central template affects the model's generalization ability, resulting in poor text unit recognition performance.

Method used

By acquiring approximate text unit samples, feature extraction is performed to determine the distinguishing sub-feature information, which is then weighted to obtain weighted text unit feature information. Based on this information, text recognition is performed and a feature extraction model is trained.

Benefits of technology

It improves the accuracy and efficiency of text unit recognition, enhances the feature extraction capability of the feature extraction model, and can more accurately identify the text units contained in similar text unit samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117197817B_ABST
    Figure CN117197817B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, computer device, and storage medium for training a feature extraction model. The method involves acquiring approximate text unit samples; extracting features from these samples using a feature extraction model to obtain text unit feature information; identifying distinguishing sub-feature information from the sub-feature information contained within the text unit feature information; weighting the distinguishing sub-feature information to obtain weighted text unit feature information; performing text recognition based on the weighted text unit feature information to obtain recognition results; and training the feature extraction model based on the recognition results to obtain a trained feature extraction model. This approach, by weighting the distinguishing sub-feature information in the text unit feature information, can achieve more accurate text recognition, enabling the feature extraction model to accelerate the learning of the mapping relationship between approximate text unit samples and sample labels, thereby improving the feature extraction capability of the trained feature extraction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, specifically to a feature extraction model training method, apparatus, computer device, and storage medium, wherein the storage medium is a computer-readable storage medium. Background Technology

[0002] In current text recognition tasks, whether it's Latin letters or Chinese characters and other text units, there are a large number of similar-looking characters. Because similar-looking characters share similar features and outlines, and there are many types, they are prone to misidentification. Currently, there are two main methods for recognizing similar-looking characters: one is to increase the network depth and width, thereby improving the accuracy of similar-looking character recognition by increasing parameters; the other method is to set a central template and use contrastive learning to shorten the distance between similar characters and widen the distance between different characters.

[0003] Both of the above methods have limitations. The first method increases the number of parameters, which reduces the inference speed of the network and results in poor recognition of text units. In the second method, the selection of the center template directly affects the accuracy of text unit recognition. Selecting the center template in advance can improve the accuracy of text unit recognition. However, selecting the template in advance can easily lead to poor generalization of the model, resulting in poor recognition of text units. Summary of the Invention

[0004] This application provides a feature extraction model training method, apparatus, computer device, and storage medium, which can improve the accuracy and efficiency of text unit recognition.

[0005] This application provides a feature extraction model training method, including:

[0006] Obtain approximate text unit samples;

[0007] The approximate text unit sample is subjected to feature extraction using a feature extraction model to obtain text unit feature information, wherein the text unit feature information contains at least one sub-feature information.

[0008] Determine distinguishing sub-feature information from the sub-feature information;

[0009] The distinguishing sub-feature information pairs in the text unit feature information are weighted to obtain weighted text unit feature information;

[0010] Based on the weighted text unit feature information, text recognition is performed on the approximate text unit samples to obtain recognition results. The feature extraction model is then trained based on the recognition results to obtain a trained feature extraction model.

[0011] Accordingly, embodiments of this application also provide a feature extraction model training apparatus, comprising:

[0012] The sample acquisition unit is used to acquire approximate text unit samples.

[0013] The feature extraction unit is used to extract features from the approximate text unit sample through a feature extraction model to obtain text unit feature information, wherein the text unit feature information includes at least one sub-feature information.

[0014] An information determination unit is used to determine distinguishing sub-feature information from the sub-feature information;

[0015] A weighting unit is used to weight the pairs of distinguishing sub-features in the text unit feature information to obtain weighted text unit feature information;

[0016] The text recognition unit is used to perform text recognition on the approximate text unit samples based on the weighted text unit feature information, obtain the recognition result, and train the feature extraction model based on the recognition result to obtain the trained feature extraction model.

[0017] In one embodiment, the information determining unit includes:

[0018] A classification subunit is used to perform text recognition on each sub-feature information through a classification network to obtain the recognized text unit for each sub-feature information and the probability of the recognized text unit;

[0019] A filtering subunit is used to filter the distinguishing sub-feature information from at least one sub-feature information based on the probability of the recognition text unit corresponding to each sub-feature information.

[0020] In one embodiment, the information determining unit includes:

[0021] The label acquisition subunit is used to acquire the weight labels carried by the text unit samples;

[0022] The feature information determination subunit is used to determine the distinguishing sub-feature information from the sub-feature information indicated by the weight label.

[0023] In one embodiment, the sample acquisition unit includes:

[0024] Obtain sub-units, used to obtain a weighted label reference image containing text units and unweighted label samples, wherein the weighted label reference image carries weighted labels;

[0025] The extraction subunit is used to extract features from the unweighted label sample using the feature extraction model to obtain sample feature information, and to extract features from the weighted label reference image using the feature extraction model to obtain reference feature information;

[0026] The label determination subunit is used to determine the weight label of the unweighted sample based on the similarity between the sample feature information and the reference feature information.

[0027] The sample generation subunit is used to generate the approximate text unit sample based on the unweighted label sample and the weighted label.

[0028] In one embodiment, the tag determining subunit includes:

[0029] The clustering module is used to cluster the unweighted label samples and the weighted label reference images according to the sample feature information and the reference feature information to obtain multiple clusters, wherein the similarity between the sample feature information and the reference feature information in each cluster meets a preset condition.

[0030] The weight label determination module is used to determine the weight label of the unweighted sample based on the weight label reference image contained in the cluster.

[0031] In one embodiment, the feature extraction model training device further includes:

[0032] The partitioning method acquisition unit is used to acquire the feature partitioning method;

[0033] A feature segmentation unit is used to segment the feature information of the text unit based on the feature segmentation method to obtain at least one initial sub-feature information;

[0034] The feature pooling unit is used to perform feature pooling for each initial sub-feature information to obtain at least one sub-feature information.

[0035] In one embodiment, the partitioning method acquisition unit includes:

[0036] The structural analysis subunit is used to perform structural analysis on the approximate text unit sample based on the text unit feature information to obtain structural feature information.

[0037] The division method determines the sub-units, which is used to determine the feature division method based on the structural feature information.

[0038] In one embodiment, the feature extraction model training device further includes:

[0039] The training sample acquisition unit is used to acquire text unit training samples carrying sample labels.

[0040] The sample feature extraction unit is used to extract features from the text unit training samples through the initial feature extraction model to obtain the sample feature information corresponding to the text unit training samples.

[0041] A sample feature segmentation unit is used to segment the sample feature information to obtain at least one sub-feature information of the sample feature information;

[0042] The text unit recognition unit is used to perform text recognition for each sub-feature information of each sample feature information to obtain the recognition text unit corresponding to the sub-feature information of the sample feature information, and to train the initial feature extraction model based on the recognition text unit to obtain the feature extraction model.

[0043] In one embodiment, the feature extraction model training device further includes:

[0044] The text unit image acquisition unit is used to acquire a text unit image containing the text unit to be identified;

[0045] The image feature extraction unit is used to extract features from the text unit image through the trained feature extraction model to obtain the feature information to be identified.

[0046] An image recognition unit is used to recognize the text unit to be recognized based on the feature information to be recognized, and to obtain a recognition result.

[0047] Accordingly, this application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any of the feature extraction model training methods provided in this application.

[0048] Accordingly, embodiments of this application also provide a computer-readable storage medium for storing a computer program, which is loaded by a processor to execute any of the feature extraction model training methods provided in embodiments of this application.

[0049] This application embodiment obtains approximate text unit samples; extracts features from the approximate text unit samples using a feature extraction model to obtain text unit feature information, the text unit feature information containing at least one sub-feature information; determines distinguishing sub-feature information from the sub-feature information; weights the distinguishing sub-feature information pairs in the text unit feature information to obtain weighted text unit feature information; performs text recognition on the approximate text unit samples based on the weighted text unit feature information to obtain recognition results, and trains the feature extraction model based on the recognition results to obtain a trained feature extraction model.

[0050] This scheme weights the distinguishing sub-features in the text unit feature information, giving greater weight to the distinguishing parts that allow text units in similar text unit samples to differentiate from other text units. This enables more accurate identification of text units in similar text unit samples, giving greater weight to the distinguishing parts when training the feature extraction model. The feature extraction model can then accelerate the learning of the mapping relationship between similar text unit samples and sample labels, thereby improving the feature extraction capability of the trained feature extraction model. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a flowchart of the feature extraction model training method provided in the embodiments of this application;

[0053] Figure 2 This is a schematic diagram of an approximate text unit sample of the feature extraction model training method provided in the embodiments of this application;

[0054] Figure 3 This is a schematic diagram of the feature extraction model training device provided in the embodiments of this application;

[0055] Figure 4 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0057] This application provides a feature extraction model training method, apparatus, computer device, and computer-readable storage medium. The feature extraction model training apparatus can be integrated into a computer device, which may be a server or a terminal, etc.

[0058] The terminal may include mobile phones, wearable smart devices, tablets, laptops, personal computers (PCs), and in-vehicle computers, etc.

[0059] Among them, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0060] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.

[0061] This embodiment will be described from the perspective of the feature extraction model training device. The feature extraction model training device can be specifically integrated in a computer device, which can be a server or other devices such as a terminal.

[0062] A feature extraction model training method provided by an embodiment of this application, as Figure 1 shown, the specific process of this feature extraction model training method can be as follows:

[0063] 101. Obtain approximate text unit samples.

[0064] Among them, the approximate text unit samples can be image samples including approximate text units. The approximate text units can include Chinese characters, English letters, and Latin letters, etc.

[0065] Specifically, the approximate text unit samples can be stored in a local database, cloud data, or blockchain, and the approximate text unit samples are obtained from the location where the approximate text unit samples are stored.

[0066] In one embodiment, the approximate text unit samples can carry weight tags, and the weight tags can represent the different parts of the approximate text units. For example, as Figure 2 shown, the different parts of approximate characters such as "子", "孑", and "孓" are in the 3rd part.

[0067] The weight tags carried by the approximate text unit samples can be added manually or automatically add weight tags to improve efficiency and accuracy. That is, the step of "obtaining approximate text unit samples" can specifically include:

[0068] Obtain a weight tag reference image containing text units and a sample without weight tags. The weight tag reference image carries weight tags;

[0069] Extract feature information of the sample by using the feature extraction model for the sample without weight tags, and extract reference feature information by using the feature extraction model for the weight tag reference image;

[0070] The weight labels of unweighted samples are determined based on the similarity between sample feature information and reference feature information.

[0071] Approximate text unit sample labels are generated based on unweighted labeled samples and weighted labeled samples.

[0072] The weight label reference image is an image containing text units and carrying weight labels.

[0073] Among them, unweighted samples are image samples containing text units that do not carry weight labels.

[0074] For example, it could involve obtaining a weighted label reference image and an unweighted label sample, extracting features from the unweighted label sample using a feature extraction model to obtain sample feature information, and extracting features from the weighted label reference image using a feature extraction model to obtain reference feature information.

[0075] Calculate the distance between sample feature information and reference feature information, determine the similarity between sample feature information and reference feature information based on the distance, generate weight labels that are the same as the weight labels of the reference image corresponding to the sample feature information for unweighted label samples with a similarity greater than a preset threshold, and generate approximate text unit samples based on unweighted label samples and the weight labels generated for them.

[0076] In one embodiment, unweighted and weighted samples can be clustered based on reference text feature information and sample feature information, and weight labels can be determined based on the clusters. Specifically, the step "determine the weight label of the unweighted sample based on the similarity between the sample feature information and the reference feature information" can include:

[0077] Based on the sample feature information and reference feature information, unweighted label samples and weighted label reference images are clustered to obtain multiple clusters. The similarity between the sample feature information and the reference feature information in each cluster meets the preset conditions.

[0078] Based on the weight label reference images contained in the clusters, the weight labels of unweighted samples are determined.

[0079] For example, clustering algorithms, such as k-means, DBSCAN, or OPTICS, can be used to cluster unweighted labeled samples and weighted labeled reference images based on sample and reference feature information, resulting in multiple clusters. The similarity between the weighted labeled reference images and unweighted labeled samples contained in the clusters obtained by the clustering algorithm will meet certain conditions.

[0080] Calculate the number of weight tags representing different distinguishing parts in each clustering cluster respectively, determine the weight tag with the largest number as the weight tag of the sample without weight tag in this clustering cluster, and generate the weight tag of the sample without weight tag.

[0081] 102. Extract features from the approximate text unit sample through the feature extraction model to obtain text unit feature information, and the text unit feature information includes at least one sub-feature information.

[0082] Among them, the feature extraction model may include a network for extracting features from text unit samples. For example, a residual neural network (ResNet) and a deep convolutional neural network (such as, VGG Net), etc.

[0083] Among them, the approximate text unit sample can be divided into multiple parts, and each part can correspond to a sub-feature information.

[0084] For example, specifically, the approximate text unit can be input into the feature extraction model, and the feature extraction model extracts features from the approximate text unit to obtain the text unit feature information of the approximate text unit. The text unit feature information includes the feature information of each part of the approximate text unit. As Figure 2 shown, if the approximate text unit is divided into 5 parts, the text unit feature information includes the feature information of 5 parts of the approximate text unit. If the approximate text unit is divided into n parts, the text unit feature information includes the feature information of n parts of the approximate text unit. The feature information of each part is a sub-feature information. Therefore, the text unit feature information includes at least one sub-feature information.

[0085] Different text units have different unit structures. Different unit structures result in different distinguishing parts. For example, the distinguishing part between "子" and "孑" is in the middle position, while the distinguishing part between "治" and "冶" is in the left radical position. Therefore, there can be various feature partitioning methods for partitioning the text unit feature information, making the feature partitioning of the text unit feature information more reasonable and the text recognition of the approximate text unit sample more accurate. That is, in one embodiment, after the step of "extracting features from the approximate text unit sample through the feature extraction model to obtain text unit feature information", the feature extraction model method provided by the embodiments of the present application may specifically further include:

[0086] Obtain a feature partitioning method;

[0087] Based on the feature partitioning method, partition the text unit feature information to obtain at least one initial sub-feature information; [[ID=二十五]]

[0088] Perform feature pooling for each initial sub-feature information to obtain at least one sub-feature information.

[0089] The feature segmentation method can include ways of segmenting text unit feature information, such as horizontal segmentation and vertical segmentation, or it can include segmenting text unit feature information into several sub-feature information, such as segmenting into 5 sub-feature information or 3 sub-feature information.

[0090] Feature pooling can be considered a feature selection and information filtering process. It can retain the main feature information, reduce parameters and computation, and prevent overfitting.

[0091] For example, the training samples of text units can be labeled with a partitioning method. The partitioning method label can include feature partitioning methods such as horizontal partitioning and vertical partitioning. The feature partitioning method is determined based on the partitioning method label carried by the training samples of text units.

[0092] Optionally, a preset feature segmentation method can be obtained.

[0093] The text unit feature information is divided according to the feature division method to obtain at least one initial sub-feature information. Then, feature pooling is performed on each initial sub-feature information to obtain the corresponding sub-feature information.

[0094] Feature pooling for each initial sub-feature can be either max pooling or average pooling.

[0095] In addition to using approximate text unit samples carrying segmentation method labels and preset feature segmentation methods, the feature segmentation method can also be determined based on the unit structure of the text units contained in the approximate text unit samples. That is, in one embodiment, the step "obtaining feature segmentation method" may specifically include:

[0096] Structural analysis of approximate text unit samples is performed based on text unit feature information;

[0097] The feature segmentation method is determined based on structural feature information.

[0098] Among them, structural feature information can characterize the structural features of the text units contained in the approximate text unit sample, such as top-bottom structure or left-right structure.

[0099] For example, the text unit feature information can be input into a neural network. The neural network can then perform structural analysis on the approximate text unit samples based on the text unit feature information to obtain structural feature information. The feature division method can be determined based on the structural feature information. For example, if the structural feature information represents a vertical structure, the feature division method is horizontal division; if the structural feature information represents a left-right structure, the feature division method is vertical division.

[0100] The text units contained in the approximate text unit sample can be identified based on the text unit feature information. Therefore, the structural features of the text units contained in the approximate text unit sample can also be determined. In one embodiment, the text units contained in the approximate text unit sample can be identified first based on the text unit feature information, and then the structural features can be determined based on the text units.

[0101] Before training the feature extraction model using approximate text unit samples with weighted labels, an initial feature extraction model can be trained using text unit training samples. No feature weighting is performed during this training process. When the feature extraction capability of the initial feature extraction model reaches the required level (e.g., the number of iterations and loss meet the requirements), the feature extraction model is obtained. Further training using approximate text unit samples further improves the feature extraction capability. Since feature weighting is not required in the early training stages, the training speed of the feature extraction model can be increased. Specifically, in one embodiment, before the step "extracting features from approximate text unit samples using the feature extraction model to obtain text unit feature information," the model training method provided in this application embodiment may further include:

[0102] 01. Obtain text unit training samples carrying sample labels;

[0103] 02. Extract features from the text unit training samples using the initial feature extraction model to obtain the sample feature information corresponding to the text unit training samples;

[0104] 03. Perform feature segmentation on the sample feature information to obtain at least one sub-feature information of the sample feature information;

[0105] 04. Perform text recognition for each sub-feature of the sample feature information to obtain the recognition text unit corresponding to the sub-feature of the sample feature information, and train the initial feature extraction model based on the recognition text unit to obtain the feature extraction model.

[0106] The sample label may include information that represents the actual text unit contained in the sample, which is similar to the sample text unit.

[0107] The initial feature extraction model can be a model that has not yet been trained using text unit training samples.

[0108] The text unit training sample can be an image sample containing text units, and the text unit training sample can carry weight labels or not.

[0109] For example, specifically, one could acquire text unit training samples, input these samples into an initial feature extraction model, extract features from the text unit samples using the initial feature extraction model to obtain sample feature information, and then divide this sample feature information to obtain at least one sub-feature information. For each sub-feature information of the sample feature information, text unit recognition is performed to obtain the recognized text unit corresponding to each sub-feature information. The recognized text unit that is recognized most frequently among the recognized text units corresponding to each sub-feature information of the sample feature information is determined as the target recognized text unit of the text unit training sample.

[0110] The initial feature extraction model is trained based on the target recognition text unit and the sample labels of the text unit training samples, and then the process returns to steps 01-04 until the preset training conditions are met to obtain the feature extraction model.

[0111] During the training of the initial feature extraction model using text unit training samples, no feature weighting is required. After obtaining the feature extraction model, it is trained using approximate text unit samples with weight labels. Since the feature extraction model already has a certain feature extraction capability, only a small number of approximate text unit samples are needed for further training to obtain the trained feature extraction model. Therefore, the above method can reduce the feature weighting process, improve the training speed, and prevent overfitting caused by feature weighting throughout the entire training process.

[0112] Optionally, the text unit training samples can be without weight labels. Whether weight labels are added manually or automatically by the machine, a certain amount of work is required. First, the initial feature extraction model is trained using the text unit training samples to obtain the feature extraction model. Since the feature extraction model already has a certain feature extraction capability, only a small number of approximate text unit samples are needed to continue training to obtain the trained feature extraction model. Therefore, the number of approximate text unit samples that need to be weighted can be reduced, the workload of adding weight labels can be reduced, and feature weighting is not required, which improves the training speed and prevents overfitting.

[0113] 103. Identify distinguishing sub-feature information from the sub-feature information.

[0114] Among them, the distinguishing sub-feature information is the feature information corresponding to the distinguishing parts of the approximate text unit samples.

[0115] Since the distinguishing region is the part of the text unit sample that can distinguish other text units, the recognition result obtained by performing text recognition on this distinguishing region is relatively certain. For example, taking... Figure 2Taking the approximate text unit samples containing "zi" as an example for illustration, the recognition results of the 1st, 2nd, 4th, and 5th parts may be "zi", "jie", or "jue", while the recognition result of the 3rd part is most likely to be "zi". Therefore, the distinguishing sub-feature information can be determined according to the recognition results corresponding to each sub-feature information. That is, in one embodiment, the step of "determining the distinguishing sub-feature information from the sub-feature information" may specifically include:

[0116] Performing text recognition on each sub-feature information through a classification network to obtain the recognized text unit of each sub-feature information and the probability of the recognized text unit;

[0117] Screening the distinguishing sub-feature information from at least one sub-feature information according to the probability of the recognized text unit corresponding to each sub-feature information.

[0118] For example, specifically, the sub-feature information can be input into the classification network, and the classification network performs text recognition based on the sub-feature information to determine the probability that the sub-feature information belongs to each classification category, obtaining a classification result. The classification category corresponds to a text unit, so the classification result includes the recognized text unit corresponding to the sub-feature information and the probability of each recognized text unit.

[0119] For each sub-feature information, the probability in the recognized text unit with the highest probability is determined as the confidence probability of the sub-feature information, and then the sub-feature information with the highest confidence probability is screened as the distinguishing sub-feature information.

[0120] In one embodiment, the approximate text unit sample may carry a weight label. Since the weight label can represent the distinguishing part in the approximate text unit sample, the distinguishing sub-feature information corresponding to the distinguishing part can be determined from at least one sub-feature information included in the text unit feature information. That is, the step of "determining the distinguishing sub-feature information from the sub-feature information" may specifically include:

[0121] Obtaining the weight label carried by the text unit sample;

[0122] Determining the sub-feature information indicated by the weight label as the distinguishing sub-feature information.

[0123] For example, specifically, it may be obtaining the weight label carried by the text unit sample and determining the sub-feature information indicated by the weight label as the distinguishing sub-feature information.

[0124] 104. Weighting the pair of distinguishing sub-feature information in the text unit feature information to obtain the weighted text unit feature information.

[0125] Since the distinguishing part is an approximate text unit that can be distinguished from other similar text units, increasing the weight of the distinguishing sub-feature information of the distinguishing part can improve the recognition accuracy of the approximate text unit sample. Therefore, the distinguishing sub-feature information in the text unit feature information can be weighted to obtain weighted text unit feature information.

[0126] 105. Based on the weighted text unit feature information, perform text recognition on the approximate text unit samples to obtain the recognition results, and train the feature extraction model according to the recognition results to obtain the trained feature extraction model.

[0127] The recognition result performs text recognition on the approximate text unit sample, and the resulting approximate text unit sample contains the text units.

[0128] For example, the weighted text unit feature information can be input into a classification network, and the classification network can perform text recognition on the approximate text unit samples based on the weighted text unit feature information to obtain the recognition result.

[0129] Approximate text unit samples can also carry sample labels. The sample labels are the actual text units contained in the approximate text unit samples, and the recognition result is the text units contained in the approximate text unit samples recognized by the classification network.

[0130] The feature extraction model and classification network are trained based on the recognition results and sample labels. When the number of iterations or the loss meets the preset conditions, the trained feature extraction model and the trained classification network are obtained.

[0131] The feature extraction model is trained based on approximate text unit samples carrying weight labels. The resulting trained feature extraction model has good feature extraction capabilities. Therefore, in one embodiment, the text unit to be identified can be directly identified using the feature extraction model. That is, after obtaining the trained feature extraction model, the method provided in this application embodiment may further include:

[0132] Obtain the image of the text unit containing the text unit to be identified;

[0133] The text unit image is used to extract features by a trained feature extraction model to obtain the feature information to be identified.

[0134] The recognition results are obtained by recognizing the text units based on the feature information to be recognized.

[0135] The text unit image is an image containing the text unit to be identified.

[0136] For example, a specific approach could be to extract features from a text unit image using a trained feature extraction model to obtain the feature information corresponding to the text unit to be identified. This feature information would then be input into a trained classification unit, and the trained classification network would identify the unit based on the feature information, outputting the classification result, i.e., the identification result.

[0137] By weighting the feature information of text units, we obtain weighted text unit feature information. Based on the weighted text unit feature information, we can better identify the text units contained in similar text units, that is, the accuracy of the recognition result is higher. By training the feature extraction model according to the recognition result and the sample labels of similar text unit samples, the feature extraction model can more easily learn the mapping relationship between similar text unit samples and sample labels, thereby improving the feature extraction capability of the feature extraction model.

[0138] As can be seen from the above, the embodiments of this application obtain approximate text unit samples; extract features from the approximate text unit samples using a feature extraction model to obtain text unit feature information, wherein the text unit feature information contains at least one sub-feature information; determine distinguishing sub-feature information from the sub-feature information; weight the distinguishing sub-feature information pairs in the text unit feature information to obtain weighted text unit feature information; perform text recognition on the approximate text unit samples based on the weighted text unit feature information to obtain recognition results, and train the feature extraction model based on the recognition results to obtain a trained feature extraction model.

[0139] This scheme weights the distinguishing features in the text unit feature information. Based on the weighted text unit feature information, it can more accurately identify the text units contained in the similar text unit samples. The feature extraction model is trained based on the recognition results, which can strengthen the mapping relationship between the text unit feature information and the recognition results. This enables the feature extraction unit to quickly learn the mapping relationship between the similar text unit samples and the sample labels, thereby improving the feature extraction capability of the trained feature extraction model.

[0140] To facilitate better implementation of the feature extraction model training method provided in this application embodiment, a feature extraction model training apparatus is also provided in one embodiment. The meanings of the terms used are the same as in the feature extraction model training method described above, and specific implementation details can be found in the description of the method embodiment.

[0141] The feature extraction model training device can be integrated into a computer device, such as... Figure 3 As shown, the feature extraction model training device may include: a sample acquisition unit 301, a feature extraction unit 302, an information determination unit 303, a weighting unit 304, and a text recognition unit 305, as detailed below:

[0142] (1) Sample acquisition unit 301: used to acquire approximate text unit samples.

[0143] In one embodiment, the sample acquisition unit 301 may include an acquisition subunit, an extraction subunit, a label determination subunit, and a sample generation subunit, specifically:

[0144] Get sub-units: Used to obtain the weighted label reference image and unweighted sample containing text units. The weighted label reference image carries weighted labels.

[0145] Extraction subunit: used to extract features from unweighted labeled samples using a feature extraction model to obtain sample feature information, and to extract features from a weighted labeled reference image using a feature extraction model to obtain reference feature information;

[0146] Label determination subunit: used to determine the weight label of unweighted samples based on the similarity between sample feature information and reference feature information;

[0147] Sample generation sub-unit: Used to generate approximate text unit samples based on unweighted and weighted samples.

[0148] (2) Feature extraction unit 302: used to extract features from approximate text unit samples through a feature extraction model to obtain text unit feature information, wherein the text unit feature information contains at least one sub-feature information.

[0149] (3) Information determination unit 303: used to determine the distinguishing sub-feature information from the sub-feature information.

[0150] In one embodiment, the information determination unit 303 may include a classification subunit and a filtering subunit, specifically:

[0151] Classification subunit: Used to perform text recognition on each sub-feature information through a classification network, to obtain the recognized text unit for each sub-feature information and the probability of recognizing the text unit;

[0152] Filtering sub-units: used to filter distinguishing sub-feature information from at least one sub-feature information based on the probability of the recognition text unit corresponding to each sub-feature information.

[0153] In one embodiment, the information determination unit may include a tag acquisition subunit, a feature information determination subunit, and a feature information determination subunit, specifically:

[0154] Label Acquisition Sub-unit: Used to retrieve the weight labels carried by text unit samples;

[0155] Feature information determination sub-unit: used to determine the distinguishable sub-feature information indicated by the weight label.

[0156] (4) Weighting unit 304: used to weight the difference sub-feature information pairs in the text unit feature information to obtain weighted text unit feature information.

[0157] (5) Text recognition unit 305: used to perform text recognition on approximate text unit samples based on weighted text unit feature information, obtain recognition results, and train the feature extraction model based on the recognition results to obtain the trained feature extraction model.

[0158] In one embodiment, the feature extraction model training apparatus may further include a partitioning method acquisition unit, a feature partitioning unit, and a feature pooling unit, specifically:

[0159] Partitioning method acquisition unit: used to acquire the feature partitioning method;

[0160] Feature partitioning unit: used to partition the feature information of text units based on the feature partitioning method to obtain at least one initial sub-feature information;

[0161] Feature pooling unit: Used to perform feature pooling for each initial sub-feature information to obtain at least one sub-feature information.

[0162] In one embodiment, the feature extraction model training device may further include a training sample acquisition unit, a sample feature extraction unit, a sample feature segmentation unit, and a text unit recognition unit, specifically:

[0163] Training sample acquisition unit: Used to acquire text unit training samples carrying sample labels;

[0164] Sample feature extraction unit: Used to extract features from the text unit training samples through the initial feature extraction model, and obtain the sample feature information corresponding to the text unit training samples;

[0165] Sample feature partitioning unit: used to partition sample feature information to obtain at least one sub-feature information of sample feature information;

[0166] Text unit recognition unit: used to perform text recognition for each sub-feature of each sample feature information, to obtain the recognition text unit corresponding to the sub-feature of the sample feature information, and to train the initial feature extraction model based on the recognition text unit to obtain the feature extraction model.

[0167] In one embodiment, the feature extraction model training device may further include a text unit image acquisition unit, an image feature extraction unit, and an image recognition unit, specifically:

[0168] Text unit image acquisition unit: used to acquire text unit images containing text units to be identified;

[0169] Image feature extraction unit: used to extract features from text unit images using a trained feature extraction model to obtain the feature information to be identified;

[0170] Image recognition unit: Used to recognize text units based on the features to be recognized, and obtain recognition results.

[0171] As can be seen from the above, the feature extraction model training device in this embodiment of the application acquires approximate text unit samples through the sample acquisition unit 301; the feature extraction unit 302 extracts features from the approximate text unit samples through the feature extraction model to obtain text unit feature information, which includes at least one sub-feature information; the information determination unit 303 determines the distinguishing sub-feature information from the sub-feature information; the weighting unit 304 weights the distinguishing sub-feature information pairs in the text unit feature information to obtain weighted text unit feature information; finally, the text recognition unit 305 performs text recognition on the approximate text unit samples based on the weighted text unit feature information to obtain the recognition result, and trains the feature extraction model based on the recognition result to obtain the trained feature extraction model.

[0172] This scheme weights the distinguishing features in the text unit feature information. Based on the weighted text unit feature information, it can more accurately identify the text units contained in the similar text unit samples. The feature extraction model is trained based on the recognition results, which can strengthen the mapping relationship between the text unit feature information and the recognition results. This enables the feature extraction unit to quickly learn the mapping relationship between the similar text unit samples and the sample labels, thereby improving the feature extraction capability of the trained feature extraction model.

[0173] This application also provides a computer device, which can be a terminal or a server, such as... Figure 4 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically:

[0174] The computer device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will understand that... Figure 4 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0175] The processor 1001 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1002, and by calling data stored in the memory 1002, thereby providing overall monitoring of the computer device. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and computer programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1001.

[0176] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.

[0177] The computer equipment also includes a power supply 1003 that supplies power to the various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1003 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0178] The computer device may also include an input unit 1004, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0179] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the computer device loads the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 runs the computer programs stored in the memory 1002 to realize various functions, as follows:

[0180] Obtain approximate text unit samples;

[0181] The text unit feature information is obtained by extracting features from the approximate text unit samples using a feature extraction model. The text unit feature information contains at least one sub-feature information.

[0182] Distinguishing sub-feature information is determined from the sub-feature information; the distinguishing sub-feature information pairs in the text unit feature information are weighted to obtain weighted text unit feature information;

[0183] Text recognition is performed on approximate text unit samples based on weighted text unit feature information to obtain recognition results. The feature extraction model is then trained based on the recognition results to obtain the trained feature extraction model.

[0184] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0185] As can be seen from the above, the computer device in this application embodiment can obtain approximate text unit samples; extract features from the approximate text unit samples using a feature extraction model to obtain text unit feature information, wherein the text unit feature information includes at least one sub-feature information; determine distinguishing sub-feature information from the sub-feature information; weight the distinguishing sub-feature information pairs in the text unit feature information to obtain weighted text unit feature information; perform text recognition on the approximate text unit samples based on the weighted text unit feature information to obtain recognition results, and train the feature extraction model based on the recognition results to obtain a trained feature extraction model.

[0186] This scheme weights the distinguishing sub-features in the text unit feature information, giving greater weight to the distinguishing parts that allow text units in similar text unit samples to differentiate from other text units. This enables more accurate identification of text units in similar text unit samples, giving greater weight to the distinguishing parts when training the feature extraction model. The feature extraction model can then accelerate the learning of the mapping relationship between similar text unit samples and sample labels, thereby improving the feature extraction capability of the trained feature extraction model.

[0187] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.

[0188] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0189] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute any of the feature extraction model training methods provided in embodiments of this application.

[0190] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0191] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0192] Since the computer program stored in the computer-readable storage medium can execute any of the feature extraction model training methods provided in the embodiments of this application, it can achieve the beneficial effects that any of the feature extraction model training methods provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.

[0193] The foregoing has provided a detailed description of a feature extraction model training method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for training a feature extraction model, characterized in that, include: Obtain a weighted label reference image containing text units and an unweighted label sample, wherein the weighted label reference image carries weight labels; The unweighted label sample is subjected to feature extraction using a feature extraction model to obtain sample feature information, and the weighted label reference image is subjected to feature extraction using the same feature extraction model to obtain reference feature information. The weight label of the unweighted sample is determined based on the similarity between the sample feature information and the reference feature information. Based on the unweighted labeled sample and the weighted labeled sample, an approximate text unit sample is generated, which is an image sample including text units. The approximate text unit sample is subjected to feature extraction by a feature extraction model to obtain text unit feature information. The text unit feature information includes at least one sub-feature information. The approximate text unit sample is divided into multiple parts based on the structural features of the included text units. Each part corresponds to a sub-feature information. Different text units have different structural features. Distinguishing sub-feature information is determined from the sub-feature information. The distinguishing sub-feature information is the feature information corresponding to the distinguishing part of the approximate text unit sample. The distinguishing part is the part of the text unit contained in the approximate text unit sample that can be distinguished from other text units. The distinguishing sub-features in the text unit feature information are weighted to obtain weighted text unit feature information, wherein the weights of the distinguishing sub-features are increased. Based on the weighted text unit feature information, text recognition is performed on the approximate text unit samples to obtain recognition results, and the feature extraction model is trained based on the recognition results to obtain the trained feature extraction model. The step of determining the distinguishing sub-feature information from the sub-feature information includes: Text recognition is performed on each sub-feature information using a classification network to obtain the recognized text unit for each sub-feature information and the probability of the recognized text unit; based on the probability of the recognized text unit corresponding to each sub-feature information, the distinguishing sub-feature information is selected from at least one sub-feature information. Alternatively, obtain the weight labels carried by the text unit samples; determine the distinguishing sub-feature information by using the sub-feature information indicated by the weight labels.

2. The method according to claim 1, characterized in that, After extracting features from the approximate text unit samples using a feature extraction model to obtain text unit feature information, the method further includes: Methods for obtaining feature segmentation; Based on the aforementioned feature segmentation method, the text unit feature information is segmented to obtain at least one initial sub-feature information; Feature pooling is performed on each initial sub-feature information to obtain at least one sub-feature information.

3. The method according to claim 1, characterized in that, Before extracting features from the approximate text unit samples using a feature extraction model to obtain text unit feature information, the method further includes: Obtain training samples of text units carrying sample labels; The initial feature extraction model is used to extract features from the training samples of the text units to obtain the sample feature information corresponding to the training samples of the text units. The sample feature information is segmented to obtain at least one sub-feature information of the sample feature information; Text recognition is performed on each sub-feature of each sample feature information to obtain the recognition text unit corresponding to the sub-feature of the sample feature information. The initial feature extraction model is trained based on the recognition text unit to obtain the feature extraction model.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: Obtain the image of the text unit containing the text unit to be identified; The trained feature extraction model is used to extract features from the text unit image to obtain the feature information to be identified. The text unit to be identified is identified based on the feature information to be identified, and the identification result is obtained.

5. A feature extraction model training device, characterized in that, include: The sample acquisition unit is used to acquire a weighted label reference image containing text units and an unweighted label sample. The weighted label reference image carries a weighted label. The unweighted label sample is subjected to feature extraction by a feature extraction model to obtain sample feature information. The weighted label reference image is subjected to feature extraction by the feature extraction model to obtain reference feature information. The weighted label of the unweighted label sample is determined according to the similarity between the sample feature information and the reference feature information. Approximate text unit samples are generated based on the unweighted label sample and the weighted label. The approximate text unit samples are image samples containing text units. The feature extraction unit is used to extract features from the approximate text unit sample through a feature extraction model to obtain text unit feature information. The text unit feature information includes at least one sub-feature information. The approximate text unit sample is divided into multiple parts based on the structural features of the included text units. Each part corresponds to a sub-feature information. Different text units have different structural features. An information determination unit is used to determine distinguishing sub-feature information from the sub-feature information. The distinguishing sub-feature information is feature information corresponding to the distinguishing part of the approximate text unit sample. The distinguishing part is the part of the text unit contained in the approximate text unit sample that can be distinguished from other text units. A weighting unit is used to weight the distinguishing sub-features in the text unit feature information to obtain weighted text unit feature information, wherein the weights of the distinguishing sub-features are increased. The text recognition unit is used to perform text recognition on the approximate text unit samples based on the weighted text unit feature information, obtain the recognition result, and train the feature extraction model based on the recognition result to obtain the trained feature extraction model. The information determining unit is used for: Text recognition is performed on each sub-feature information using a classification network to obtain the recognized text unit for each sub-feature information and the probability of the recognized text unit; based on the probability of the recognized text unit corresponding to each sub-feature information, the distinguishing sub-feature information is selected from at least one sub-feature information. Alternatively, obtain the weight labels carried by the text unit samples; determine the distinguishing sub-feature information by using the sub-feature information indicated by the weight labels.

6. A computer device, characterized in that, It includes a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to perform the feature extraction model training method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which is loaded by a processor to execute the feature extraction model training method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image recognition method and device, electronic equipment and storage medium

    CN111368893A

  • Information identification method and device, data processing method and device, equipment and information interaction method

    CN112307199A