Information retrieval method, device, storage medium and electronic device

By dividing feature spaces and calculating the set of stretched thresholds in the information retrieval system, the problem of insufficient distinction between true and non-true values ​​is solved, and a better user experience is achieved.

CN119068212BActive Publication Date: 2025-02-18HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411573247.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-18
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

In the existing information retrieval system, the similarity between true and non-true values ​​is insufficient, which affects the user experience.

Method used

By dividing the feature space into multiple feature subspaces, the center point and center point encoding of each feature subspace are determined, and the corresponding set of stretch thresholds is calculated for each feature subspace, which is used to adjust the similarity and thus improve the truth The similarity between values ​​and non-true values ​​is distinguishable.

Benefits of technology

It effectively improves the discrimination between true and non-true similarity in the search results and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068212B_ABST
    Figure CN119068212B_ABST
Patent Text Reader

Abstract

The present application discloses an information retrieval method, device, storage medium and electronic device, including: using a first data set to divide and encode a feature subspace; using a second data set to construct a mapping relationship between the center point encoding of the feature subspace and a stretching threshold; when performing information retrieval, for one or more feature subspaces that are closest to the target query sample feature and have a stretching threshold set, based on the corresponding stretching threshold set, calculate a function stretching threshold; calculate the initial similarity between the target query sample feature and each sample feature in the base library, determine a similarity stretching function based on the function stretching threshold, and use the similarity stretching function determined based on the function stretching threshold to stretch the initial similarity; based on the stretched similarity, output the information retrieval result for the target query sample. The application of the present application can effectively increase the distinguishability of true value and non-true value similarity in the retrieval results and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to retrieval technology, and in particular to an information retrieval method, device, storage medium and electronic device. Background Art

[0002] Information retrieval is a multidisciplinary research field involving computer science, artificial intelligence, etc., which aims to help users find the information they need efficiently and accurately in large amounts of data. Information retrieval usually includes image retrieval, text retrieval, video retrieval, etc.

[0003] The usual information retrieval process is to compare the similarity of data features, sort the similarities from high to low to find relevant matching results, and output the matching results and the corresponding similarities.

[0004] In the actual application of the current retrieval system, the output retrieval results may have the problem of low differentiation between the true value and the non-true value similarity, which affects the user experience. For example, in the image retrieval for the main target, it is assumed that the query sample image X is the image of the main target A under the background B, and the retrieval results include the image Y of the main target A under the background C and the image Z of the main target a under the background B. Obviously, in this retrieval, image Y is the true value and image Z is the non-true value, but because the background of image Z is the same as that of image X, the similarity α between image Z and image X is also relatively high. Although α is still lower than the similarity β between image Y and image X, the differentiation between similarities α and β is not large. In the eyes of the user, image Z is already another main target, and the similarity differentiation should be very obvious, resulting in a poor user experience. For another example, suppose pedestrian A, the standing state is recorded as A1, and the riding state is recorded as A2; pedestrian B, the standing state B1 is dressed similarly to A. Due to the deformation of A2, the similarity between A1 and B1 may be higher than that between A1 and A2, but in fact A1 and A2 are true values ​​of each other and are different states of pedestrian A. As a result, the difference between true value and non-true value is not large, resulting in wrong retrieval results, which affects the user experience. Summary of the invention

[0005] The present application provides an information retrieval method, device, storage medium and electronic device, which can effectively increase the distinguishability of true value and non-true value similarities in retrieval results and improve user experience.

[0006] To achieve the above purpose, this application adopts the following technical solutions:

[0007] An information retrieval method, comprising:

[0008] Using the first data set, the feature space is divided into a plurality of feature subspaces, and the center point and the center point code of each feature subspace are determined; wherein the division of the feature subspace is determined based on the similarity between the sample features of each training sample in the first data set, and each of the feature subspaces includes one or more similar sample features;

[0009] Extract features from the second training samples in the second data set to obtain second training sample features; for each of the second training sample features, find the feature subspace with the closest distance among the multiple feature subspaces, encode the center point of the feature subspace as the code corresponding to the second training sample feature, use the second training sample as a query sample, calculate the similarity threshold of the query sample, use it as the stretching threshold corresponding to the second training sample feature, and establish a corresponding relationship between the code corresponding to the second training sample feature and the corresponding stretching threshold; combine all stretching thresholds corresponding to any code into a stretching threshold set corresponding to the code;

[0010] When performing information retrieval, feature extraction is performed on the retrieved target query sample to obtain the target query sample feature, and for one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, at least one function stretching threshold corresponding to the target query sample feature is calculated based on the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces;

[0011] Calculating the initial similarity between the target query sample feature and each sample feature in the base database, and stretching the initial similarity using a similarity stretching function determined based on the function stretching threshold;

[0012] Based on the stretched similarity, an information retrieval result for the target query sample is output.

[0013] Preferably, the calculating of the similarity threshold of the query sample includes:

[0014] Based on the comparison and similarity ranking results between the second training sample feature and each sample feature in the base database, determine the first similarity threshold when the specified recognition false alarm rate is reached as the similarity threshold;

[0015] or,

[0016] According to the ranking of the similarities between the second training sample feature and each sample feature in the base database, the similarity between the sample feature of the first non-true value sample and the second training sample feature is determined as the similarity threshold.

[0017] Preferably, the step of calculating the stretching threshold corresponding to the target query sample feature includes:

[0018] For one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, a stretching threshold is selected from the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces to form a threshold set for the target query sample feature;

[0019] Statistical analysis is performed on all stretching thresholds in the threshold set of the target query sample feature to obtain the function stretching threshold.

[0020] Preferably, the step of selecting a stretching threshold value from a stretching threshold value set corresponding to the center point code of the corresponding feature subspace comprises:

[0021] Determine a feature subspace that is closest to the target query sample feature and whose center point code has a corresponding stretching threshold set, select all stretching thresholds in the stretching threshold set corresponding to the center point code, or select other stretching thresholds except the stretching threshold corresponding to the singular point in the corresponding stretching threshold set to form a threshold set for the target query sample feature;

[0022] or,

[0023] Determine a plurality of feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, and select, from the stretching threshold sets corresponding to the center point codes of the respective feature subspaces, stretching thresholds corresponding to the N second training sample features that are closest to the target query sample feature, or select stretching thresholds corresponding to the second training sample features whose distance to the target query sample feature is less than a second set threshold, to form a threshold set for the target query sample feature.

[0024] Preferably, the statistical analysis of all stretching thresholds in the threshold set of the target query sample feature includes:

[0025] Calculating an average value of all stretching thresholds in the threshold set as the function stretching threshold;

[0026] or,

[0027] The weighted sum or weighted mean of all stretching thresholds in the threshold set is calculated as the function stretching threshold; wherein the weighting coefficient of each stretching threshold is determined according to the distance between the second training sample feature corresponding to the stretching threshold and the target query sample feature, and the closer the distance, the higher the weighting coefficient.

[0028] Preferably, the first similarity threshold is a plurality of similarity thresholds when a plurality of different specified recognition false alarm rates are reached respectively;

[0029] Correspondingly, the same center point code corresponds to multiple stretching threshold sets, and the function stretching thresholds are determined to be multiple.

[0030] Preferably, when there is only one function stretching threshold,

