Methods, apparatus, storage media and electronic devices for constructing feature libraries

By using images that have successfully aligned with the first model and have high image quality scores for second feature extraction during the model upgrade process, the problem of low efficiency in feature library construction caused by incompatibility between the old and new models is solved, achieving seamless upgrade and efficient feature library update.

CN121388205BActive Publication Date: 2026-03-13ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, after a model is upgraded, the old and new models are incompatible, resulting in low efficiency in building the feature library. This requires the object to be re-collected images, making it impossible to effectively utilize the feature library of the old model.

Method used

The first feature of the target image is extracted using the first model and compared with the first feature library. If the comparison is successful and the image quality score is higher than the threshold, the second feature is extracted using the upgraded second model and saved to the second feature library, thus achieving a seamless upgrade.

Benefits of technology

It improves the efficiency of feature library construction, avoids the need to re-collect images of objects, and ensures the continuity of recognition services and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121388205B_ABST
    Figure CN121388205B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, storage medium, and electronic device for constructing a feature library. The method includes: extracting a first feature from a acquired target image using a first model; comparing the first feature with features included in a first feature library to obtain a comparison result, wherein the features stored in the first feature library are features obtained by extracting features from the image using the first model; determining an image quality score for the target image if the comparison result indicates successful comparison; and extracting a second feature from the target image using a second model if the image quality score is greater than a preset threshold, and saving the second feature to a second feature library, wherein the second model is obtained by upgrading the first model, and the features stored in the second feature library are features obtained by extracting features from the image using the second model. This application solves the problem of low efficiency in constructing feature libraries in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a method, apparatus, storage medium, and electronic device for constructing a feature library. Background Technology

[0002] In related technologies, network models are typically used to identify objects in acquired images. However, after a model upgrade, the upgraded model becomes incompatible with the old model, making it impossible for the upgraded model to use the feature library already built by the old model. Therefore, it is necessary to re-acquire images with the cooperation of the objects, and then use the upgraded model to extract features and build a feature library.

[0003] This indicates that the related technologies suffer from low efficiency in building feature libraries.

[0004] There is currently no effective solution to the aforementioned problems in the relevant technologies. Summary of the Invention

[0005] This application provides a method, apparatus, storage medium, and electronic device for constructing a feature library, so as to at least solve the technical problem of low efficiency in constructing feature libraries in related technologies.

[0006] According to one aspect of the embodiments of this application, a method for constructing a feature library is provided, comprising: extracting a first feature of a target image using a first model; comparing the first feature with features included in a first feature library to obtain a comparison result, wherein the features stored in the first feature library are features obtained by extracting features from the image using the first model; determining an image quality score of the target image if the comparison result indicates successful comparison; and extracting a second feature of the target image using a second model if the image quality score is greater than a preset threshold, and saving the second feature to a second feature library, wherein the second model is obtained by upgrading the first model, and the features stored in the second feature library are features obtained by extracting features from the image using the second model.

[0007] In one exemplary embodiment, determining an image quality score for a target image includes: determining sub-scores for the target image from multiple target dimensions; determining a judgment condition for each target dimension; and determining the image quality score based on the determined sub-scores for each target dimension if the sub-scores of the target dimensions satisfy the judgment conditions.

[0008] In one exemplary embodiment, determining a sub-score for the target image from multiple target dimensions includes at least one of the following: if the multiple target dimensions include a sharpness dimension, determining the sharpness of the target image and determining the sub-score for the sharpness dimension based on the sharpness; if the multiple target dimensions include an angle dimension, determining the target angle between a first plane containing a target object in the target image and the imaging plane of the acquisition device acquiring the target image, and determining the sub-score for the angle dimension based on the target angle; if the multiple target dimensions include an occlusion dimension, determining the target occlusion coefficient of the target object in the target image and determining the sub-score for the occlusion dimension based on the target occlusion coefficient; if the multiple target dimensions include a size dimension, determining the target size of the target object in the target image and determining the sub-score for the size dimension based on the target size; if the multiple target dimensions include a brightness dimension, determining the target brightness of the target object in the target image and determining the sub-score for the brightness dimension based on the target brightness.

[0009] In one exemplary embodiment, determining the image quality score based on the determined sub-scores of each of the target dimensions includes: determining a score weight for each target dimension; determining an index score based on the score weights of the target dimensions and the sub-scores of the target dimensions, wherein the index score is calculated exponentially from the score weights and the sub-scores; and determining the image quality score based on the index score and the score weights of each target dimension.

[0010] In one exemplary embodiment, determining an index score based on the rating weights of the target dimension and the sub-ratings of the target dimension includes: determining a first index value with the sub-ratings of the target dimension as the base and the rating weights of the target dimension as the index; and determining the first index value as the index score.

[0011] In an exemplary embodiment, determining the image quality score based on the index score and the score weight of each of the target dimensions includes: determining the product of the index scores corresponding to all the target dimensions; determining the sum of the score weights of all the target dimensions; determining the ratio of the target constant to the sum; determining a second index value with the product as the base and the ratio as the exponent; and determining the second index value as the image quality score.

[0012] In an exemplary embodiment, after comparing the first feature with features included in the first feature library to obtain a comparison result, the method further includes: if the comparison result indicates a comparison failure, extracting the second feature of the target image using the second model; and identifying the target object included in the target image based on the second feature.

[0013] In one exemplary embodiment, after determining the image quality score of the target image, the method further includes: if the image quality score is greater than a preset threshold, deleting features in the first feature library that have successfully matched the first feature.

[0014] In one exemplary embodiment, after saving the second feature to the second feature library, the method further includes: determining a target number of features included in the first feature library; and deleting the first model and the first feature library if the target number is less than a preset number.

[0015] In an exemplary embodiment, after saving the second feature to the second feature library, the method further includes: determining the duration for which the target number of features included in the first feature library remains unchanged; and deleting the first model and the first feature library if the duration is longer than a preset duration.

[0016] In an exemplary embodiment, after saving the second feature to the second feature library, the method further includes: determining a target number of features included in the first feature library; determining a duration during which the target number remains unchanged; and deleting the first model and the first feature library if the target number is less than a preset number and the duration is greater than a preset duration.

[0017] In an exemplary embodiment, comparing the first feature with features included in a first feature library to obtain a comparison result includes: determining the similarity between the first feature and features included in the first feature library; if there is a similarity greater than a similarity threshold in the similarity, determining the comparison result as a successful comparison; if all similarities are less than the similarity threshold, determining the comparison result as a failed comparison.

