A hash feature compression method and related device
By determining and removing inefficient hash bits in the hash code, the hash feature compression is achieved, the problem of information redundancy in hash technology is solved, and the storage efficiency is improved.
Patent Information
- Application Number
- CN202111129434.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-09-26
Smart Images

Figure CN114329007B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a hash feature compression method and related devices. Background Art
[0002] With the rapid development of Internet technology and computer technology, multimedia data such as images, texts, and videos have increased dramatically, and large-scale data retrieval has become a current research hotspot. Faced with massive multimedia data, the Approximate Nearest Neighbor (ANN) technology has shown obvious application advantages, thus becoming a key technology in the field of data retrieval.
[0003] The hashing technology under ANN technology has attracted more and more attention from relevant technical personnel due to its low storage cost and high query efficiency. The hashing technology is used to encode high-dimensional data into low-dimensional and compact binary hash codes; specifically, given a d-dimensional sample feature vector x i ∈R 1×d , hashing technology aims to use a mapping (i.e. hash function) Encode the sample feature vector into an r-dimensional binary hash code b i ∈{+1,-1} 1×r , where r<<d. After hash coding, the distance between samples can be represented by Hamming distance, and the calculation of Hamming distance can be supported by the bitwise exclusive OR (XOR) of the computer, thereby accelerating the distance measurement.
[0004] In some cases, the hash code calculated by hash technology may include information with low reference value (such as redundant information, etc.), that is, not all hash bits in the hash code are meaningful and can play a positive role. Storing such hash codes will cause a waste of storage resources and increase unnecessary storage costs. Summary of the invention
[0005] The embodiments of the present application provide a hash feature compression method and related devices, which can effectively reduce information with low reference value in the hash code while retaining information with high reference value in the hash code, so that storage resources can be reasonably utilized.
[0006] In view of this, the first aspect of the present application provides a hash feature compression method, the method comprising:
[0007] Obtaining a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding a target feature of the target object through a target hash model;
[0008] Determine the inefficient hash bits in the hash code to be compressed based on the inefficient hash bit index, remove the inefficient hash bits in the hash code to be compressed, and obtain a compressed hash code corresponding to the target object;
[0009] Among them, the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance meets the preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object, and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
[0010] A second aspect of the present application provides a hash feature compression device, the device comprising:
[0011] A hash code acquisition module is used to acquire a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding a target feature of the target object through a target hash model;
[0012] A hash code compression module is used to determine the inefficient hash bits in the hash code to be compressed based on an inefficient hash bit index, remove the inefficient hash bits in the hash code to be compressed, and obtain a compressed hash code corresponding to the target object; wherein the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance meets a preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
[0013] Optionally, the device further includes: a hash index determination module; the hash index determination module includes:
[0014] A first feature determination submodule, used to construct a training target feature matrix according to the target features of each of the n training objects, wherein n is an integer greater than or equal to 1;
[0015] The second feature determination submodule is used to encode the target features of the n training objects respectively through the target hash model to obtain the training hash codes corresponding to the n training objects respectively; and construct a training hash feature matrix according to the training hash codes corresponding to the n training objects respectively;
[0016] The inefficient index determination submodule is used to determine the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix; and use the index value of the hash bit whose corresponding importance meets the preset non-important condition as the inefficient hash bit index.
[0017] Optionally, the inefficient index determination submodule is specifically used for:
[0018] Based on the hash bit importance measurement algorithm, determining the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix;
[0019] Among them, the hash bit importance measurement algorithm is determined with the goal of minimizing the objective function; the objective function is used to characterize the gap between the similarity of the n training objects in the target feature space and the reference similarity of the n training objects in the hash feature space, and the reference similarity of the n training objects in the hash feature space is obtained by processing the similarity between the n training hash codes based on the importance matrix, and the importance matrix includes the importance corresponding to each hash bit in the training hash code.
[0020] Optionally, the inefficient index determination submodule is specifically used for:
[0021] Calculate a first reference matrix according to the training hash feature matrix and the transposed matrix corresponding to the training hash feature matrix; calculate the Hadamard product of the first reference matrix and itself to obtain a second reference matrix;
[0022] Normalizing the elements in the training target feature matrix to obtain a normalized training target feature matrix; calculating a third reference matrix according to a transposed matrix corresponding to the normalized training target feature matrix and the training hash feature matrix; calculating the Hadamard product of the third reference matrix and itself to obtain a fourth reference matrix;
[0023] The importance matrix is calculated according to the second reference matrix and the fourth reference matrix; the values of the diagonal elements in the importance matrix are the importance corresponding to the hash bits in the training hash code.
[0024] Optionally, the inefficient index determination submodule is specifically used for:
[0025] The importances corresponding to the respective hash bits in the training hash code are sorted in ascending order, and the index values of the hash bits corresponding to the top a importances are determined as the inefficient hash bit indexes; wherein a is an integer greater than or equal to 1;
[0026] Removing the hash bits corresponding to the inefficient hash bit indexes in the n training hash codes respectively to obtain n updated training hash codes; constructing an updated training hash feature matrix according to the n updated training hash codes;
[0027] Determine the importance of each hash bit in the updated training hash code according to the training target feature matrix and the updated training hash feature matrix; sort the importance of each hash bit in the updated training hash code in ascending order, and determine the index value of the hash bit corresponding to the top a importances as the inefficient hash bit index;
[0028] The above process is repeated until the number of the determined inefficient hash bit indexes reaches a preset number.
[0029] Optionally, the hash code acquisition module is specifically used for:
[0030] Through m1 types of target hash models, target features of the target object are respectively encoded to obtain hash codes corresponding to the m1 types of target hash models; m1 is an integer greater than 1;
[0031] The hash codes corresponding to the target hash models of m1 types are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
[0032] Optionally, the hash code acquisition module is specifically used for:
[0033] Through m2 versions of the target hash model, the target features of the target object are respectively encoded to obtain hash codes corresponding to the m2 versions; m2 is an integer greater than 1; the m2 versions of the target hash model are obtained based on different training samples or based on different numbers of iterative training;
[0034] The hash codes corresponding to the m2 versions are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
[0035] Optionally, the hash code acquisition module is specifically used for:
[0036] Through m3 kinds of feature extraction models, feature extraction processing is performed on the target object respectively to obtain m3 kinds of target features of the target object; m3 is an integer greater than 1;
[0037] Through the target hash model, the m3 target features are respectively encoded to obtain hash codes corresponding to the m3 target features;
[0038] The hash codes corresponding to the m3 target features are concatenated to obtain the hash code to be compressed corresponding to the target object.
[0039] Optionally, the hash code acquisition module is specifically used for:
[0040] Acquire m4 types of modal information related to the target object; wherein m4 is an integer greater than 1;
[0041] Performing feature extraction processing on the m4 types of modal information respectively to obtain target features corresponding to the m4 types of modal information respectively;
[0042] By using the target hash model, encoding processing is performed on the target features corresponding to the m4 types of modal information respectively to obtain hash codes corresponding to the m4 types of modal information respectively;
[0043] The hash codes corresponding to the m4 types of modal information are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
[0044] A third aspect of the present application provides a device, the device comprising a processor and a memory:
[0045] The memory is used to store computer programs;
[0046] The processor is used to execute the steps of the hash feature compression method described in the first aspect according to the computer program.
[0047] The fourth aspect of the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the steps of the hash feature compression method described in the first aspect.
[0048] In a fifth aspect, the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the steps of the hash feature compression method described in the first aspect.
[0049] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0050] The embodiment of the present application provides a hash feature compression method, which determines the importance of each hash bit in the training hash code according to the target feature of the training object belonging to the target data type and the training hash code obtained by encoding the target feature of the training object through the target hash model, and then determines the index value of the corresponding hash bit with lower importance as the inefficient hash bit index. Since the information distribution of the hash code obtained by encoding the same feature of the object belonging to the same data type through the same hash model is basically the same, the inefficient hash bit index determined by the above method can also be correspondingly applied to other hash codes obtained by encoding the target feature of the object belonging to the target data type through the target hash model, that is, in the hash code obtained by encoding the target feature of the object belonging to the target data type through the target hash model, the information carried by the hash bit corresponding to the inefficient hash bit index generally does not have a high reference value. Therefore, the hash bit corresponding to the inefficient hash bit index in such a hash code can be removed to realize the compression processing of such a hash code, reduce the information with lower reference value in the compressed hash code obtained after the compression processing, and ensure that the compressed hash code retains the information with higher reference value, thereby realizing the effective use of storage resources and avoiding the waste of storage costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A schematic diagram of an application scenario of the hash feature compression method provided in an embodiment of the present application;
[0052] Figure 2 A flowchart of a hash feature compression method provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the first implementation architecture for obtaining a hash code to be compressed provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of a second implementation architecture for obtaining a hash code to be compressed provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of a third implementation architecture for obtaining a hash code to be compressed provided in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of a fourth implementation architecture for obtaining a hash code to be compressed provided in an embodiment of the present application;
[0057] Figure 7 A schematic diagram of a fifth implementation architecture for obtaining a hash code to be compressed provided in an embodiment of the present application;
[0058] Figure 8A schematic diagram of an implementation method for compressing a hash code to be compressed provided in an embodiment of the present application;
[0059] Fig. 9 A schematic diagram of an implementation flow of determining an inefficient hash bit index provided in an embodiment of the present application;
[0060] Fig.10 A schematic diagram of the structure of a hash feature compression device provided in an embodiment of the present application;
[0061] Fig.11 A schematic diagram of the structure of another hash feature compression device provided in an embodiment of the present application;
[0062] Fig.12 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0063] Fig.13 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0065] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0066] In order to solve the problem in the related art that the hash code obtained by hash model encoding includes information with low reference value, which causes waste of storage resources, an embodiment of the present application provides a hash feature compression method.
[0067] In the hash feature compression method, the to-be-compressed hash code corresponding to the target object is first obtained. The target object here belongs to the target data type. The to-be-compressed hash code is obtained by encoding the target features of the target object through a target hash model. Then, the inefficient hash bits in the to-be-compressed hash code are determined based on a predetermined inefficient hash bit index, and the inefficient hash bits in the to-be-compressed hash code are removed accordingly to obtain a compressed hash code corresponding to the target object. The inefficient hash bit index here is the index value of the hash bit in the target hash code whose importance meets a preset non-important condition. The target hash code is a hash code obtained by encoding the target features of an object belonging to the target data type through a target hash model; the inefficient hash bit index is determined based on the target features of a training object belonging to the target data type, and a training hash code obtained by encoding the target features of the training object through a target hash model.
[0068] The above hash feature compression method determines the importance of each hash bit in the training hash code in advance according to the target feature of the training object belonging to the target data type and the training hash code obtained by encoding the target feature of the training object through the target hash model, and then determines the index value of the corresponding hash bit with lower importance as the inefficient hash bit index. Since the information distribution of the hash code obtained by encoding the same feature of the object belonging to the same data type through the same hash model is basically the same, the inefficient hash bit index determined by the above method can also be correspondingly applied to other hash codes obtained by encoding the target feature of the object belonging to the target data type through the target hash model, that is, in the hash code obtained by encoding the target feature of the object belonging to the target data type through the target hash model, the information carried by the hash bit corresponding to the inefficient hash bit index generally does not have a high reference value. Therefore, by removing the hash bit corresponding to the inefficient hash bit index in such hash code, the compression processing of such hash code can be realized, the information with lower reference value in the compressed hash code obtained after the compression processing is reduced, and the information with higher reference value is guaranteed to be retained in the compressed hash code, so as to realize the effective utilization of storage resources and avoid wasting storage costs.
[0069] It should be understood that the hash feature compression method provided in the embodiment of the present application can be applied to any electronic device with data processing capabilities, such as a terminal device or a server. The terminal device can specifically be a smart phone, a tablet computer, a computer, a personal digital assistant (PDA), a vehicle terminal, etc.; the server can specifically be an application server or a Web server. When actually deployed, it can be an independent physical server, a cluster server, or a cloud server.
[0070] To facilitate understanding of the hash feature compression method provided in the embodiment of the present application, the following uses the server as an example in which the execution subject of the hash feature compression method is used to exemplify the application scenarios in which the hash feature compression method is applicable.
[0071] See also Figure 1 , Figure 1 Schematic diagram of application scenarios of the hash feature compression method provided in the embodiment of the present application. The hash feature compression method provided in the embodiment of the present application can be specifically applied to application scenarios such as image retrieval, text retrieval, video retrieval, advertisement retrieval, and product retrieval. When the hash feature compression method provided in the embodiment of the present application is applied in a certain application scenario, the retrieval object in the application scenario is the object that needs to be hash-encoded; for example, when the hash feature compression method provided in the embodiment of the present application is applied in an image retrieval scenario, the image data is the object that needs to be hash-encoded.
[0072] like Figure 1 As shown, the application scenario includes a server 110 and a database 120; the server 110 and the database 120 can communicate via a network, or the database 120 can be integrated inside the server 110. The server 110 is used to execute the hash feature compression method provided in the embodiment of the present application to compress the hash code to be compressed; the database 120 is used to store the objects to be hashed, and the objects can be exemplarily image data, text data, video data, advertising data, commodity data, etc., and the present application does not make any limitation on the data type of the objects stored in the database 120.
[0073] In actual applications, the server 110 can retrieve a target object belonging to a target data type from the database 120, and then encode the target features of the target object through the target hash model to obtain a hash code to be compressed corresponding to the target object. For example, assuming that the target object is a target image (i.e., the target data type is an image type), the server 110 can encode the target image itself (such as RGB channel values) through the target hash model to obtain a hash code to be compressed corresponding to the target image.
[0074] Furthermore, the server 110 may determine that the hash bit corresponding to the inefficient hash bit index in the hash code to be compressed is an inefficient hash bit based on a predetermined inefficient hash bit index applicable to the target hash code (i.e., a hash code obtained by encoding the target features of an object belonging to the target data type through a target hash model), and remove the inefficient hash bit in the hash code to be compressed to obtain a compressed hash code corresponding to the target object. Still taking the target object as a target image, and the hash code to be compressed corresponding to the target object being a hash code obtained by encoding the target image itself through a target hash model as an example, when the server 110 compresses the hash code to be compressed, it is necessary to determine the inefficient hash bit in the hash code to be compressed corresponding to the target image based on the inefficient hash bit index applicable to compressing the hash code obtained by encoding the image itself through the target hash model, and then remove the inefficient hash bit in the hash code to be compressed.
[0075] It should be noted that the above-mentioned inefficient hash bit index is predetermined, and is the index value of the hash bit in the target hash code whose importance meets the preset non-important condition. Here, the hash bit whose importance meets the non-important condition can be understood as a hash bit with low importance, low reference value, and difficult to effectively play a positive role. The inefficient hash bit index is usually determined based on the target features of the training object belonging to the same target data type, and the training hash code obtained by encoding the target features of the training object through the target hash model; taking the inefficient hash bit index suitable for compressing the hash code obtained by encoding the image itself through the target hash model as an example, when determining the inefficient hash bit index, multiple training images can be obtained, and the multiple training images are respectively encoded through the target hash model to obtain the training hash codes corresponding to the multiple training images, and then the importance of each hash bit in the training hash code can be measured according to the similarity of the multiple training images in the image feature space and the similarity of the training hash codes corresponding to the multiple images in the hash feature space, so as to determine the index value of the hash bit with low importance as the inefficient hash bit index.
[0076] It should be understood that Figure 1 The application scenarios shown are only examples. In practical applications, the hash feature compression method provided in the embodiment of the present application can be applied to Figure 1 In addition to the application scenarios shown, the present invention can also be applied to various scenarios that require hash encoding and compression of the encoded hash codes. For example, the server performs hash encoding on the relevant data uploaded by the terminal device (such as images, texts, videos, etc.), and then compresses the encoded hash codes. No limitation is made herein on the application scenarios to which the hash feature compression method provided in the embodiments of the present application is applicable.
[0077] The hash feature compression method provided by the present application is introduced in detail below through a method embodiment.
[0078] See also Figure 2 , Figure 2 The flowchart of the hash feature compression method provided in the embodiment of the present application is shown in FIG. For the convenience of description, the following embodiment is still introduced by taking the server as the execution subject of the hash feature compression method. Figure 2 As shown, the hash feature compression method includes the following steps:
[0079] Step 201: Obtain a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding target features of the target object through a target hash model.
[0080] In practical applications, the server may use a target hash model to encode the target features of the target object to obtain a hash code to be compressed corresponding to the target object. Alternatively, the server may obtain the hash code to be compressed obtained by encoding the target features of the target object using the target hash model from other devices, for example, obtaining the hash code to be compressed corresponding to the target object from a terminal device, or other server, or database. This application does not make any limitation on the method of obtaining the hash code to be compressed corresponding to the target object.
[0081] It should be noted that the above-mentioned target hash model can also be called a target hash function or a target hash algorithm, and the target hash model can be any one or more models that can encode a hash code; exemplarily, the target hash model can be any one or more of a locality-sensitive hashing (LSH) model, a spectral hashing (SpectralHashing) model, an anchor graph hashing (AGH) model, an iterative quantization (ITQ) model, a sparse projections (SP) model and the like; this application does not specifically limit the type and number of target hash models.
[0082] The target data type may be any data type, such as image data, video data, text data, advertisement data, commodity data, etc. Accordingly, the target object may be any object belonging to the target data type, for example, when the target data type is image data, the target object may be any image. The target feature of the target object can be the target object itself, that is, there is no need to perform any processing on the target object, and the target object itself can be directly used as the target feature corresponding to the target object; the target feature of the target object can also be a feature vector of the target object obtained by performing feature extraction processing on the target object. For example, when the target object is a target picture, the target picture can be feature extracted by using a picture feature extraction model to obtain a picture feature vector, and the picture feature vector is used as the target feature of the target object; the target feature of the target object can also be an information feature related to the target object. For example, when the target object is a target video, the target feature of the target object can be a text feature corresponding to the target video (such as a text feature determined according to the title and / or subtitles of the target video), or an audio feature corresponding to the target video (such as an audio feature determined according to the audio of the target video), or a picture feature corresponding to the video frame in the target video, and so on; in the embodiment of the present application, the target corresponding to the target object can include one or more types, and no limitation is made on the type and number of the target features of the target object.
[0083] In a possible implementation, the server may use a target hash model to encode a target feature of the target object to obtain a hash code to be compressed corresponding to the target object. Figure 3 As shown, the server can use the AGH hash model to encode the target image to obtain the hash code to be compressed corresponding to the target image.
[0084] In another possible implementation, the server may encode the target features of the target object through m1 (m1 is an integer greater than 1) target hash models, respectively, to obtain hash codes corresponding to the m1 target hash models; then, concatenate the hash codes corresponding to the m1 target hash models, to obtain the compressed hash code corresponding to the target object.
[0085] In practical applications, designing or selecting a certain hash model in a specific application scenario usually consumes a lot of energy, because the hash model usually depends on the distribution of data, and it is necessary to try more parameters to achieve a better effect. In order to solve the above problems, the embodiment of the present application proposes a new method for calculating hash codes for target objects, that is, directly using a variety of existing hash models to encode the target features of the target object respectively, to obtain a variety of hash codes, and then integrate a variety of hash codes to enrich the information represented by the hash code. However, such processing may introduce more redundant information, that is, not all hash bits in the hash code obtained by integrating a variety of hash codes are meaningful, and high-dimensional hash codes will greatly increase storage costs. Therefore, the embodiment of the present application needs to compress the hash code obtained by the integration through the subsequent step 202, select the hash bits with higher reference value in the hash code obtained by the integration to retain, and select the hash bits with lower reference value to remove.
[0086] For example, Figure 4 This is a schematic diagram of the implementation architecture of obtaining the hash code to be compressed provided in the embodiment of the present application. Figure 4 As shown, for the target feature X∈R 1×d , the server can use m1 target hash models {H1, H2, ..., H m1} Encode the target feature X respectively and generate corresponding m1 hash codes Among them, r is the length of the hash code obtained by encoding the target feature through the target hash model. Then, the server can concatenate m1 hash codes to obtain the compressed hash code B∈{1,-1} corresponding to the target object 1×R , where R=m1r.
[0087] It should be understood that Figure 4 The implementation method shown is introduced by taking the example that the lengths of m1 hash codes generated by m1 target hash models are the same. In actual applications, the lengths of m1 hash codes generated by m1 target hash models may also be different. This application does not make specific limitations on the length of the hash code generated by each target hash model.
[0088] In another possible implementation, the server can encode the target features of the target object through m2 (m2 is an integer greater than 1) versions of the target hash model to obtain hash codes corresponding to the m2 versions; the m2 versions of the target hash model are trained based on different training samples, or are trained based on different numbers of iterative training; then, the hash codes corresponding to the m2 versions are concatenated to obtain the compressed hash code corresponding to the target object.
[0089] In practical applications, when it has been determined that a certain target hash model is suitable for hash coding the target features of the target object, it is necessary to further train the hash model using training samples and adjust the parameters of the hash model; in many cases, it is often difficult to measure whether the trained hash model has better performance during the training of the hash model, that is, it is difficult to measure whether the hash code obtained by encoding the trained hash model can accurately reflect the object features. The embodiment of the present application proposes a solution to this situation, that is, using different versions of the target hash model obtained by training, respectively encode the target features of the target object to obtain multiple hash codes, and then integrate multiple hash codes to fuse the reference information carried in the hash code determined by different versions of the target hash model; however, this processing method will also introduce more redundant information, so that not all hash bits in the integrated hash code are meaningful, and the high-dimensional hash code will greatly increase the storage cost, so the embodiment of the present application needs to compress the hash code through the subsequent step 202, select the hash bits with higher reference value in the integrated hash code to retain, and select the hash bits with lower reference value to remove.
[0090] For example, Figure 5 This is a schematic diagram of the implementation architecture of obtaining the hash code to be compressed provided in the embodiment of the present application. Figure 5 As shown, for the target feature X∈R 1×d , the server can use m2 different versions of the target hash model {H1, H2, ..., H m2}, encode the target feature X respectively and generate the corresponding m2 hash codes Where r is the length of the hash code obtained by encoding the target feature through the target hash model; the m2 different versions of the target hash model here can be the target hash model trained with m2 different training samples (for example, the target hash model trained based on training sample 1, training sample 2, ..., training sample m2), or the target hash model trained based on m2 different times of iterative training (for example, the target hash model trained after 5 iterative training, 10 iterative training, 15 iterative training, ...). Then, the server can concatenate the m2 hash codes to obtain the compressed hash code B∈{1,-1} corresponding to the target object 1×R , where R=m2r.
[0091] In another possible implementation, the server may perform feature extraction processing on the target object through m3 (m3 is an integer greater than 1) feature extraction models to obtain m3 target features of the target object; then, encode the m3 target features through the target hash model to obtain hash codes corresponding to the m3 target features; and then, concatenate the hash codes corresponding to the m3 target features to obtain the hash code to be compressed corresponding to the target object.
[0092] In practical applications, different feature extraction models are used to extract features from target objects, which can often extract features that carry different reference information. In order to enrich the information that can be represented by the hash code corresponding to the target object, the embodiment of the present application can use the target hash model to perform hash coding on the target features extracted from the target object by different feature extraction models, obtain the hash codes corresponding to the different target features, and then integrate these hash codes. The hash code obtained by integration will carry extremely rich feature information. However, this processing method often introduces a lot of redundant information, that is, not all hash bits in the integrated hash code are meaningful, and high-dimensional hash codes will greatly increase storage costs. Therefore, the embodiment of the present application needs to compress the hash code through the subsequent step 202, select the hash bits with higher reference value in the integrated hash code to retain, and select the hash bits with lower reference value to remove.
[0093] For example, Figure 6 This is a schematic diagram of the implementation architecture of obtaining the hash code to be compressed provided in the embodiment of the present application. Figure 6 As shown in the figure, the server can use m3 different feature extraction models to perform feature extraction processing on the target object respectively, and obtain m3 target features corresponding to the target object. Among them, d i is the characteristic length of the i-th target feature. Then, the server can use the target hash model to encode these m3 target features respectively, and obtain m3 hash codes corresponding to these m3 target features respectively. Among them, r is the length of the hash code obtained by encoding the target feature through the target hash model. Then, the server can concatenate m3 hash codes to obtain the compressed hash code B∈{1,-1} corresponding to the target object. 1×R , where R = m3r.
[0094] In another possible implementation, the server may obtain m4 (m4 is an integer greater than 1) types of modal information related to the target object; then, perform feature extraction processing on the m4 types of modal information respectively to obtain target features corresponding to the m4 types of modal information; then, through the target hash model, encode the target features corresponding to the m4 types of modal information respectively to obtain hash codes corresponding to the m4 types of modal information; finally, concatenate the hash codes corresponding to the m4 types of modal information to obtain the compressed hash code corresponding to the target object.
[0095] In practical applications, information of different modes related to the target object can describe the target object from different dimensions. In order to enrich the information carried by the hash code corresponding to the target object, the embodiment of the present application proposes an implementation method for determining the compressed hash code corresponding to the target object; that is, through the target hash model, the target features corresponding to the different modal information related to the target object are encoded and processed to obtain the hash codes corresponding to the different modal information; and then these multiple hash codes are integrated, and the features corresponding to the information of different modes related to the target object are integrated to further enrich the information represented by the hash code corresponding to the target object. However, this processing method often introduces a lot of redundant information, that is, not all hash bits in the integrated hash code are meaningful, and the high-dimensional hash code will greatly increase the storage cost. Therefore, the embodiment of the present application needs to compress the hash code through the subsequent step 202, select the hash bits with higher reference value in the integrated hash code to retain, and select the hash bits with lower reference value to eliminate.
[0096] The following takes the target object as the target video as an example. Figure 7 The schematic diagram of the implementation architecture of obtaining the hash code to be compressed is shown in FIG. 1 , which is an exemplary introduction to the implementation method of obtaining the hash code to be compressed. Figure 7 As shown in FIG. 1 , the server can first obtain m4 types of modal information related to the target video, such as obtaining the video frame in the target video, obtaining the text of the target video (such as the subtitles in the target video and the title of the target video, etc.), and the audio in the target video. Then, the server can perform feature extraction processing on the obtained video frame, text, and audio, respectively, to obtain the target features corresponding to each of the m4 types of modal information. Among them, d i is the characteristic length of the i-th target feature. Then, the server can encode the target features corresponding to the m4 types of modal information respectively through the target hash model to obtain m4 hash codes corresponding to the m4 types of modal information respectively. Among them, r is the length of the hash code obtained by encoding the target feature through the target hash model. Then, the server can concatenate m4 hash codes to obtain the compressed hash code B∈{1,-1} corresponding to the target object. 1×R , where R=m4r.
[0097] It should be understood that the several implementation methods of obtaining the hash code to be compressed introduced above are only examples. In actual applications, the server can also use other methods to obtain the hash code to be compressed. This application does not make any limitation on the implementation method of obtaining the hash code to be compressed.
[0098] Step 202: determining the inefficient hash bits in the hash code to be compressed based on the inefficient hash bit index, removing the inefficient hash bits in the hash code to be compressed, and obtaining a compressed hash code corresponding to the target object; wherein the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance satisfies a preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
[0099] After the server obtains the hash code to be compressed corresponding to the target object, it can determine the inefficient hash bits in the hash code to be compressed based on a predetermined inefficient hash bit index suitable for compressing and processing such hash code to be compressed, and then remove the inefficient hash bits in the hash code to be compressed accordingly, reduce the hash bits with low reference value of the information carried in the hash code to be compressed, implement compression processing of the hash code to be compressed, and obtain the compressed hash code corresponding to the target object.
[0100] Figure 8 Schematic diagram of the implementation method of compressing the above-mentioned hash code to be compressed. Figure 8 As shown, assuming that the hash code to be compressed obtained by the server through step 201 is 1001101, the inefficient hash bit indexes corresponding to this type of hash code are the 1st, 3rd, 6th and 7th positions. Accordingly, the server can determine that the hash bits at the 1st, 3rd, 6th and 7th positions in the hash code to be compressed are inefficient hash bits, and then the server can remove the inefficient hash bits in the hash code to be compressed to obtain the corresponding compressed hash code 011.
[0101] It should be noted that the above-mentioned inefficient hash bit index is a predetermined hash bit index value specifically suitable for compressing the target hash code, which is essentially the index value of the hash bit in the target hash code whose importance meets the preset non-important condition. The target hash code here is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model. In other words, as long as the hash code obtained by encoding the target features of the object belonging to the target data type using the target hash model belongs to the target hash code, the target object belonging to the target data type obtained through step 201 above The target hash code to be compressed corresponding to the target object is obtained by encoding the target features of the target object through the target hash model. Accordingly, the hash code to be compressed corresponding to the target object belongs to the target hash code. The hash bit in the target hash code whose importance meets the preset non-important condition refers to the hash bit in the target hash code whose corresponding importance is lower than the preset importance threshold, or the preset number of hash bits with low importance in the target hash code. Such hash bits can be understood as hash bits with low importance, low reference value, and difficult to effectively play a positive role.
[0102] The above-mentioned inefficient hash bit index is determined in advance based on the target features of the training object belonging to the target data type and the training hash code obtained by encoding the target features of the training object through the target hash model.
[0103] Combine the following Fig. 9 The process shown in FIG. 1 is used to describe in detail the method for determining the above-mentioned inefficient hash bit index. Fig. 9 As shown, the method for determining the inefficient hash bit index includes the following steps:
[0104] Step 901: construct a training target feature matrix according to the target features of each of the n training objects; wherein n is an integer greater than or equal to 1.
[0105] For example, assume that the target features of n training objects are Among them, x i is the target feature corresponding to the i-th training object, and d is the length of the target feature of each training object; then, the server can calculate the target feature of each training object according to the target feature of each of the n training objects. Construct the training target feature matrix X∈R n×d .
[0106] It should be understood that in practical applications, the target features of the training object may include only one or multiple target features. For example, the target features of the training object may include multiple target features corresponding to the training object obtained by performing feature extraction processing on the training object through multiple different feature extraction models, or the target features of the training object may also include features corresponding to multiple modal information related to the target object; that is, the target features of the training object can be set according to actual needs, and the embodiments of the present application do not impose any restrictions on the number and type of target features of the training object.
[0107] Step 902: encoding the target features of the n training objects respectively through the target hash model to obtain the training hash codes corresponding to the n training objects; and constructing a training hash feature matrix according to the training hash codes corresponding to the n training objects.
[0108] For each target feature of a training object, the server can use a target hash model to encode the target feature of the training object to obtain a training hash code corresponding to the training object; thus, the server will obtain a training hash code corresponding to each of the n training objects. Furthermore, the server can construct a training hash feature matrix based on the training hash codes corresponding to each of the n training objects.
[0109] For example, for the target feature x of the i-th training object i ∈R 1×d , the server can use the target hash model to deal with the target feature x i ∈R 1×d Perform encoding processing to obtain the training hash code B corresponding to the i-th training object i ∈{1,-1} 1×r After the server determines the training hash codes corresponding to each of the n training objects in the above manner, it can construct a training hash feature matrix B∈{1,-1} according to the training hash codes corresponding to each of the n training objects. n×r .
[0110] It should be noted that when the training object includes multiple target features, when the server determines the corresponding training hash code for each training object, it can use the target hash model to encode the various target features of the training object separately to obtain the training hash codes corresponding to the various target features, and then concatenate the training hash codes corresponding to the various target features to obtain the training hash code corresponding to the training object.
[0111] It should be noted that, in practical applications, the above target hash models may include only one or multiple ones; when the target hash models include multiple ones, the server needs to use multiple target hash models to encode the target features of the training object respectively, obtain the hash codes corresponding to the multiple target hash models, and then concatenate the hash codes corresponding to the multiple target hash models to obtain the training hash code corresponding to the training object. That is, the target hash model used can also be set according to actual needs, and this application does not limit the number and type of the target hash models used.
[0112] Step 903: Determine the importance of each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix; and use the index value of the hash bit whose corresponding importance meets the preset non-important condition as the inefficient hash bit index.
[0113] After the server determines the training target feature matrix and the training hash feature matrix in the above manner, it can further determine the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix. Then, the index value of the hash bit whose corresponding importance satisfies the preset non-important condition is used as an inefficient hash bit index suitable for compressing the target hash code (i.e., the hash code obtained by encoding the target feature of the object belonging to the target data type using the target hash model); for example, the server can use the index value of the hash bit whose corresponding importance is lower than the preset importance threshold as the inefficient hash bit index, and for another example, the server can sort the importance corresponding to each hash bit in the training hash code in order from large to small or from small to large, and then determine the index value of the preset number of hash bits with lower corresponding importance as the inefficient hash bit index; the present application does not make any limitation on the specific implementation method of determining the inefficient hash bit index.
[0114] In a possible implementation, the server can determine the importance of each hash bit in the training hash code based on the training target feature matrix and the training hash feature matrix based on the hash bit importance measurement algorithm. The hash bit importance measurement algorithm herein is determined by minimizing an objective function, which is used to characterize the gap between the similarity of n training objects in the target feature space and the reference similarity of the n training objects in the hash feature space. The reference similarity of the n training objects in the hash feature space is obtained by processing the similarity between the n training hash codes based on the importance matrix, and the importance matrix includes the importance of each hash bit in the training hash code.
[0115] In theory, the embodiment of the present application hopes that the hash code corresponding to the training object can perfectly maintain the similarity information of the training object in the original feature space (ie, the target feature space), that is, minimize the basic objective function shown in the following formula (1):
[0116]
[0117] in, Satisfy the normalization condition, that is Accordingly, the first term in formula (1) It can represent the cosine similarity of the training object in the target feature space; and the second term in formula (1) It can represent the similarity of the training object in the Hamming space (i.e., the hash feature space). The embodiment of the present application hopes that the similarity information of the training object in the target feature space and the Hamming space is consistent, so that This is the optimization goal of the basic objective function.
[0118] In the embodiment of the present application, considering that the reference value of the information carried by different hash bits in the training hash code is different, different hash bits in the hash code should be treated differently when calculating the similarity between the training hash codes. That is, the embodiment of the present application modifies the similarity of the training object in the Hamming space to in, The elements on its diagonal are k It is used to indicate the weight of the kth hash bit in the training hash code when calculating the Hamming space similarity, that is, it indicates the importance of the kth hash bit in the training hash code; if the information carried by the kth hash bit has a low reference value (such as redundant information), a smaller weight λ can be configured for it k , so that it makes a smaller contribution when calculating similarity; on the contrary, if the information carried by the kth hash bit has a higher reference value, a larger weight λ can be configured for it k , making it contribute more when calculating similarity.
[0119] Based on the above theoretical basis, the present application can adjust the basic objective function shown in formula (1) to an objective function applicable to the embodiment of the present application, that is, the objective function shown in formula (2) below:
[0120]
[0121] In the embodiment of the present application, the objective function shown in formula (2) can be minimized as the goal to derive a hash bit importance measurement algorithm for calculating the importance corresponding to each hash bit in the training hash code; in the objective function, Used to characterize the similarity of training objects in the target feature space. It is used to characterize the similarity of the training object in the hash feature space, where Λ is the importance matrix including the importance of each hash bit. After the hash bit importance measurement algorithm is derived, the importance of each hash bit in the training hash code can be determined based on the training target feature matrix and the training hash feature matrix using the hash bit importance measurement algorithm.
[0122] As an example, the hash bit importance measurement algorithm derived by the embodiment of the present application is as follows: a first reference matrix is calculated based on the training hash feature matrix and the transposed matrix corresponding to the training hash feature matrix; and the Hadamard product of the first reference matrix and itself is calculated to obtain a second reference matrix. The elements in the training target feature matrix are normalized to obtain a normalized training target feature matrix; a third reference matrix is calculated based on the transposed matrix corresponding to the normalized training target feature matrix and the training hash feature matrix; and the Hadamard product of the third reference matrix and itself is calculated to obtain a fourth reference matrix. Furthermore, an importance matrix is calculated based on the second reference matrix and the fourth reference matrix; the values of each diagonal element in the importance matrix are the importance corresponding to each hash bit in the training hash code.
[0123] The embodiment of the present application takes minimizing the objective function shown in the above formula (2) as the goal, and proves that the importance matrix Λ in the objective function has a closed-form solution, which is specifically shown in the following formula (3):
[0124]
[0125] Among them, B T B is the first reference matrix, B T B⊙B T B is the second reference matrix obtained by calculating the Hadamard product of the first reference matrix and itself; That is the normalized training target feature matrix, is the third reference matrix, That is, the fourth reference matrix is obtained by calculating the Hadamard product of the third reference matrix and itself; is an importance matrix, where the diagonal elements are the importance of each hash bit in the training hash code. The proof process of the above formula (3) will be introduced in detail below.
[0126] In an embodiment of the present application, in order to ensure the accuracy of the determined inefficient hash bit index, the server can screen out the inefficient hash bit index in the training hash code through multiple rounds of iterations according to a specific number of iterations and iteration step.
[0127] Specifically, after the server determines the importance corresponding to each hash bit in the training hash code through the above steps 901 to 903, it can sort the importance corresponding to each hash bit in the training hash code in ascending order, and determine the index value of the hash bit corresponding to the top a (a is an integer greater than or equal to 1) importances as the inefficient hash bit index. Then, the server can remove the hash bits corresponding to the above a inefficient hash bit indexes in the n training hash codes to obtain n updated training hash codes; and reconstruct the updated training hash feature matrix based on the n updated training hash codes. Furthermore, the server can re-execute step 903, determine the importance corresponding to each hash bit in the updated training hash code according to the training target feature matrix and the updated training hash feature matrix, and sort the importance corresponding to each hash bit in the updated training hash code in ascending order, and determine the index value of the hash bit corresponding to the top a importances as the inefficient hash bit index. In this way, the above process is repeated until the number of determined inefficient hash bit indexes reaches a preset number.
[0128] Exemplarily, the server can pre-set the number of iterations t and the iteration step length η (the same as a in the above text). After the server constructs the training target feature matrix X and the training hash feature matrix B, it can use formula (3), that is, Calculate the importance λ corresponding to each hash bit in the training hash code in the training hash feature matrix B, and sort the importance λ corresponding to each hash bit in ascending order, and determine the index values corresponding to the top n hash bits as the inefficient hash bit index. Then, the server can remove the hash bits whose index values are the above-mentioned inefficient hash bit indexes from the training hash feature matrix B to obtain an updated training hash feature matrix. Furthermore, based on the updated training hash feature matrix, use formula (3) to again determine the importance λ corresponding to each hash bit in the training hash code in the updated training hash feature matrix, and sort the importance λ corresponding to each hash bit in ascending order, and then determine the index values corresponding to the top n hash bits as the inefficient hash bit index. In this way, the above-mentioned process of determining the inefficient hash bit index is repeated t times to determine tη inefficient hash bit indexes; after the above-mentioned t iterations, the training hash feature matrix will become Where f = R - tη.
[0129] It should be understood that the implementation method of determining the inefficient hash bit index introduced above is only an example. In actual applications, the server can also use other methods to determine the index value of the hash bit with lower importance in the hash code. This application does not impose any limitation on the method of determining the inefficient hash bit index.
[0130] The above hash feature compression method determines the importance of each hash bit in the training hash code in advance according to the target feature of the training object belonging to the target data type and the training hash code obtained by encoding the target feature of the training object through the target hash model, and then determines the index value of the corresponding hash bit with lower importance as the inefficient hash bit index. Since the information distribution of the hash code obtained by encoding the same feature of the object belonging to the same data type through the same hash model is basically the same, the inefficient hash bit index determined by the above method can also be correspondingly applied to other hash codes obtained by encoding the target feature of the object belonging to the target data type through the target hash model, that is, in the hash code obtained by encoding the target feature of the object belonging to the target data type through the target hash model, the information carried by the hash bit corresponding to the inefficient hash bit index generally does not have a high reference value. Therefore, by removing the hash bit corresponding to the inefficient hash bit index in such hash code, the compression processing of such hash code can be realized, the information with lower reference value in the compressed hash code obtained after the compression processing is reduced, and the information with higher reference value is guaranteed to be retained in the compressed hash code, so as to realize the effective utilization of storage resources and avoid wasting storage costs.
[0131] The following is an introduction to the proof process of the above formula (3) for calculating the importance corresponding to each hash bit in the hash code.
[0132] Based on the definition of matrix trace operation, the following equations (4) to (7) all hold true.
[0133] Tr(AB)=Tr(BA) (4)
[0134] Tr(A T )=Tr(A) (5)
[0135]
[0136]
[0137] When the matrix A is a diagonal matrix, equation (8) holds.
[0138]
[0139] Next, the present application example will prove two inferences:
[0140] The first corollary: If A T =A∈R r×r , then formula (9) holds.
[0141]
[0142] The proof process is as follows:
[0143]
[0144]
[0145] The second corollary: If is a diagonal matrix, where And A T =A∈R r ×r , then formula (10) holds.
[0146]
[0147] The proof process is as follows:
[0148]
[0149]
[0150] Based on the above conclusions and inferences, equation (3) can be derived based on the following proof process.
[0151]
[0152] The first term in the second row of the above formula Tr(XX T XX T ) is equivalent to a constant term for Λ, so the proof problem is equivalent to minimizing the last two terms (i.e., the third line in the above formula), and minimizing this formula is equivalent to taking the derivative of the formula with respect to the variable Λ and making it equal to 0. Based on this, the following derivation process can be obtained:
[0153]
[0154] Based on the two inferences that have been proven above, the following derivation process can be obtained:
[0155]
[0156] In this way, the proof of formula (3) for calculating the importance corresponding to each hash bit in the hash code is completed.
[0157] The inventors of the present application have experimentally verified the effectiveness of the hash feature compression method provided in the embodiments of the present application in the target application scenario; the target application scenario here refers to encoding image features using multiple hash models to obtain multiple hash codes, and then splicing these multiple hash codes, and using the hash feature compression method provided in the embodiments of the present application to compress the spliced hash codes.
[0158] Specifically, when the inventor conducted the experiment, 395,114 pictures were used as training objects, and the parameters of various hash models were trained based on these training objects. Based on these training objects, inefficient hash bit indexes were determined, and the inefficient hash bit indexes are suitable for compressing the splicing of various hash codes obtained by encoding the image features through these various hash models. The test set used to determine the test effect includes 4,883 pictures, involving a total of 69,869 categories. During the training and testing stages, the pictures will be sent to the deep convolutional network, and the 512-dimensional floating-point feature vectors corresponding to the pictures will be used as input features of the hash model to obtain the hash code of each sample as a retrieval feature. At this stage, pictures can be selected from the test set as query samples in turn, and the remaining 4,882 pictures can be used as retrieval databases. This application uses the following evaluation indicators to evaluate the performance of hash retrieval:
[0159] MAP@K, that is, given c query samples And specify the number of first K samples to be returned, and its average retrieval accuracy is defined as follows:
[0160]
[0161] Among them, g j for The number of correctly retrieved samples in the retrieval results; P(i) is the prediction accuracy of the first i retrieval results; σ(i) is the indicator function, if the i-th retrieval sample is predicted correctly, σ(i) is equal to 1, otherwise, σ(i) is equal to 0. The larger the value of MAP@K, the better the retrieval performance.
[0162] In the algorithm framework, the inventors of the present application adopted three hash models (ITQ, AGH and SP), and each hash model was optimized for the data set parameters to obtain the best results, as shown in Table 1:
[0163] Table 1
[0164] Hash Model Dimensions parameter MAP@all <![CDATA[B1]]> ITQ 512 Iterate 50 times 0.8280 <![CDATA[B2]]> AGH 512 The number of anchor points is 25K, the number of nearest neighbors is 2 0.8014 <![CDATA[B3]]> SP 512 The sparse coefficient is 0.1 and the number of iterations is 50. 0.8089
[0165] Then, the inventor of the present application concatenates the above three hash codes to obtain Indicates that the feature dimension is spliced. Thereafter, based on the method for determining the inefficient hash bit index provided in the embodiment of the present application, the inefficient hash bit index suitable for compressing and processing such hash codes is determined based on the spliced hash code; when determining the inefficient hash bit index, the number of iterations t=8 and the iteration step η=64 can be set, thereby determining 512 inefficient hash bit indexes, and the hash code obtained by splicing the above three hash codes based on the inefficient hash bit index is compressed, and a compressed hash code with a dimension of f=1024 will be obtained. The inventor adopts the hash feature compression method (BitCompression) provided in the embodiment of the present application, and uses the determined inefficient hash bit index to perform testing based on the test set. The test results are shown in Table 2.
[0166] Table 2
[0167]
[0168] From the test results shown in Table 2, it can be found that the 1536-dimensional concatenated hash code is converted into a 1024-dimensional compressed hash code after being processed by the hash feature compression method provided in the embodiment of the present application, and 512 hash bits are screened out. When the encoding length is reduced by 33%, the retrieval accuracy is almost the same, which shows that the 512 removed hash bits do not play a key role in the sample features, further showing that the method provided in the embodiment of the present application is meaningful for calculating the importance of hash bits.
[0169] In addition, since the dimension of the compressed hash code is still relatively high, the inventors of the present application compared the compressed hash code with the hash code of the same dimension calculated by a separate hash model, and obtained the comparison results shown in Table 3; among them, since PCA in ITQ limits the hash code dimension to no more than 512 dimensions of deep features, only the performance of AGH and SP in 1024 dimensions was compared in this comparison process.
[0170] Table 3
[0171]
[0172] The test results shown in Table 3 show that the hash code The performance of the single hash model AGH is improved by nearly 4.19%, and the performance of the single hash model SP is improved by nearly 1.90%; the reason is that the hash code It combines the characteristics of multiple hash models, and discards the redundant information in the hash code obtained by these multiple hash models after feature compression. Therefore, the hash code Compared with the single hash model encoding of the same dimension, the hash code obtained has better performance.
[0173] With respect to the hash feature compression method described above, the present application also provides a corresponding hash feature compression device so that the above hash feature compression method can be applied and implemented in practice.
[0174] See also Fig.10 , Fig.10 It is the same as above Figure 2 The structure diagram of a hash feature compression device 1000 corresponding to the hash feature compression method shown in FIG. Fig.10 As shown, the hash feature compression device 1000 includes:
[0175] The hash code acquisition module 1001 is used to acquire a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding a target feature of the target object through a target hash model;
[0176] The hash code compression module 1002 is used to determine the inefficient hash bits in the hash code to be compressed based on the inefficient hash bit index, remove the inefficient hash bits in the hash code to be compressed, and obtain the compressed hash code corresponding to the target object; wherein the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance meets the preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
[0177] Optional, in Fig.10 Based on the hash feature compression device shown, see Fig.11 , Fig.11 This is a schematic diagram of the structure of another hash feature compression device 1100 provided in an embodiment of the present application. Fig.11 As shown, the device further includes: a hash index determination module 1101; the hash index determination module 1101 includes:
[0178] The first feature determination submodule 1102 is used to construct a training target feature matrix according to the target features of each of the n training objects, wherein n is an integer greater than or equal to 1;
[0179] The second feature determination submodule 1103 is used to encode the target features of the n training objects respectively through the target hash model to obtain the training hash codes corresponding to the n training objects respectively; and construct a training hash feature matrix according to the training hash codes corresponding to the n training objects respectively;
[0180] The inefficient index determination submodule 1104 is used to determine the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix; and use the index value of the hash bit whose corresponding importance meets the preset non-important condition as the inefficient hash bit index.
[0181] Optional, in Fig.11 Based on the hash feature compression device shown, the inefficient index determination submodule 1104 is specifically used for:
[0182] Based on the hash bit importance measurement algorithm, determining the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix;
[0183] Among them, the hash bit importance measurement algorithm is determined with the goal of minimizing the objective function; the objective function is used to characterize the gap between the similarity of the n training objects in the target feature space and the reference similarity of the n training objects in the hash feature space, and the reference similarity of the n training objects in the hash feature space is obtained by processing the similarity between the n training hash codes based on the importance matrix, and the importance matrix includes the importance corresponding to each hash bit in the training hash code.
[0184] Optional, in Fig.11 Based on the hash feature compression device shown, the inefficient index determination submodule 1104 is specifically used for:
[0185] Calculate a first reference matrix according to the training hash feature matrix and the transposed matrix corresponding to the training hash feature matrix; calculate the Hadamard product of the first reference matrix and itself to obtain a second reference matrix;
[0186] Normalizing the elements in the training target feature matrix to obtain a normalized training target feature matrix; calculating a third reference matrix according to a transposed matrix corresponding to the normalized training target feature matrix and the training hash feature matrix; calculating the Hadamard product of the third reference matrix and itself to obtain a fourth reference matrix;
[0187] The importance matrix is calculated according to the second reference matrix and the fourth reference matrix; the values of the diagonal elements in the importance matrix are the importance corresponding to the hash bits in the training hash code.
[0188] Optional, in Fig.11 Based on the hash feature compression device shown, the inefficient index determination submodule 1104 is specifically used for:
[0189] The importances corresponding to the respective hash bits in the training hash code are sorted in ascending order, and the index values of the hash bits corresponding to the top a importances are determined as the inefficient hash bit indexes; wherein a is an integer greater than or equal to 1;
[0190] Removing the hash bits corresponding to the inefficient hash bit indexes in the n training hash codes respectively to obtain n updated training hash codes; constructing an updated training hash feature matrix according to the n updated training hash codes;
[0191] Determine the importance of each hash bit in the updated training hash code according to the training target feature matrix and the updated training hash feature matrix; sort the importance of each hash bit in the updated training hash code in ascending order, and determine the index value of the hash bit corresponding to the top a importances as the inefficient hash bit index;
[0192] The above process is repeated until the number of the determined inefficient hash bit indexes reaches a preset number.
[0193] Optional, in Fig.10 Based on the hash feature compression device shown, the hash code acquisition module 1001 is specifically used for:
[0194] Through m1 types of target hash models, target features of the target object are respectively encoded to obtain hash codes corresponding to the m1 types of target hash models; m1 is an integer greater than 1;
[0195] The hash codes corresponding to the target hash models of m1 types are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
[0196] Optional, in Fig.10 Based on the hash feature compression device shown, the hash code acquisition module 1001 is specifically used for:
[0197] Through m2 versions of the target hash model, the target features of the target object are respectively encoded to obtain hash codes corresponding to the m2 versions; m2 is an integer greater than 1; the m2 versions of the target hash model are obtained based on different training samples or based on different numbers of iterative training;
[0198] The hash codes corresponding to the m2 versions are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
[0199] Optional, in Fig.10 Based on the hash feature compression device shown, the hash code acquisition module 1001 is specifically used for:
[0200] Through m3 kinds of feature extraction models, feature extraction processing is performed on the target object respectively to obtain m3 kinds of target features of the target object; m3 is an integer greater than 1;
[0201] Through the target hash model, the m3 target features are respectively encoded to obtain hash codes corresponding to the m3 target features;
[0202] The hash codes corresponding to the m3 target features are concatenated to obtain the hash code to be compressed corresponding to the target object.
[0203] Optional, in Fig.10 Based on the hash feature compression device shown, the hash code acquisition module 1001 is specifically used for:
[0204] Acquire m4 types of modal information related to the target object; wherein m4 is an integer greater than 1;
[0205] Performing feature extraction processing on the m4 types of modal information respectively to obtain target features corresponding to the m4 types of modal information respectively;
[0206] By using the target hash model, encoding processing is performed on the target features corresponding to the m4 types of modal information respectively to obtain hash codes corresponding to the m4 types of modal information respectively;
[0207] The hash codes corresponding to the m4 types of modal information are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
[0208] The above-mentioned hash feature compression device determines the importance of each hash bit in the training hash code in advance according to the target feature of the training object belonging to the target data type and the training hash code obtained by encoding the target feature of the training object through the target hash model, and then determines the index value of the corresponding hash bit with lower importance as the inefficient hash bit index. Since the information distribution of the hash code obtained by encoding the same feature of the object belonging to the same data type through the same hash model is basically the same, the inefficient hash bit index determined by the above method can also be correspondingly applied to other hash codes obtained by encoding the target feature of the object belonging to the target data type through the target hash model, that is, in the hash code obtained by encoding the target feature of the object belonging to the target data type through the target hash model, the information carried by the hash bit corresponding to the inefficient hash bit index generally does not have a high reference value. Therefore, by removing the hash bit corresponding to the inefficient hash bit index in such hash code, the compression processing of such hash code can be realized, the information with lower reference value in the compressed hash code obtained after the compression processing is reduced, and the information with higher reference value is guaranteed to be retained in the compressed hash code, so as to realize the effective utilization of storage resources and avoid wasting storage costs.
[0209] An embodiment of the present application also provides an electronic device for compressing hash features, which may specifically be a terminal device or a server. The terminal device and server provided in the embodiment of the present application will be introduced below from the perspective of hardware instantiation.
[0210] See also Fig.12 , Fig.12 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Fig.12 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant, a point of sales (POS), a car computer, etc., taking the terminal as a computer as an example:
[0211] Fig.12 FIG. 1 is a block diagram showing a partial structure of a computer related to a terminal provided in an embodiment of the present application. Fig.12The computer includes: a radio frequency (RF) circuit 1210, a memory 1220, an input unit 1230 (including a touch panel 1231 and other input devices 1232), a display unit 1240 (including a display panel 1241), a sensor 1250, an audio circuit 1260 (which can be connected to a speaker 1261 and a microphone 1262), a wireless fidelity (WiFi) module 1270, a processor 1280, and a power supply 1290. Those skilled in the art can understand that Fig.12 The computer structure shown in the figure does not constitute a limitation of the computer, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0212] The memory 1220 can be used to store software programs and modules. The processor 1280 executes various functional applications and data processing of the computer by running the software programs and modules stored in the memory 1220. The memory 1220 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the computer (such as audio data, a phone book, etc.), etc. In addition, the memory 1220 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0213] The processor 1280 is the control center of the computer. It uses various interfaces and lines to connect various parts of the entire computer. It executes various functions of the computer and processes data by running or executing software programs and / or modules stored in the memory 1220, and calling data stored in the memory 1220, so as to monitor the computer as a whole. Optionally, the processor 1280 may include one or more processing units; preferably, the processor 1280 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1280.
[0214] In the embodiment of the present application, the processor 1280 included in the terminal also has the following functions:
[0215] Obtaining a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding a target feature of the target object through a target hash model;
[0216] Determine the inefficient hash bits in the hash code to be compressed based on the inefficient hash bit index, remove the inefficient hash bits in the hash code to be compressed, and obtain a compressed hash code corresponding to the target object;
[0217] Among them, the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance meets the preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object, and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
[0218] Optionally, the processor 1280 is also used to execute the steps of any implementation method of the hash feature compression method provided in the embodiments of the present application.
[0219] See also Fig.13 , Fig.13 A schematic diagram of the structure of a server 1300 provided for an embodiment of the present application. The server 1300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1322 (for example, one or more processors) and a memory 1332, and one or more storage media 1330 (for example, one or more mass storage devices) storing application programs 1342 or data 1344. Among them, the memory 1332 and the storage medium 1330 may be temporary storage or permanent storage. The program stored in the storage medium 1330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1322 may be configured to communicate with the storage medium 1330 to execute a series of instruction operations in the storage medium 1330 on the server 1300.
[0220] The server 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input and output interfaces 1358, and / or one or more operating systems, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0221] The steps performed by the server in the above embodiment can be based on the Fig.13The server structure shown.
[0222] The CPU 1322 is used to execute the following steps:
[0223] Obtaining a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding a target feature of the target object through a target hash model;
[0224] Determine the inefficient hash bits in the hash code to be compressed based on the inefficient hash bit index, remove the inefficient hash bits in the hash code to be compressed, and obtain a compressed hash code corresponding to the target object;
[0225] Among them, the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance meets the preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object, and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
[0226] Optionally, CPU 1322 can also be used to execute the steps of any implementation method of the hash feature compression method provided in the embodiments of the present application.
[0227] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute any one of the implementation methods of a hash feature compression method described in the aforementioned embodiments.
[0228] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes any one of the implementation methods of a hash feature compression method described in the above embodiments.
[0229] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0230] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0231] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0232] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0233] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store computer programs.
[0234] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0235] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A hash feature compression method, characterized in that: The method comprises: Obtaining a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding a target feature of the target object through a target hash model; Determine the inefficient hash bits in the hash code to be compressed based on the inefficient hash bit index, remove the inefficient hash bits in the hash code to be compressed, and obtain a compressed hash code corresponding to the target object; Among them, the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance meets the preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object, and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
2. The method according to claim 1, characterized in that The inefficient hash bit index is determined in the following manner: Constructing a training target feature matrix according to the target features of each of the n training objects, wherein n is an integer greater than or equal to 1; Through the target hash model, encoding processing is performed on the target features of the n training objects respectively to obtain the training hash codes corresponding to the n training objects respectively; and a training hash feature matrix is constructed according to the training hash codes corresponding to the n training objects respectively; According to the training target feature matrix and the training hash feature matrix, the importance corresponding to each hash bit in the training hash code is determined; and the index value of the hash bit whose corresponding importance meets the preset non-important condition is used as the inefficient hash bit index.
3. The method according to claim 2, characterized in that The step of determining the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix includes: Based on the hash bit importance measurement algorithm, determining the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix; Among them, the hash bit importance measurement algorithm is determined with the goal of minimizing the objective function; the objective function is used to characterize the gap between the similarity of the n training objects in the target feature space and the reference similarity of the n training objects in the hash feature space, and the reference similarity of the n training objects in the hash feature space is obtained by processing the similarity between the n training hash codes based on the importance matrix, and the importance matrix includes the importance corresponding to each hash bit in the training hash code.
4. The method according to claim 3, characterized in that The hash bit importance measurement algorithm is based on the training target feature matrix and the training hash feature matrix to determine the importance corresponding to each hash bit in the training hash code, including: Calculate a first reference matrix according to the training hash feature matrix and the transposed matrix corresponding to the training hash feature matrix; calculate the Hadamard product of the first reference matrix and itself to obtain a second reference matrix; Normalizing the elements in the training target feature matrix to obtain a normalized training target feature matrix; calculating a third reference matrix according to a transposed matrix corresponding to the normalized training target feature matrix and the training hash feature matrix; calculating the Hadamard product of the third reference matrix and itself to obtain a fourth reference matrix; The importance matrix is calculated according to the second reference matrix and the fourth reference matrix; the values of the diagonal elements in the importance matrix are the importance corresponding to the hash bits in the training hash code.
5. The method according to any one of claims 2 to 4, characterized in that: The step of using the index value of the hash bit whose corresponding importance satisfies the preset non-important condition as the inefficient hash bit index includes: The importances corresponding to the respective hash bits in the training hash code are sorted in ascending order, and the index values of the hash bits corresponding to the top a importances are determined as the inefficient hash bit indexes; wherein a is an integer greater than or equal to 1; Removing the hash bits corresponding to the inefficient hash bit indexes in the n training hash codes respectively to obtain n updated training hash codes; constructing an updated training hash feature matrix according to the n updated training hash codes; Determine the importance of each hash bit in the updated training hash code according to the training target feature matrix and the updated training hash feature matrix; sort the importance of each hash bit in the updated training hash code in ascending order, and determine the index value of the hash bit corresponding to the top a importances as the inefficient hash bit index; The above process is repeated until the number of the determined inefficient hash bit indexes reaches a preset number.
6. The method according to claim 1, characterized in that The step of obtaining the to-be-compressed hash code corresponding to the target object includes: Through m1 types of target hash models, target features of the target object are respectively encoded to obtain hash codes corresponding to the m1 types of target hash models; m1 is an integer greater than 1; The hash codes corresponding to the target hash models of m1 types are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
7. The method according to claim 1, characterized in that The step of obtaining the to-be-compressed hash code corresponding to the target object includes: Through m2 versions of the target hash model, the target features of the target object are respectively encoded to obtain hash codes corresponding to the m2 versions; m2 is an integer greater than 1; the m2 versions of the target hash model are obtained based on different training samples or based on different numbers of iterative training; The hash codes corresponding to the m2 versions are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
8. The method according to claim 1, characterized in that The step of obtaining the to-be-compressed hash code corresponding to the target object includes: Through m3 kinds of feature extraction models, feature extraction processing is performed on the target object respectively to obtain m3 kinds of target features of the target object; m3 is an integer greater than 1; Through the target hash model, the m3 target features are respectively encoded to obtain hash codes corresponding to the m3 target features; The hash codes corresponding to the m3 target features are concatenated to obtain the hash code to be compressed corresponding to the target object.
9. The method according to claim 1, characterized in that: The step of obtaining the to-be-compressed hash code corresponding to the target object includes: Acquire m4 types of modal information related to the target object; wherein m4 is an integer greater than 1; Performing feature extraction processing on the m4 types of modal information respectively to obtain target features corresponding to the m4 types of modal information respectively; By using the target hash model, encoding processing is performed on the target features corresponding to the m4 types of modal information respectively to obtain hash codes corresponding to the m4 types of modal information respectively; The hash codes corresponding to the m4 types of modal information are concatenated to obtain the to-be-compressed hash code corresponding to the target object.
10. A hash feature compression device, characterized in that: The device comprises: A hash code acquisition module is used to acquire a to-be-compressed hash code corresponding to a target object; the target object belongs to a target data type, and the to-be-compressed hash code is obtained by encoding a target feature of the target object through a target hash model; A hash code compression module is used to determine the inefficient hash bits in the hash code to be compressed based on an inefficient hash bit index, remove the inefficient hash bits in the hash code to be compressed, and obtain a compressed hash code corresponding to the target object; wherein the inefficient hash bit index is the index value of the hash bit in the target hash code whose importance meets a preset non-important condition, and the target hash code is a hash code obtained by encoding the target features of the object belonging to the target data type through the target hash model; the inefficient hash bit index is determined according to the target features of the training object and the training hash code obtained by encoding the target features of the training object through the target hash model, and the training object belongs to the target data type.
11. The device according to claim 10, characterized in that The device further includes: a hash index determination module; the hash index determination module includes: A first feature determination submodule, used to construct a training target feature matrix according to the target features of each of the n training objects, wherein n is an integer greater than or equal to 1; The second feature determination submodule is used to encode the target features of the n training objects respectively through the target hash model to obtain the training hash codes corresponding to the n training objects respectively; and construct a training hash feature matrix according to the training hash codes corresponding to the n training objects respectively; The inefficient index determination submodule is used to determine the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix; and use the index value of the hash bit whose corresponding importance meets the preset non-important condition as the inefficient hash bit index.
12. The device according to claim 11, characterized in that The inefficient index determination submodule is specifically used for: Based on the hash bit importance measurement algorithm, determining the importance corresponding to each hash bit in the training hash code according to the training target feature matrix and the training hash feature matrix; Among them, the hash bit importance measurement algorithm is determined with the goal of minimizing the objective function; the objective function is used to characterize the gap between the similarity of the n training objects in the target feature space and the reference similarity of the n training objects in the hash feature space, and the reference similarity of the n training objects in the hash feature space is obtained by processing the similarity between the n training hash codes based on the importance matrix, and the importance matrix includes the importance corresponding to each hash bit in the training hash code.
13. A device, characterized in that The device includes a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the hash feature compression method according to any one of claims 1 to 9 according to the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the hash feature compression method according to any one of claims 1 to 9.
15. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or the instruction is executed by a processor, the hash feature compression method according to any one of claims 1 to 9 is implemented.