[0031] The similarity stretching function ensures that: the initial similarity greater than the function stretching threshold value becomes larger after stretching, and the initial similarity less than the function stretching threshold value becomes smaller after stretching; and / or,

[0032] The similarity stretching function is a piecewise function with the function stretching threshold as a dividing point; and / or,

[0033] The similarity stretching function ensures that: the closer the initial similarity is to the function stretching threshold, the greater the function curvature of the corresponding initial similarity position.

[0034] An information retrieval device, comprising: a feature subspace division and encoding unit, a mapping relationship construction unit, a function stretching threshold determination unit, a similarity stretching and output unit;

[0035] The feature subspace division and encoding unit is used to divide the feature space into multiple feature subspaces using the first data set, and determine the center point and center point encoding of each feature subspace; wherein the division of the feature subspace is determined based on the similarity between the sample features of each training sample in the first data set, and each of the feature subspaces includes one or more similar sample features;

[0036] The mapping relationship construction unit is used to extract features from the second training samples in the second data set to obtain second training sample features; for each of the second training sample features, find the feature subspace with the closest distance among the multiple feature subspaces, encode the center point of the feature subspace as the code corresponding to the second training sample feature, use the second training sample as a query sample, calculate the similarity threshold of the query sample, use it as the stretching threshold corresponding to the second training sample feature, and establish a corresponding relationship between the code corresponding to the second training sample feature and the corresponding stretching threshold; and form a stretching threshold set corresponding to any code with all stretching thresholds corresponding to the code;

[0037] The function stretching threshold determination unit is used to extract features of the retrieved target query sample when performing information retrieval to obtain target query sample features, and for one or more feature subspaces that are closest to the target query sample features and whose center point codes have corresponding stretching threshold sets, calculate at least one function stretching threshold corresponding to the target query sample features based on the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces;

[0038] The similarity stretching and output unit is used to calculate the initial similarity between the target query sample feature and the sample features in the base database, and to stretch the initial similarity using a similarity stretching function determined based on the function stretching threshold; and is also used to output the information retrieval result for the target query sample based on the stretched similarity.

[0039] Preferably, in the mapping relationship building unit, the calculating of the similarity threshold of the query sample includes:

[0040] Based on the comparison and similarity ranking results between the second training sample feature and each sample feature in the base database, determine the first similarity threshold when the specified recognition false alarm rate is reached as the similarity threshold;

[0041] or,

[0042] According to the ranking of the similarities between the second training sample feature and each sample feature in the base database, the similarity between the sample feature of the first non-true value sample and the second training sample feature is determined as the similarity threshold.

[0043] Preferably, in the function stretching threshold determination unit, the step of calculating the function stretching threshold corresponding to the target query sample feature includes:

[0044] For one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, a stretching threshold is selected from the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces to form a threshold set for the target query sample feature;

[0045] Statistical analysis is performed on all stretching thresholds in the threshold set of the target query sample feature to obtain the function stretching threshold.

[0046] Preferably, in the function stretching threshold determination unit, selecting the stretching threshold from the stretching threshold set corresponding to the center point code of the corresponding feature subspace includes:

[0047] Determine a feature subspace that is closest to the target query sample feature and whose center point code has a corresponding stretching threshold set, select all stretching thresholds in the stretching threshold set corresponding to the center point code, or select other stretching thresholds except the stretching threshold corresponding to the singular point in the corresponding stretching threshold set to form a threshold set for the target query sample feature;

[0048] or,

[0049] Determine a plurality of feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, and select, from the stretching threshold sets corresponding to the center point codes of the respective feature subspaces, stretching thresholds corresponding to the N second training sample features that are closest to the target query sample feature, or select stretching thresholds corresponding to the second training sample features whose distance to the target query sample feature is less than a second set threshold, to form a threshold set for the target query sample feature.

[0050] Preferably, in the function stretching threshold determination unit, the statistical analysis of all stretching thresholds in the threshold set of the target query sample feature includes:

[0051] Calculating an average value of all stretching thresholds in the threshold set as the function stretching threshold;

[0052] or,

[0053] The weighted sum or weighted mean of all stretching thresholds in the threshold set is calculated as the function stretching threshold; wherein the weighting coefficient of each stretching threshold is determined according to the distance between the second training sample feature corresponding to the stretching threshold and the target query sample feature, and the closer the distance, the higher the weighting coefficient.

[0054] Preferably, the first similarity threshold is a plurality of similarity thresholds when a plurality of different specified recognition false alarm rates are reached respectively;

[0055] Correspondingly, the same center point code corresponds to multiple stretching threshold sets, and the function stretching thresholds are determined to be multiple.

[0056] Preferably, when there is only one function stretching threshold,

[0057] The similarity stretching function ensures that: the initial similarity greater than the function stretching threshold value becomes larger after stretching, and the initial similarity less than the function stretching threshold value becomes smaller after stretching; and / or,

[0058] The similarity stretching function is a piecewise function with the function stretching threshold as a dividing point; and / or,

[0059] The similarity stretching function ensures that: the closer the initial similarity is to the function stretching threshold, the greater the function curvature of the corresponding initial similarity position.

[0060] A computer-readable storage medium stores computer instructions, which, when executed by a processor, can implement any of the above-mentioned information retrieval methods.

[0061] An electronic device comprising at least a computer-readable storage medium and a processor;

[0062] The processor is used to read executable instructions from the computer-readable storage medium and execute the instructions to implement any of the above-mentioned information retrieval methods.

[0063] As can be seen from the above technical solution, in this application, the feature space is divided into multiple feature subspaces using the first data set, and the center point and center point code of each feature subspace are determined; wherein, the division of the feature subspace is determined based on the similarity between the sample features of each training sample in the first data set, and each feature subspace includes one or more similar sample features. Feature space division and coding are achieved through the above processing. Next, feature extraction is performed on the second training sample in the second data set to obtain the second training sample feature; for each second training sample feature, the feature subspace with the closest distance is found in multiple feature subspaces, and the center point code of the feature subspace is used as the code corresponding to the second training sample feature, and the similarity threshold is determined based on the similarity distribution in the retrieval and sorting results of the second training sample feature, and it is used as the stretching threshold corresponding to the second training sample feature, and a corresponding relationship is established between the code corresponding to the second training sample feature and the corresponding stretching threshold; all stretching thresholds corresponding to any code form a stretching threshold set corresponding to the code. Through the above processing of the second training data set, a mapping relationship between each code and the stretching threshold is constructed, and the stretching threshold is the similarity threshold used for true value and non-true value judgment, which is adapted to the similarity distribution of the current second training sample features; and the sample features located in the same feature subspace are relatively similar, so the sample similarity distributions corresponding to these similar sample features are also similar, and the mapping relationship between each code and the stretching threshold constructed in this way also reflects the adaptability of the stretching threshold and the sample similarity distribution. When performing information retrieval, the neural network model is used to extract the features of the retrieved target query samples to obtain the target query sample features. For one or more feature subspaces that are closest to the target query sample features and whose center point codes have corresponding stretching threshold sets, the function stretching threshold corresponding to the target query sample features is calculated based on the stretching threshold set corresponding to the center point code of the corresponding feature subspace; the similarity distribution adapted by each stretching threshold in the stretching threshold set determined in the above process is closest to the target query sample features, so the corresponding stretching thresholds should also be similar, so the function stretching threshold corresponding to the target query sample features is determined based on these similar stretching thresholds. Obviously, the calculated function stretching threshold can adapt to the similarity distribution of the target query sample features. Finally, the similarity stretching function is determined based on the function stretching threshold, and the initial similarity between the target query sample features and each sample feature in the base database is calculated, and the initial similarity is stretched using the similarity stretching function, and the information retrieval result of the target query sample is output based on the stretched similarity.Therefore, by adjusting the similarity stretching function based on the function stretching threshold that is adapted to the similarity distribution of the target query sample features, the similarity stretching processing can effectively match the similarity distribution of the target query sample features. After the stretching processing, the distance between the true value and the non-true value similarity can be effectively widened, the distinguishability between the true value and the non-true value similarity is increased, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 It is a basic flow chart of the information retrieval method in this application;