[0018] According to another aspect of the embodiments of this application, a feature library construction apparatus is also provided, comprising: an extraction module, configured to extract a first feature of a acquired target image using a first model; a comparison module, configured to compare the first feature with features included in a first feature library to obtain a comparison result, wherein the features stored in the first feature library are features obtained by extracting features from the image using the first model; a determination module, configured to determine an image quality score of the target image when the comparison result indicates successful comparison; and a construction module, configured to extract a second feature of the target image using a second model when the image quality score is greater than a preset threshold, and save the second feature to a second feature library, wherein the second model is obtained by upgrading the first model, and the features stored in the second feature library are features obtained by extracting features from the image using the second model.

[0019] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed by a processor.

[0020] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.

[0021] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.

[0022] This application allows for the extraction of a first feature from a captured target image using a first model; comparison of the first feature with features included in a first feature library to obtain a comparison result; determination of the target image's image quality score when the comparison result indicates successful comparison; and extraction of a second feature from the target image using a second model obtained by upgrading the first model when the image quality score is greater than a preset threshold. This second feature is then saved to a second feature library, achieving seamless feature value upgrading. Since the first feature can be extracted using the un-upgraded first model first, and the second feature can be extracted using the second model only when the first feature comparison is successful and the image quality score is greater than the preset threshold, there is no need for the object to be identified to re-capture the image. Therefore, this addresses the problem of low efficiency in feature library construction in related technologies, improving feature library construction efficiency and enhancing user experience. Attached Figure Description

[0023] Figure 1 This is a schematic diagram illustrating an application scenario of a method for constructing a feature library according to an embodiment of this application;

[0024] Figure 2 This is a flowchart illustrating an optional feature library construction method according to an embodiment of this application;

[0025] Figure 3 This is a schematic diagram of an optional data migration according to an embodiment of this application;

[0026] Figure 4 This is a flowchart of a method for constructing a feature library according to a specific embodiment of the present invention;

[0027] Figure 5 This is a timing diagram of a feature library construction method according to a specific embodiment of the present invention;

[0028] Figure 6 This is a structural block diagram of an optional feature library construction apparatus according to an embodiment of this application;

[0029] Figure 7 This is a computer system architecture block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] According to one aspect of the embodiments of this application, a method for constructing a feature library is provided. Optionally, in this embodiment, the above-described method for constructing a feature library may be applied, but is not limited to, to applications such as... Figure 1 The hardware environment shown includes terminal device 102 and server 104. Server 104 can be connected to terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to terminal device 102 or clients installed on terminal device 102. A database can be set up on server 104 or independently of server 104 to provide data storage services for server 104.

[0033] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wireless Fidelity (WIFI) and Bluetooth. Terminal device 102 may be, but is not limited to, a personal computer (PC), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, a cloud server, server cluster, or other server types.

[0034] The feature library construction method of this application embodiment can be executed by server 104, terminal device 102, or jointly by server 104 and terminal device 102. Alternatively, the feature library construction method of this application embodiment can be executed by a client installed on terminal device 102.

[0035] Taking the feature library construction method in this embodiment as an example, which is executed by terminal device 102 (server 104), Figure 2 This is a flowchart illustrating an optional feature library construction method according to an embodiment of this application, such as... Figure 2 As shown, the process of this method may include the following steps:

[0036] Step S202: Extract the first feature of the acquired target image using the first model;

[0037] In this embodiment, the first model can be a model used for feature extraction and recognition of objects included in an image. The first model can be a biometric recognition model, such as a face recognition model, palm vein recognition model, fingerprint recognition model, palmprint recognition model, iris recognition model, etc. The first model can also be an object recognition model, such as a barcode recognition model, vegetable recognition model, fruit recognition model, etc. The first model can be a model deployed in a target system, which can be a recognition system, attendance system, etc. The target system may also include an image acquisition device for acquiring target images.

[0038] In this embodiment, the target image may include the target object to be identified. The target object may include a face, palm veins, fingerprints, palm prints, irises, etc., and may also include items such as vegetables, fruits, barcodes, etc.

[0039] Step S204: Compare the first feature with the features included in the first feature library to obtain a comparison result, wherein the features stored in the first feature library are features obtained by extracting features from the image using the first model;

[0040] In this embodiment, the first feature library may be a database corresponding to the first model, which stores feature values ​​extracted by the first model, such as facial feature values, palm vein feature values, fingerprint feature values, palm print feature values, barcode feature values, vegetable feature values, fruit feature values, etc.

[0041] In this embodiment, after upgrading the first model, for the acquired target image, the first model can be used to extract the first feature of the target image, and the first feature can be compared with the features in the first feature library to determine the similarity between the first feature and the features included in the first feature library. The comparison result is determined based on the similarity. The comparison result can include "successful comparison" or "identified comparison". When there is a similarity score greater than the similarity threshold, the comparison result is "successful comparison"; when every similarity score is less than the similarity threshold, the comparison result is "failed comparison".

[0042] Step S206: If the comparison result indicates that the comparison is successful, determine the image quality score of the target image;

[0043] In this embodiment, upon successful comparison, multiple quality dimensions of the image, such as sharpness, angle, occlusion, size, and brightness, are comprehensively considered for a quantitative evaluation of the target image to determine its suitability for feature value updating. The image quality score is a score reflecting the overall quality of the image, calculated by comprehensively evaluating multiple quality dimensions of the target image. It is based on multiple factors such as image sharpness, angle, occlusion degree, size, and brightness, and is calculated through normalization and weighting to determine whether the image is suitable for feature value extraction and updating.

[0044] Step S208: If the image quality score is greater than a preset threshold, the second feature of the target image is extracted using the second model, and the second feature is saved in the second feature library. The second model is obtained by upgrading the first model, and the features stored in the second feature library are the features obtained by extracting features from the image using the second model.

[0045] In this embodiment, the second feature library is a database corresponding to the second model, used to store feature values ​​extracted by the second model, gradually replacing the data in the first feature library. Two databases can be established to store the first and second feature libraries respectively, and the old database can be migrated to the new database. A data migration diagram can be found in the appendix. Figure 3 ,like Figure 3 As shown, it can be determined whether the first feature is successfully matched with the feature in the old database. If the match is successful, the second feature extracted by the second model is saved to the new database, and the first feature in the old database is deleted, which is equivalent to completing the data migration.

[0046] In this embodiment, upgrading the first model to obtain the second model may include upgrading the version of the first model to obtain the second model, or upgrading the functionality of the first model to obtain the second model. After the model upgrade, two databases can be established, namely a first feature database and a second feature database. The first model is first compared with the first feature database. According to the comparison result, if they match, it means that the target is in the first feature database. Then, the target is first evaluated for quality. If a preset threshold is met, the second model is used to re-extract feature values, delete the old feature values, and store the new feature values ​​in the second feature database. This process is repeated to dynamically update the model for each feature value without any noticeable difference.

