Platform parameter correction method, electronic device and computer-readable storage medium
By determining the feature groups of the same target between the benchmark platform and the platform to be adjusted, generating a similarity extension list and adjusting the parameters, the problem of feature extraction differences between platforms is solved and the effect of clustering archiving is improved.
Patent Information
- Application Number
- CN202211364569.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-11-02
AI Technical Summary
There are large differences in feature extraction between different platforms, resulting in poor clustering and archiving effects.
By obtaining the feature sets of the reference platform and the platform to be adjusted, the feature group to be compared for the same target is determined, an initial list is generated and expanded into a stretched list, and the platform parameters are adjusted based on the position index of the similarity matching until the convergence condition is met.
The feature extraction differences between multiple platforms are reduced, and the effect of cross-platform clustering archiving is improved.
Smart Images

Figure CN115878610B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a platform parameter correction method, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the advent of the data age, massive amounts of data need to be processed and ultimately clustered and archived. Prior art typically utilizes multiple platforms to collect and extract features before clustering and archiving data. However, these platforms are not standardized, resulting in significant discrepancies between the features extracted from different platforms. Ultimately, clustering and archiving using features extracted from multiple platforms is ineffective. Therefore, reducing the discrepancies in feature extraction across multiple platforms has become a pressing issue. Summary of the Invention
[0003] The main technical problem solved by this application is to provide a platform parameter correction method, electronic device and computer-readable storage medium, which can reduce the differences in feature extraction between multiple platforms.
[0004] To solve the above technical problems, the first aspect of the present application provides a platform parameter correction method, which includes: obtaining a first feature set corresponding to a reference platform and a second feature set corresponding to a platform to be adjusted, determining all feature groups to be compared that belong to the same target in the first feature set and the second feature set; obtaining an initial list based on the target type matched by the target corresponding to the feature group to be compared, and generating a stretched list based on the initial list; wherein the initial list includes a first value of similarities between targets of a preset type, and the stretched list includes a second value of similarities, and the second value is greater than the first value; traversing all the feature groups to be compared, and based on the comparative similarities between the features in the feature groups to be compared, determining a position index that matches the comparative similarities, extracting the similarity corresponding to the position index from the stretched list as a comparative score corresponding to the feature group to be compared; adjusting the parameters of the platform based on the comparative scores corresponding to all the feature groups to be compared until a preset convergence condition is met, thereby obtaining a platform to be adjusted that matches the reference platform.
[0005] To solve the above technical problems, the second aspect of the present application provides an electronic device, which includes: a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect above.
[0006] In order to solve the above technical problems, the third aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect is implemented.
[0007] The above scheme obtains a first feature set obtained after feature extraction by the reference platform and a second feature set corresponding to the platform to be adjusted, determines all feature groups to be compared belonging to the same target in the first feature set and the second feature set, obtains an initial list based on the target type matched by the target corresponding to the feature group to be compared, wherein the initial list includes a first numerical value of similarities between targets of preset types, generates a stretched list based on the initial list, wherein the stretched list includes a second numerical value of similarities, and the second numerical value is greater than the first numerical value, traverses all feature groups to be compared, determines the position index that matches the comparison similarity based on the comparison similarity between the features in the feature group to be compared, and uses the position index to extract the similarity corresponding to the position index from the stretched list as the comparison score corresponding to the feature group to be compared. Therefore, a larger number of similarities are included in the stretching list. For features that are difficult to determine whether they are similar in the feature groups to be compared, the position index is determined by comparing the similarities, and the similarity corresponding to the position index is extracted from the stretching list. This can improve the accuracy of the comparison score, and thus adjust the platform parameters based on the comparison scores corresponding to all feature groups to be compared, so that the features extracted by the platform to be adjusted match those of the benchmark platform, reduce the differences in feature extraction between multiple platforms, and improve the effect of clustering archiving across platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:
[0009] Figure 1 This is a flow chart of an embodiment of the platform parameter correction method of the present application;
[0010] Figure 2 This is a flow chart of another embodiment of the platform parameter correction method of the present application;
[0011] Figure 3 yes Figure 2 A flowchart of an embodiment corresponding to step S201;
[0012] Figure 4 This is a schematic structural diagram of an embodiment of the electronic device of the present application;
[0013] Figure 5 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0014] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0015] The terms "system" and "network" are often used interchangeably in this document. The term "and / or" is simply a description of an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " generally indicates that the related objects are in an "or" relationship. Furthermore, "multiple" in this document means two or more than two.
[0016] The platform parameter correction method provided in the present application is used to adjust the parameters of the platform to be adjusted. Therefore, the corresponding execution subject of the platform parameter correction method provided in the present application is a processor that can call the reference platform and the platform to be adjusted, wherein the reference platform and the platform to be adjusted are used to extract features of the target, and the targets include but are not limited to faces and human bodies. The reference platform includes a platform that has been put into operation for more than a time threshold and has been running stably, and the platform to be adjusted includes a newly put into operation platform.
[0017] In addition, the number of platforms to be adjusted in the present application can be one or more. When multiple platforms to be adjusted are included, the parameters of multiple platforms to be adjusted can be adjusted sequentially or in parallel based on the platform parameter correction method provided in the present application. For ease of explanation, the embodiments of the present application are described with one platform to be adjusted, but this is not a basis for limiting the patent scope of the present application.
[0018] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of a method for calibrating platform parameters of the present application, which includes:
[0019] S101: Obtain a first feature set corresponding to a reference platform and a second feature set corresponding to a platform to be adjusted, and determine all feature groups to be compared that belong to the same target in the first feature set and the second feature set.
[0020] Specifically, a first feature set obtained by feature extraction from a reference platform and a second feature set corresponding to the platform to be adjusted are obtained, and all feature groups to be compared belonging to the same target are determined in the first feature set and the second feature set. The feature groups to be compared include features extracted from the first feature set and features extracted from the second feature set.
[0021] In one application method, the first feature set is obtained by extracting features from a test image set by a reference platform, and the second feature set is obtained by extracting features from a test image set by a platform to be adjusted. Based on the coordinates corresponding to the targets in the first feature set and the second feature set, the same target in the first feature set and the second feature set is determined, and the features of the same target in the first feature set and the second feature set are extracted to form a feature group to be compared, so as to improve the accuracy of the feature group to be compared.
[0022] In another application method, the first test image set is input into the reference platform for feature extraction to obtain the first feature set, and the second test image set is input into the platform to be adjusted for feature extraction to obtain the second feature set, wherein the first test image set and the second test image set correspond to video frames captured from the same scene, and the features in the first feature set and the second feature set correspond to the frame number of the video frame and the target frame of the target, based on the intersection and union ratio between the target frames in the same frame number corresponding to the first feature set and the second feature set, the same target in the first feature set and the second feature set is determined, and the features of the same target in the first feature set and the second feature set are extracted to form a feature group to be compared, so as to improve the accuracy of the feature group to be compared.
[0023] S102: Based on the target types matched by the targets corresponding to the feature groups to be compared, an initial list is obtained, and a stretched list is generated based on the initial list, wherein the initial list includes a first value of similarities between targets of preset types, and the stretched list includes a second value of similarities, and the second value is greater than the first value.
[0024] Specifically, based on the target type matched by the target corresponding to the feature group to be compared, an initial list is obtained, where the initial list includes a first numerical value of similarities between targets of a preset type. In other words, when the target corresponding to the feature group to be compared is a target of a preset type, an initial list matching the preset type is obtained, and the first numerical value of similarities in the initial list is used as an empirical value.
[0025] Furthermore, a stretched list is generated based on the initial list, wherein the stretched list includes a second number of similarities, and the second number is greater than the first number. In other words, based on the empirical value, a second number of similarities exceeding the first number is generated, thereby increasing the number of similarities in the stretched list.
[0026] In one application, in response to a target corresponding to a feature group to be compared being a preset type, an initial list matching the preset type is obtained, wherein the similarities in the initial list are sorted in ascending order of numerical value, and the first numerical similarities in the initial list are interpolated, and the number of interpolations is inversely proportional to the difference between adjacent similarities in the initial list, so that the smaller the difference between adjacent similarities in the initial list, the more similarities are inserted to obtain a stretched list, thereby increasing the number of similarities in the stretched list.
[0027] In one application scenario, the multiple of the second value relative to the first value is determined, the multiple is divided by the difference between adjacent similarities in the initial list, and then multiplied by a preset coefficient to determine the number of similarities when interpolating between adjacent similarities in the initial list.
[0028] In another application method, in response to the corresponding target in the feature group to be compared being a preset type, an initial list matching the preset type is obtained, wherein the similarities in the initial list are sorted in ascending order of numerical value, and based on the ratio of the second numerical value to the first numerical value, the data bits to be interpolated in the stretched list are determined, and two adjacent similarities are selected in turn from the initial list to generate similarities for interpolation between the data bits to be interpolated, to obtain a stretched list, thereby increasing the number of similarities in the stretched list.
[0029] In another application scenario, the multiple of the second value relative to the first value is determined, and based on the multiple, the stretched list is divided into data bits to be interpolated corresponding to the multiple, two adjacent similarities are selected from the initial position in the initial list to generate similarities for interpolation, and interpolated to the data bits to be interpolated at the initial position in the stretched list, and so on until interpolation is completed between all data bits to be interpolated in the stretched list, wherein the similarity used for interpolation between two adjacent data bits to be interpolated is positively correlated with the order corresponding to the positions in the stretched list, so as to achieve ascending arrangement of similarities in the stretched list.
[0030] S103: Traverse all feature groups to be compared, determine the position index that matches the comparison similarity based on the comparison similarity between the features in the feature groups to be compared, extract the similarity corresponding to the position index from the stretch list as the comparison score corresponding to the feature group to be compared.
[0031] Specifically, for each feature group to be compared, based on the comparative similarity between features in the feature group to be compared, a position index that matches the comparative similarity is determined. The position index is then used to extract the similarity corresponding to the position index from the stretched list, and this is used as the comparison score for the feature group to be compared. The comparative similarity is the similarity between features in the feature group to be compared, and the similarity is determined based on the cosine distance.
[0032] Furthermore, a larger number of similarities are included in the stretched list. For features in the feature group to be compared that are difficult to determine whether they are similar, the position index is determined by comparing the similarities, and the similarity corresponding to the position index is extracted from the stretched list, which can improve the accuracy of the comparison score.
[0033] In one application, based on the product of the comparison similarity between the features in the feature group to be compared and the second numerical value, a position index matching the comparison similarity is determined, and the similarity at the position corresponding to the position index is extracted from the stretched list according to the position index as the comparison score corresponding to the feature group to be compared.
[0034] In another application, a multiple of the second value relative to the first value is determined, and based on the product of the comparative similarity between the features in the feature group to be compared and the multiple, a position index matching the comparative similarity is determined, and the similarity at the position corresponding to the position index is extracted from the stretched list according to the position index as the comparative score corresponding to the feature group to be compared.
[0035] S104: Adjusting the parameters of the platform based on the comparison scores corresponding to all the feature groups to be compared until a preset convergence condition is met, thereby obtaining a platform to be adjusted that matches the reference platform.
[0036] Specifically, the parameters of the platform are adjusted based on the comparison scores corresponding to all feature groups to be compared until a preset convergence condition is met, so that the features extracted by the platform to be adjusted match those of the reference platform.
[0037] In one application, the preset convergence condition is determined based on the loss value between the first feature set and the second feature set. When the loss value is less than the loss threshold, the parameters of the platform to be adjusted are fixed to obtain the platform to be adjusted that matches the reference platform.
[0038] In another application method, the preset convergence condition is determined based on the loss value and the number of adjustments between the first feature set and the second feature set. When the loss value is less than the loss threshold and the number of adjustments exceeds the number threshold, the parameters of the platform to be adjusted are fixed to obtain the platform to be adjusted that matches the reference platform.
[0039] In a specific application scenario, a baseline platform is a platform that has been in operation for more than a time threshold and is equipped with a stable algorithm version. The platform to be adjusted is a newly-operated platform or a platform with an algorithm version different from that of the baseline platform. A first feature set obtained by feature extraction on the baseline platform and a second feature set corresponding to the platform to be adjusted are obtained. All feature groups to be compared that belong to the same target are determined in the first feature set and the second feature set. An initial list is obtained and a stretched list is generated based on the initial list, wherein the second value corresponding to the similarity in the stretched list is an integer multiple of the second value corresponding to the similarity in the initial list. For each feature group to be compared, based on the comparative similarity between features in the feature group to be compared, a position index matching the comparative similarity is determined. The similarity corresponding to the position index is extracted from the stretched list using the position index as a comparison score corresponding to the feature group to be compared. Based on the maximum value, minimum value, variance, and average value corresponding to the comparison score corresponding to each feature group to be compared, parameters of the platform to be adjusted are adjusted until the loss value between the first feature set and the second feature set is less than a loss threshold and the number of adjustments exceeds a number threshold. Then, the parameters of the platform to be adjusted are fixed to obtain the platform to be adjusted that matches the baseline platform.
[0040] The above scheme obtains a first feature set obtained after feature extraction by the reference platform and a second feature set corresponding to the platform to be adjusted, determines all feature groups to be compared belonging to the same target in the first feature set and the second feature set, obtains an initial list based on the target type matched by the target corresponding to the feature group to be compared, wherein the initial list includes a first numerical value of similarities between targets of preset types, generates a stretched list based on the initial list, wherein the stretched list includes a second numerical value of similarities, and the second numerical value is greater than the first numerical value, traverses all feature groups to be compared, determines the position index that matches the comparison similarity based on the comparison similarity between the features in the feature group to be compared, and uses the position index to extract the similarity corresponding to the position index from the stretched list as the comparison score corresponding to the feature group to be compared. Therefore, a larger number of similarities are included in the stretching list. For features that are difficult to determine whether they are similar in the feature groups to be compared, the position index is determined by comparing the similarities, and the similarity corresponding to the position index is extracted from the stretching list. This can improve the accuracy of the comparison score, and thus adjust the platform parameters based on the comparison scores corresponding to all feature groups to be compared, so that the features extracted by the platform to be adjusted match those of the benchmark platform, reduce the differences in feature extraction between multiple platforms, and improve the effect of clustering archiving across platforms.
[0041] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of the platform parameter correction method of the present application, the method comprising:
[0042] S201: Obtain a first feature set corresponding to a reference platform and a second feature set corresponding to a platform to be adjusted, and determine all feature groups to be compared that belong to the same target in the first feature set and the second feature set.
[0043] Specifically, a first feature set obtained after feature extraction from the reference platform and a second feature set corresponding to the platform to be adjusted are obtained, and all feature groups to be compared that belong to the same target are determined in the first feature set and the second feature set.
[0044] In one application, the features in the first feature set and the second feature set correspond to the image name of the image and the coordinates of the object.
[0045] Specifically, see Figure 3 , Figure 3 yes Figure 2 Schematic diagram of a flow chart of an embodiment corresponding to step S201, step S201 specifically includes:
[0046] S301: Obtain all to-be-processed images and their corresponding to-be-processed image names based on the intersection of the image names in the first feature set and the second feature set.
[0047] Specifically, when extracting features, the reference platform and the platform to be adjusted retain the coordinates of the target corresponding to the features, as well as the image name corresponding to the image where the target is located. Based on the intersection between the image names corresponding to the first feature set and the second feature set, the image set in which the target and its corresponding features are extracted from both the reference platform and the platform to be adjusted is determined, the images in the image set are used as images to be processed, and the image names corresponding to the images to be processed are used as names of the images to be processed.
[0048] In one application scenario, image names correspond to frame numbers in video frames. Features in the first and second feature sets are assigned feature names. The feature names include the image name, target ID, feature length, and target coordinates, using the following format: image name_target ID_feature length_target coordinates. Assume that the baseline platform and the target platform each extract features from 100 video frames. The baseline platform extracts targets and their corresponding features in 90 video frames, which serve as the first feature set. The first feature set is used to construct a first query dictionary, while the target platform extracts targets and their corresponding features in 89 video frames, which serve as the second feature set. The second feature set is used to construct a second query dictionary. The features in the first and second query dictionaries are sorted in ascending order by the image names in the feature names to determine the intersection between the image names. The images in the intersection are then used as the images to be processed. For example, if the intersection includes 88 image names, these 88 image names are used as the names of the images to be processed, and their corresponding images are used as the images to be processed. This eliminates images that do not match the first and second feature sets.
[0049] S302: extracting first targets corresponding to the images to be processed from the first feature set using the names of the images to be processed, and extracting second targets corresponding to the images to be processed from the second feature set.
[0050] Specifically, the first target corresponding to the feature extracted from each image to be processed is determined from the first feature set using the name of the image to be processed, and the second target corresponding to the feature extracted from each image to be processed is determined from the second feature set.
[0051] S303: Traverse all images to be processed, and determine a group of objects to be compared that belong to the same object in the images to be processed based on the intersection-and-union ratio between the coordinates corresponding to the first object and the second object corresponding to the images to be processed.
[0052] Specifically, for each image to be processed, the intersection-and-union ratio between the coordinates of the first and second objects corresponding to the image to be processed is used to determine whether the first and second objects are the same object, thereby determining a group of objects to be compared that are the same object in the image to be processed. If there is only one first and second object corresponding to the image to be compared, the corresponding first and second objects can be directly used as the group of objects to be compared to improve processing efficiency.
[0053] In one application scenario, an intersection-and-union (IUN) matrix is generated based on the intersection-and-union (IUN) ratios between the coordinates of all first targets and the coordinates of all second targets in the image to be processed, wherein the dimension of the IUN matrix corresponds to the number of first targets and second targets; based on the minimum dimension of the IUN matrix, the number of first targets and second targets to be compared corresponding to each other in the image to be processed is determined, and based on the IUN in the IUN matrix, the number of target groups to be compared that belong to the same target in the first target and the second target is determined.
[0054] Specifically, the coordinates corresponding to the first target and the second target are expressed in the form of a coordinate frame, and the coordinate frames between the coordinate frames of all first targets in the image to be compared and all second targets are calculated. Assuming that the number of first targets is A and the number of second targets is B, an A*B-dimensional intersection-in-union matrix is obtained, and the minimum dimension in the intersection-in-union matrix is used as the number to be compared corresponding to the first target and the second target in the image to be processed. That is, when A≤B, A is used as the number to be compared, and all first targets are used as targets to be compared. The intersection-in-union matrix determines the maximum intersection-in-union corresponding to each first target, thereby determining the second target that is the same target as the target to be compared, and obtaining a target group to be compared. When A>B, B is used as the number to be compared, and all second targets are used as targets to be compared. The intersection-in-union matrix determines the maximum intersection-in-union corresponding to each second target, thereby determining the first target that is the same target as the target to be compared, and obtaining a target group to be compared. In this way, the accuracy of detecting the same target is improved by obtaining the intersection-in-union and generating the intersection-in-union matrix.
[0055] S304: The features corresponding to the targets in all the target groups to be compared are taken as the feature groups to be compared.
[0056] Specifically, based on the targets in the target group to be compared, features corresponding to the targets are searched, and features corresponding to all targets in the target group to be compared are taken as the feature group to be compared.
[0057] S202: Acquire a first list and a second list matching the target type as initial lists, wherein the similarities in the first list and the second list are arranged in ascending order.
[0058] Specifically, a first list and a second list matching the target type are obtained, and both the first list and the second list are used as initial lists, wherein the similarity in the initial list is obtained based on the similarity between features corresponding to targets of a preset type that exceeds a quantity threshold, and the similarity in the initial list is related to the algorithm version for feature extraction.
[0059] Furthermore, the similarities in the first list and the second list are arranged in ascending order, wherein the similarity values are both values between 0 and 1, and the first similarity in the first list and the second list is 0, and the last similarity is 1.
[0060] S203: Based on the adjacent similarities and the second value in the first list, determine the data bits to be interpolated in the stretch list, and extract two similarities matching the adjacent data bits to be interpolated from the second list as two reference similarities.
[0061] Specifically, adjacent similarities in the first list are multiplied by the second value and rounded to the nearest integer to determine the data bit to be interpolated in the stretched list, and two similarities that match the adjacent data bit to be interpolated are extracted from the second list as two reference similarities. For example, the first and second similarities are extracted from the first list, multiplied by the second value and rounded to the nearest integer to determine the data bit to be interpolated in the stretched list, and the first and second similarities are also extracted from the second list as two similarities that match the adjacent data bit to be interpolated and used as two reference similarities.
[0062] In an application scenario, assuming that the first value is n and the second value is N, the first list is score_src including n similarities, the second list is score_dst including n similarities, the result of rounding down score_src[i]*N is recorded as the data position to be interpolated begin_pos, the result of rounding down score_src[i+1]*N is recorded as the data position to be interpolated end_pos, and score_dst[i] and score_dst[i+1] are extracted from score_dst as the reference feature values matching the data position to be interpolated, where 0≤i <n-1。
[0063] S204: Traverse every two adjacent data bits to be interpolated, generate a third numerical similarity for interpolation based on the two reference similarities, and sequentially interpolate between the corresponding data bits to be interpolated until all the data bits to be interpolated and the positions between them are interpolated, thereby obtaining a stretched list, wherein the third numerical value is related to the difference between the adjacent data bits to be interpolated, and the similarities in the stretched list are arranged in ascending order.
[0064] Specifically, for every two adjacent data bits to be interpolated, a third numerical value of similarities for interpolation is generated based on the two benchmark similarities, and the third numerical value of similarities is sequentially interpolated between the corresponding data bits to be interpolated, wherein the third numerical value of the third similarity is related to the difference between the adjacent data bits to be interpolated, and the similarity between the data bits to be interpolated is increased in numerical value until all the data bits to be interpolated and the positions between them are interpolated, thereby obtaining a stretched list, so that the similarities in the stretched list are arranged in increasing numerical value, and the number of similarities in the stretched list is increased to expand the span between the similarities.
[0065] In an application scenario, a third similarity value for interpolation is generated based on two reference similarities and interpolated in sequence between corresponding data positions to be interpolated, including: taking the smaller value of the two reference similarities as the first base value, taking the smaller value of adjacent data positions to be interpolated as the second base value, and taking the ratio between the difference of the two reference similarities and the difference of adjacent data positions to be interpolated as the reference value; superimposing a variable value related to the position in the stretching list on the first base value to obtain the similarity between adjacent data positions to be interpolated and interpolating it to the corresponding position in the stretching list; where the variable value is determined based on the product of the digit difference and the reference value, and the digit difference is the difference between the sequence number corresponding to the current position and the second base value.
[0066] Specifically, still taking the application scenario in step S203 as an example, taking the smaller value of the two reference similarities as the first base value. Since the similarities in the second list are arranged in increasing order, that is, taking score_dst[i] as the first base value, taking the smaller value of adjacent data positions to be interpolated as the second base value. Since the similarities in the first list are arranged in increasing order, that is, taking begin_pos as the second base value, and taking the ratio between the difference of the two reference similarities and the difference of adjacent data positions to be interpolated as the reference value, that is, taking (score_dst[i + 1] - score_dst[i]) / (end_pos - begin_pos) as the reference value.
[0067] Furthermore, superimposing a variable value related to the position in the stretching list on the first base value to obtain the similarity between adjacent data positions to be interpolated and interpolating it to the corresponding position in the stretching list, where the variable value is determined based on the product of the digit difference and the reference value, and the digit difference is the difference between the sequence number corresponding to the current position and the second base value. The above process is expressed by the formula as follows:
[0068]
[0069] where j is the current position, begin_pos ≤ j < end_pos + 1, score_table[j] is the similarity for interpolation, (score_dst[i + 1] - score_dst[i]) / (end_pos - begin_pos) is the reference value, j - begin_pos is the digit difference, so the similarity between adjacent data positions to be interpolated is positively correlated with the sequence number corresponding to the current position, and the similarities in the finally obtained stretching list are sorted in increasing order of value.
[0070] S205: Traverse all feature groups to be compared, determine the position index that matches the comparison similarity based on the comparison similarity between the features in the feature groups to be compared, and extract the similarity corresponding to the position index from the stretch list as the comparison score corresponding to the feature group to be compared.
[0071] Specifically, for each feature group to be compared, based on the comparison similarity between the features in the feature group to be compared, the position index that matches the comparison similarity is determined, and the similarity corresponding to the position index is extracted from the stretch list using the position index as the comparison score corresponding to the feature group to be compared.
[0072] In one application, the comparison similarity between features in the feature group to be compared is multiplied by a second value and the resulting value is rounded to an integer, which is used as a position index matching the comparison similarity; based on the position index, the similarity at the position corresponding to the position index is extracted from the stretched list as the comparison score corresponding to the feature group to be compared.
[0073] Specifically, the comparison similarity between the features in the feature group to be compared is multiplied by the second value and the resulting integer is used as the position index that matches the comparison similarity. The position index is used to stretch the list to extract the similarity corresponding to the position index as the comparison score corresponding to the feature group to be compared.
[0074] In a specific application scenario, assume that the first value is n, the second value is N, n = 20, N = 10000, and the decimal places of at least some similarities in the first list match the second value. If the comparison similarity is 0.95, then the comparison similarity is multiplied by N and rounded to 9500, and the 9500th similarity is extracted from the stretched list. Assume that the first list score_src = [0, 0.5, 0.65, 0.6721, 0.696, 0.7202, 0.7241, 0.7283, 0.7302, 0.7336, 0.7404, 0.7453, 0.7506, 0.7635, 0.7697, 0.7787, 0.783 7,0.7887,0.7987,1], the second list score_dst=[0,0.3,0.6,0.7,0.75,0.8,0.82,0.84,0.85,0.86,0.88,0.9,0.92,0.94,0.95,0.96,0.97,0.98,0.99,1], according to the above formula 1, the 9500th similarity is 0.9975, and the comparison score corresponding to the feature group to be compared is obtained, or assuming that the first The list score_src = [0, 0.5525, 0.6535, 0.6721, 0.696, 0.7202, 0.7241, 0.7283, 0.7302, 0.7336, 0.8404, 0.8698, 0.9021, 0.9125, 0.9210, 0.9332, 0.9502, 0.9787, 0.9887, 1], the second list score_dst = [0, 0.3, 0.6, 0.7, 0 .75,0.8,0.82,0.84,0.85,0.86,0.87,0.88,0.89,0.90,0.92,0.93,0.94,0.96,0.98,1]. According to the above formula 1, the 9500th similarity is 0.9399. For targets whose features are difficult to compare, compared with directly using similarity as the comparison score, it can improve the accuracy of the comparison score, so that the adjusted platform has better robustness when performing feature extraction.
[0075] It should be noted that in other specific application scenarios, the first value and the second value may also be other customized values, and the similarity in the first list and the second list is obtained based on big data analysis, wherein the big data includes features obtained after feature extraction of the target based on the same algorithm version.
[0076] S206: Adjust the parameters of the platform based on the comparison scores corresponding to all the feature groups to be compared until a preset convergence condition is met, thereby obtaining a platform to be adjusted that matches the reference platform.
[0077] Optionally, both the reference platform and the platform to be adjusted include a decoding module, and the parameters of the platform are adjusted based on the comparison scores corresponding to all feature groups to be compared until a preset convergence condition is met. Before obtaining the platform to be adjusted that matches the reference platform, the method further includes: inputting a test image into the decoding module of the reference platform to obtain a first decoded image, and inputting the test image into the decoding module of the platform to be adjusted to obtain a second decoded image; based on the difference between pixels in a pixel group at the same position on the first decoded image and the second decoded image, determining the ratio of the pixel group with a difference of zero to the total number of pixels in the first decoded image; adjusting the parameters of the decoding module of the platform to be adjusted based on the ratio until the ratio exceeds a ratio threshold, and obtaining the parameters of the decoding module of the platform to be adjusted.
[0078] Specifically, the same test image is input into the decoding modules of the reference platform and the platform to be adjusted for decoding, and a first decoded image output by the reference platform and a second decoded image output by the platform to be adjusted are obtained. The absolute value of the difference between the pixel groups at the same position on the first decoded image and the second decoded image is calculated pixel by pixel, and the ratio of the pixel groups with zero difference to the total number of pixels is counted according to the absolute value of the pixel value difference.
[0079] Furthermore, the parameters of the decoding module of the platform to be adjusted are adjusted based on the ratio until the ratio exceeds a ratio threshold, and the parameters of the decoding module of the platform to be adjusted are obtained, so that the second decoded image obtained after decoding by the decoding module of the platform to be adjusted matches the first decoded image, thereby improving the consistency of feature extraction between the platform to be adjusted and the reference platform, and reducing the differences in feature extraction between multiple platforms.
[0080] In one application scenario, the parameters of the platform are adjusted based on the comparison scores corresponding to all feature groups to be compared until a preset convergence condition is met, and a platform to be adjusted that matches the reference platform is obtained, including: determining the comparison results of the reference platform and the platform to be adjusted based on the comparison scores corresponding to all feature groups to be compared and the number of feature groups to be compared; the comparison results include the maximum value, minimum value, variance and average value corresponding to all comparison scores, and the proportion of the number of feature groups to be compared to all features in the first feature set and the second feature set respectively; fixing the parameters of the decoding module of the platform to be adjusted, and adjusting the parameters of other modules of the platform to be adjusted based on the comparison results until the preset convergence condition is met, and obtaining a platform to be adjusted that matches the reference platform.
[0081] Specifically, the number of all features in the first feature set and the second feature set is counted, the proportion of the number of feature groups to be compared to all features in the first feature set and the second feature set is calculated, the maximum value, minimum value, variance and average value corresponding to the comparison scores in all feature groups to be compared are counted, and finally the comparison results of the benchmark platform and the platform to be adjusted are determined.
[0082] In a specific application scenario, the comparison results are expressed in a table as follows, where Table 1 is the comparison results between the benchmark platform and the platform to be adjusted.
[0083] Table 1: Comparison results between the baseline platform and the platform to be tuned
[0084]
[0085]
[0086] Furthermore, the parameters of the decoding module of the platform to be adjusted are fixed, and the parameters of other modules of the platform to be adjusted are adjusted based on the comparison results until the preset convergence conditions are met, thereby obtaining the platform to be adjusted that matches the benchmark platform, wherein the other modules include but are not limited to a quantization module, an inference scaling module, a model inference module, and an algorithm module.
[0087] It should be noted that the comparison results include the proportion of the number of feature groups to be compared to all features in the first feature set and the second feature set, as well as statistical indicators derived from the comparison scores corresponding to the feature groups to be compared, so that the adjusted platform to be adjusted can detect features belonging to the same target as the benchmark platform, and obtain a higher proportion of feature groups to be compared, and the similarity between the features in the feature groups to be compared is higher, reducing the differences in feature extraction between multiple platforms and improving the effect of clustering archiving across platforms.
[0088] In a specific application scenario, the preset convergence conditions include that the proportion of the number of feature groups to be compared to all features in the first feature set and the second feature set exceeds the proportion threshold, and the proportion of the comparison scores exceeding the preset scores exceeds the proportion threshold. When adjusting the parameters, the control variable method can be used to adjust each module in the quantization module, inference scaling module, model inference module and algorithm module one by one.
[0089] In this embodiment, based on the intersection of the image names corresponding to the first feature set and the second feature set, an image set is determined in which targets and their corresponding features are extracted from both the reference platform and the platform to be adjusted. The images in the image set are used as images to be processed. The intersection-over-union ratio between the coordinates corresponding to the first target and the second target corresponding to the image to be processed is used to determine whether the first target and the second target belong to the same target. A group of targets to be compared belonging to the same target in the image to be processed is determined. An initial list is obtained, wherein the initial list includes a first number of similarities between targets of a preset type. A stretched list is generated based on the initial list, wherein the stretched list includes a second number of similarities, and the second number is greater than the first number. All feature groups to be compared are traversed. Based on the comparative similarities between the features in the feature groups to be compared, a position index matching the comparative similarity is determined. The similarity corresponding to the position index is extracted from the stretched list using the position index as a comparison score corresponding to the feature group to be compared. For targets whose features are difficult to compare, the accuracy of the comparison score can be improved compared to directly using the similarity as the comparison score, so that the adjusted platform to be adjusted has better robustness when performing feature extraction. Therefore, the parameters of the platform are adjusted based on the comparison scores corresponding to all feature groups to be compared, so that the features extracted by the platform to be adjusted match those of the benchmark platform, reducing the differences in feature extraction between multiple platforms and improving the effect of clustering and archiving across platforms.
[0090] See also Figure 4 , Figure 4 This is a structural diagram of an embodiment of an electronic device of the present application. The electronic device 40 includes a memory 401 and a processor 402 coupled to each other, wherein the memory 401 stores program data (not shown in the figure), and the processor 402 calls the program data to implement the method in any of the above embodiments. For an explanation of the relevant content, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0091] See also Figure 5 , Figure 5 This is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 50 stores program data 500. When the program data 500 is executed by the processor, the method in any of the above embodiments is implemented. For an explanation of the relevant content, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0092] It should be noted that the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.
[0093] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0094] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0095] The above description is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A platform parameter calibration method, characterized in that: The method comprises: Obtaining a first feature set corresponding to a reference platform and a second feature set corresponding to a platform to be adjusted, and determining all feature groups to be compared that belong to the same target in the first feature set and the second feature set; Obtaining an initial list based on target types matched by targets corresponding to the target feature group to be compared, and generating a stretched list based on the initial list; wherein the initial list includes a first value of similarities between targets of a preset type, and the stretched list includes a second value of similarities, the second value being greater than the first value; determining a data bit to be interpolated in the initial list, and inserting similarities related to two adjacent similarities into the data bit to be interpolated to obtain the stretched list; Traversing all the feature groups to be compared, determining a position index that matches the comparison similarity based on the comparison similarity between the features in the feature groups to be compared, and extracting the similarity corresponding to the position index from the stretched list as a comparison score corresponding to the feature group to be compared; The parameters of the platform are adjusted based on the comparison scores corresponding to all the feature groups to be compared until a preset convergence condition is met, thereby obtaining a platform to be adjusted that matches the reference platform; wherein, based on the numerical statistical results corresponding to the comparison scores corresponding to each of the feature groups to be compared, the parameters of the platform to be adjusted are adjusted until a preset convergence condition is met, thereby obtaining a platform to be adjusted that matches the reference platform.
2. The platform parameter correction method according to claim 1, characterized in that: The step of obtaining an initial list based on the target type matched by the target corresponding to the feature group to be compared, and generating a stretched list based on the initial list includes: Obtaining a first list and a second list matching the target type as the initial list; wherein the similarities in the first list and the second list are arranged in ascending order; Determining the data bits to be interpolated in the stretched list based on adjacent similarities in the first list and the second value, and extracting two similarities matching the adjacent data bits to be interpolated from the second list as two reference similarities; Traversing every two adjacent data bits to be interpolated, generating a third numerical similarity for interpolation based on the two reference similarities, and sequentially interpolating the third similarity between the corresponding data bits to be interpolated until all the data bits to be interpolated and the positions between them are interpolated, thereby obtaining the stretched list; wherein the third numerical value is related to the difference between the adjacent data bits to be interpolated, and the similarities in the stretched list are arranged in ascending order.
3. The platform parameter correction method according to claim 2, characterized in that: Generating a third numerical value of similarities for interpolation based on the two reference similarities and sequentially interpolating the third numerical value between the corresponding data bits to be interpolated comprises: Taking the smaller value of the two reference similarities as a first base value, taking the smaller value of the adjacent data bits to be interpolated as a second base value, and taking the ratio between the difference between the two reference similarities and the difference between the adjacent data bits to be interpolated as a reference value; A variable value related to the position in the stretched list is superimposed on the first base value to obtain the similarity between adjacent data bits to be interpolated, and the data bits are interpolated to the corresponding position in the stretched list; wherein the variable value is determined based on the product of the bit difference and the reference value, and the bit difference is the difference between the order corresponding to the current position and the second base value.
4. The platform parameter correction method according to claim 1, characterized in that: The step of determining a position index that matches the comparison similarity based on the comparison similarity between features in the feature group to be compared, and extracting the similarity corresponding to the position index from the stretched list as a comparison score corresponding to the feature group to be compared includes: multiplying the comparison similarity between the features in the feature group to be compared by the second value and rounding the result to an integer, and using the result as a position index that matches the comparison similarity; Based on the position index, the similarity at the position corresponding to the position index is extracted from the stretch list as the comparison score corresponding to the feature group to be compared.
5. The platform parameter correction method according to claim 1, characterized in that: The features in the first feature set and the second feature set correspond to the image name and the coordinates of the target, and determining all feature groups to be compared belonging to the same target in the first feature set and the second feature set includes: Obtaining all to-be-processed images and their corresponding to-be-processed image names based on an intersection of the image names in the first feature set and the second feature set; Extracting a first target corresponding to each image to be processed from the first feature set using the name of the image to be processed, and extracting a second target corresponding to each image to be processed from the second feature set; Traversing all the images to be processed, and determining a group of objects to be compared that belong to the same object in the images to be processed based on an intersection-and-union ratio between the coordinates corresponding to the first object and the second object corresponding to the images to be processed; The features corresponding to the targets in the target group to be compared are used as the feature group to be compared.
6. The platform parameter correction method according to claim 5, characterized in that: The determining, based on the intersection-and-union ratio between the coordinates corresponding to the first target and the second target in the image to be processed, a group of targets to be compared that belong to the same target in the image to be processed includes: generating an IoU matrix based on the IoU ratios between the coordinates of all the first objects and the coordinates of all the second objects in the image to be processed; wherein the dimension of the IoU matrix corresponds to the number of the first objects and the second objects; Based on the minimum dimension of the intersection-and-union matrix, the number of targets to be compared corresponding to the first target and the second target in the image to be processed is determined, and based on the intersection-and-union in the intersection-and-union matrix, the number of target groups to be compared that belong to the same target in the first target and the second target is determined.
7. The platform parameter correction method according to claim 1, characterized in that: The reference platform and the platform to be adjusted both include a decoding module. The method of adjusting the parameters of the platform based on the comparison scores corresponding to all the feature groups to be compared until a preset convergence condition is met and the platform to be adjusted that matches the reference platform is obtained further includes: Inputting the test image into the decoding module of the reference platform to obtain a first decoded image, and inputting the test image into the decoding module of the platform to be adjusted to obtain a second decoded image; determining, based on differences between pixels in pixel groups at the same position in the first decoded image and the second decoded image, a ratio of pixel groups having zero differences to the total number of pixels in the first decoded image; The parameters of the decoding module of the platform to be adjusted are adjusted based on the ratio until the ratio exceeds a ratio threshold, thereby obtaining the parameters of the decoding module of the platform to be adjusted.
8. The platform parameter correction method according to claim 7, characterized in that: The adjusting the parameters of the platform based on the comparison scores corresponding to all the feature groups to be compared until a preset convergence condition is satisfied to obtain a platform to be adjusted that matches the reference platform includes: Determining a comparison result between the reference platform and the platform to be adjusted based on the comparison scores corresponding to all the feature groups to be compared and the number of the feature groups to be compared; the comparison result includes a maximum value, a minimum value, a variance, and an average value corresponding to all the comparison scores, and a ratio of the number of the feature groups to be compared to all the features in the first feature set and the second feature set, respectively; The parameters of the decoding module of the platform to be adjusted are fixed, and the parameters of other modules of the platform to be adjusted are adjusted based on the comparison result until a preset convergence condition is met, thereby obtaining a platform to be adjusted that matches the reference platform.
9. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Image sub-pixel matching and positioning method and system, equipment and medium
CN113850807A
Two Step Algorithm for Non-exact Matching of Large Datasets
US20210279238A1