[0065] Figure 2 A schematic diagram of the four-stage division of the information retrieval method in this application;

[0066] Figure 3 Schematic diagram of feature subspace division and encoding in the embodiment of the present application Figure 1 ;

[0067] Figure 4 Schematic diagram of feature subspace division and encoding in the embodiment of the present application Figure 2 ;

[0068] Figure 5 A schematic diagram of constructing a mapping relationship between encoding and stretching threshold in an embodiment of the present application;

[0069] Figure 6 This is a schematic diagram of the similarity stretching effect in the embodiment of this application. Figure 1 ;

[0070] Figure 7 This is a schematic diagram of the similarity stretching effect in the embodiment of this application. Figure 2 ;

[0071] Figure 8 It is a basic structural diagram of the information retrieval device in this application;

[0072] Fig. 9 This is a schematic diagram of the basic structure of the electronic device provided in this application. DETAILED DESCRIPTION

[0073] In order to make the objectives, technical means and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings.

[0074] First, let's explain the sample similarity distribution, which refers to the distribution of values ​​of each similarity determined after comparing the features of the query sample with the samples in the base library. In this application, the similarity distribution is adjusted by similarity stretching without changing the order of the search results, that is, the similarity between the true value sample and the query sample is improved, and the similarity between the non-true value sample and the query sample is reduced, thereby effectively improving the similarity distinction between the true value and the non-true value, and improving the search results. The base library here refers to the sample library used during the search, and the search results that match the query sample are searched from this sample library.

[0075] When adjusting the similarity distribution, one issue needs to be considered - the boundary between true value samples and non-true value samples, that is, the similarity threshold. For different similarity distributions, the value of the similarity threshold varies. Therefore, it is necessary to determine a similarity threshold that is adapted to the similarity distribution of the target query sample in order to accurately distinguish true value samples from non-true value samples, thereby improving the similarity of true value samples and reducing the similarity of non-true value samples. Here, the similarity threshold adapted to the similarity distribution is also the stretching threshold of the similarity stretching function, which is used to distinguish different stretching methods (i.e., improving the similarity of true value samples and reducing the similarity of non-true value samples).

[0076] Figure 1 Schematic diagram of the basic flow of the information retrieval method in this application. Figure 1 As shown, the method includes:

[0077] Step 101: divide the feature space into multiple feature subspaces using the first data set, and determine the center point and center point code of each feature subspace.

[0078] The division of the feature subspace is determined based on the similarity between the sample features of each training sample in the first data set, and each feature subspace includes one or more similar sample features.

[0079] Specifically, a neural network model is used to extract features from the training samples included in the first data set to obtain training sample features; based on the similarity between the features of each training sample, the feature space is divided into multiple feature subspaces, the center point of each training sample feature in each feature subspace is determined, and each center point is encoded to uniquely mark each center point and its corresponding feature subspace. Here, in order to distinguish from other subsequent training samples and training sample features, the training samples included in the first data set are referred to as first training samples, the training sample features obtained after feature extraction of the first training samples are referred to as first training sample features, and all first training sample features form a first training sample feature set.

[0080] In more detail, in a feature expression space (such as an image feature space, a text feature space, etc.), the closer the distance between sample features, the more similar the samples are, and the farther the distance is, the greater the difference in sample features. According to the spatial distribution relationship of all first training sample features in the first training sample feature set, the feature space is divided into several feature subspaces, each feature subspace having several first training sample features with different features and similarity. For each feature subspace, determine the center point representing the current subspace and encode the center point. The center point can approximately represent all sample features of the feature subspace, and the sample features in the same feature subspace have the same encoding. Feature space division and encoding can help sample features quickly and accurately find the feature subspace to which they belong by matching the center point of the feature subspace, determining the feature space encoding, and finding a set of sample features with similar features.

[0081] Step 102: extract features from the second training samples in the second data set to obtain features of the second training samples.

[0082] This step extracts features from the second training sample in the second data set. The specific method of feature extraction is the same as step 101. The same neural network model is used for feature extraction. The extracted sample features are called second training sample features. To avoid the influence of homologous data on the robustness of the solution, the sample sources of the second data set and the first data set can be different.

[0083] Step 103: for each second training sample feature, find the feature subspace closest to it in multiple feature subspaces, encode the center point of the feature subspace as the code corresponding to the second training sample feature, determine the similarity threshold based on the similarity distribution in the retrieval and ranking results of the second training sample feature, use it as the stretching threshold corresponding to the second training sample feature, and establish a corresponding relationship between the code corresponding to the second training sample feature and the corresponding stretching threshold; and combine all stretching thresholds corresponding to any code into a stretching threshold set corresponding to the code.

[0084] This step is used to construct a mapping relationship between the encoding and the stretching threshold. Samples with similar features are located close to each other in the feature expression space, and their feature subspaces share the same encoding. At the same time, the similarity distribution of sample retrieval results with similar features is also similar, so the adapted similarity threshold and stretching threshold are also similar. Therefore, the sample features can be used as a link to establish an association relationship between the encoding of the feature subspace and the stretching threshold adapted to the sample features corresponding to the encoding.

[0085] For each second training sample feature, search the nearest neighbor feature subspace in each feature subspace determined in step 101 according to the corresponding sample feature; wherein, searching the nearest neighbor feature subspace can specifically be searching the center point closest to the sample feature in the center point of each feature subspace, and the feature subspace where the center point is located is also the nearest neighbor feature subspace; then, obtain the code corresponding to the center point of the nearest neighbor feature subspace as the code corresponding to the second training sample feature. Then, take the second training sample as the query sample, compare it with each sample feature in the base library, and calculate the similarity threshold corresponding to the query sample according to the similarity ranking result obtained by comparison. The similarity threshold is adapted to the similarity distribution of the second training sample, and this threshold is used as the stretching threshold corresponding to the second training sample feature. Finally, with the second training sample feature as a bridge, establish a corresponding relationship between the code corresponding to the second training sample feature and the corresponding stretching threshold, that is, save the corresponding stretching threshold for the code of the second training sample feature. The above operation is performed for each second training sample, and a certain code may correspond to different second training sample features, and may also correspond to different stretching thresholds. All stretching thresholds corresponding to any code are combined into a stretching threshold set corresponding to the code, thus constructing a mapping relationship between the code and the stretching threshold.

[0086] In addition, in order to ensure the completeness of the mapping relationship between the encoding and the stretching threshold, preferably, the second data set should have diversity in terms of data sources, scenarios, etc.

[0087] Step 104, when performing information retrieval, feature extraction is performed on the retrieved target query sample to obtain the target query sample feature, and for one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, based on the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces, at least one function stretching threshold corresponding to the target query sample feature is calculated.