[0047] For example, consider an attendance device using a first-generation facial recognition model. When upgrading to a second-generation model, the device first extracts the first feature from the currently captured target face image using the first model. Next, it compares this first feature with features in a first feature library, which stores all registered face features extracted using the first model. If the comparison shows a match between the target face and a feature in the first feature library, the device further scores the target face image for quality, evaluating factors such as clarity, angle, occlusion, size, and brightness. If the image quality score exceeds a preset threshold, indicating sufficient image quality, the device re-extracts the second feature of the target face using the second model and saves it to the second feature library, completing the feature value upgrade. The second feature library is specifically used to store feature values ​​extracted using the second model. Throughout the upgrade process, the device does not need to stop the recognition service or perform a full comparison or recalculation of feature values, achieving high-quality, high-efficiency feature library construction and model upgrade.

[0048] The first model extracts the first feature of the acquired target image, and then compares this feature with all features stored in the first feature library to obtain the comparison result. For target images that successfully match, their image quality is further scored to ensure that the image meets preset quality standards in multiple dimensions such as angle, sharpness, occlusion, size, and brightness. When the image quality score exceeds a preset threshold, it indicates that the image quality is good enough. At this time, the upgraded second model is used to extract features from the target image again to generate more accurate second features. The second features are then saved to the second feature library, replacing the original first features, achieving seamless upgrade of feature values. This method effectively avoids the re-extraction of all feature values ​​and the full update of the database, greatly reducing the consumption of computing resources. At the same time, the quality-driven feature extraction strategy ensures the accuracy and reliability of feature value updates and reduces the problem of feature library pollution caused by low-quality images. Compared with the need to recalculate all feature values ​​during model upgrade, this method significantly reduces the computational complexity of the upgrade process, improves the system's operating efficiency and stability, realizes intelligent and automated feature library updates, and improves user experience and management efficiency.

[0049] This application allows for the extraction of a first feature from a captured target image using a first model; comparison of the first feature with features included in a first feature library to obtain a comparison result; determination of the target image's image quality score when the comparison result indicates successful comparison; and extraction of a second feature from the target image using a second model obtained by upgrading the first model when the image quality score is greater than a preset threshold. This second feature is then saved to a second feature library, achieving seamless feature value upgrading. Since the first feature can be extracted using the un-upgraded first model first, and the second feature can be extracted using the second model only when the first feature comparison is successful and the image quality score is greater than the preset threshold, there is no need for the object to be identified to re-capture the image. Therefore, this addresses the problem of low efficiency in feature library construction in related technologies, improving feature library construction efficiency and enhancing user experience.

[0050] In an exemplary embodiment, determining the image quality score of a target image includes: determining sub-scores of the target image from multiple target dimensions; determining judgment conditions for each target dimension; and determining the image quality score based on the determined sub-scores of each target dimension when the sub-scores of the target dimensions satisfy the judgment conditions. In this embodiment, target dimensions may include sharpness, angle, occlusion, size, brightness, etc. Sub-scores of the target image under each target dimension can be determined separately, and the image quality score can be determined based on the sub-scores. A sub-score can be a normalized score for each quality dimension (such as sharpness, angle, occlusion, size, and brightness) in the image quality score.

[0051] In this embodiment, determining the image quality score based on the determined sub-scores of each of the target dimensions may include determining the judgment conditions for each target dimension, and determining the image quality score based on the determined sub-scores of each of the target dimensions if the sub-scores of the target dimensions meet the judgment conditions of the target dimension. For example, in a biometric system, when a device needs to be upgraded to a new model, the system first uses the old model to recognize the target image. During the recognition process, the system evaluates the quality of the target image, including determining sub-scores of the target image from multiple target dimensions such as sharpness, angle, occlusion, target size, and brightness. If the target image is successfully matched in the old database, and its sharpness sub-score meets the set threshold of 0.9, angle sub-score meets the set threshold of 0.7, occlusion sub-score meets the set threshold of 0.9, size sub-score meets the set threshold of 0.8, and brightness sub-score meets the set threshold of 0.5, then the system combines these sub-scores with weights to calculate a weighted geometric average to obtain the final image quality score. Only when the overall score reaches the preset total score threshold, such as 0.75 or higher, will the system use the new model to extract feature values ​​from the image, store the new feature values ​​in the new database, and delete the corresponding feature values ​​in the old database, thus achieving a seamless upgrade of the feature value version.

[0052] In this embodiment, determining the image quality score based on the sub-scores of each of the determined target dimensions may further include: determining a first number of target dimensions, determining a second number based on the first number, wherein the second number is less than the first number, and determining the image quality score based on the determined sub-scores of each of the target dimensions when the sub-scores including the second number satisfy the judgment condition. For example, the target dimensions may include a sharpness dimension, an angle dimension, an occlusion dimension, a size dimension, and a brightness dimension, i.e., the first number is 5, and the second number may be four-fifths of the first number, i.e., the second number is 4. Then, when four sub-scores among the sub-scores of the sharpness dimension, the angle dimension, the occlusion dimension, the size dimension, and the brightness dimension satisfy the judgment condition, the image quality score is determined based on the determined sub-scores of each of the target dimensions.

[0053] In this embodiment, each target dimension corresponds to a judgment condition. New model feature extraction and replacement are only triggered when the image quality (angle / quality score / occlusion / size / brightness) meets the judgment condition, ensuring the reliability of data updates. The correspondence between target dimensions and judgment conditions can be seen in Table 1.

[0054] Table 1

[0055]

[0056] In this embodiment, determining the image quality score based on the sub-scores of each of the determined target dimensions may include: for each target dimension, determining the product of the score weight of the target dimension and the sub-score of the target dimension to obtain multiple first products, and determining the sum of the multiple first products as the image quality score.

[0057] In this embodiment, determining the image quality score based on the sub-scores of each of the determined target dimensions may include: determining the average value of all sub-scores and using the average value as the image quality score.

[0058] In this embodiment, when recognizing images, feature values ​​are updated only for target images that meet preset quality standards, avoiding full calculations for all images and reducing computational consumption during the upgrade process. Furthermore, after the system upgrade, the old and new models and their corresponding databases are dynamically compatible, ensuring the continuity of the recognition service and avoiding service interruptions due to model switching. It also eliminates the need to save facial images, reducing the risk of privacy leaks. When the quality scores of all images reach or exceed a preset migration threshold, the feature values ​​are automatically upgraded to the new algorithm model, achieving an efficient and secure model version upgrade strategy.

