Object determination method and apparatus, storage medium, and electronic device
By dividing the target feature library into multiple sub-feature libraries based on preset object attribute subsets and comparing them according to priority, the problem of low comparison efficiency of detection equipment is solved, and the effect of improving comparison efficiency is achieved.
Patent Information
- Application Number
- CN202211742996.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-12-27
AI Technical Summary
The comparison efficiency of the detection equipment is low, especially when the types of targets to be detected are complex in edge scenarios. The target comparison capability of the equipment is limited, resulting in high performance consumption and long time consumption in the comparison operation.
The target feature library is divided into multiple sub-feature libraries according to a preset subset of object attributes. The sub-feature libraries are then compared in descending order of priority until the feature data of the target object is found.
It improves the efficiency of target feature comparison, avoids the problems of high equipment consumption and long time consumption caused by comparison one by one, and achieves the goal of speeding up the comparison hit rate.
Smart Images

Figure CN116010796B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of intelligent detection technology, and more specifically, to a method, apparatus, storage medium, and electronic device for determining an object. Background Technology
[0002] Currently, the demand for edge-cloud intelligent detection is booming, especially in edge scenarios where the types of targets to be detected are quite complex. However, the performance of detection equipment suffers from significant bottlenecks, particularly in its target comparison capabilities. For example, the speed of comparing the features of the target to be detected with the features in the control library (or the feature information base library deployed on the device) is limited by the device's chip capabilities. The larger the control library, the greater the limitation on comparison. Various technical means are needed to address the problem of insufficient comparison performance. For instance, related technologies involve comparing each feature of the target to be detected completely with the features in the control library. This results in high performance consumption and long processing time for the comparison operation. In other words, related technologies suffer from low comparison efficiency of detection equipment.
[0003] There is currently no effective solution to the technical problem of low comparison efficiency of detection equipment in related technologies. Summary of the Invention
[0004] This invention provides a method, apparatus, storage medium, and electronic device for determining an object, in order to at least solve the technical problem of low comparison efficiency of detection equipment in related technologies.
[0005] According to an embodiment of the present invention, a method for determining an object is provided, comprising: acquiring target feature data of an object to be detected; comparing the target feature data with feature data in the plurality of sub-feature libraries in descending order of priority, until feature data of the target object is found in the plurality of sub-feature libraries, or traversing the plurality of sub-feature libraries, wherein the similarity between the feature data of the target object and the target feature data is greater than or equal to a first similarity threshold, the plurality of sub-feature libraries are feature libraries obtained by dividing the target feature library according to a preset subset of object attributes, the priority of the plurality of sub-feature libraries is related to the subset of object attributes, the target feature library includes feature data of each object in the target object set under each object attribute in the object attribute set, the object attribute set includes the subset of object attributes, the target object set includes objects of the same type as the object to be detected; and determining the target object as the object to be detected if feature data of the target object is found in the plurality of sub-feature libraries.
[0006] In an exemplary embodiment, before comparing the target feature data sequentially with the feature data in the plurality of sub-feature libraries, the method further includes: determining the object attribute subset, wherein the object attribute subset is an attribute subset determined in a sample attribute set based on an intermediate feature library obtained in the past first predetermined period, the intermediate feature library including feature data of each object in the sample object set under each object attribute in the sample attribute set; dividing the target feature library into the plurality of sub-feature libraries based on the object attribute subset, and determining the priority of each sub-feature library in the plurality of sub-feature libraries.
[0007] In an exemplary embodiment, determining the object attribute subset includes: obtaining the sample attribute set corresponding to the intermediate feature library; selecting the object attribute subset from the sample attribute set, wherein the ratio of the number of candidate objects corresponding to the object attribute subset to the number of objects in the sample object set exceeds a preset ratio threshold, and the feature data of the candidate objects under the same object attribute in the object attribute subset are all the same, and are one attribute value of the same object attribute.
[0008] In an exemplary embodiment, selecting the subset of object attributes from the sample attribute set includes: searching the sample attribute set for object attributes that satisfy a first preset condition, wherein the first preset condition includes the ratio of the number of first candidate objects corresponding to the object attribute to the number of objects in the sample object set exceeding a first predetermined ratio threshold, the first candidate objects having identical feature data under the object attribute, and being an attribute value of the object attribute; and determining the subset of object attributes to include the found one or more object attributes if one or more object attributes satisfying the first preset condition are found.
[0009] In an exemplary embodiment, dividing the target feature library into multiple sub-feature libraries based on the object attribute subset includes: when the object attribute subset includes an object attribute, obtaining the attribute value of the object attribute in the target feature library to obtain an attribute value set, wherein the attribute value set includes N attribute values, where N is a positive integer greater than or equal to 2; dividing the target feature library into N sub-feature libraries according to the N attribute values, wherein the feature data of the objects included in each of the N sub-feature libraries are the same under the object attribute, and are one of the N attribute values.
[0010] In an exemplary embodiment, dividing the target feature library into multiple sub-feature libraries based on the object attribute subset includes: when the object attribute subset includes P object attributes, obtaining the attribute value of each of the P object attributes in the target feature library to obtain P attribute value subsets, wherein the number of attribute values in each of the P attribute value subsets is greater than or equal to 2, and P is a positive integer greater than or equal to 2; dividing the target feature library into N sub-feature libraries according to the P attribute value subsets, wherein the feature data of the objects included in each of the N sub-feature libraries under the same object attribute in the P object attributes are all the same, and are one attribute value of the same object attribute.
[0011] In one exemplary embodiment, determining the priority of each sub-feature library in the plurality of sub-feature libraries includes: setting the priority of each sub-feature library in the N sub-feature libraries in descending order of the number of objects included in each sub-feature library, wherein the more objects included in a sub-feature library, the higher the priority of the corresponding sub-feature library.
[0012] In an exemplary embodiment, determining the priority of each sub-feature library in the plurality of sub-feature libraries includes: when the sample attribute set includes the N attribute values, dividing the intermediate feature library into N sample sub-feature libraries according to the N attribute values, wherein the feature data of the objects included in each of the N sample sub-feature libraries are the same under the same object attribute, and is one of the N attribute values; setting the priority of the corresponding sub-feature libraries in the N sub-feature libraries according to the order of the number of objects included in each of the N sample sub-feature libraries from high to low, wherein the more objects included in a sample sub-feature library, the higher the priority of the corresponding sub-feature library, and the sample sub-feature libraries and the sub-feature libraries with corresponding relationships correspond to the same attribute value in the N attribute values; when the sample attribute set includes the N... In the case of M attribute values, the intermediate feature library is divided into M sample sub-feature libraries according to the M attribute values, where M is less than N. The feature data of the objects included in each of the M sample sub-feature libraries are the same under the same object attribute, and are one of the N attribute values. The priority of the corresponding M sub-feature libraries in the N sub-feature libraries is set according to the order of the number of objects included in each of the M sample sub-feature libraries from high to low. The priority of the NM sub-feature libraries other than the M sub-feature libraries in the N sub-feature libraries is set to be the same and lower than the priority of the M sub-feature libraries. The more objects included in a sample sub-feature library, the higher the priority of the corresponding sub-feature library. The sample sub-feature libraries and the sub-feature libraries with corresponding relationships correspond to the same attribute value in the N attribute values.
[0013] In an exemplary embodiment, before comparing the target feature data sequentially with the feature data in the plurality of sub-feature libraries, the method further includes: when the target feature data includes the feature data of the object to be detected under the target object attribute, and the object attribute set includes the target object attribute, setting the object attribute subset to include the target object attribute, obtaining the attribute value of the target object attribute in the target feature library, and obtaining an attribute value set, wherein the attribute value set includes N attribute values, where N is a positive integer greater than or equal to 2; dividing the target feature library into N sub-feature libraries according to the N attribute values, wherein the feature data of the object included in each of the N sub-feature libraries under the target object attribute are the same, and are one of the N attribute values.
[0014] In an exemplary embodiment, determining the object attribute subset includes: obtaining the sample attribute set corresponding to the intermediate feature library; selecting a first attribute subset from the sample attribute set, wherein the ratio of the number of first candidate objects corresponding to the first attribute subset to the number of objects in the sample object set exceeds a predetermined ratio threshold, and the feature data of the first candidate objects under the same object attribute in the first attribute subset are all the same, and are one attribute value of the same object attribute; when the target feature data includes the feature data of the object to be detected under the target object attribute, and the object attribute set includes the target object attribute, and the target object attribute is different from the object attribute in the first attribute subset, the object attribute subset is set to include the target object attribute and the first attribute subset; or when the target feature data does not include the feature data of the object to be detected under the target object attribute, or the object attribute set does not include the target object attribute, or the first attribute subset includes the target object attribute, the object attribute subset is set to include the first attribute subset.
[0015] In one exemplary embodiment, determining the object attribute subset includes: updating the object attribute subset every second predetermined period, and determining the updated attribute subset as the currently used object attribute subset.
[0016] According to another embodiment of the present invention, an object determination apparatus is also provided, comprising: an acquisition module for acquiring target feature data of an object to be detected; a comparison module for comparing the target feature data with feature data in the plurality of sub-feature libraries in descending order of priority, until feature data of the target object is found in the plurality of sub-feature libraries, or for traversing the plurality of sub-feature libraries, wherein the similarity between the feature data of the target object and the target feature data is greater than or equal to a first similarity threshold, the plurality of sub-feature libraries are feature libraries obtained by dividing the target feature library according to a preset subset of object attributes, the priority of the plurality of sub-feature libraries is related to the subset of object attributes, the target feature library includes feature data of each object in the target object set under each object attribute in the object attribute set, the object attribute set includes the subset of object attributes, and the target object set includes objects of the same type as the object to be detected; and a first determination module for determining the target object as the object to be detected when feature data of the target object is found in the plurality of sub-feature libraries.
[0017] According to yet another embodiment of the present invention, 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.
[0018] According to yet another embodiment of the present invention, 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 run the computer program to perform the steps in any of the above method embodiments.
[0019] This invention divides the target feature library into multiple sub-feature libraries according to a preset subset of object attributes. When target feature data of the object to be detected is obtained, the target feature data is compared with the feature data in each of the multiple sub-feature libraries in descending order of priority until the feature data of the target object is found in multiple sub-feature libraries or all sub-feature libraries have been traversed. When the feature data of the target object is found in multiple sub-feature libraries, the target object can be identified as the object to be detected. This achieves the purpose of comparing the target feature data with the feature data in each of the multiple sub-feature libraries in descending order of priority. The priority of the multiple sub-feature libraries is related to the preset subset of object attributes. That is, it achieves the purpose of dividing the target feature library into multiple sub-feature libraries according to the preset subset of object attributes and determining the priority of the multiple sub-feature libraries, thereby accelerating the comparison hit rate and avoiding the problems of high equipment consumption and long time consumption caused by comparing the target feature to be detected with each feature in the target feature library one by one in related technologies. This improves the efficiency of target feature comparison. Therefore, the technical problem of low comparison efficiency of detection equipment in related technologies has been solved, and the effect of improving comparison efficiency has been achieved. Attached Figure Description
[0020] Figure 1 This is a mobile terminal hardware structure block diagram of the object determination method according to an embodiment of the present invention;
[0021] Figure 2 This is a flowchart of a method for determining an object according to an embodiment of the present invention;
[0022] Figure 3 This is an overall flowchart of the target feature comparison method according to an embodiment of the present invention;
[0023] Figure 4 This is a flowchart of a target feature comparison method according to a specific embodiment of the present invention;
[0024] Figure 5 This is a structural block diagram of an object determination device according to an embodiment of the present invention. Detailed Implementation
[0025] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0027] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a mobile terminal hardware structure block diagram of the object determination method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0028] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the object determination method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0030] This embodiment provides a method for determining an object. Figure 2 This is a flowchart of a method for determining an object according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0031] Step S202: Obtain the target feature data of the object to be detected;
[0032] Step S204: According to the priority of the multiple sub-feature libraries from high to low, the target feature data is compared with the feature data in the multiple sub-feature libraries in turn until the feature data of the target object is found in the multiple sub-feature libraries, or the multiple sub-feature libraries are traversed. The similarity between the feature data of the target object and the target feature data is greater than or equal to a first similarity threshold. The multiple sub-feature libraries are feature libraries obtained by dividing the target feature library according to a preset subset of object attributes. The priority of the multiple sub-feature libraries is related to the subset of object attributes. The target feature library includes the feature data of each object in the target object set under each object attribute in the object attribute set. The object attribute set includes the subset of object attributes. The target object set includes objects of the same type as the object to be detected.
[0033] Step S206: If the feature data of the target object is found in the plurality of sub-feature libraries, the target object is identified as the object to be detected.
[0034] Through the above steps, the target feature library is divided into multiple sub-feature libraries according to a preset subset of object attributes. When target feature data of the object to be detected is obtained, the target feature data is compared with the feature data in each of the multiple sub-feature libraries in descending order of priority until the feature data of the target object is found in multiple sub-feature libraries or all sub-feature libraries have been traversed. When the feature data of the target object is found in multiple sub-feature libraries, the target object can be identified as the object to be detected. This achieves the purpose of comparing the target feature data with the feature data in each of the multiple sub-feature libraries in descending order of priority. The priority of the multiple sub-feature libraries is related to the preset subset of object attributes. That is, it achieves the purpose of dividing the target feature library into multiple sub-feature libraries according to the preset subset of object attributes and determining the priority of multiple sub-feature libraries, thereby accelerating the comparison hit rate and avoiding the problems of high device performance consumption and long time consumption caused by comparing the target feature to be detected with each feature in the target feature library one by one, which is used in related technologies. This achieves the effect of improving the efficiency of target feature comparison. Therefore, the technical problem of low comparison efficiency of detection equipment in related technologies has been solved, and the effect of improving comparison efficiency has been achieved.
[0035] The entity executing the above steps can be a terminal, device, or server, such as a camera device, a backend processor, or a processor with human-computer interaction capabilities configured on a storage device, or a processing device or unit with similar processing capabilities, but is not limited to these. The following explanation uses a server performing the above operations as an example (this is merely an illustrative example; in actual operation, other devices or modules can also perform the above operations):
[0036] In the above embodiments, the server obtains the target feature data of the object to be detected. The target feature data can be the feature data of the object to be detected in the video or image captured by the camera device. In practical applications, the target feature data will be different depending on the application scenario. For example, when the object to be detected is a person, the target feature data may include the person's facial features, clothing, or whether or not glasses are worn. When the object to be detected is a vehicle, the target feature data may include the license plate number, vehicle model, or the location of the license plate.Following the order of priority from high to low among multiple sub-feature libraries, the target feature data is compared sequentially with the feature data in each sub-feature library until the target object's feature data is found in any of the sub-feature libraries. Alternatively, all sub-feature libraries can be traversed. For example, following the order of priority from high to low, the target feature data is first compared with the feature data in the highest priority sub-feature library (e.g., sub-feature library V1). If no matching target object feature data (i.e., the similarity to the target feature data is greater than or equal to the first similarity threshold) is found in the highest priority sub-feature library (e.g., sub-feature library V1), then the target feature data is compared with the higher priority sub-feature library. The feature data in the next highest (or second highest) sub-feature library (such as sub-feature library V2) is compared, and so on, until the feature data of the target object is found in multiple sub-feature libraries or all sub-feature libraries have been traversed. These multiple sub-feature libraries are feature libraries obtained by dividing the target feature library according to a preset subset of object attributes. The priority of the multiple sub-feature libraries is related to the object attribute subset. The target feature library includes the feature data of each object in the target object set under each object attribute in the object attribute set. The object attribute set includes a subset of object attributes. The target object set includes objects of the same type as the object to be detected. For example, taking target detection in a university basketball court as an example, the aforementioned target feature library stores feature data of teachers and students on campus. This feature data covers multiple object attributes (i.e., the aforementioned object attribute set), such as place of origin, gender, and age. The aforementioned object attribute subset only contains a portion of this set; for example, it might only include the gender attribute. Based on this subset, the target feature library can be divided into multiple sub-feature libraries, such as a sub-feature library for male and a sub-feature library for female. In practical applications, the subset can be used to determine the target feature library based on the gender attributes included in the sub-feature library. The attribute values of an object attribute (which can be one or more, such as gender) are used to divide it into multiple sub-feature libraries, and the priority of each sub-feature library is determined. In practical applications, the above-mentioned object attribute subset can be determined based on historical detection data. For example, if it is determined based on historical detection data that most of those entering and leaving the basketball court during a certain period are male, then the gender attribute can be used as the above-mentioned object attribute subset. Then, based on the different attribute values corresponding to the gender attribute, the target feature library can be divided into a sub-feature library with the gender attribute being male and a sub-feature library with the gender attribute being female. At the same time, the priority of the sub-feature library with the gender attribute being male can be set to be higher than that of the sub-feature library with the gender attribute being female.Optionally, in practical applications, the aforementioned object attribute subset may include multiple object attributes. For example, the object attribute subset may include place of origin and gender attributes. According to the different attribute values corresponding to each object attribute, the target feature library can be divided into multiple sub-feature libraries, such as Zhejiang Province + Male, Jiangsu Province + Male, Anhui Province + Male, Zhejiang Province + Female, Jiangsu Province + Female, Anhui Province + Female, etc. In this case, the priority of different attribute value combinations among multiple attribute combinations can be determined based on historical detection data. For example, the sub-feature library corresponding to "Zhejiang Province + Male" has the highest priority, the sub-feature library corresponding to "Jiangsu Province + Male" has the second highest priority, and so on, thus determining the priority order of multiple sub-feature libraries. If the feature data of the target object is found in multiple sub-feature libraries, the target object is identified as the object to be detected. This embodiment divides the target feature library into multiple sub-feature libraries based on a preset subset of object attributes and determines the priority of these sub-feature libraries. This accelerates the comparison hit rate and avoids the problems of high equipment consumption and long processing times caused by comparing the target feature to be detected with each feature in the target feature library one by one, as used in related technologies. Therefore, it improves the efficiency of target feature comparison. Thus, it solves the technical problem of low comparison efficiency in related technologies and achieves the effect of improving comparison efficiency.
[0037] In an optional embodiment, before comparing the target feature data sequentially with the feature data in the plurality of sub-feature libraries, the method further includes: determining the object attribute subset, wherein the object attribute subset is an attribute subset determined in the sample attribute set based on an intermediate feature library obtained in the past first predetermined period, the intermediate feature library including feature data of each object in the sample object set under each object attribute in the sample attribute set; dividing the target feature library into the plurality of sub-feature libraries based on the object attribute subset, and determining the priority of each sub-feature library in the plurality of sub-feature libraries. In this embodiment, the object attribute subset is a subset of attributes determined from the sample attribute set. The sample attribute set is the set of object attributes of the sample objects included in the intermediate feature library. That is, the aforementioned object attribute subset can be determined based on historical detection data. For example, if most of the sample data obtained in the first predetermined period were male, then "gender = male" can describe most of the sample data. Thus, the gender attribute in the sample attribute set can be determined as a subset of object attributes, or the gender attribute can be added to the object attribute subset. Based on the object attribute subset, the target feature library can be divided into multiple sub-feature libraries. For example, the target feature library can be divided into a sub-feature library for males and a sub-feature library for females. Simultaneously, the priority of each sub-feature library can be determined. For example, based on historical detection data, the priority of the sub-feature library for males can be set higher than that of the sub-feature library for females. Through this embodiment, the purpose of determining the object attribute subset based on historical detection data is achieved, thereby achieving the purpose of dividing the object attribute subset into multiple sub-feature libraries and determining the priority of each sub-feature library.
[0038] In an optional embodiment, determining the object attribute subset includes: obtaining the sample attribute set corresponding to the intermediate feature library; selecting the object attribute subset from the sample attribute set, wherein the ratio of the number of candidate objects corresponding to the object attribute subset to the number of objects in the sample object set exceeds a preset ratio threshold, and the feature data of the candidate objects under the same object attribute in the object attribute subset are all the same, and are one attribute value of the same object attribute. In this embodiment, the sample attribute set corresponding to the intermediate feature library can be determined, that is, the set of object attributes corresponding to the sample data in the intermediate feature library can be determined, and then the object attribute subset can be selected from the sample attribute set. When selecting the object attribute subset, the following condition must be met: the ratio of the number of candidate objects corresponding to a certain attribute value (e.g., place of origin = Zhejiang Province, or other attribute values) under a certain object attribute (e.g., place of origin = Zhejiang Province, or other attribute values) in the object attribute subset to the number of objects in the sample object set exceeds a preset ratio threshold (e.g., 70%, 60%, or other values). That is, when the above condition is met, the place of origin attribute can be added to the object attribute subset. In practical applications, the object attribute subset may include one object attribute or multiple object attributes. This embodiment achieves the goal of determining a subset of object attributes from the set of sample attributes corresponding to historical detection sample data.
[0039] In an optional embodiment, selecting the object attribute subset from the sample attribute set includes: searching for object attributes in the sample attribute set that satisfy a first preset condition, wherein the first preset condition includes the ratio of the number of first candidate objects corresponding to the object attribute to the number of objects in the sample object set exceeding a first predetermined ratio threshold, the first candidate objects having identical feature data under the object attribute, and being an attribute value of the object attribute; and determining the object attribute subset to include the found one or more object attributes when one or more object attributes satisfying the first preset condition are found. In this embodiment, when one or more object attributes satisfying the first preset condition are found from the sample attribute set, the object attribute subset is determined to include the found one or more object attributes, that is, all found one or more object attributes satisfying the first preset condition are taken as attribute elements in the object attribute subset. Through this embodiment, the purpose of searching for one or more object attributes satisfying the first preset condition from the sample attribute set is achieved, and the purpose of determining one or more object attributes satisfying the first preset condition as attribute elements in the object attribute subset is also achieved.
[0040] In an optional embodiment, dividing the target feature library into multiple sub-feature libraries based on the object attribute subset includes: when the object attribute subset includes an object attribute, obtaining the attribute value of the object attribute in the target feature library to obtain an attribute value set, wherein the attribute value set includes N attribute values, where N is a positive integer greater than or equal to 2; dividing the target feature library into N sub-feature libraries according to the N attribute values, wherein the feature data of the objects included in each of the N sub-feature libraries are the same under the object attribute, and are one of the N attribute values. In this embodiment, when the subset of object attributes includes only one object attribute, taking the gender attribute as an example, the attribute value of that object attribute can be obtained. For example, if the gender attribute has two corresponding attribute values, then two attribute values can be obtained. Similarly, if the object attribute is the place of origin attribute, and the target feature library has N attribute values corresponding to the place of origin attribute (e.g., 34 or 10), then N attribute values can be obtained. The target feature library is then divided into N sub-feature libraries according to these N attribute values. Each sub-feature library contains objects corresponding to the same attribute value, for example, all objects are "place of origin = Zhejiang", or all objects are "gender = male". This embodiment achieves the goal of dividing the target feature library into multiple sub-feature libraries based on the number of attribute values corresponding to a single object attribute.
[0041] In an optional embodiment, dividing the target feature library into multiple sub-feature libraries based on the object attribute subset includes: when the object attribute subset includes P object attributes, obtaining the attribute value of each of the P object attributes in the target feature library to obtain P attribute value subsets, wherein the number of attribute values in each of the P attribute value subsets is greater than or equal to 2, and P is a positive integer greater than or equal to 2; dividing the target feature library into N sub-feature libraries according to the P attribute value subsets, wherein the feature data of the objects included in each of the N sub-feature libraries under the same object attribute in the P object attributes are all the same, and are one attribute value of the same object attribute. In this embodiment, when the subset of object attributes includes P (e.g., 2, 3, or more) object attributes, taking two object attributes, namely place of origin and gender, as an example, the attribute value set of each object attribute in the target feature library can be obtained to obtain two attribute value subsets. For example, the place of origin attribute value subset = {Zhejiang Province, Jiangsu Province, Anhui Province, ...}, and the gender attribute value subset = {Male, Female}. Then, the target feature library is divided into N sub-feature libraries based on these two attribute value subsets. In practical applications, it is assumed that the number of attribute values included in each subset of the P attribute value subsets are Q1, Q2, ..., Q... P When N is selected, the value of N can be determined using the formula N = Q1 * Q2 * ... * Q PThe goal is to obtain multiple multi-attribute combinations by combining the attribute values of different object attributes, such as "Zhejiang Province + Male", "Jiangsu Province + Male", "Anhui Province + Male", "Zhejiang Province + Female", "Jiangsu Province + Female", and "Anhui Province + Female". This divides the target feature library into N sub-feature libraries. In practical applications, after determining the above-mentioned subset of object attributes based on historical detection data, N sub-feature libraries are then divided, and the priority of each sub-feature library is determined. In this way, it is very likely that the target feature data to be detected can be matched (or hit) in the sub-feature library with the highest priority. Of course, it is also possible to hit an object with a similarity of up to the first similarity threshold in the sub-feature library with the second highest priority. In short, compared with the existing technology of comparing the target feature data of the object to be detected with each feature data in the target feature library one by one, the scheme of this embodiment greatly improves the comparison efficiency of the object to be detected.
[0042] In an optional embodiment, determining the priority of each sub-feature library among the plurality of sub-feature libraries includes: setting the priority of each of the N sub-feature libraries in descending order of the number of objects included in each sub-feature library, wherein the more objects a sub-feature library includes, the higher its priority. In this embodiment, after dividing into N sub-feature libraries, the priorities of the N sub-feature libraries can be set in descending order of the number of objects included in each sub-feature library. Generally speaking, the more objects a sub-feature library includes, the higher its priority. Through this embodiment, the purpose of determining the priority of each sub-feature library based on the number of objects included in each sub-feature library is achieved.
[0043] In an optional embodiment, determining the priority of each sub-feature library in the plurality of sub-feature libraries includes: when the sample attribute set includes the N attribute values, dividing the intermediate feature library into N sample sub-feature libraries according to the N attribute values, wherein the feature data of the objects included in each of the N sample sub-feature libraries are the same under the same object attribute, and is one of the N attribute values; setting the priority of the corresponding sub-feature libraries in the N sample sub-feature libraries according to the order of the number of objects included in each of the N sample sub-feature libraries from high to low, wherein the more objects included in the sample sub-feature library, the higher the priority of the corresponding sub-feature library, and the sample sub-feature libraries and the sub-feature libraries with corresponding relationships correspond to the same attribute value in the N attribute values; when the sample attribute set includes the N... In the case of M attribute values, the intermediate feature library is divided into M sample sub-feature libraries according to the M attribute values, where M is less than N. The feature data of the objects included in each of the M sample sub-feature libraries are the same under the same object attribute, and are one of the N attribute values. The priority of the corresponding M sub-feature libraries in the N sub-feature libraries is set according to the order of the number of objects included in each of the M sample sub-feature libraries from high to low. The priority of the NM sub-feature libraries other than the M sub-feature libraries in the N sub-feature libraries is set to be the same and lower than the priority of the M sub-feature libraries. The more objects included in a sample sub-feature library, the higher the priority of the corresponding sub-feature library. The sample sub-feature libraries and the sub-feature libraries with corresponding relationships correspond to the same attribute value in the N attribute values. In this embodiment, when the sample attribute set includes N attribute values, the intermediate feature library can be divided into N sample sub-feature libraries. The priority of each sample sub-feature library is determined in descending order based on the number of objects included in each sample sub-feature library, and the priority of each sub-feature library is then set. Each sample sub-feature library corresponds to each other based on having the same attribute value. When the sample attribute set includes M attribute values, the intermediate feature library can be divided into M sample sub-feature libraries. The priority of each sample sub-feature library is determined in descending order based on the number of objects included in each sample sub-feature library, and the priority of the corresponding M sub-feature libraries (i.e., the sub-feature libraries corresponding to the M attribute values in the sample attribute set) is then set. For the other (NM) sub-feature libraries in the N sub-feature libraries (for example, those containing a small number of objects), their priority can be set lower than that of the aforementioned M sub-feature libraries.This embodiment achieves the goal of determining the priority of N sub-feature libraries in the target feature library based on the priority of each sample sub-feature library in the intermediate feature library.
[0044] In an optional embodiment, before comparing the target feature data sequentially with the feature data in the plurality of sub-feature libraries, the method further includes: when the target feature data includes the feature data of the object to be detected under the target object attribute, and the object attribute set includes the target object attribute, setting the object attribute subset to include the target object attribute, obtaining the attribute value of the target object attribute in the target feature library, and obtaining an attribute value set, wherein the attribute value set includes N attribute values, where N is a positive integer greater than or equal to 2; dividing the target feature library into N sub-feature libraries according to the N attribute values, wherein the feature data of the objects included in each of the N sub-feature libraries under the target object attribute are the same, and are one of the N attribute values. In this embodiment, when it is determined that the target feature data includes feature data of the object to be detected under the target object attribute, and the object attribute set corresponding to the target feature library also includes the target object attribute, the object attribute subset is set to include the target object attribute. That is, the target object attribute is taken as the attribute element in the aforementioned object attribute subset. For example, if the object to be detected is male as detected in the current video frame, then the gender attribute can be taken as the object attribute subset, and the target feature library is divided into multiple sub-feature libraries according to the different attribute values corresponding to the gender attribute. In this way, the target feature library can be divided into multiple sub-feature libraries more specifically based on the detection result of the current object to be detected, thereby further improving the comparison efficiency. For example, if the number of attribute values corresponding to the acquired target object attribute is N, then the target feature library is divided into N sub-feature libraries according to the N attribute values. Through this embodiment, the purpose of determining the object attribute subset based on the acquired target object attribute of the current object to be detected, and then dividing multiple sub-feature libraries based on the object attribute subset, is achieved, thereby further improving the comparison efficiency.
[0045] In an optional embodiment, determining the object attribute subset includes: obtaining the sample attribute set corresponding to the intermediate feature library; selecting a first attribute subset from the sample attribute set, wherein the ratio of the number of first candidate objects corresponding to the first attribute subset to the number of objects in the sample object set exceeds a predetermined ratio threshold, and the feature data of the first candidate objects under the same object attribute in the first attribute subset are all the same, and are one attribute value of the same object attribute; when the target feature data includes the feature data of the object to be detected under the target object attribute, and the object attribute set includes the target object attribute, and the target object attribute is different from the object attribute in the first attribute subset, the object attribute subset is set to include the target object attribute and the first attribute subset; or when the target feature data does not include the feature data of the object to be detected under the target object attribute, or the object attribute set does not include the target object attribute, or the first attribute subset includes the target object attribute, the object attribute subset is set to include the first attribute subset. In this embodiment, after selecting a first attribute subset from the sample attribute set, if it is determined that the target feature data includes feature data of the object to be detected under the target object attribute, and the object attribute set corresponding to the target feature library also includes the target object attribute, and the target object attribute is different from the first attribute subset, then both the target object attribute and the first attribute subset are used as attribute elements of the aforementioned object attribute subset. That is, the first attribute subset selected from the sample attribute set is combined with the target object attribute detected from the current object to be detected to set the object attribute subset. However, if it is determined that the target feature data does not include feature data of the object to be detected under the target object attribute, or the object attribute set corresponding to the target feature library does not include the target object attribute, or the first attribute subset includes the target object attribute, then only the first attribute subset can be set as an attribute element of the object attribute subset; that is, the target object attribute does not need to be set as an attribute element of the object attribute subset. Through this embodiment, the purpose of jointly determining the object attribute subset based on the first attribute subset selected from the sample attribute set and the object attribute results detected from the current object to be detected is achieved.
[0046] In an optional embodiment, determining the object attribute subset includes: updating the object attribute subset every second predetermined period, and determining the updated attribute subset as the currently used object attribute subset. In practical applications, the aforementioned object attribute subset can be updated according to a predetermined period. For example, it can be updated every second predetermined period (e.g., 1 day, 1 week, or other periods), and the updated attribute subset is determined as the currently used object attribute subset. For example, every 3 days, the feature data of objects obtained in the intermediate feature library within the past first predetermined period (e.g., 1 day, 3 days, or 1 week) are analyzed to determine a new object attribute subset. For example, the current object attribute subset is determined based on the historical detection data of the most recent 3 days, and the next object attribute subset will be re-determined after 3 days based on the latest 3 days of detection data, thereby achieving the purpose of updating the object attribute subset. This allows for the determination of the latest priority strategy, and then the purpose of dividing the target feature library into multiple sub-feature libraries based on the latest priority strategy.
[0047] Obviously, the embodiments described above are only some embodiments of the present invention, and not all embodiments. The present invention will be specifically described below with reference to the embodiments.
[0048] Taking edge target detection as an example, in edge target detection comparison scenarios, when the amount of base feature data is large and the device comparison performance is limited, this application proposes a "self-learning attribute classification" method to improve the overall speed of target feature detection comparison and enhance the real-time performance of device comparison. The method is as follows:
[0049] S1: Classify base database features according to attribute type
[0050] Based on the relevance of the targets, this relevance is termed an "attribute." An attribute priority strategy (similar to the aforementioned determination of object attribute subsets) is designed to divide all base database feature data into multiple virtual base databases (corresponding to the aforementioned sub-feature databases) using one or more attributes. Each virtual base database is assigned a priority value (1-100). Virtual base databases with higher priority values are used preferentially for feature comparison. Attribute elements include information such as place of origin, gender, age, and residence, which can be combined as needed. Figure 3 This is an overall flowchart of the target feature comparison method according to an embodiment of the present invention, as follows: Figure 3 As shown, the process specifically includes the following steps:
[0051] S302, attribute selection is based on the actual usage scenario, determining the attribute priority strategy; for example: according to the place of origin, street, etc. of the base database features; according to the age, gender, etc. of the base database features. For example, in the scenario of detecting and comparing a basketball court of an unknown school in Zhejiang, assuming that the device currently has only one Top1 attribute, which is place of origin, the priority value from high to low is Zhejiang > Anhui > Jiangsu > ... (this is the default priority, and the attribute priority information will be continuously updated by the self-learning attribute classification module).
[0052] S304. Based on the attribute priority strategy, sort all features in the base database D0 by attribute classification and obtain the base databases VD1, VD2, VD3, ... after priority sorting.
[0053] S306, the system sends the sorted base databases VD1, VD2, VD3, ... to the comparator.
[0054] S308, the device detects the target (corresponding to the aforementioned object to be detected) and acquires the target feature data.
[0055] S310, according to the order of priority of the virtual base library VDx from high to low, the target feature is compared with each virtual base library VDx in turn. If the similarity threshold is met (corresponding to the aforementioned first similarity threshold), the comparison ends; otherwise, the comparison continues until all virtual base libraries are compared.
[0056] S312, output the comparison results.
[0057] In the above steps, by selecting an attribute priority strategy, the target features are compared with the base database features with higher priority, which can avoid a large number of invalid comparison processes, save comparison resources, and improve the real-time performance of the comparison.
[0058] S2: Self-learning attribute classification
[0059] After the equipment has been running for a period of time, the historical feature data becomes richer. The "self-learning attribute classification" module can analyze the historical feature data and extract the attributes with the highest correlation among the historical feature data (for example, most of the targets detected in this basketball court are "Zhejiang Province household registration + male"). Then the system automatically adds the gender attribute to the attribute priority strategy in step S301 above (at this time, the top 2 attribute conditions are "Zhejiang Province household registration" and "male" respectively). Once the priority strategy is updated (corresponding to the aforementioned update of the object attribute subset), the system will re-execute the above S1 process, re-optimize the base database structure, and subsequently prioritize target comparison according to the attribute combination of "Zhejiang Province household registration + male". As the system continues to run, it will continuously optimize its base database structure, achieving an automatic optimization effect.
[0060] The following example illustrates how to update the priority of a single TOP1 attribute to multiple TOPN attributes based on historical detection data.
[0061] According to the "attribute association table" mentioned below, the target attribute is subdivided into various dimensions. Through historical data features, we can extract more dimensions to describe a type of feature of historical data.
[0062] When historical data is input into the self-learning attribute classification module, since each specific target has corresponding attribute information when it is detected, we can choose to use a method (including but not limited to sample estimation methods) to obtain attribute information in more dimensions to evaluate the features of historical data, thereby obtaining the TOPN multi-attribute combination. The following is a simulation of the derivation using sample estimation methods, following the example above:
[0063] Assuming the default use of the TOP1 single attribute, with the sorting order "Zhejiang > Anhui > Jiangsu > ...", over a period of time, the number of targets detected by the device is M. By province, the target percentages are Zhejiang (70%), Anhui (5%), Jiangsu (20%), ... (5%), where the values in parentheses represent the percentage of the target samples belonging to each province. Simultaneously, in this sample data, if the sample is calculated based on the gender attribute dimension corresponding to the target, the percentages are male (95%) and female (5%). If a threshold is set for the gender attribute dimension (corresponding to the aforementioned preset proportion threshold), this threshold indicates that if the proportion of this dimension in the sample data exceeds this value, it is considered that this dimension can represent most of the sample data. The module will then draw the following conclusion:
[0064] (1) Assuming the threshold for the gender attribute dimension is 80%, since the proportion of “gender = male” is 95%, which exceeds the threshold, “gender = male” can be used to describe most of the sample data.
[0065] (2) The province dimension attribute also has a threshold. Assuming it is 60%, then “province = Zhejiang” can represent most of the sample data.
[0066] (3) Meanwhile, in the sample data, the TOP1 ranking is “Zhejiang > Anhui > Jiangsu > …”. Since Jiangsu accounts for a higher percentage (20%), the priority needs to be updated to “Zhejiang > Jiangsu > Anhui > …”. Logically, it can be considered that “identity = Jiangsu” is more representative of the entire sample data than “province = Zhejiang”.
[0067] (4) Since “province = Zhejiang” accounted for 70% and “gender = male” accounted for 95%, it shows that the gender dimension is more representative of the sample data than the province dimension.
[0068] At this point, the module can obtain the top 2 multi-attribute combinations (province + gender) based on "province = {Zhejiang (70%), Jiangsu (20%), Anhui (5%), ...}" + "gender = {male (95%), female (5%)}". Simultaneously, it accumulates the priorities of the above items according to different dimensions, from largest to smallest, to determine the priority:
[0069] "Gender dimension" > "Province dimension";
[0070] "Zhejiang 70% > Jiangsu 20% > Anhui 5% > ...";
[0071] "95% of men > 5% of women";
[0072] The priority of the TOP2 multi-attribute combination is:
[0073] "Male + Zhejiang" > "Male + Jiangsu" > "Male + Anhui" > ...
[0074] This application provides a method for fast comparison of target features in self-learning attribute classification, such as... Figure 4 As shown, Figure 4 This is a flowchart of a target feature comparison method according to a specific embodiment of the present invention, the process including:
[0075] Step S100: The edge detection and comparison device is powered on and started.
[0076] Step S101: Import the feature data base (corresponding to the aforementioned target feature base) and parse the associated attribute data (corresponding to the aforementioned object attribute set), such as information like gender, age, and place of origin.
[0077] Step S102: Select the corresponding attribute parameters according to the device usage scenario. These parameters can be combined to generate a priority strategy (similar to the aforementioned determination of a subset of object attributes).
[0078] Step S103: Generate priority strategy results based on the input attribute information.
[0079] Step S104: According to the strategy, for the imported feature base library D, N virtual base libraries VDx (corresponding to the aforementioned sub-feature libraries) are virtually abstracted, and each virtual base library VDx has a definite priority level.
[0080] Step S105: Send the virtual base database VDx (x = 1, ..., N) to the feature comparator.
[0081] In step S106, the device detects the target (corresponding to the aforementioned object to be detected) in the video frame and extracts the target feature value data.
[0082] Step S107: Does the intermediate library (corresponding to the aforementioned intermediate feature library) contain feature data? If so, proceed to step S108 and compare it with the intermediate library first; otherwise, proceed to step S111 and compare it with the virtual base library.
[0083] Step S108: Obtain the feature comparison strategy of the intermediate library.
[0084] Step S109: According to the priority of the strategy output, compare it with the intermediate library from high to low.
[0085] Step S110: During the comparison process, determine whether the similarity meets the threshold (corresponding to the aforementioned first similarity threshold). If the threshold is met, it means that the comparison is in progress and continue to the next step; if the threshold is not met, it means that the comparison is not in progress and continue to compare with the virtual database.
[0086] Step S111: Obtain the feature matching strategy of the virtual base library VDx (x = 1, ..., N).
[0087] Step S112: According to the priority of the strategy output, compare it with each virtual base library VDx in order from high to low.
[0088] Step S113, the comparison process: once the similarity reaches the threshold, it indicates that the comparison is in progress and the comparison ends.
[0089] Step S114: Update the key information of this comparison to the intermediate library for use in the next pre-comparison.
[0090] Step S115: Whenever the comparison information is updated to the intermediate library, the number of feature samples in the intermediate library is determined. If the threshold is reached, it indicates that the historical comparison data in the intermediate library can be analyzed, and the process jumps to step S117; otherwise, the comparison is terminated.
[0091] Step S116: Exit this comparison.
[0092] Step S117: Trigger the background monitoring task to analyze the attribute correlation results of all historical comparison features in the intermediate database.
[0093] Step S118: From the analysis of correlation results, filter out the dominant attributes.
[0094] Step S119: Update this attribute to the priority policy system and jump to step S103 to immediately trigger the re-division of the base database D and the sorting of the virtual base database VDx, and then redistribute the base database to the comparator device.
[0095] The "S2: Self-learning Attribute Classification" method described above will now be explained in detail as follows:
[0096] S2.1 Description of Attribute Association Table
[0097] Step 117 above describes the attribute association priority expansion process, which means that the target features can be evaluated from different dimensions.
[0098] The range of features that can be used for description and scoring includes, but is not limited to, time feature dimension f1, physiological feature dimension f2, geographical feature dimension f3, physical appearance feature dimension f4, ...; Furthermore, any feature dimension fn can be further subdivided based on its sub-items; for example, the time dimension f1 can be subdivided into sub-dimensions such as year (e.g., "four seasons"), month (e.g., "summer and winter vacations"), and week (e.g., "weekdays + weekends"), as shown below:
[0099] r = "physiological characteristics"; fr = {"gender", "height", "age", ...}; indicating that the physiological characteristics dimension includes sub-characteristics such as "gender", "height", and "age".
[0100] Furthermore, a specific sub-feature can be further subdivided into more refined sub-features. For example, the "gender" sub-feature above can be described in a more detailed way as follows:
[0101] r = "gender"; fr = {"male", "female"}; indicates that the gender feature dimension includes "male" and "female" sub-features.
[0102] By continuously subdividing the feature information of each dimension, a complete description of the target features can be constructed. This general description is as follows:
[0103]
[0104] "r_sets" represents the set of target feature dimensions, including subdivided feature dimensions r1, r2 to rn; for a specific feature dimension ri, it can be further subdivided into sub-feature dimensions ril, ri2 to rim. This data description method is called an "attribute association table".
[0105] S2.2 Priority Description of Attribute Association Tables
[0106] Each objective can obtain an accurate evaluation in the attribute association table. For each type of objective, the evaluations in the attribute association table will be more similar. That is, for the attribute association table {r1, r2, r3, ..., rn}, the combinations of certain feature dimensions {rx, ..., ry} will be highly consistent. At this time, {rx, ..., ry} is described as a new attribute association table, and this newly generated table has a higher priority.
[0107] A priority-based attribute association table is represented as follows:
[0108] {{r1, p1}, {r2, p2}, ...}
[0109] This indicates that the association table contains feature dimensions r1, r2, ..., and the corresponding priorities are p1, p2, ... (priority values range from 0 to 100, with larger values indicating higher priorities).
[0110] S2.3 Obtain a priority-based attribute association table from historical detection data.
[0111] When the device starts running, it acquires an attribute association table that supports default priorities and continuously performs detection. The algorithm outputs detection results for various attributes of the target, and the device maps these results to entries in the attribute association table, using the attribute values as sample data for that entry (the more samples, the higher the priority of the corresponding entry). However, once the sample size reaches a threshold (default or manually set), the analysis data export for the current sample data is immediately triggered. Specific methods include, but are not limited to, voting on the sample data for each entry; the more votes, the higher the priority. The specific value can be calculated using p = "number of votes / number of samples". Through this calculation, new attribute association tables with priorities can be extracted from historical data, and these tables can be used for subsequent updates.
[0112] S2.4 Priority attribute association table is used for logical base library partitioning.
[0113] The physical database D contains various feature information of the target. Different priority attribute association tables can divide database D into different logical sub-databases VD according to the priority of the table entries. Each logical sub-database VD is the feature set with the highest priority for the corresponding table entry. It should be noted that: ① Based on the priority of the TOPN multi-attribute combinations, the databases to be compared are arranged from highest to lowest priority. The database data is logically abstracted, resulting in logical sub-databases VD. Different VDs are essentially data aggregations of different priority combinations; ② In this way, during the comparison process, higher priority data is compared first, followed by lower priority data, improving comparison efficiency.
[0114] As the device continues to run, it will continuously output an optimized priority attribute association table, which will continue to guide the partitioning of the logical base library. Each comparison process of the device starts from the logical base library with the highest priority, thereby greatly accelerating the comparison hit rate, and this process does not require human intervention.
[0115] In the above embodiments, for device detection scenarios with certain "correlation" and "repetition", this embodiment introduces a self-learning attribute classification module. It uses historical target feature data to calculate the top N attribute combinations with the highest correlation to the detection target within a certain period of time, and uses this as a prerequisite for subsequent comparison and filtering. The self-learning attribute classification proposed in this embodiment is based on the analysis and summarization of historical data within a certain period of time, and further optimizes the feature structure and filtering strategy of the current stage database based on the results of the analysis and summarization.
[0116] Through the above embodiments, the attribute type information with the highest correlation to the target can be automatically derived based on the historical target feature data detected by the device, without the need for manual specification, and can adapt to the device scenario; the device can learn from historical detection data and continuously correct and optimize the attribute filtering strategy, which can avoid the performance deficiencies and low comparison efficiency caused by comparing target features with the base database one by one in related technologies.
[0117] 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 the present invention, 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 ROM / 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 the present invention.
[0118] This embodiment also provides an object determination device. Figure 5 This is a structural block diagram of an object determination device according to an embodiment of the present invention, such as... Figure 5 As shown, the device includes:
[0119] The acquisition module 502 is used to acquire the target feature data of the object to be detected;
[0120] The comparison module 504 is used to compare the target feature data with the feature data in the multiple sub-feature libraries in descending order of priority, until the feature data of the target object is found in the multiple sub-feature libraries, or to traverse all the multiple sub-feature libraries. The similarity between the feature data of the target object and the target feature data is greater than or equal to a first similarity threshold. The multiple sub-feature libraries are feature libraries obtained by dividing the target feature library according to a preset subset of object attributes. The priority of the multiple sub-feature libraries is related to the subset of object attributes. The target feature library includes the feature data of each object in the target object set under each object attribute in the object attribute set. The object attribute set includes the subset of object attributes. The target object set includes objects of the same type as the object to be detected.
[0121] The first determining module 506 is used to determine the target object as the object to be detected when the feature data of the target object is found in the plurality of sub-feature libraries.
[0122] In an optional embodiment, the above apparatus further includes: a second determining module, configured to determine the object attribute subset before sequentially comparing the target feature data with feature data in the plurality of sub-feature libraries, wherein the object attribute subset is an attribute subset determined in the sample attribute set based on an intermediate feature library obtained in the past first predetermined period, the intermediate feature library including feature data of each object in the sample object set under each object attribute in the sample attribute set; and a first processing module, configured to divide the target feature library into the plurality of sub-feature libraries based on the object attribute subset, and determine the priority of each sub-feature library in the plurality of sub-feature libraries.
[0123] In an optional embodiment, the second determining module includes: a first acquisition unit, configured to acquire the sample attribute set corresponding to the intermediate feature library; and a first selection unit, configured to select the object attribute subset from the sample attribute set, wherein the ratio of the number of candidate objects corresponding to the object attribute subset to the number of objects in the sample object set exceeds a preset ratio threshold, and the feature data of the candidate objects under the same object attribute in the object attribute subset are all the same, and are one attribute value of the same object attribute.
[0124] In an optional embodiment, the first selection unit includes: a search subunit, configured to search for object attributes that satisfy a first preset condition from the sample attribute set, wherein the first preset condition includes the ratio of the number of first candidate objects corresponding to the object attribute to the number of objects in the sample object set exceeding a first predetermined ratio threshold, and the first candidate objects having identical feature data under the object attribute and being an attribute value of the object attribute; and a determination subunit, configured to determine the object attribute subset to include the one or more object attributes found when one or more object attributes satisfy the first preset condition are found.
[0125] In an optional embodiment, the first processing module includes: a second acquisition unit, configured to acquire the attribute value of the object attribute in the target feature library when the subset of object attributes includes an object attribute, to obtain an attribute value set, wherein the attribute value set includes N attribute values, where N is a positive integer greater than or equal to 2; and a first partitioning unit, configured to partition the target feature library into N sub-feature libraries according to the N attribute values, wherein the feature data of the objects included in each of the N sub-feature libraries under the object attribute are the same, and are one of the N attribute values.
[0126] In an optional embodiment, the first processing module includes: a third acquisition unit, configured to, when the subset of object attributes includes P object attributes, acquire the attribute value of each of the P object attributes in the target feature library to obtain P attribute value subsets, wherein the number of attribute values in each of the P attribute value subsets is greater than or equal to 2, and P is a positive integer greater than or equal to 2; and a second partitioning unit, configured to partition the target feature library into N sub-feature libraries according to the P attribute value subsets, wherein the feature data of objects included in each of the N sub-feature libraries under the same object attribute in the P object attributes are all the same, and are one attribute value of the same object attribute.
[0127] In an optional embodiment, the first processing module further includes: a first setting unit, configured to set the priority of each of the N sub-feature libraries in descending order of the number of objects included in each sub-feature library, wherein the more objects included in a sub-feature library, the higher the priority of the corresponding sub-feature library.
[0128] In an optional embodiment, the first processing module further includes: a third partitioning unit, configured to partition the intermediate feature library into N sample sub-feature libraries according to the N attribute values when the sample attribute set includes the N attribute values, wherein the feature data of the objects included in each of the N sample sub-feature libraries are the same under the same object attribute, and are one of the N attribute values; a second setting unit, configured to set the priority of the corresponding sub-feature libraries in the N sub-feature libraries according to the order of the number of objects included in each of the N sample sub-feature libraries from high to low, wherein the more objects included in the sample sub-feature library, the higher the priority of the corresponding sub-feature library, and the sample sub-feature libraries and the sub-feature libraries with corresponding relationships correspond to the same attribute value among the N attribute values; a fourth partitioning unit, configured to partition the intermediate feature library into N sample sub-feature libraries when the sample attribute set includes the N attribute values. In the case of M attribute values out of the N attribute values, the intermediate feature library is divided into M sample sub-feature libraries according to the M attribute values, where M is less than N. The feature data of the objects included in each of the M sample sub-feature libraries are the same under the same object attribute, and are one of the N attribute values. The third setting unit is used to set the priority of the M sub-feature libraries in the N sub-feature libraries in descending order of the number of objects included in each of the M sample sub-feature libraries, and set the priority of the NM sub-feature libraries other than the M sub-feature libraries in the N sub-feature libraries to be the same and lower than the priority of the M sub-feature libraries. The more objects included in the sample sub-feature library, the higher the priority of the corresponding sub-feature library. The sample sub-feature libraries and the sub-feature libraries with corresponding relationships correspond to the same attribute value among the N attribute values.
[0129] In an optional embodiment, the above apparatus further includes: a second processing module, configured to, before sequentially comparing the target feature data with the feature data in the plurality of sub-feature libraries, if the target feature data includes the feature data of the object to be detected under the target object attribute and the object attribute set includes the target object attribute, set the object attribute subset to include the target object attribute, obtain the attribute value of the target object attribute in the target feature library, and obtain an attribute value set, wherein the attribute value set includes N attribute values, and N is a positive integer greater than or equal to 2; and a first partitioning module, configured to divide the target feature library into N sub-feature libraries according to the N attribute values, wherein the feature data of the objects included in each of the N sub-feature libraries under the target object attribute are the same, and are one of the N attribute values.
[0130] In an optional embodiment, the second determining module further includes: a fourth acquiring unit, configured to acquire the sample attribute set corresponding to the intermediate feature library; a second selecting unit, configured to select a first attribute subset from the sample attribute set, wherein the ratio of the number of first candidate objects corresponding to the first attribute subset to the number of objects in the sample object set exceeds a predetermined ratio threshold, and the feature data of the first candidate objects under the same object attribute in the first attribute subset are all the same, and are one attribute value of the same object attribute; a fourth setting unit, configured to set the object attribute subset to include the target object attribute and the first attribute subset when the target feature data includes the feature data of the object to be detected under the target object attribute, and the object attribute set includes the target object attribute, and the target object attribute is different from the object attribute in the first attribute subset; or, a fifth setting unit, configured to set the object attribute subset to include the first attribute subset when the target feature data does not include the feature data of the object to be detected under the target object attribute, or the object attribute set does not include the target object attribute, or the first attribute subset includes the target object attribute.
[0131] In an optional embodiment, the second determining module includes a processing unit, configured to update the object attribute subset every second predetermined period, and determine the updated attribute subset as the currently used object attribute subset.
[0132] 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.
[0133] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0134] 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 a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0135] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0136] In one 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.
[0137] 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.
[0138] It is obvious to those skilled in the art that the modules or steps of the present invention 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, the present invention is not limited to any particular combination of hardware and software.
[0139] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method of determining an object, characterized by, The method comprises: obtaining target feature data of a to-be-detected object photographed by a camera device; comparing the target feature data with feature data in a plurality of sub-feature libraries in order from high to low priority of the plurality of sub-feature libraries until target object feature data is found in the plurality of sub-feature libraries or the plurality of sub-feature libraries are traversed, wherein the target object feature data has a similarity to the target feature data greater than or equal to a first similarity threshold, the plurality of sub-feature libraries are obtained by dividing a target feature library according to a preset object attribute subset, the priority of the plurality of sub-feature libraries is related to the object attribute subset, the target feature library comprises feature data of each object in a target object set under each object attribute in an object attribute set, the object attribute set comprises the object attribute subset, and the target object set comprises objects of the same type as the to-be-detected object; in a case where the target object feature data is found in the plurality of sub-feature libraries, determining the target object as the to-be-detected object; The method further comprises, before comparing the target feature data with the feature data in the plurality of sub-feature libraries, determining the object attribute subset, comprising: obtaining a sample attribute set corresponding to an intermediate feature library; selecting the object attribute subset from the sample attribute set, wherein a ratio of a number of candidate objects corresponding to the object attribute subset to a number of objects in a sample object set exceeds a preset ratio threshold, feature data of the candidate objects under a same object attribute in the object attribute subset are all the same and are of one attribute value of the same object attribute, wherein the object attribute subset is an attribute subset determined in the sample attribute set according to an intermediate feature library obtained in a first predetermined period, the intermediate feature library comprises feature data of each object in a sample object set under each object attribute in the sample attribute set; dividing the target feature library into the plurality of sub-feature libraries based on the object attribute subset, and determining a priority of each sub-feature library in the plurality of sub-feature libraries.
2. The method of claim 1, wherein, The selecting of the object attribute subset from the sample attribute set comprises: finding an object attribute satisfying a first preset condition from the sample attribute set, wherein the first preset condition comprises that a ratio of a number of first candidate objects corresponding to the object attribute to a number of objects in the sample object set exceeds a first predetermined ratio threshold, and feature data of the first candidate objects under the object attribute are all the same and are of one attribute value of the object attribute; and in a case where one or more object attributes satisfying the first preset condition are found, determining the object attribute subset to comprise the one or more found object attributes.
3. The method of claim 1, wherein, The dividing of the target feature library into the plurality of sub-feature libraries based on the object attribute subset comprises: When the object attribute subset includes one object attribute, an attribute value of the one object attribute in the target feature library is obtained, and an attribute value set is obtained, where the attribute value set includes N attribute values, N is a positive integer greater than or equal to 2; The target feature library is divided into N sub-feature libraries according to the N attribute values, where each sub-feature library in the N sub-feature libraries includes the same feature data of an object under the one object attribute, and is one attribute value in the N attribute values.
4. The method of claim 1, wherein, The target feature library is divided into the plurality of sub-feature libraries based on the object attribute subset, including: When the object attribute subset includes P object attributes, an attribute value of each object attribute in the P object attributes in the target feature library is obtained, and P attribute value subsets are obtained, where the number of attribute values in each attribute value subset in the P attribute value subsets is greater than or equal to 2, and P is a positive integer greater than or equal to 2; The target feature library is divided into N sub-feature libraries according to the P attribute value subsets, where each sub-feature library in the N sub-feature libraries includes the same feature data of an object under the same object attribute in the P object attributes, and is one attribute value of the same object attribute.
5. The method according to claim 3 or 4, characterized in that, The priority of each sub-feature library in the plurality of sub-feature libraries is determined, including: The priority of each sub-feature library in the N sub-feature libraries is set in a descending order of the number of objects included in each sub-feature library, where the more objects a sub-feature library includes, the higher the priority of the sub-feature library.
6. The method of claim 3, wherein, The priority of each sub-feature library in the plurality of sub-feature libraries is determined, including: When the sample attribute set includes the N attribute values, the intermediate feature library is divided into N sample sub-feature libraries according to the N attribute values, where each sample sub-feature library in the N sample sub-feature libraries includes the same feature data of an object under the one object attribute, and is one attribute value in the N attribute values; the priority of a corresponding sub-feature library in the N sub-feature libraries is set in a descending order of the number of objects included in each sample sub-feature library in the N sample sub-feature libraries, where the more objects a sample sub-feature library includes, the higher the priority of the corresponding sub-feature library, and the sample sub-feature library and the sub-feature library having the corresponding relationship correspond to the same attribute value in the N attribute values; In a case where the sample attribute set includes M attribute values in the N attribute values, the intermediate feature library is divided into M sample sub-feature libraries according to the M attribute values, where M is less than N, each sample sub-feature library in the M sample sub-feature libraries includes the same feature data of an object under the same object attribute and is one attribute value in the N attribute values; the priority of the corresponding M sub-feature libraries in the N sub-feature libraries is set in a descending order of the number of objects included in each sample sub-feature library in the M sample sub-feature libraries, and the priority of the N-M sub-feature libraries in the N sub-feature libraries other than the M sub-feature libraries is set to be the same and lower than the priority of the M sub-feature libraries, where the more objects included in the sample sub-feature library, the higher the priority of the corresponding sub-feature library, and the sample sub-feature library and the sub-feature library having the corresponding relationship correspond to the same attribute value in the N attribute values.
7. The method of claim 1, wherein, Before sequentially comparing the target feature data with the feature data in the plurality of sub-feature libraries, the method further comprises: In a case where the target feature data includes the feature data of the to-be-detected object under a target object attribute and the object attribute set includes the target object attribute, the object attribute subset is set to include the target object attribute, the attribute value of the target object attribute in the target feature library is obtained, and an attribute value set is obtained, where the attribute value set includes N attribute values, and N is a positive integer greater than or equal to 2; The target feature library is divided into N sub-feature libraries according to the N attribute values, where the feature data of an object under the target object attribute included in each sub-feature library in the N sub-feature libraries is the same and is one attribute value in the N attribute values.
8. The method of claim 1, wherein, The determination of the object attribute subset comprises: The sample attribute set corresponding to the intermediate feature library is obtained; A first attribute subset is selected from the sample attribute set, where the ratio of the number of first candidate objects corresponding to the first attribute subset to the number of objects in the sample object set exceeds a predetermined proportion threshold, the feature data of the first candidate objects under the same object attribute in the first attribute subset is the same, and is one attribute value of the same object attribute; In a case where the target feature data includes the feature data of the to-be-detected object under a target object attribute, the object attribute set includes the target object attribute, and the target object attribute is different from the object attribute in the first attribute subset, the object attribute subset is set to include the target object attribute and the first attribute subset; or In a case where the target feature data does not include the feature data of the to-be-detected object under the target object attribute, or the object attribute set does not include the target object attribute, or the first attribute subset includes the target object attribute, the object attribute subset is set to include the first attribute subset.
9. The method of claim 1, wherein, The determination of the object attribute subset comprises: The object attribute subset is updated every second predetermined period, and the updated attribute subset is determined as the object attribute subset currently used.
10. A determination device of an object, characterized by, The method comprises the following steps: The acquisition module is configured to acquire target feature data of a to-be-detected object captured by a camera device. The comparison module is configured to compare the target feature data with feature data in a plurality of sub-feature libraries in a descending order of priority of the plurality of sub-feature libraries until target object feature data is found in the plurality of sub-feature libraries or the plurality of sub-feature libraries are traversed, wherein the target object feature data has a similarity to the target feature data greater than or equal to a first similarity threshold, the plurality of sub-feature libraries are obtained by dividing a target feature library according to a preset object attribute subset, the priority of the plurality of sub-feature libraries is related to the object attribute subset, the target feature library comprises feature data of each object in a target object set under each object attribute in an object attribute set, the object attribute set comprises the object attribute subset, and the target object set comprises objects of the same type as the to-be-detected object. The first determination module is configured to determine the target object as the to-be-detected object when the target object feature data is found in the plurality of sub-feature libraries. The device is further configured to determine the object attribute subset before comparing the target feature data with the feature data in the plurality of sub-feature libraries, comprising: acquiring a sample attribute set corresponding to an intermediate feature library; selecting the object attribute subset from the sample attribute set, wherein a ratio of a number of candidate objects corresponding to the object attribute subset to a number of objects in a sample object set exceeds a preset ratio threshold, feature data of the candidate objects under a same object attribute in the object attribute subset are all the same, and the feature data is an attribute value of the same object attribute, wherein the object attribute subset is an attribute subset determined in a sample attribute set according to an intermediate feature library obtained within a first predetermined period in the past, the intermediate feature library comprises feature data of each object in a sample object set under each object attribute in the sample attribute set; dividing the target feature library into the plurality of sub-feature libraries based on the object attribute subset, and determining a priority of each sub-feature library in the plurality of sub-feature libraries.
11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 9. 12.An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 9.
Citation Information
Patent Citations
Human face image matching method and apparatus, terminal and storage medium
CN108009521A
Voiceprint recognition authentication method and device and equipment
CN111444377A
Face recognition method and device and storage medium
CN115050079A