[0088] For any target query sample to be retrieved, feature extraction is first performed, and the same feature extraction method as step 101 and step 102 is still used to extract the target query sample features; next, in all feature subspaces where the center point code has a corresponding stretching threshold set, one or more feature subspaces closest to the target query sample features are searched; the reason why the center point code is required to have a corresponding stretching threshold set is that the second training sample set may not evenly cover all feature subspaces. Through the processing of steps 102 to 103, the codes of some feature subspaces have not determined the corresponding stretching threshold set, and this step needs to calculate the stretching threshold according to the stretching threshold set corresponding to the center point code, so it is necessary to search in the feature subspace where the center point code has a corresponding stretching threshold set, and no longer consider the feature subspace where the stretching threshold set does not exist. When searching specifically, the distance between the target query sample feature and the center point of the corresponding feature subspace can be calculated, and the distance is used as the distance between the target query sample feature and the corresponding feature subspace.

[0089] Then, for the feature subspace found, it is relatively close to the target query sample feature, that is, the center point feature of the feature subspace is similar to the target query sample feature, and the corresponding sample similarity distribution is also similar. Then, accordingly, the stretching threshold (hereinafter referred to as the function stretching threshold) adapted to the target query sample feature is also similar to the stretching threshold corresponding to the center point feature of these feature subspaces. Therefore, in this application, the function stretching threshold corresponding to the target query sample feature is calculated based on the stretching threshold set corresponding to the number of these feature subspaces, that is, the function stretching threshold is calculated based on these similar stretching thresholds, and it can be ensured that the calculated function stretching threshold is adapted to the similarity distribution of the target query sample feature.

[0090] Optionally, when calculating the function stretching threshold, the stretching threshold that meets the set requirements can be selected from the stretching threshold set found above to form a threshold set; then all the stretching thresholds in the threshold set are statistically analyzed to obtain the function stretching threshold. The statistical analysis can adopt various existing methods, such as averaging, summing, weighted summing, weighted averaging, etc.

[0091] As above, the function stretching threshold adapted to the target query sample characteristics can be calculated. Since the scale of the mapping relationship between the center point code and the stretching threshold is fixed, that is, the center point code range is fixed, the time consumption of searching for the stretching threshold that meets the requirements and calculating the function stretching threshold is controllable.

[0092] Step 105, calculate the initial similarity between the target query sample feature and each sample feature in the base database, determine the similarity stretching function based on the function stretching threshold, and stretch the initial similarity using the similarity stretching function determined based on the function stretching threshold.

[0093] In order to improve the distinguishability of true values ​​and non-true values ​​in the retrieval results and increase the recall rate of true values ​​in high similarity intervals, the similarity of the retrieval results is adaptively adjusted using a similarity stretching function. That is, for the initial similarity determined in the existing manner, the initial similarity is stretched using a similarity stretching function to obtain a stretched similarity.

[0094] As mentioned above, in order to ensure that the similarity stretching achieves the expected effect, that is, to increase the similarity of the true value sample and reduce the similarity of the non-true value sample, it is necessary to determine the similarity threshold adapted to the current target query sample, and use this threshold as the stretching threshold to distinguish different stretching methods on both sides of the stretching threshold. For the part less than the stretching threshold (i.e., the similarity is lower than the stretching threshold, indicating that the corresponding sample retrieval result is a non-true value), its similarity is reduced, and for the part greater than the stretching threshold (i.e., the similarity is higher than the stretching threshold, indicating that the corresponding sample retrieval result is a true value), its similarity is increased. The function stretching threshold obtained in the above step 104 is the stretching threshold adapted to the target query sample feature.

[0095] Therefore, the specific stretching process of the initial similarity in the present application includes: stretching the initial similarity based on a similarity stretching function determined by a function stretching threshold.

[0096] Further optionally, according to the actual scene requirements, the function stretching threshold calculated in step 104 can be one or more. In this step, the similarity stretching function is divided into two or more different expression intervals. These function stretching thresholds are all matched with the similarity distribution of the target query sample features. Those skilled in the art can set the expressions of the similarity stretching function in different intervals based on experience, so that the similarity of the true value sample becomes larger after stretching, and the similarity of the non-true value sample becomes smaller, thereby increasing the distinguishability between the similarity between the true value and the non-true value. Generally, relative to the initial similarity function (generally a straight line), the function curvature at the position within the set range near each function stretching threshold (the set ranges near different function stretching thresholds are preferably not overlapped) can be increased, and the similarity function value at the position greater than the function stretching threshold is increased, and the similarity function value at the position less than the function stretching threshold is reduced. The specific function stretching effect can be designed as needed based on the above principles.

[0097] For example, when the determined function stretching threshold is one, the similarity stretching function ensures that the order of the similarities before and after stretching remains unchanged, and ensures that: the initial similarity greater than the function stretching threshold becomes larger after stretching, and the initial similarity less than the function stretching threshold becomes smaller after stretching.

[0098] Through the above processing, the similarity of the target query sample is adaptively adjusted to obtain the stretched similarity, and the distinguishability of the similarity between the true value and the non-true value can be improved.

[0099] Step 106: output the information retrieval result for the target query sample based on the stretched similarity.

[0100] The processing of this step is the same as the existing processing, and will not be repeated here. Through this step, the similarity after stretching is improved in terms of the distinguishability of the true value and the non-true value, and the information retrieval result based on this output can effectively improve the user experience.

[0101] At this point, the information retrieval method process in this application ends.

[0102] The above method flow specifically includes four stages: the first stage, through step 101, feature space division and encoding; the second stage, through steps 102-103, the mapping relationship between the center point encoding and the stretching threshold set is constructed; the third stage, through step 104, the function stretching threshold corresponding to the target query sample feature is determined; the fourth stage, through steps 105-106, the similarity is stretched, and the retrieval result based on the stretched similarity is output. The general process can be referred to Figure 2 .

[0103] The following is a specific implementation example of the information retrieval method in the present application. Figure 2 The four-stage process is described in the following.

[0104] Phase 1: Partitioning and encoding of feature space

[0105] In this embodiment, the first stage is implemented as follows: Figure 3 As shown. The general model is used to extract features from all the first training samples in the first data set to obtain the first training sample features and form the first training sample feature set. The feature space division and encoding can use the vector quantization method, which is essentially to cluster the sample features in the first training sample feature set, determine the class center of each class, and encode the class center. Various existing methods can be used for specific space division and encoding. A feature subspace encoding book is generated based on the class centers of all feature subspaces and their encodings, and the correspondence between the feature subspace and the class center (i.e., the center point of the feature subspace) and the class center encoding is recorded.

[0106] For high-dimensional feature vectors, in order to reduce the difficulty of feature space division, the product quantization method (ProductQuantization) can be used. First, the feature space is divided into several sub-regions, that is, the first training sample feature is divided into several sub-vectors. In each sub-region, feature clustering is performed based on the sample feature sub-vectors of the corresponding sub-region, and several component spaces and their class centers and class center codes in the corresponding sub-region are determined; the component spaces between different sub-regions are combined to obtain feature subspaces, and the class centers and their codes between different sub-regions are combined to obtain the center points and center point codes of the corresponding feature subspaces.