[0059] In one exemplary embodiment, determining a sub-score for the target image from multiple target dimensions includes at least one of the following: if the multiple target dimensions include a sharpness dimension, determining the sharpness of the target image and determining the sub-score for the sharpness dimension based on the sharpness; if the multiple target dimensions include an angle dimension, determining the target angle between a first plane containing a target object in the target image and the imaging plane of the acquisition device acquiring the target image, and determining the sub-score for the angle dimension based on the target angle; if the multiple target dimensions include an occlusion dimension, determining the target occlusion coefficient of the target object in the target image and determining the sub-score for the occlusion dimension based on the target occlusion coefficient; if the multiple target dimensions include a size dimension, determining the target size of the target object in the target image and determining the sub-score for the size dimension based on the target size; if the multiple target dimensions include a brightness dimension, determining the target brightness of the target object in the target image and determining the sub-score for the brightness dimension based on the target brightness. In this embodiment, sharpness in the sharpness dimension can be calculated using Laplacian variance, Brenner gradient function, etc., and after normalization, a sub-score for the sharpness dimension can be obtained. The deflection angle between the plane containing the target object and the imaging plane of the acquisition device, i.e., the target angle, can be determined, and normalized to obtain a sub-score for the angle dimension. The pixel percentage of non-target object regions can be calculated through image segmentation or edge detection, and this pixel percentage can be determined as the target occlusion coefficient. Normalizing the target occlusion coefficient yields a sub-score for the occlusion dimension. The effective pixel percentage of the target object region in the entire image can be calculated, and this effective pixel percentage can be determined as the target size. Normalizing the target size yields a sub-score for the size dimension. The mean or median grayscale value of the target object region can be calculated, and this mean or median grayscale value can be determined as the target brightness. Normalizing the target brightness yields a sub-score for the brightness dimension.

[0060] In this embodiment, taking the palm vein or palm print recognition model as an example, the definition of the target dimension and the correspondence with normalization can be found in Table 2. The core purpose of normalization is to map indicators of different dimensions and ranges to a unified, unitless interval [0, 1] so as to perform comprehensive weighted calculation.

[0061] Here, 1 represents the optimal state.

[0062] Table 2

[0063]

[0064] In this embodiment, the quantization method for the sharpness (S) dimension can employ the Laplacian variance. The variance is calculated after performing a Laplacian convolution on the image; the larger the variance, the sharper the image. The normalization formula can be Norm_S = S / S_max, where S represents the Laplacian variance value of the current image, and S_max is a predefined "ideal sharpness" threshold. This value is determined through experiments with a large number of high-quality samples (e.g., the 95th percentile of all sharpness values). Any value higher than S_max will be truncated to 1.

[0065] Calculation example: Let S_max = 500 (this is a hypothetical experimental value). Image A has S_A = 450. Norm_S_A = 450 / 500 = 0.90. Image B has S_B = 600 (exceeding S_max). Norm_S_B = min(600 / 500, 1.0) = 1.00.

[0066] In the angle (Angle, A) dimension, quantization can be achieved by algorithmically estimating the deflection angle A (in degrees) between the palm plane and the imaging sensor plane. The normalization formula can be Norm_A = max(0, 1 - (|A| / A_max)). Here, A represents the estimated deflection angle, and A_max represents the maximum allowed deflection angle. For example, A_max = 30° means that an image quality score exceeding 30° is 0.

[0067] Calculation example: Let A_max = 30. Image A has A_A = 10°. Norm_A_A = 1 - (|10| / 30) ≈ 0.67. Image B has A_B = 35°. Norm_A_B = max(0, 1 - (|35| / 30)) = 0.00.

[0068] In the occlusion (O) dimension, the quantization method can be to obtain a mask of the palm region through an image segmentation model and calculate the pixel ratio of the non-palm region (occluded object or background). O = (Number of Occluded Pixels) / (Total Pixels in ROI). The normalization formula can be Norm_O = 1 – O. This is a direct linear transformation. The less occlusion (the smaller O), the closer Norm_O is to 1.

[0069] Calculation example: The occlusion percentage of image A is O_A = 0.15 (15% of the area is occluded). Norm_O_A = 1 - 0.15 = 0.85. The occlusion percentage of image B is O_B = 0.02. Norm_O_B = 1 - 0.02 = 0.98.

[0070] In terms of target size (Size, Area), i.e., the dimension of dimensions, the quantization method can be used to calculate the effective pixel area of ​​the palm region, Area. The normalization formula (using sigmoid function logic, such as parabolic) can be expressed as Norm_Size = 1 - (|Area - Area_ideal| / Area_ideal)^2. Here, Area_ideal is the predefined, ideal pixel area of ​​the palm. This formula scores highest (1) at Area_ideal, and the score decays faster the value deviates from the ideal.

[0071] Calculation Example: Let Area_ideal = 10000 pixels. Image A has Area_A = 9500 pixels. Norm_Size_A = 1 - (|9500 - 10000| / 10000)^2 = 1 - (0.05)^2 = 0.9975. Image B has Area_B = 6000 pixels. Norm_Size_B = 1 - (|6000 - 10000| / 10000)^2 = 1 - (0.4)^2 = 0.84.

[0072] In the luminance dimension (L), the quantization method can be expressed as calculating the average gray value (range 0-255) of the palm region. The normalization formula (using the Gaussian function idea) can be expressed as Norm_L=exp(-((L-L_ideal)^2) / (2 L_std^2)). Where L_ideal: the ideal brightness value (e.g., 128). L_std can be represented as a parameter controlling the brightness tolerance range (e.g., 50). This formula scores the highest at L_ideal (1), and the score decreases with a Gaussian curve as it moves further away from the ideal value.

[0073] Calculation example: Let L_ideal = 128, L_std = 50. Image A has L_A = 130. Norm_L_A = exp(-((130-128)^2) / (2 50^2))≈exp(-(4) / (5000))≈exp(-0.0008)≈0.9992. The L_B of image B is 60. Norm_L_B=exp(-((60-128)^2) / (2 50^2))=exp(-(4624) / (5000))≈exp(-0.9248)≈0.396.

[0074] In this embodiment, by maintaining the old and new feature models and their corresponding databases in parallel, it is ensured that the old model can continue to be used to verify the identity of the target during system upgrades, thereby achieving seamless model version switching for users and avoiding interruption of the recognition service. Furthermore, the system introduces a quality-driven feature value migration condition, that is, the extraction and replacement of feature values ​​by the new model is only triggered when the image quality (including sharpness, angle, occlusion, size, and brightness) reaches a preset threshold. This condition ensures the reliability of feature value updates and avoids data misplacement due to image quality issues. To achieve efficient database updates, the system adopts an incremental feature library update method. Through a closed-loop process of "comparison-quality verification-feature replacement," quality verification and feature value replacement are only performed on targets identified through comparison using the old model, avoiding a full recalculation of the entire database and significantly reducing the computational power required during the upgrade process. This strategy not only optimizes resource utilization but also provides a solution that balances efficiency and quality for model upgrades in the recognition system, ensuring data continuity and reliability. Of course, each quality dimension in this embodiment, such as sharpness, angle, occlusion, size, and brightness, can be determined by independently evaluating various features of the target image, such as sharpness S, target angle A, occlusion coefficient O, target size Size, and target brightness L. These sub-scores are then used to calculate a comprehensive image quality score through a weighted geometric average, providing a scientific basis for the dynamic transfer of feature values.