[0107] by Figure 4 For example, all the first training sample features are divided into two sub-vectors, and the dimension of each sub-vector is D, which is equivalent to dividing the feature space into two sub-regions; all the first sub-vectors in the first training sample feature set are clustered using clustering methods such as KMeans to determine K component spaces and the corresponding K class centers, and the class centers are encoded as x, that is, K component spaces and their class centers are determined in the first sub-region; all the second sub-vectors in the second training sample feature set are clustered using clustering methods such as KMeans to determine K component spaces and the corresponding K class centers, and the class centers are encoded as y, that is, K component spaces and their class centers are determined in the second sub-region; the K component spaces in the first region are combined with the K component spaces in the second region to obtain K 2 feature subspaces, the center point encoding of the feature subspace is represented by the class center encodings x and y of the combined two component spaces, such as K x+y.

[0108] The second stage: construct the mapping relationship between the center point encoding of the feature subspace and the stretching threshold;

[0109] In this embodiment, the implementation example of the second stage is as follows Figure 5 The specific processing steps include:

[0110] Step 1: Use the general model to extract features from all second training samples in the second data set to obtain second training sample features to form a second training sample feature set.

[0111] Step 2: For each second training sample feature, find the closest feature subspace and its center point code in the feature subspace codebook of the first stage, and use the center point code as the center point code corresponding to the second training sample feature.

[0112] Specifically, assume that the feature space is divided into M sub-regions, each sub-region contains K class centers, and the vector dimension of the class center is D. Divide the sample feature vector in the second training sample feature set into M sub-vectors, and the dimension of the sub-vector is equal to the class center. The sub-vectors are compared with the class centers of the corresponding component spaces respectively, and the encoding of the class center with the closest distance is determined. Based on the encoding of the class center with the closest distance determined in each component subspace, the encoding of the center point corresponding to the closest feature subspace is determined in the same way as the encoding of the center point of the feature subspace in the first stage, for example Figure 4 and Figure 5 Here, for different second training sample features, the corresponding center point codes determined may be the same.

[0113] Step three: for each second training sample feature, use it as a query sample feature, calculate the corresponding similarity threshold, and use it as the stretching threshold corresponding to the second training sample feature.

[0114] Specifically, the method for calculating the sample stretching threshold is also the method for calculating the similarity threshold, which can use but is not limited to the following two methods:

[0115] Method 1, using the similarity threshold corresponding to the specified recognition false alarm rate as the stretching threshold. Specifically, construct positive and negative sample pairs of the second training sample and the base library sample, the retrieval results are the same target as the positive pair, and the retrieval results are different targets as the negative pair. The proportion of negative pairs above the similarity threshold in the retrieval ranking results to the total negative pairs is called the false alarm rate, and the similarity threshold corresponding to the specified false alarm rate is used as the stretching threshold corresponding to the second training sample, i.e., the corresponding sample feature;

[0116] Method 2, according to the ranking of the similarities between the second training sample feature and the features of each sample in the base library, the similarity between the sample feature of the first non-true value sample and the second training sample feature is determined as the similarity threshold, that is, the stretching threshold. In other words, the second training sample is compared with each sample in the base library, and according to the determined similarity ranking, the first sample in the base library corresponding to a different target from the second training sample is determined, and the corresponding similarity is used as the similarity threshold, that is, the stretching threshold corresponding to the second training sample feature.

[0117] Step 4: For each second training sample feature, establish a corresponding relationship between its corresponding center point code and the corresponding stretching threshold. As mentioned above, different second training sample features may correspond to the same center point code, so the same center point code may correspond to different stretching thresholds, that is, the center point code and the stretching threshold may be a one-to-many relationship, and all stretching thresholds corresponding to the same center point code form a stretching threshold set.

[0118] Specifically, the encoding value of the center point can be used as a key, and the stretching threshold set of the same encoding value can be used as a value to obtain a center point encoding and stretching threshold mapping table. At the same time, the corresponding relationship between the second training sample feature and the stretching threshold is also saved.

[0119] Phase 3: Determine the function stretching threshold corresponding to the target query sample feature

[0120] As mentioned above, the third stage performs actual retrieval processing, and uses the general model to extract features of the retrieved target query samples to obtain the target query sample features; in the feature subspace determined in the first stage, select M feature subspaces that are closest to the target query sample features and whose center point codes have corresponding stretching threshold sets, where M is a preset positive integer.

[0121] When searching for feature subspaces, various existing methods can be used, such as the inverted index table method, to sequentially search for the feature subspace closest to the target query sample feature, and determine whether the center point code of the feature subspace has a corresponding stretching threshold set. If so, it is used as one of the M feature subspaces to be selected. If not, the subsequent feature subspaces are searched until the M feature subspaces are selected and the search is stopped. The inverted index table method finds the stretching threshold set of the center point code of the nearest neighbor feature subspace with the least number of traversals, avoiding traversing all feature subspaces, so the search efficiency is high.

[0122] After selecting M feature subspaces, a stretching threshold is selected from the stretching threshold sets corresponding to the center point codes of the M feature subspaces to form a threshold set corresponding to the target query sample feature. The specific threshold set can be determined by, but is not limited to, the following two methods:

[0123] Method Example 1: Hard Partitioning

[0124] Usually, sample features in the same feature subspace use the same center point encoding, and the corresponding stretching thresholds are slightly different. Therefore, M can be set to 1, that is, a feature subspace with the closest distance and a stretching threshold set is selected, and all stretching thresholds are selected from the corresponding stretching threshold set to form the threshold set corresponding to the target query sample feature.

[0125] Alternatively, considering that there is a certain loss in feature space quantization, that is, there may be sample features with large individual feature differences in the same feature subspace, which affects the accuracy of threshold calculation. The samples corresponding to such sample features are called singular points. A feature subspace with the closest distance and a set of stretched thresholds can be determined. In the set of stretched thresholds corresponding to the central point encoding of the feature subspace, all other stretched thresholds except the stretched threshold corresponding to the singular point are selected to form a threshold set corresponding to the target query sample feature, which is used to calculate the function stretched threshold corresponding to the target query sample feature. Among them, the singular point refers to a point in the second training sample.

[0126] Method Example 2: Soft Partitioning

[0127] In the vicinity of the nearest neighbor subspace, there are still some sample features similar to the target query sample features in other adjacent feature subspaces of the target query sample features, such as Figure 3 As shown in the quantized outer neighboring area. Considering this kind of situation, the stretching threshold selection can be performed as follows: determine multiple feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, and select the stretching thresholds corresponding to the N second training sample features that are closest to the target query sample feature from the stretching threshold sets corresponding to the center point codes of each determined feature subspace, or select the stretching thresholds corresponding to the second training sample features that are less than the second set threshold from the target query sample feature to form the threshold set of the target query sample feature. In this way, the influence of singular values ​​in the same feature subspace on the result threshold can be eliminated, and similar thresholds in the neighboring feature space can be covered, so as to ensure the accuracy and adaptability of the result threshold.

[0128] After determining the threshold set of the target query sample feature, statistical analysis is performed on all stretching thresholds in the threshold set to determine the function stretching threshold corresponding to the target query sample feature. The statistical analysis method may adopt various existing methods, such as summing, averaging, weighted summing, weighted averaging, etc.

[0129] The method of calculating the average value may specifically be: calculating the average value of all stretching thresholds in the threshold set of the target query sample feature, and using the average value as the function stretching threshold;