[0075] For example, during the upgrade of the recognition system, the system detects a target image. First, it analyzes the sharpness dimension. The Laplacian variance of the image is 450, and the set sharpness threshold S_max is 500. Therefore, the sub-score Norm_S for the sharpness dimension is 0.9. Next, it analyzes the angle dimension. The deflection angle between the palm plane and the imaging plane of the acquisition device in the target image is 10 degrees, and the set maximum allowable angle A_max is 30 degrees. Therefore, the sub-score Norm_A for the angle dimension is 0.67. Finally, it evaluates the occlusion dimension, calculating the occluded area as a percentage of the total area. The domain ratio is 0.15, and the set occlusion threshold is 0.4, so the sub-score Norm_O for the occlusion dimension is 0.85. Analyzing the size dimension, the effective pixel area of ​​the detected palm region is 9500 pixels, and the set ideal area Area_ideal is 10000 pixels, resulting in a sub-score Norm_Size of 0.9975. Finally, through brightness dimension analysis, the average grayscale value of the palm region is 130, and the set ideal brightness value L_ideal is 128, resulting in a sub-score Norm_L of 0.9992. Based on these sub-scores, the system further calculates a comprehensive image quality score to determine whether to use the image for feature value transfer.

[0076] In this scenario, the system only analyzes images that match the target and meet the quality standards. For images that do not meet the preset threshold, the re-extraction and replacement process of feature values ​​is not triggered, thereby effectively saving computing resources, reducing the amount of data processing, and ensuring the high quality of new feature values, thus achieving a smooth upgrade of feature value versions.

[0077] In an exemplary embodiment, determining the image quality score based on the determined sub-scores of each of the target dimensions includes: determining a score weight for each target dimension; determining an exponential score based on the score weights and sub-scores of the target dimensions, wherein the exponential score is calculated exponentially using the score weights and sub-scores; and determining the image quality score based on the exponential score and the score weights of each target dimension. In this embodiment, determining the image quality score involves determining the score weights for each target dimension (such as sharpness, angle, occlusion, size, and brightness), which reflect the relative importance of each dimension in image quality assessment. Subsequently, the exponential score is calculated exponentially based on the score weights of the target dimensions and their corresponding sub-scores. This step ensures that the assessment results for each dimension of image quality are non-linearly weighted according to their importance. Ultimately, the image quality score is determined by an index score and the weights of each dimension. This weighted index score calculation method not only accurately reflects the overall image quality level but also highlights dimensions that are particularly critical for feature extraction, such as sharpness and occlusion, thus avoiding the use of low-quality image feature data during the update process. Compared to linear weighted averaging, it is more sensitive to extreme values ​​in image quality, effectively preventing inaccurate feature extraction due to extremely poor quality in a single dimension. By implementing this embodiment, the accuracy and reliability of image quality assessment are significantly improved, thereby ensuring the efficiency and data quality of feature value library updates. The scoring weights and index function parameters can be flexibly adjusted according to specific application scenarios and the distribution characteristics of image data to adapt to different biometric systems and model upgrade strategies.

[0078] In an exemplary embodiment, determining an index score based on the rating weights of the target dimension and the sub-ratings of the target dimension includes: determining a first index value with the sub-ratings of the target dimension as the base and the rating weights of the target dimension as the index; and determining the first index value as the index score. In this embodiment, the sub-rating can be represented as A, the rating weight can be represented as B, and the first index value can be represented as A. B .

[0079] In an exemplary embodiment, determining the image quality score based on the index score and the score weight of each target dimension includes: determining the product of the index scores corresponding to all target dimensions; determining the sum of the score weights of all target dimensions; determining the ratio of a target constant to the sum; determining a second index value with the product as the base and the ratio as the exponent; and determining the second index value as the image quality score. In this embodiment, when the target dimensions include sharpness, angle, occlusion, size, and brightness, Norm_S can represent a sub-score for the sharpness dimension, Ws can represent the score weight for the sharpness dimension, Norm_A can represent a sub-score for the angle dimension, Wa can represent the score weight for the angle dimension, Norm_O can represent a sub-score for the occlusion dimension, Ws can represent the score weight for the occlusion dimension, Norm_Size can represent a sub-score for the size dimension, Wsize can represent the score weight for the size dimension, Norm_L can represent a sub-score for the brightness dimension, and Wl can represent the score weight for the brightness dimension. Then, the image quality score can be expressed as Quality_Score = (Norm_S^Ws) Norm_A^Wa Norm_O^Wo Norm_Size^Wsize Norm_L^Wl)^(1 / Ws+Wa+Wo+Wsize+Wl). Where Ws+Wa+Wo+Wsize+Wl can be 1 or other values, and the scoring weights of each target dimension can be configured according to the application scenario.

[0080] For example, the weights are set as Ws=0.4, Wa=0.15, Wo=0.3, Wsize=0.1, Wl=0.05 (∑=1). The normalized values ​​of a certain authentication image are: Norm_S=0.90 (very clear), Norm_A=0.67 (slightly off-center angle), Norm_O=0.85 (slight occlusion), Norm_Size=0.84 (target is too small), Norm_L=0.40 (severely insufficient brightness). The image quality score is then calculated as Quality_Score=(0.90^0.4). (0.67^0.15) (0.85^0.3) (0.84^0.1) (0.40^0.05).

[0081] Calculate the following indices: 0.90^0.4 ≈ 0.958, 0.67^0.15 ≈ 0.935, 0.85^0.3 ≈ 0.953, 0.84^0.1 ≈ 0.983, 0.40^0.05 ≈ 0.861 (this value is extremely low, but is appropriately suppressed due to its small weight). Multiply the results together: 0.958 0.935 0.953 0.983 0.861 ≈ 0.691. Assume the system's migration threshold T_total = 0.75. Because 0.691 < 0.75, the authentication is successful, but the feature migration process will not be triggered. Despite high clarity, issues such as angle deviation, occlusion, small size, and especially abnormal brightness severely lower the overall score. The weighted geometric mean successfully captured this "weakest link effect," preventing the use of this low-quality image to update the feature library and ensuring data reliability. Using a weighted arithmetic mean would result in a much higher score, potentially leading to misjudgments.

[0082] In an exemplary embodiment, after comparing the first feature with features included in the first feature library and obtaining a comparison result, the method further includes: if the comparison result indicates a comparison failure, extracting the second feature of the target image using the second model; and identifying the target object included in the target image based on the second feature. In this embodiment, when the biometric feature model used by the device needs to be upgraded, not only is a seamless switch between the old and new models achieved, but an effective solution is also proposed to address the feature value incompatibility problem caused by model upgrades. Specifically, after obtaining a comparison result by comparing the first feature with features in the first feature library, if the comparison result indicates a comparison failure, the system will automatically activate the second model to extract the second feature from the target image. Subsequently, the target object in the target image is identified based on the second feature. This step ensures that the stability and accuracy of the recognition system are not affected even during model upgrades. This design intelligently judges image quality and only performs feature value updates when the image quality meets certain requirements, effectively reducing the workload of data recalculation caused by feature version incompatibility and saving computing resources. Simultaneously, the use of an incremental update strategy, rather than a traditional full update, greatly reduces the number of database writes and optimizes the efficiency of the upgrade process. This approach not only reduces the impact of system upgrades on users and services, but also improves the security and reliability of feature value updates, enabling the biometric system to continuously provide users with a high-quality service experience during model upgrades.

[0083] In an exemplary embodiment, after determining the image quality score of the target image, the method further includes: if the image quality score is greater than a preset threshold, deleting features in the first feature library that successfully matched the first feature. In this embodiment, after the system determines the image quality score of the target image, if the score exceeds the preset threshold, it means that the target image meets the high-quality standard. At this time, a deletion operation is triggered for features in the first feature library that successfully matched the first feature, and then the corresponding features in the old database are replaced with feature values ​​extracted by the new model. This mechanism ensures that only images that have undergone strict quality checks are used for feature value updates during the seamless switching of feature versions, thereby ensuring the purity and effectiveness of the new database. In this way, not only is feature extraction failure or error due to poor image quality avoided, but the migration of feature values ​​is also ensured to be completed gradually without interrupting the normal operation of the system, greatly reducing the resource consumption and performance impact caused by system upgrades. The preset threshold can be flexibly adjusted according to specific application scenarios and needs to achieve the best balance between feature value update quality and efficiency. This dynamic migration and quality control strategy effectively improves the adaptability and stability of the biometric system, ensures a smooth transition of feature model version upgrades, and maintains a high level of recognition accuracy.

[0084] In an exemplary embodiment, after saving the second feature to the second feature library, the method further includes: determining the target number of features included in the first feature library; and deleting the first model and the first feature library if the target number is less than a preset number. In this embodiment, after the device completes the switch between the old and new feature value models and successfully saves the second feature (i.e., the feature value extracted by the new model) to the second feature library, the system further monitors the target number of features in the first feature library. If the target number in the first feature library is less than a preset threshold number, the system will automatically perform a deletion operation, removing the first model and its corresponding feature library. This strategy ensures that after the feature value migration is completed, the old model and its database can be cleaned up in a timely manner, thereby freeing up storage space and computing resources and optimizing system operating efficiency. By implementing this technical solution, the system can automatically adjust and maintain the optimal model version while ensuring biometric continuity and data quality, reducing management costs and improving the resource utilization efficiency and response speed of the device. The system can also dynamically adjust the preset threshold number to adapt to the feature library maintenance needs in different scenarios, further enhancing the flexibility and adaptability of the system.

[0085] In an exemplary embodiment, after saving the second feature to the second feature library, the method further includes: determining the duration for which the number of target features included in the first feature library remains unchanged; and deleting the first model and the first feature library if the duration exceeds a preset duration. In this embodiment, after the device completes saving the second feature value to the second feature library, it monitors the change in the number of target features in the first feature library over a certain period of time. The system automatically calculates the duration for which the number of target features in the first feature library remains unchanged. Once this duration exceeds a preset threshold, it is considered that all feature values ​​meeting quality requirements have been successfully migrated to the second feature library, and at this time, the deletion operation of the first model and its related feature library is performed. This strategy ensures that the system can intelligently determine the completion status of feature value version migration without manual intervention and release unused resources in a timely manner, avoiding redundant models and feature libraries occupying storage space and computing resources. In this way, not only is the burden on the device reduced, but the system operating efficiency is further optimized, and the effective management and utilization of resources are achieved. The preset duration can be flexibly adjusted according to actual needs to adapt to the feature library update requirements of different scales, which makes this solution more adaptable to a variety of application scenarios and enhances its practicality and flexibility.

[0086] In an exemplary embodiment, after saving the second feature to the second feature library, the method further includes: determining the target number of features included in the first feature library; determining the duration during which the target number remains unchanged; and deleting the first model and the first feature library if the target number is less than the preset number and the duration is greater than the preset duration. In this embodiment, after migrating the new feature value and saving it to the second feature library, the system further implements a dynamic monitoring and cleanup strategy. The system first determines the target number of features stored in the first feature library, and then monitors the duration during which the target number remains unchanged. Once it is found that the target number in the feature library is lower than the preset threshold, and this state lasts for more than the preset duration, the system will automatically perform the deletion operation of the first model and the first feature library. This mechanism ensures that after the system completes the smooth transition of feature value versions, it can clean up outdated models and data in a timely manner, saving storage resources and avoiding the impact of redundant models on system operating efficiency, thus achieving automated optimization and management of resources. Of course, the setting of the target number and duration in this embodiment can be flexibly adjusted according to specific application scenarios and needs to adapt to the requirements of feature libraries and model switching times of different sizes. In other embodiments not detailed, the system can also determine when to clean up old models and old feature libraries through periodic checks or external trigger signals, further enhancing the adaptability and controllability of the solution.

[0087] In an exemplary embodiment, comparing the first feature with features included in a first feature library to obtain a comparison result includes: determining the similarity between the first feature and features included in the first feature library; if any similarity is greater than a similarity threshold, determining the comparison result as a successful comparison; if all similarities are less than the similarity threshold, determining the comparison result as a failed comparison. In this embodiment, the similarity between the first feature and features included in the first feature library can be determined; if any similarity is greater than the similarity threshold, the comparison is determined to be successful; conversely, if all similarities are less than the similarity threshold, the comparison is determined to be a failed comparison. This process is essentially a step to confirm the identity of the target individual. By quantifying the similarity between features and using a similarity threshold as a judgment standard, it ensures that the system can accurately identify whether the target individual exists in the first feature library. This similarity-based comparison method not only improves the accuracy of the biometric system but also provides a foundation for subsequent quality-driven feature value transfer, that is, only after confirming the identity of the target individual will the image quality be further evaluated and a decision be made on whether to update the feature values. This method effectively avoids the waste of resources caused by blindly updating feature values, while also ensuring the quality of the updated feature values, which plays an important role in improving the efficiency and accuracy of biometric systems during model upgrades.

[0088] The method for constructing the feature library will be explained below with reference to specific implementation methods.