[0130] The specific method for calculating the weighted sum and weighted mean can be: calculating the weighted sum or weighted mean of all stretching thresholds in the threshold set of the target query sample feature as the function stretching threshold; wherein the weighting coefficient of each stretching threshold is determined according to the distance between the second training sample feature corresponding to the stretching threshold and the target query sample feature, and the closer the distance, the higher the weighting coefficient.

[0131] Phase 4: Similarity stretching and retrieval result output

[0132] In this stage, the target query sample features are used to compare with the base database sample features to obtain the initial similarity. The function stretching threshold corresponding to the initial similarity and the target query sample features is used as the input of the similarity stretching function, and the stretched similarity is calculated and output. The retrieval results are displayed according to the stretched similarity to complete the similarity stretching.

[0133] The adaptive stretching transformation function in this embodiment has the following three characteristics:

[0134] (1) Monotonically increasing, with an expression range of [0, 1], satisfying the similarity sorting characteristics;

[0135] (2) Use the function stretching threshold as the dividing point and stretch in sections. Most of the samples whose initial similarity is greater than the function stretching threshold are true values, so the similarity values ​​of these samples are increased. Similarly, most of the samples whose initial similarity is less than the stretching threshold are false values, and the similarity values ​​of these samples need to be reduced;

[0136] (3) Near the stretching threshold of the function, the curvature of the function is large, and the curvature at both ends of the function is gentle. Analysis of the search results shows that the confidence that the two parts of samples with smaller and larger similarities belong to non-true values ​​and true values ​​respectively is very high, so the degree of similarity transformation of these two parts is relatively gentle. However, it is more difficult to distinguish the similarity of positive and negative samples in the area near the similarity threshold dividing point. Therefore, the curvature of the stretching transformation function is larger near the stretching threshold, that is, the function is relatively steep.

[0137] In this embodiment, it is assumed that the function stretching threshold is one. In order to meet the above requirements, different asymmetric sigmoid functions are applied on both sides of the function stretching threshold, and the slopes and offsets of the functions on both sides are adjusted. The general definition of the similarity stretching function is as shown in formula (2):

[0138] (2)

[0139] in, x 0 represents the dividing point of different stretching methods in the function, that is, the stretching threshold. Parameter c controls the maximum and minimum value range of the similarity stretching function output. Since the similarity output range is [0, 1], c=1. Parameters a and b must satisfy the function monotonically increasing. When the input is 0, the output is close to 0, and when the input is 1, the output is close to 1. The function passes the dividing point ( x 0, x 0). and are the slope parameters on the left and right sides, respectively, used to control the stretching amplitude. The schematic diagram of the similarity stretching effect is shown in Figure 6As shown, the inclined straight line simulates the similarity function without stretching, and the inclined curve represents the similarity stretching function. By comparing the function curves in the figure, it can be seen that the stretching function meets the transformation requirements. For the initial similarity greater than the stretching threshold, the similarity is improved after stretching; for the initial similarity less than the stretching threshold, the similarity is reduced after stretching, which can effectively improve the similarity distinction between the true value and the non-true value.

[0140] Of course, there can be multiple function stretching thresholds. For example, in method 1 of step three of the second stage mentioned above, multiple specified recognition false alarm rates can be set. For each specified recognition false alarm rate, a similarity threshold corresponding to the false alarm rate can be obtained, thereby obtaining multiple similarity thresholds; accordingly, multiple stretching threshold sets can be obtained in step four of the second stage; then, multiple function stretching thresholds can be obtained in the third stage. Thus, by using X function stretching thresholds, the similarity stretching function can be divided into X+1 different expression intervals, and the stretching method of each interval is flexible and variable. The specific stretching method can be set as needed, and it is only necessary to ensure that the true value similarity becomes larger and the non-true value similarity becomes smaller. For example, three function stretching thresholds [0.7, 0.8, 0.9], where the value of the initial similarity is reduced in the interval [0, 0.7], and the value of the initial similarity is increased in the interval [0.9, 1], and the intervals (0.7, 0.8] and [0.8, 0.9) are translated and stretched. For another example Figure 7 As shown, the function stretching threshold has 5 thresholds from threshold 1 to threshold 5. Figure 7 Five examples of function expressions in different intervals under different function stretching thresholds are given.

[0141] At this point, the information retrieval method process in this embodiment ends.

[0142] The information retrieval method of the present application has the following effects:

[0143] (1) The function stretching threshold is adaptive to sample features. This application proposes that the adaptive stretching threshold varies according to the sample. Different samples have different similarity distributions and different stretching positions. Through the correlation between the center point encoding and the stretching threshold, the stretching position that meets the sample is found, and the sample and stretching threshold are adaptive, which solves the problem of poor adaptability between fixed threshold stretching and sample similarity distribution;

[0144] (2) The stretching function is adaptive to sample features. This application proposes a stretching function based on a stretching threshold with different stretching strengths in different similarity intervals. It is difficult to distinguish between true value and non-true value similarity near the stretching threshold, and the stretching function has a larger stretching strength in this interval. The confidence that samples in intervals with smaller and larger similarities belong to non-true values ​​and true values ​​is very high, and the stretching function has a smaller stretching strength in this interval; different stretching strengths in different intervals can make the adjusted similarity distribution more obvious;

[0145] (3) The similarity stretching method of the present application is highly efficient. The stretching process mainly involves finding the threshold and stretching calculation. Since the mapping relationship between feature coding and stretching threshold is fixed in scale, finding the threshold through feature coding is efficient, so the stretching threshold can be quickly determined, reducing the impact of the stretching process on the retrieval time.

[0146] (4) The information retrieval method of the present application is universal. Regardless of whether the data is in various modalities such as images or texts, the stretching method can be adapted to all retrieval tasks related to similarity ranking.

[0147] (5) Improve user experience and enhance product competitiveness. By stretching similarity, we can improve the similarity distribution of search results, enhance the distinction between true values ​​and false values, and make the search results more in line with user expectations, thereby enhancing algorithm advantages and product competitiveness.

[0148] The above is the specific implementation of the information retrieval method in this application. This application also provides an information retrieval device, which can be used to implement the above information retrieval method. Figure 8 FIG. 1 is a schematic diagram of the basic structure of the information retrieval device in this application. Figure 8 As shown, the device includes: a feature subspace division and encoding unit, a mapping relationship construction unit, a function stretching threshold determination unit, a similarity stretching and output unit;

[0149] The feature subspace division and encoding unit is used to divide the feature space into multiple feature subspaces using the first data set, and determine the center point and center point encoding of each feature subspace; wherein the division of the feature subspace is determined based on the similarity between the sample features of each training sample in the first data set, and each feature subspace includes one or more similar sample features;

[0150] A mapping relationship construction unit is used to extract features from the second training samples in the second data set to obtain second training sample features; for each second training sample feature, find the feature subspace with the closest distance in multiple feature subspaces, encode the center point of the feature subspace as the code corresponding to the second training sample feature, use the second training sample as a query sample, calculate the similarity threshold of the query sample, use it as the stretching threshold corresponding to the second training sample feature, and establish a corresponding relationship between the code corresponding to the second training sample feature and the corresponding stretching threshold; all stretching thresholds corresponding to any code form a stretching threshold set corresponding to the code;

[0151] The function stretching threshold determination unit is used to extract features of the retrieved target query sample when performing information retrieval to obtain target query sample features, and for one or more feature subspaces that are closest to the target query sample features and whose center point codes have corresponding stretching threshold sets, calculate at least one function stretching threshold corresponding to the target query sample features based on the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces;

[0152] The similarity stretching and output unit is used to calculate the initial similarity between the target query sample features and the sample features in the base database, and to stretch the initial similarity using a similarity stretching function determined based on a function stretching threshold; and is also used to output the information retrieval result for the target query sample based on the stretched similarity.

[0153] Optionally, in the mapping relationship building unit, the process of calculating the similarity threshold of the query sample may specifically include:

[0154] Based on the comparison and similarity ranking results between the second training sample feature and the features of each sample in the base database, determine the first similarity threshold when the specified recognition false alarm rate is reached as the similarity threshold;

[0155] or,

[0156] According to the ranking of the similarities between the second training sample feature and each sample feature in the base database, the similarity between the sample feature of the first non-true value sample and the second training sample feature is determined as the similarity threshold.

[0157] Optionally, in the function stretching threshold determination unit, the process of calculating the function stretching threshold corresponding to the target query sample feature may specifically include:

[0158] For one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, a stretching threshold is selected from the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces to form a threshold set for the target query sample feature;

[0159] By performing statistical analysis on all stretching thresholds in the threshold set of the target query sample feature, the function stretching threshold can be obtained.

[0160] Optionally, in the function stretching threshold determination unit, the process of selecting the stretching threshold from the stretching threshold set corresponding to the center point code of the corresponding feature subspace may specifically include:

[0161] Determine a feature subspace that is closest to the target query sample feature and whose center point code has a corresponding stretching threshold set, select all stretching thresholds in the stretching threshold set corresponding to the center point code, or select other stretching thresholds except the stretching threshold corresponding to the singular point in the corresponding stretching threshold set to form a threshold set for the target query sample feature;

[0162] or,

[0163] Determine a plurality of feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets. Select the stretching thresholds corresponding to the N second training sample features that are closest to the target query sample feature from the stretching threshold sets corresponding to the center point codes of the feature subspaces, or select the stretching thresholds corresponding to the second training sample features that are closer to the target query sample feature than the second set threshold to form a threshold set for the target query sample feature.

[0164] Optionally, in the function stretching threshold determination unit, the process of performing statistical analysis on all stretching thresholds in the threshold set of the target query sample feature may specifically include:

[0165] Calculate the average value of all stretching thresholds in the threshold set as the function stretching threshold;

[0166] or,

[0167] The weighted sum or weighted mean of all stretching thresholds in the threshold set is calculated as the function stretching threshold; wherein the weighting coefficient of each stretching threshold is determined according to the distance between the second training sample feature corresponding to the stretching threshold and the target query sample feature, and the closer the distance, the higher the weighting coefficient.

[0168] Optionally, the first similarity threshold is a plurality of similarity thresholds when a plurality of different specified recognition false alarm rates are reached respectively;

[0169] Accordingly, the same center point code corresponds to multiple stretching threshold sets, and the number of determined function stretching thresholds is multiple.

[0170] Optionally, when there is only one function stretching threshold,

[0171] The similarity stretching function ensures that: the initial similarity greater than the function stretching threshold becomes larger after stretching, and the initial similarity less than the function stretching threshold becomes smaller after stretching; and / or,

[0172] The similarity stretching function is a piecewise function with a function stretching threshold as a dividing point; and / or,

[0173] The similarity stretching function ensures that: the closer the initial similarity distance function stretching threshold is, the greater the function curvature of the corresponding initial similarity position is.

[0174] The present application also provides a computer-readable storage medium, which stores instructions, and when the instructions are executed by a processor, the steps in the information retrieval method described above can be executed. In practical applications, the computer-readable medium can be included in each device / apparatus / system in the above embodiments, or it can exist independently without being assembled into the device / apparatus / system. Instructions are stored in the computer-readable storage medium, and when the instructions stored in the computer-readable storage medium are executed by a processor, the steps in the information retrieval method described above can be executed.

[0175] According to the embodiments disclosed in the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof, but it is not used to limit the scope of protection of the present application. In the embodiments disclosed in the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0176] Fig. 9 This application also provides an electronic device. Fig. 9 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:

[0177] The electronic device may include a processor 901 with one or more processing cores, a memory 902 with one or more computer-readable storage media, and a computer program stored in the memory and executable on the processor. When the program in the memory 902 is executed, an information retrieval method may be implemented.

[0178] Specifically, in practical applications, the electronic device may further include components such as a power supply 903, an input / output unit 904, etc. Those skilled in the art may understand that Fig. 9 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0179] Processor 901 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the server and processes data by running or executing software programs and / or modules stored in memory 902 and calling data stored in memory 902, thereby monitoring the electronic device as a whole.

[0180] The memory 902 can be used to store software programs and modules, that is, the above-mentioned computer-readable storage medium. The processor 901 executes various functional applications and data processing by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 902 may also include a memory controller to provide the processor 901 with access to the memory 902.

[0181] The electronic device also includes a power supply 903 for supplying power to various components, which can be logically connected to the processor 901 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 903 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0182] The electronic device may also include an input and output unit 904, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, and optical signal inputs related to user settings and function control. The input unit output 904 may also be used to display information input by the user or information provided to the user and various graphical user interfaces, which may be composed of graphics, text, icons, videos, and any combination thereof.

[0183] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An information retrieval method, characterized in that: include: Using the first data set, the feature space is divided into a plurality of feature subspaces, and the center point and the center point code of each feature subspace are determined; wherein the division of the feature subspace is determined based on the similarity between the sample features of each training sample in the first data set, and each of the feature subspaces includes one or more similar sample features; Extract features from the second training samples in the second data set to obtain second training sample features; for each of the second training sample features, find the feature subspace with the closest distance among the multiple feature subspaces, encode the center point of the feature subspace as the code corresponding to the second training sample feature, use the second training sample as a query sample, calculate the similarity threshold of the query sample, use it as the stretching threshold corresponding to the second training sample feature, and establish a corresponding relationship between the code corresponding to the second training sample feature and the corresponding stretching threshold; combine all stretching thresholds corresponding to any code into a stretching threshold set corresponding to the code; When performing information retrieval, feature extraction is performed on the retrieved target query sample to obtain the target query sample feature, and for one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, at least one function stretching threshold corresponding to the target query sample feature is calculated based on the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces; Calculating the initial similarity between the target query sample feature and each sample feature in the base database, and stretching the initial similarity using a similarity stretching function determined based on the function stretching threshold; wherein the base database is a sample database used for retrieval; Based on the stretched similarity, an information retrieval result for the target query sample is output.

2. The method according to claim 1, characterized in that: The calculating the similarity threshold of the query sample includes: Based on the comparison and similarity ranking results between the second training sample feature and each sample feature in the base database, determine the first similarity threshold when the specified recognition false alarm rate is reached as the similarity threshold; or, According to the ranking of the similarities between the second training sample feature and each sample feature in the base database, the similarity between the sample feature of the first non-true value sample and the second training sample feature is determined as the similarity threshold.

3. The method according to claim 1, characterized in that The calculating the stretching threshold corresponding to the target query sample feature includes: For one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, a stretching threshold is selected from the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces to form a threshold set for the target query sample feature; Statistical analysis is performed on all stretching thresholds in the threshold set of the target query sample feature to obtain the function stretching threshold.