[0089] Figure 4 This is a flowchart of a method for constructing a feature library according to a specific embodiment of the present invention, such as... Figure 4 As shown, the process includes:

[0090] Step S402, upgrade the equipment to a new model.

[0091] Step S404: Establish the first feature library of the first model and the second feature library of the second model.

[0092] Step S406: Acquire images.

[0093] Step S408: Determine whether the migration is complete. If the result is no, proceed to step S410. If the result is yes, proceed to step S430.

[0094] Step S410: The first model extracts the first feature.

[0095] Step S412: Compare with the first feature library. If the comparison is successful, proceed to step S414; otherwise, proceed to step S430.

[0096] Step S414: Detect image quality from the dimensions of angle, sharpness, occlusion, size, and brightness. If the quality meets the standards, proceed to step S416; otherwise, proceed to step S426.

[0097] Step S416, second model feature extraction.

[0098] Step S418: Delete the old feature values.

[0099] Step S420: The new feature values ​​are stored in the new database.

[0100] Step S422: Determine whether all data migration is complete. If the result is yes, proceed to step S424. If the result is no, proceed to step S406.

[0101] Step S424: Clear the first feature library.

[0102] Step S426: Retain the old feature values.

[0103] Step S428: Return the recognition result, either successful or recognized.

[0104] Step S430: Feature extraction of the new model.

[0105] Step S432: Compare the new feature values ​​with the new data.

[0106] Figure 5 This is a timing diagram of a feature library construction method according to a specific embodiment of the present invention, such as... Figure 5 As shown, the acquisition end sends real-time images to the comparison module. The comparison module compares the features of the real-time image with the features of the old model in the database. If a match is found, the database returns the old feature record to the quality assessment end. When the quality assessment end determines that the image quality meets the standard, it sends a quality compliance signal to the feature extraction end. The feature extraction end extracts new features and sends them to the data volume to replace the old features. If the comparison module fails to find a match, it sends a signal to the feature extraction end to directly extract new features. The feature extraction end extracts the new features and stores them in the new feature database. Through a closed-loop process of "comparison-quality verification-feature replacement," feature values ​​are migrated one by one, avoiding full recalculation and significantly reducing the computational cost of upgrading. After the migration is complete, the old model and the old database are destroyed.

[0107] In the aforementioned embodiments, new and old feature models and corresponding databases are maintained in parallel during system upgrades. The target identity is determined by comparing the results of the old model, ensuring continuity of recognition. Furthermore, the user seamlessly switches between different versions of feature values ​​without interrupting face services. New model feature extraction and replacement are triggered only when image quality (angle / quality score / occlusion / size / brightness) meets preset thresholds, ensuring reliable data updates. Effective quality judgment ensures that the feature values ​​after switching are also optimal. A closed-loop process of "comparison-quality verification-feature replacement" achieves feature value migration line by line, avoiding full recalculation and significantly reducing upgrade computational power consumption. No full comparison is required; the total number of comparisons during the switching process remains unchanged, without additional performance consumption.

[0108] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0110] According to another aspect of the embodiments of this application, a feature library construction apparatus is also provided. This feature library construction apparatus can be used to implement the feature library construction method provided in the above embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0111] Figure 6 This is a structural block diagram of an optional feature library construction apparatus according to an embodiment of this application, such as... Figure 6 As shown, the apparatus for building this feature library includes:

[0112] Extraction module 62 is used to extract the first feature of the acquired target image using the first model;

[0113] The comparison module 64 is used to compare the first feature with the features included in the first feature library to obtain a comparison result, wherein the features stored in the first feature library are features obtained by extracting features from the image using the first model;

[0114] The determining module 66 is used to determine the image quality score of the target image when the comparison result indicates that the comparison is successful;

[0115] The construction module 68 is used to extract a second feature of the target image using a second model when the image quality score is greater than a preset threshold, and save the second feature to a second feature library. The second model is obtained by upgrading the first model, and the features stored in the second feature library are features obtained by extracting features from the image using the second model.

[0116] In an exemplary embodiment, the determining module 66 may determine the image quality score of the target image by: determining sub-scores of the target image from multiple target dimensions respectively; determining a judgment condition for each target dimension; and determining the image quality score based on the determined sub-scores of each target dimension when the sub-score of the target dimension satisfies the judgment condition.

[0117] In an exemplary embodiment, the determining module 66 may determine the sub-ratings of the target image from multiple target dimensions in at least one of the following ways: if the multiple target dimensions include a sharpness dimension, determine the sharpness of the target image and determine the sub-rating for the sharpness dimension based on the sharpness; if the multiple target dimensions include an angle dimension, determine the target angle between the first plane containing the target object in the target image and the imaging plane of the acquisition device acquiring the target image, and determine the sub-rating for the angle dimension based on the target angle; if the multiple target dimensions include an occlusion dimension, determine the target occlusion coefficient of the target object in the target image and determine the sub-rating for the occlusion dimension based on the target occlusion coefficient; if the multiple target dimensions include a size dimension, determine the target size of the target object in the target image and determine the sub-rating for the size dimension based on the target size; if the multiple target dimensions include a brightness dimension, determine the target brightness of the target object in the target image and determine the sub-rating for the brightness dimension based on the target brightness.

[0118] In an exemplary embodiment, the determining module 66 may determine the image quality score based on the determined sub-scores of each of the target dimensions in the following manner: determining a score weight for each target dimension; determining an index score based on the score weights of the target dimensions and the sub-scores of the target dimensions, wherein the index score is calculated exponentially from the score weights and the sub-scores; and determining the image quality score based on the index score and the score weights of each target dimension.

[0119] In an exemplary embodiment, the determining module 66 may determine an index score based on the rating weights of the target dimension and the sub-ratings of the target dimension by: determining a first index value with the sub-ratings of the target dimension as the base and the rating weights of the target dimension as the index; and determining the first index value as the index score.

[0120] In an exemplary embodiment, the determining module 66 may determine the image quality score based on the index score and the score weight of each of the target dimensions in the following manner: determining the product of the index scores corresponding to all the target dimensions; determining the sum of the score weights of all the target dimensions; determining the ratio of the target constant to the sum; determining a second index value with the product as the base and the ratio as the exponent; and determining the second index value as the image quality score.

[0121] In an exemplary embodiment, the apparatus may be used to: after comparing the first feature with features included in a first feature library and obtaining a comparison result, if the comparison result indicates a comparison failure, extract the second feature of the target image using the second model; and identify the target object included in the target image based on the second feature.

[0122] In an exemplary embodiment, the apparatus may be used to, after determining the image quality score of a target image, delete features in the first feature library that have successfully matched the first feature if the image quality score is greater than a preset threshold.

[0123] In an exemplary embodiment, the apparatus may be used to: determine a target number of features included in the first feature library after saving the second feature to the second feature library; and delete the first model and the first feature library if the target number is less than a preset number.