4. The method according to claim 3, characterized in that: The step of selecting a stretching threshold value from a stretching threshold value set corresponding to the center point code of the corresponding feature subspace includes: Determine a feature subspace that is closest to the target query sample feature and whose center point code has a corresponding stretching threshold set, select all stretching thresholds in the stretching threshold set corresponding to the center point code, or select other stretching thresholds except the stretching threshold corresponding to the singular point in the corresponding stretching threshold set to form a threshold set for the target query sample feature; or, Determine a plurality of feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, and select, from the stretching threshold sets corresponding to the center point codes of the respective feature subspaces, stretching thresholds corresponding to the N second training sample features that are closest to the target query sample feature, or select stretching thresholds corresponding to the second training sample features whose distance to the target query sample feature is less than a second set threshold, to form a threshold set for the target query sample feature.

5. The method according to claim 3, characterized in that: The statistical analysis of all stretching thresholds in the threshold set of the target query sample feature includes: Calculating an average value of all stretching thresholds in the threshold set as the function stretching threshold; or, The weighted sum or weighted mean of all stretching thresholds in the threshold set is calculated as the function stretching threshold; wherein the weighting coefficient of each stretching threshold is determined according to the distance between the second training sample feature corresponding to the stretching threshold and the target query sample feature, and the closer the distance, the higher the weighting coefficient.

6. The method according to claim 2, characterized in that The first similarity threshold is a plurality of similarity thresholds when a plurality of different specified recognition false alarm rates are reached respectively; Correspondingly, the same center point code corresponds to multiple stretching threshold sets, and the function stretching thresholds are determined to be multiple.

7. The method according to claim 1, characterized in that When there is only one function stretching threshold, The similarity stretching function ensures that: the initial similarity greater than the function stretching threshold value becomes larger after stretching, and the initial similarity less than the function stretching threshold value becomes smaller after stretching; and / or, The similarity stretching function is a piecewise function with the function stretching threshold as a dividing point; and / or, The similarity stretching function ensures that: the closer the initial similarity is to the function stretching threshold, the greater the function curvature of the corresponding initial similarity position.

8. An information retrieval device, characterized in that: include: Feature subspace division and encoding unit, mapping relationship construction unit, function stretching threshold determination unit, similarity stretching and output unit; The feature subspace division and encoding unit is used to divide the feature space into multiple feature subspaces using the first data set, and determine the center point and center point encoding of each feature subspace; wherein the division of the feature subspace is determined based on the similarity between the sample features of each training sample in the first data set, and each of the feature subspaces includes one or more similar sample features; The mapping relationship construction unit is used to extract features from the second training samples in the second data set to obtain second training sample features; for each of the second training sample features, find the feature subspace with the closest distance among the multiple feature subspaces, encode the center point of the feature subspace as the code corresponding to the second training sample feature, use the second training sample as a query sample, calculate the similarity threshold of the query sample, use it as the stretching threshold corresponding to the second training sample feature, and establish a corresponding relationship between the code corresponding to the second training sample feature and the corresponding stretching threshold; and form a stretching threshold set corresponding to any code with all stretching thresholds corresponding to the code; The function stretching threshold determination unit is used to extract features of the retrieved target query sample when performing information retrieval to obtain target query sample features, and for one or more feature subspaces that are closest to the target query sample features and whose center point codes have corresponding stretching threshold sets, calculate at least one function stretching threshold corresponding to the target query sample features based on the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces; The similarity stretching and output unit is used to calculate the initial similarity between the target query sample features and the sample features in the base library, and to stretch the initial similarity using a similarity stretching function determined based on the function stretching threshold; and is also used to output the information retrieval result for the target query sample based on the stretched similarity; wherein the base library is a sample library used for retrieval.

9. The device according to claim 8, characterized in that In the mapping relationship building unit, the calculating of the similarity threshold of the query sample includes: Based on the comparison and similarity ranking results between the second training sample feature and each sample feature in the base database, determine the first similarity threshold when the specified recognition false alarm rate is reached as the similarity threshold; or, According to the ranking of the similarities between the second training sample feature and each sample feature in the base database, the similarity between the sample feature of the first non-true value sample and the second training sample feature is determined as the similarity threshold.

10. The device according to claim 8, characterized in that In the function stretching threshold determination unit, the calculation of the function stretching threshold corresponding to the target query sample feature includes: For one or more feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, a stretching threshold is selected from the stretching threshold sets corresponding to the center point codes of the corresponding feature subspaces to form a threshold set for the target query sample feature; Statistical analysis is performed on all stretching thresholds in the threshold set of the target query sample feature to obtain the function stretching threshold.

11. The device according to claim 10, characterized in that In the function stretching threshold determination unit, selecting a stretching threshold from a stretching threshold set corresponding to the center point code of the corresponding feature subspace includes: Determine a feature subspace that is closest to the target query sample feature and whose center point code has a corresponding stretching threshold set, select all stretching thresholds in the stretching threshold set corresponding to the center point code, or select other stretching thresholds except the stretching threshold corresponding to the singular point in the corresponding stretching threshold set to form a threshold set for the target query sample feature; or, Determine a plurality of feature subspaces that are closest to the target query sample feature and whose center point codes have corresponding stretching threshold sets, and select, from the stretching threshold sets corresponding to the center point codes of the respective feature subspaces, stretching thresholds corresponding to the N second training sample features that are closest to the target query sample feature, or select stretching thresholds corresponding to the second training sample features whose distance to the target query sample feature is less than a second set threshold, to form a threshold set for the target query sample feature.

12. The device according to claim 10, characterized in that In the function stretching threshold determination unit, the statistical analysis of all stretching thresholds in the threshold set of the target query sample feature includes: Calculating an average value of all stretching thresholds in the threshold set as the function stretching threshold; or, The weighted sum or weighted mean of all stretching thresholds in the threshold set is calculated as the function stretching threshold; wherein the weighting coefficient of each stretching threshold is determined according to the distance between the second training sample feature corresponding to the stretching threshold and the target query sample feature, and the closer the distance, the higher the weighting coefficient.

13. The device according to claim 9, characterized in that The first similarity threshold is a plurality of similarity thresholds when a plurality of different specified recognition false alarm rates are reached respectively; Correspondingly, the same center point code corresponds to multiple stretching threshold sets, and the function stretching thresholds are determined to be multiple.

14. The device according to claim 8, characterized in that When there is only one function stretching threshold, The similarity stretching function ensures that: the initial similarity greater than the function stretching threshold value becomes larger after stretching, and the initial similarity less than the function stretching threshold value becomes smaller after stretching; and / or, The similarity stretching function is a piecewise function with the function stretching threshold as a dividing point; and / or, The similarity stretching function ensures that: the closer the initial similarity is to the function stretching threshold, the greater the function curvature of the corresponding initial similarity position.

15. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed by a processor, the information retrieval method described in any one of claims 1 to 7 can be implemented.

16. An electronic device, characterized in that: The electronic device includes at least a computer-readable storage medium and also includes a processor; The processor is used to read executable instructions from the computer-readable storage medium and execute the instructions to implement the information retrieval method described in any one of claims 1 to 7 above.

Citation Information

Patent Citations

  • Picture retrieval method and device, equipment and computer readable storage medium

    CN112052350A

  • Image retrieval method and system based on big data

    CN112287140A