[0124] In an exemplary embodiment, the apparatus may be used to, after saving the second feature to a second feature library: determine the duration for which the target number of features included in the first feature library has not changed; and if the duration is longer than a preset duration, delete the first model and the first feature library.

[0125] In an exemplary embodiment, the apparatus may be used to: determine a target number of features included in the first feature library after saving the second feature to the second feature library; determine a duration during which the target number remains unchanged; and delete the first model and the first feature library if the target number is less than the preset number and the duration is greater than the preset duration.

[0126] In an exemplary embodiment, the comparison module 64 can compare the first feature with the features included in the first feature library in the following manner to obtain a comparison result: determine the similarity between the first feature and the features included in the first feature library; if there is a similarity greater than a similarity threshold in the similarity, determine that the comparison result is a successful comparison; if the similarity is less than the similarity threshold, determine that the comparison result is a failed comparison.

[0127] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0128] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.

[0129] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0130] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0131] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0132] According to another aspect of the embodiments of this application, a computer program product is also provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit 701, it performs various functions provided in the embodiments of this application. The sequence numbers of the embodiments of this application above are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0133] Figure 7 A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 7 As shown, the computer system 700 includes a Central Processing Unit (CPU) 701, which performs various appropriate actions and processes based on programs stored in ROM 702 or loaded into RAM 703 from storage section 708. Random access memory 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0134] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card, such as a local area network card or modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0135] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit 701, it performs various functions defined in the system of this application.

[0136] It should be noted that, Figure 7 The computer system 700 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0137] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0138] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A method for constructing a feature library, characterized in that, include: The first feature of the acquired target image is extracted using the first model; The first feature is compared with the features included in the first feature library to obtain a comparison result, wherein the features stored in the first feature library are features obtained by extracting features from the image using the first model; If the comparison result indicates a successful comparison, an image quality score for the target image is determined. If the image quality score is greater than a preset threshold, the second feature of the target image is extracted using the second model and the second feature is saved to the second feature library. The second model is obtained by upgrading the first model, and the features stored in the second feature library are the features obtained by extracting features from the image using the second model.

2. The method according to claim 1, characterized in that, The image quality score for determining the target image includes: Sub-scores of the target image are determined from multiple target dimensions respectively; Determine the judgment conditions for each of the target dimensions; If the sub-scores of the target dimensions satisfy the judgment conditions, the image quality score is determined based on the determined sub-scores of each target dimension.

3. The method according to claim 2, characterized in that, Determining the sub-scores of the target image from multiple target dimensions includes at least one of the following: When a sharpness dimension is included among the multiple target dimensions, the sharpness of the target image is determined, and the sub-score of the sharpness dimension is determined based on the sharpness. When an angle dimension is included among the multiple target dimensions, the target angle between the first plane containing the target object in the target image and the imaging plane of the acquisition device that acquires the target image is determined, and the sub-score of the angle dimension is determined based on the target angle. When an occlusion dimension is included among the multiple target dimensions, the target occlusion coefficient of the target object included in the target image is determined, and the sub-score of the occlusion dimension is determined based on the target occlusion coefficient; When a size dimension is included among the multiple target dimensions, the target size of the target object included in the target image is determined, and the sub-score of the size dimension is determined based on the target size; When a brightness dimension is included among the multiple target dimensions, the target brightness of the target object included in the target image is determined, and the sub-rating of the brightness dimension is determined based on the target brightness.

4. The method according to claim 2, characterized in that, Determining the image quality score based on the sub-scores of each of the identified target dimensions includes: Determine the scoring weight for each of the target dimensions; An index score is determined based on the rating weights of the target dimension and the sub-ratings of the target dimension, wherein the index score is calculated by exponentially using the rating weights and the sub-ratings. The image quality score is determined based on the index score and the score weight for each of the target dimensions.

5. The method according to claim 4, characterized in that, The index score is determined based on the score weights of the target dimension and the sub-scores of the target dimension, including: A first index value is determined, with the sub-rating of the target dimension as the base and the rating weight of the target dimension as the index; The first index value is determined as the index score.

6. The method according to claim 4, characterized in that, Determining the image quality score based on the index score and the score weight for each of the target dimensions includes: Determine the product of the index scores corresponding to all the target dimensions; Determine the sum of the rating weights for all the target dimensions; Determine the ratio of the target constant to the sum value; Determine a second exponent value with the product as the base and the ratio as the exponent; The second index value is determined as the image quality score.

7. The method according to claim 1, characterized in that, After comparing the first feature with the features included in the first feature library to obtain the comparison result, the method further includes: If the comparison result indicates a failure, the second feature of the target image is extracted using the second model; The target object included in the target image is identified based on the second feature.

8. The method according to claim 1, characterized in that, After determining the image quality score of the target image, the method further includes: If the image quality score is greater than a preset threshold, delete the features in the first feature library that were successfully matched with the first feature.

9. The method according to claim 1, characterized in that, After saving the second feature to the second feature library, the method further includes: Determine the target number of features included in the first feature library; If the target number is less than a preset number, delete the first model and the first feature library.

10. The method according to claim 1, characterized in that, After saving the second feature to the second feature library, the method further includes: determining the duration during which the number of targets of the features included in the first feature library remains unchanged; If the duration exceeds a preset duration, the first model and the first feature library are deleted.

11. The method according to claim 1, characterized in that, After saving the second feature to the second feature library, the method further includes: Determine the target number of features included in the first feature library; Determine the duration during which the target quantity remains unchanged; If the number of targets is less than a preset number and the duration is greater than a preset duration, delete the first model and the first feature library.

12. The method according to claim 1, characterized in that, By comparing the first feature with the features included in the first feature library, the comparison results include: Determine the similarity between the first feature and the features included in the first feature library; If there is a similarity score greater than the similarity threshold among the similarity scores, the comparison result is determined to be a successful comparison. If all similarities are less than the similarity threshold, the comparison result is determined to be a failure.

13. An apparatus for constructing a feature library, characterized in that, include: The extraction module is used to extract the first feature of the acquired target image using the first model; The comparison module is used to compare the first feature with the features included in the first feature library to obtain the comparison result, wherein the features stored in the first feature library are features obtained by extracting features from the image using the first model; The determination module is used to determine the image quality score of the target image when the comparison result indicates that the comparison is successful; The construction module is used to extract a second feature of the target image using a second model when the image quality score is greater than a preset threshold, and save the second feature to a second feature library. The second model is obtained by upgrading the first model, and the features stored in the second feature library are the features obtained by extracting features from the image using the second model.

14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.

16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

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

    CN114066877A

  • Image generation model training method and device, storage medium and electronic equipment

    CN116912639A