Object information processing method and apparatus, device and medium
By calculating the difference in label similarity and hash similarity in the sample set, the hash generation model is trained based on the loss value, which solves the problem of poor hash code generation performance in traditional methods, improves the accuracy of hash code generation and avoids the Waste of hardware resources.
Patent Information
- Application Number
- PCT/CN2023/128317
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-16
- Filing Date
- 2023-10-31
- Publication Date
- 2024-11-21
AI Technical Summary
In the training process of traditional hash generation model, only the current batch sample data is considered, which leads to the model optimization results being easily corrupted, resulting in poor hash code generation performance and low accuracy, which leads to waste of hardware resources.
By obtaining the difference in label similarity and hash similarity in the sample set, the first and second loss values are calculated, and the hash generation model is trained based on these loss values to ensure that the model does not oscillate in batch training, and improves The accuracy of hash code generation.
It effectively avoids data oscillation during model training, improves the accuracy of hash code generation, and reduces the waste of hardware resources used to generate hash codes.
Smart Images

Figure CN2023128317_21112024_PF_FP_ABST
Abstract
Description
Object information processing method, device, equipment and medium
[0001] Related applications
[0002] This application claims priority to Chinese patent application number 2023105534288, filed on May 16, 2023, entitled “Object Information Processing Method, Apparatus, Device and Medium,” the entire text of which is hereby incorporated by reference. Technical Field
[0003] The present application relates to the field of artificial intelligence, and in particular to an object information processing method, apparatus, device, and medium. Background Art
[0004] A hash code is a unique and extremely compact numerical representation of a piece of data. As can be understood, a hash code for an object can be generated based on its characteristics using a hash algorithm. With the advancement of computer technology, generating hash codes for object information has applications in many areas of daily life. Therefore, generating accurate hash codes for object information has broad application value.
[0005] Typically, a trained hash generation model is used to generate hash codes for object information. However, in traditional methods, when training a hash generation model, the loss value guiding model optimization training only considers the sample data in the current batch. As a result, if the model is trained in batches, the optimization results of previous batches are easily destroyed, and data is prone to oscillation during model training, resulting in poor performance of the trained hash generation model, low accuracy in generating hash codes for object information, and further waste of hardware resources used to support generating hash codes for object information.
[0006] Summary of the Invention
[0007] Based on this, it is necessary to provide an object information processing method, device, equipment and medium to address the above technical problems.
[0008] In a first aspect, the present application provides an object information processing method, which is executed by a computer device, and the method includes:
[0009] Acquire a sample set, the sample set including sample object information, the sample object information corresponding to a label;
[0010] Obtaining the label similarity of labels corresponding to any two sample object information in the sample set, and obtaining the hash similarity between hash codes generated by the hash generation model to be trained for the any two sample object information;
[0011] Determining a difference between the label similarity and the hash similarity, and obtaining a first loss value based on the difference;
[0012] For each piece of sample object information in the sample set, determining a first hash similarity between the targeted sample object information and similar sample object information in the sample set, wherein the similar sample object information is sample object information in the sample set that is similar to the targeted sample object information;
[0013] determining a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set, wherein the dissimilar sample object information is sample object information in the sample set that is dissimilar to the targeted sample object information;
[0014] Determining a second loss value according to the first hash similarity and the second hash similarity respectively corresponding to each of the sample object information in the sample set;
[0015] The hash generation model to be trained is trained according to the first loss value and the second loss value to obtain a trained hash generation model, and the trained hash generation model is used to generate a corresponding hash code for the input target object information.
[0016] In a second aspect, the present application provides an object information processing device, the device comprising:
[0017] An acquisition module, configured to acquire a sample set, wherein the sample set includes sample object information, and the sample object information corresponds to a label;
[0018] a determination module, configured to obtain label similarity of labels corresponding to any two sample object information in the sample set, obtain hash similarity between hash codes generated by a hash generation model to be trained for the any two sample object information, determine a difference between the label similarity and the hash similarity, and obtain a first loss value based on the difference; determine, for each sample object information in the sample set, a first hash similarity between the targeted sample object information and similar sample object information in the sample set, where the similar sample object information is sample object information in the sample set that is similar to the targeted sample object information; determine a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set, where the dissimilar sample object information is sample object information in the sample set that is dissimilar to the targeted sample object information; and determine a second loss value based on the first hash similarity and the second hash similarity corresponding to each sample object information in the sample set;
[0019] A training module is used to train the hash generation model to be trained according to the first loss value and the second loss value to obtain a trained hash generation model, and the trained hash generation model is used to generate a corresponding hash code for the input target object information.
[0020] In a third aspect, the present application provides a computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and the processor implements the steps in the method embodiments of the present application when executing the computer-readable instructions.
[0021] In a fourth aspect, the present application provides one or more computer-readable storage media storing computer-readable instructions, which, when executed by one or more processors, implement the steps in the various method embodiments of the present application.
[0022] In a fifth aspect, the present application provides a computer program product comprising computer-readable instructions, which, when executed by one or more processors, implement the steps in the method embodiments of the present application.
[0023] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.
[0025] FIG1 is a diagram illustrating an application environment of an object information processing method according to an embodiment;
[0026] FIG2 is a schematic flow chart of an object information processing method according to an embodiment;
[0027] FIG3 is a schematic diagram of a traditional model training process and a model training process of the present application in one embodiment;
[0028] FIG4 is a flow chart of generating a hash code of target object information in one embodiment;
[0029] FIG5 is a schematic diagram of the model structure of a hash generation model in one embodiment;
[0030] FIG6 is a flow chart of an object information processing method according to another embodiment;
[0031] FIG7 is a structural block diagram of an object information processing device according to an embodiment;
[0032] FIG8 is a structural block diagram of an object information processing device according to another embodiment;
[0033] FIG9 is a diagram showing the internal structure of a computer device according to one embodiment;
[0034] FIG10 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0036] The object information processing method provided in this application can be applied in the application environment shown in Figure 1. Terminal 102 communicates with server 104 via a network. A data storage system can be separately provided to store data that server 104 needs to process. The data storage system can be integrated with server 104 or placed in the cloud or on another server. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices can include smart watches, smart bracelets, head-mounted devices, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides network security services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. Terminal 102 and server 104 can be connected directly or indirectly via wired or wireless communication, which is not limited in this application.
[0037] Server 104 may obtain a sample set, which includes sample object information, each of which has a corresponding label. Server 104 may obtain the label similarity of the labels corresponding to any two sample object information in the sample set, and obtain the hash similarity between the hash codes generated by the hash generation model to be trained for any two sample object information. Server 104 may determine the difference between the label similarity and the hash similarity, and obtain a first loss value based on the difference. For each sample object information in the sample set, server 104 may determine a first hash similarity between the targeted sample object information and similar sample object information in the sample set, where similar sample object information is sample object information in the sample set that is similar to the targeted sample object information. Server 104 may determine a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set, where dissimilar sample object information is sample object information in the sample set that is dissimilar to the targeted sample object information. The server 104 can determine the second loss value based on the first hash similarity and the second hash similarity corresponding to each sample object information in the sample set; train the hash generation model to be trained based on the first loss value and the second loss value to obtain a trained hash generation model, and the trained hash generation model is used to generate a corresponding hash code for the input target object information.
[0038] It is understood that terminal 102 can obtain target object information and send the target object information to server 104. Server 104 can input the target object information into a trained hash generation model to generate a hash code for the target object information using the trained hash generation model. It is also understood that server 104 can also perform information retrieval based on the hash code of the target object information and feed the retrieved information back to terminal 102. This embodiment is not limited to this. It is understood that the application scenario in Figure 1 is only for illustration and is not limited to this.
[0039] It should be noted that the object information processing methods in some embodiments of the present application utilize artificial intelligence technology. For example, the hash code of the sample object information is generated using artificial intelligence technology, that is, it is generated by a trained hash generation model. Furthermore, the corresponding hash code generated by the target object information is also generated using artificial intelligence technology, that is, it is generated by a trained hash generation model. To facilitate understanding of artificial intelligence, the concept of artificial intelligence is now explained. Specifically, artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a manner similar to human intelligence. Artificial intelligence is the study of the design principles and implementation methods of various intelligent machines, giving them the capabilities of perception, reasoning, and decision-making.
[0040] In one embodiment, as shown in FIG2 , a method for processing object information is provided. The method can be applied to a computer device, which can be a terminal or a server. The method can be executed independently by the terminal or server itself, or through interaction between the terminal and the server. This embodiment uses the method applied to a computer device as an example to illustrate the method, including the following steps:
[0041] Step 202: Acquire a sample set, where the sample set includes sample object information, and the sample object information corresponds to a label.
[0042] The sample set includes multiple sample object information, and each sample object information in the sample set corresponds to at least one label. For ease of understanding, let's take an example: if the sample object information is the description text "A little girl and her puppy playing on the grass," then the sample object information corresponds to the three labels "little girl," "puppy," and "grass."
[0043] In one embodiment, the sample object information may be an information group including object information in at least one modality. It is understood that the sample object information may include at least one of sample object image information in image modality, sample object text information in text modality, and sample object audio information in audio modality.
[0044] For example, sample object information may include at least one of image information of the object "a little girl and her puppy playing on the grass" in image mode, text information in text mode, and audio information in audio mode. It is understood that the object "a little girl and her puppy playing on the grass" can be described using at least one of image, text, and audio.
[0045] Step 204: obtain the label similarity of the labels corresponding to any two sample object information in the sample set, and obtain the hash similarity between the hash codes generated by the hash generation model to be trained for any two sample object information, determine the difference between the label similarity and the hash similarity, and obtain a first loss value.
[0046] Among them, label similarity is used to represent the similarity between the labels corresponding to any two sample object information in the sample set. Hash similarity is used to represent the similarity between the hash codes corresponding to any two sample object information in the sample set.
[0047] In one embodiment, the computer device may determine the label similarity between the labels corresponding to any two pieces of sample object information in the sample set based on the labels corresponding to the two pieces of sample object information. For each round of training, the computer device may generate hash codes for any two pieces of sample object information in the sample set using the hash generation model to be trained in that round, and determine the hash similarity between the two pieces of sample object information based on the hash codes corresponding to the two pieces of sample object information. Furthermore, the computer device may determine the difference between the label similarity and the hash similarity corresponding to the two pieces of sample object information to obtain a first loss value.
[0048] Step 206 : For each sample object information in the sample set, determine a first hash similarity between the targeted sample object information and similar sample object information in the sample set. Similar sample object information is sample object information in the sample set that is similar to the targeted sample object information.
[0049] The first hash similarity is the similarity between the hash code of the sample object information and the hash code of similar sample object information.
[0050] In one embodiment, for each piece of sample object information in a sample set, the computer device may obtain a hash code for the sample object information and the hash codes for sample object information in the sample set that is similar to the sample object information. Furthermore, the computer device may determine the similarity between the hash code for the sample object information and the hash codes for similar sample object information in the sample set to obtain a first hash similarity.
[0051] In one embodiment, for each piece of sample object information in a sample set, the computer device may extract features of the sample object information, as well as features of sample object information in the sample set that is similar to the sample object information. Furthermore, the computer device may hash the features of the sample object information to obtain a hash code for the sample object information, and hash the features of the similar sample object information to obtain hash codes for the sample object information in the sample set that is similar to the sample object information.
[0052] In one embodiment, the computer device may hash-code each feature field in the features of the targeted sample object information to obtain hash bits corresponding to each feature field in the features of the targeted sample object information, and concatenate the hash bits corresponding to each feature field in the features of the targeted sample object information to obtain a hash code for the targeted sample object information. Furthermore, the computer device may hash-code each feature field in the features of similar sample object information to obtain hash bits corresponding to each feature field in the features of the similar sample object information, and concatenate the hash bits corresponding to each feature field in the features of the similar sample object information to obtain a hash code for sample object information in the sample set that is similar to the targeted sample object information.
[0053] In one embodiment, for each piece of sample object information in the sample set, the computer device may determine the Hamming distance between the hash code of the sample object information and the hash code of similar sample object information in the sample set, and determine a first hash similarity based on the determined Hamming distance. It will be appreciated that the determined Hamming distance is negatively correlated with the sample hash similarity. The first sample hash similarity is the similarity between the hash code of the sample object information and the hash code of similar sample object information in the sample set.
[0054] Step 208 : Determine a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set, where dissimilar sample object information is sample object information in the sample set that is dissimilar to the targeted sample object information.
[0055] The second hash similarity is the similarity between the hash code of the sample object information and the hash code of the dissimilar sample object information.
[0056] In one embodiment, for each piece of sample object information in the sample set, the computer device may obtain a hash code for the sample object information and the hash codes for sample object information in the sample set that is dissimilar to the sample object information. Furthermore, the computer device may determine a similarity between the hash code for the sample object information and the hash codes for the dissimilar sample object information in the sample set to obtain a second hash similarity.
[0057] In one embodiment, for each piece of sample object information in a sample set, the computer device may extract features of the targeted sample object information and features of sample object information in the sample set that is dissimilar to the targeted sample object information. Furthermore, the computer device may hash-code the features of the targeted sample object information to obtain a hash code for the targeted sample object information, and hash-code the features of the dissimilar sample object information to obtain a hash code for the sample object information in the sample set that is dissimilar to the targeted sample object information.
[0058] In one embodiment, the computer device may perform hash coding on each feature field in the features of the targeted sample object information to obtain hash bits corresponding to each feature field in the features of the targeted sample object information, and concatenate the hash bits corresponding to each feature field in the features of the targeted sample object information to obtain a hash code for the targeted sample object information. Furthermore, the computer device may perform hash coding on each feature field in the features of dissimilar sample object information to obtain hash bits corresponding to each feature field in the features of the dissimilar sample object information, and concatenate the hash bits corresponding to each feature field in the features of the dissimilar sample object information to obtain a hash code for sample object information in the sample set that is dissimilar to the targeted sample object information.
[0059] In one embodiment, for each piece of sample object information in the sample set, the computer device may determine a Hamming distance between a hash code of the sample object information and a hash code of a dissimilar sample object information in the sample set, and determine a second hash similarity based on the determined Hamming distance. It will be appreciated that the determined Hamming distance is negatively correlated with the second sample hash similarity. The second sample hash similarity is the similarity between the hash code of the sample object information and the hash code of the dissimilar sample object information in the sample set.
[0060] Step 210 : Determine a second loss value according to the first hash similarity and the second hash similarity corresponding to each sample object information in the sample set.
[0061] In one embodiment, for each sample object information in the sample set, the computer device may determine a global hash similarity based on the first hash similarity and the second hash similarity corresponding to the sample object information. Furthermore, the computer device may determine a second loss value based on the first hash similarity and the global hash similarity. The global hash similarity is the hash similarity corresponding to each sample object information in the entire sample set. It is understood that the global hash similarity may include both the first hash similarity and the second hash similarity.
[0062] In one embodiment, the computer device may determine the second loss value according to the proportion of the first hash similarity in the global hash similarity.
[0063] In step 212 , the hash generation model to be trained is trained according to the first loss value and the second loss value to obtain a trained hash generation model. The trained hash generation model is used to generate a corresponding hash code for the input target object information.
[0064] Among them, the target object information is the object information obtained by the hash generation model to be trained after the training is completed and the trained hash generation model is obtained, that is, the object information obtained in the application stage and input into the trained hash generation model.
[0065] In one embodiment, the target object information is an information group including object information in at least one modality. It is understood that the target object information may include at least one of object information selected from the group consisting of object image information in image modality, object text information in text modality, and object audio information in audio modality.
[0066] Specifically, the computer device may iteratively train the hash generation model to be trained based on the first loss value and the second loss value until an iteration stopping condition is satisfied, thereby obtaining a trained hash generation model. During the model application phase, the computer device may obtain target object information and input the target object information into the trained hash generation model to predict a hash code for the target object information using the trained hash generation model.
[0067] In one embodiment, the hash generation model to be trained is trained according to the first loss value and the second loss value to obtain a trained hash generation model, including: weighting the first loss value and the second loss value to obtain a target loss value; training the hash generation model to be trained in a direction to reduce the target loss value to obtain a trained hash generation model.
[0068] Specifically, the computer device may weight the first loss value and the second loss value to obtain a target loss value. Furthermore, the computer device may iteratively train the hash generation model to be trained based on the target loss value to obtain a trained hash generation model. It can be understood that both the first loss value and the second loss value are taken into account during the acquisition of the target loss value. In this embodiment, by training the hash generation model with the target loss value obtained by weighting the first loss value and the second loss value, the trained hash generation model can be further enabled to generate accurate hash codes, thereby improving the accuracy of hash code generation and avoiding the waste of hardware resources used to support the generation of object information hash codes.
[0069] In the object information processing method described above, a sample set is obtained, the sample set including sample object information, each of which has a corresponding label. The label similarity between the labels corresponding to any two sample object information in the sample set is obtained, and the hash similarity between the hash codes generated by the hash generation model to be trained for the two sample object information is obtained. The difference between the label similarity and the hash similarity is determined to obtain a first loss value. For each sample object information in the sample set, a first hash similarity is determined between the sample object information and similar sample object information in the sample set; a second hash similarity is determined between the sample object information and dissimilar sample object information in the sample set; and a second loss value is determined based on the first and second hash similarities corresponding to each sample object information in the sample set. The hash generation model to be trained is trained based on the first and second loss values to obtain a trained hash generation model. Since the first loss value during model training takes into account the label similarity and hash similarity of the sample object information, and the second loss value corresponding to each targeted sample object information takes into account both the correlation between the targeted sample object information and similar sample object information in the entire sample set, and the repulsion between the targeted sample object information and dissimilar sample object information in the entire sample set, even if training is performed in batches, the sample object information will not be unreasonably close or distant, thus avoiding data oscillation during model training. Therefore, the hash generation model obtained through training with the first loss value and the second loss value can generate accurate hash codes for the target object information, thereby improving the accuracy of hash code generation and avoiding the waste of hardware resources used to support the generation of hash codes for object information.
[0070] It can be understood that the model training method of the present application can train the hash generation model to be trained in batches or not.
[0071] To further illustrate the beneficial effects of the present application, an example is given, as shown in Figure 3, x, y and z are respectively sample object information in the sample set, wherein x is similar to y (i.e., contains the same label), z is similar to y (i.e., contains the same label), and x is not similar to z (i.e., does not contain the same label). In the three batches during the model training process, the first batch contains sample object information y and x, the second batch contains sample object information y and z, and the third batch contains sample object information x and z. In the traditional model training process, the loss value guiding the model optimization training only considers the sample data in the current batch. In this way, when the model is trained in batches, the optimization results of the previous batch are easily destroyed, and the data is prone to oscillation during the model training process. For example, the optimization results of the first batch are that x is close to y, the optimization results of the second batch are that z is close to y, and the optimization results of the third batch are that x is far away from z. However, it also makes x far away from y, and z far away from y, that is, the model optimization process of the third batch destroys the optimization results of the first and second batch model training, resulting in poor performance of the hash generation model obtained by training, which leads to low accuracy of hash code generation of object information.
[0072] Continuing to refer to Figure 3, since the first loss value in the model training process simultaneously considers the label similarity and hash similarity of the sample object information, and the second loss value considers both the correlation between the targeted sample object information and the similar sample object information in the entire sample set, and the repulsion between the targeted sample object information and the dissimilar sample object information in the entire sample set, the sample object information will not be unreasonably close or distant during the model training process, thus avoiding data oscillation during the model training process. For example, for the third batch of model training, the model training method of the present application will not only consider the distance between x and z, but also keep the optimization results x and y of the first batch close, and keep the optimization results z and y of the second batch close. Therefore, the hash generation model obtained by training with the first loss value and the second loss value can generate accurate hash codes for the target object information, thereby improving the accuracy of hash code generation.
[0073] In one embodiment, a second loss value is determined based on the first hash similarity and the second hash similarity corresponding to each sample object information in the sample set, including: determining a global hash similarity for each targeted sample object information in the sample set based on the first hash similarity and the second hash similarity corresponding to the targeted sample object information; determining a similarity ratio parameter corresponding to the targeted sample object information based on a ratio of the first hash similarity to the global hash similarity; and determining the second loss value based on the similarity ratio parameter corresponding to each sample object information in the sample set.
[0074] The similarity ratio parameter is used to characterize the ratio of the first hash similarity to the global hash similarity.
[0075] In one embodiment, for each piece of sample object information in the sample set, the computer device may add the first hash similarity and the second hash similarity corresponding to the sample object information to obtain a global hash similarity, and directly use the ratio of the first hash similarity to the global hash similarity as the similarity ratio parameter corresponding to the sample object information. Furthermore, the computer device may determine a second loss value based on the similarity ratio parameters corresponding to each piece of sample object information in the sample set.
[0076] In one embodiment, the computer device may determine the difference between the label similarity and the hash similarity corresponding to any two sample object information to obtain a first loss value. For each sample object information in the sample set, the computer device may determine a first hash similarity between the sample object information and similar sample object information in the sample set, and determine a second hash similarity between the sample object information and dissimilar sample object information in the sample set. For each sample object information in the sample set, the computer device may determine a global hash similarity based on the first hash similarity and the second hash similarity corresponding to the sample object information, determine a similarity ratio parameter corresponding to the sample object information based on the ratio of the first hash similarity to the global hash similarity, and determine a second loss value based on the similarity ratio parameter corresponding to each sample object information in the sample set. Furthermore, the computer device may weight the first loss value and the second loss value to obtain a target loss value. Furthermore, the computer device may perform training iterations on the hash generation model to be trained based on the target loss value to obtain a trained hash generation model.
[0077] In one embodiment, the target loss value can be calculated using the following formula:
[0078] Among them, s ij Indicates the label l corresponding to the sample object information i i The label l corresponding to the sample object information j j similarity. Indicates that sample object information i and sample object information j have at least one identical label. Indicates that sample object information i and sample object information j do not have the same corresponding label. k indicates the number of feature fields contained in the object information feature of the sample object information. b i and b j denote the hash codes of sample object information i and sample object information j respectively. cos(b i ,b j) represents the hash similarity between sample object information i and sample object information j. Represents the first loss value. m = |φ| represents the number of sample object information in each training batch selected from the sample set. i Ω represents the set of sample object information in the sample set that is similar to the sample object information (i.e., sample object information i). i It represents the set of sample object information in the sample set that is dissimilar to the targeted sample object information (ie, sample object information i). represents the first hash similarity, Indicates the second hash similarity. represents the second loss value. α represents a predefined weighting coefficient. Represents the target loss value.
[0079] In the above embodiment, the similarity ratio parameter corresponding to the sample object information is determined by the ratio of the first hash similarity to the global hash similarity. Because the similarity ratio parameter can represent the proportion of the first hash similarity in the global hash similarity, determining the second loss value based on the similarity ratio parameter corresponding to each sample object information in the sample set can improve the accuracy of the second loss value, thereby further improving the accuracy of the hash code generation of the target object information during the model application process, and further avoiding the waste of hardware resources used to support the generation of the object information hash code.
[0080] In one embodiment, the method further includes: for each sample object information in the sample set, treating the sample object information in the sample set that has at least one identical label with the targeted sample object information as sample object information similar to the targeted sample object information; and treating the sample object information in the sample set that does not have the same label with the targeted sample object information as sample object information that is dissimilar to the targeted sample object information.
[0081] For ease of understanding, let's take an example. For example, the sample object information being targeted is the descriptive text "A little girl and her puppy playing on the grass." This sample object information corresponds to the three tags "little girl," "puppy," and "grass." Sample object information 1 is the descriptive text "A little girl and a little boy playing on the grass." This sample object information 1 corresponds to the three tags "little girl," "little boy," and "grass." Sample object information 2 is the descriptive text "A little duck swimming in a pond." This sample object information 2 corresponds to the two tags "little duck" and "pond." It can be understood that because both the sample object information being targeted and sample object information 1 correspond to the two tags "little girl" and "grass," it can be determined that sample object information 1 is similar to the sample object information being targeted. Because the sample object information being targeted and sample object information 2 do not correspond to the same tags, it can be determined that sample object information 2 is dissimilar to the sample object information being targeted.
[0082] In the above embodiment, since the labels corresponding to the sample object information can be used to characterize the type of the sample object information, the greater the number of identical labels corresponding to any two sample object information, the more similar the two sample object information are. Therefore, by treating sample object information in the sample set that shares at least one identical label with the targeted sample object information as sample object information similar to the targeted sample object information, the accuracy of determining similar sample object information can be improved. By treating sample object information in the sample set that does not share the same label as the sample object information as sample object information dissimilar to the targeted sample object information, the accuracy of determining dissimilar sample object information can be improved, thereby further avoiding the waste of hardware resources used to support the generation of object information hash codes.
[0083] In one embodiment, determining a first hash similarity between the targeted sample object information and similar sample object information in a sample set includes: obtaining a first hash code generated by a hash generation model to be trained for the targeted sample object information; obtaining a second hash code generated by the hash generation model to be trained for sample object information in the sample set that is similar to the targeted sample object information; and obtaining a first hash similarity based on the similarity between the first hash code and the second hash code; determining a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set includes: obtaining a third hash code generated by the hash generation model to be trained for sample object information in the sample set that is dissimilar to the targeted sample object information; and obtaining a second hash similarity based on the similarity between the first hash code and the third hash code.
[0084] Specifically, the computer device may input the targeted sample object information into a hash generation model to be trained, so as to generate a hash code for the targeted sample object information using the hash generation model to be trained, thereby obtaining a first hash code. The computer device may input sample object information in the sample set that is similar to the sample object information into the hash generation model to be trained, so as to generate a hash code for the sample object information in the sample set that is similar to the targeted sample object information using the hash generation model to be trained, thereby obtaining a second hash code. The computer device may input sample object information in the sample set that is dissimilar to the targeted sample object information into the hash generation model to be trained, so as to generate a hash code for the sample object information in the sample set that is dissimilar to the targeted sample object information using the hash generation model to be trained, thereby obtaining a third hash code. Furthermore, the computer device may obtain a first hash similarity based on the similarity between the first hash code and the second hash code, and obtain a second hash similarity based on the similarity between the first hash code and the third hash code.
[0085] In the above embodiment, during the model training process, the first hash similarity is obtained by measuring the similarity between the first hash code and the second hash code, thereby improving the accuracy of the first hash similarity. The second hash similarity is obtained by measuring the similarity between the first hash code and the third hash code, thereby improving the accuracy of the second hash similarity, thereby further avoiding the waste of hardware resources used to support the generation of object information hash codes.
[0086] In one embodiment, as shown in FIG4 , the method further includes:
[0087] In step 402 , the target object information is input into the trained hash generation model to extract object information features of the target object information through the trained hash generation model.
[0088] Step 404 : Hash-code each feature field in the object information feature to obtain a hash bit corresponding to each feature field.
[0089] Step 406: Concatenate the hash bits corresponding to the characteristic fields to obtain a hash code of the target object information.
[0090] The feature field is a field used to describe the characteristics of the object information. The hash bit is a component of the hash code. It can be understood that the hash code includes multiple hash bits.
[0091] In one embodiment, a computer device may input target object information into a trained hash generation model to perform convolution processing on the input target object information using the trained hash generation model to extract object information features of the target object information. The object information features include at least one feature field. The computer device may hash-encode each feature field in the object information features using a bitwise hash function to obtain hash bits corresponding to each feature field in the object information features. Furthermore, the computer device may concatenate the hash bits corresponding to each feature field in the object information features according to the order in which the feature fields are arranged in the object information features to obtain a hash code for the target object information.
[0092] In one embodiment, the hash code of the target object information can be determined by the following formula:
[0093] Among them, k represents the object information feature g of the target object information i i Included feature fields The number of Indicates the number of bits used to generate the jth hash A bitwise hash function. Indicates the hash code of the target object information obtained after cascading.
[0094] In the above embodiment, by extracting the object information features of the target object information and performing field-level, fine-grained hash coding on each feature field in the object information features, hash bits corresponding to each feature field are obtained. The hash bits corresponding to each feature field are then concatenated to obtain a hash code for the target object information. This improves the accuracy of hash code generation for the target object information and further avoids wasting hardware resources used to support hash code generation for the object information.
[0095] In one embodiment, the target object information is an information group including object information under at least two modalities; the number of target object information is at least one, and the target object information is input into a trained hash generation model to extract the object information features of the target object information through the trained hash generation model, including: inputting the object information under each modality in the target object information into the trained hash generation model to extract the information sub-features of the object information under each modality through the trained hash generation model; fusing the information sub-features corresponding to the object information under each modality in the same target object information to obtain the object information features of the target object information.
[0096] Among them, the information sub-feature is the feature of the object information under a single modality.
[0097] In one embodiment, the computer device may input the object information in each modality of the target object information into a trained hash generation model to extract information sub-features of the object information in each modality through the trained hash generation model. The computer device may then perform feature concatenation on the information sub-features corresponding to the object information in each modality of the same target object information to obtain object information features of the target object information.
[0098] In one embodiment, the computer device can map the information sub-features of the object information under each modality to the same feature space respectively, so as to fuse the mapped features corresponding to the object information under each modality in the same target object information in the same feature space to obtain the object information features of the target object information.
[0099] In one embodiment, the target object information may include at least two types of object information: object image information of the object in image mode, object text information of the object in text mode, and object audio information of the object in audio mode.
[0100] In the above embodiment, when the target object information is an information group including object information under at least two modalities, the object information features of the target object information are obtained by respectively extracting the information sub-features of the object information under each modality and fusing the information sub-features corresponding to the object information under each modality in the same target object information. This allows the object information features of the target object information to simultaneously include the information sub-features of the object information under each modality, thereby improving the accuracy of the object information features of the target object information and further avoiding the waste of hardware resources used to support the generation of object information hash codes.
[0101] In one embodiment, the target object information includes object image information in an image modality and object text information in a text modality; the information sub-features include object image features extracted from the object image information and object text features extracted from the object text information; the information sub-features corresponding to the object information in each modality in the same target object information are fused to obtain the object information features of the target object information, including: fusing the object image features and object text features corresponding to the same target object information to obtain the object information features of the target object information.
[0102] Specifically, the target object information includes object image information in image mode and object text information in text mode. The computer device may input the object image information and object text information in the target object information into a trained hash generation model to extract object image features of the object image information and object text features of the object text information, respectively, using the trained hash generation model. Furthermore, the computer device may fuse the object image features and object text features corresponding to the same target object information to obtain object information features of the target object information.
[0103] In the above embodiment, when the target object information includes object image information in image mode and object text information in text mode, the object information features of the target object information are obtained by fusing the object image features and object text features corresponding to the same target object information, so that the object information features of the target object information can simultaneously include the object image features of the object image information and the object text features of the object text information, thereby improving the accuracy of the object information features of the target object information, and further avoiding the waste of hardware resources used to support the generation of object information hash codes.
[0104] In one embodiment, the object image features and object text features corresponding to the same target object information are fused to obtain the object information features of the target object information, including: mapping the object image features corresponding to the target object information to the target feature space to obtain image mapping features; mapping the object text features corresponding to the target object information to the target feature space to obtain text mapping features; the image mapping features and the text mapping features have the same feature dimension in the target feature space; and fusing the image mapping features and the text mapping features corresponding to the same target object information to obtain the object information features of the target object information.
[0105] The image mapping feature is the feature of the target object information in the target feature space. The text mapping feature is the feature of the target object information in the target feature space. The image mapping feature and the text mapping feature have the same feature dimension in the target feature space. This means that the feature vector of the image mapping feature and the feature vector of the text mapping feature have the same feature vector dimension in the target feature space.
[0106] In one embodiment, for each target object information, the computer device may map the object image features corresponding to the target object information to the target feature space to obtain image mapping features, and map the object text features corresponding to the target object information to the target feature space to obtain text mapping features. It will be understood that the image mapping features and the text mapping features have the same feature dimension in the target feature space. Furthermore, the computer device may fuse the image mapping features and text mapping features corresponding to the same target object information to obtain the object information features of the target object information.
[0107] In the above embodiment, since the image mapping features and the text mapping features have the same feature dimension in the target feature space, the image mapping features and the text mapping features corresponding to the same target object information can be quickly fused to obtain the object information features of the target object information, thereby improving the efficiency of obtaining the object information features of the target object information, and further avoiding the waste of hardware resources used to support the generation of object information hash codes.
[0108] In one embodiment, the trained hash generation model includes a feature processing network and a hash generation network; inputting the target object information into the trained hash generation model to extract the object information features of the target object information through the trained hash generation model, including: inputting the target object information into the feature processing network to extract the object information features of the target object information through the feature processing network; hash encoding each feature field in the object information features to obtain hash bits corresponding to each feature field, including: inputting the object information features into the hash generation network to hash encoding each feature field in the object information features through the hash generation network to obtain hash bits corresponding to each feature field.
[0109] In one embodiment, referring to FIG5 , a trained hash generation model includes a feature processing network and a hash generation network. During the model application phase, a computer device may input target object information into the feature processing network to extract object information features of the target object information through the feature processing network. Furthermore, the computer device may input the object information features into the hash generation network to hash each feature field in the object information features through the hash layer of the hash generation network to obtain hash bits corresponding to each feature field. The hash bits corresponding to each feature field are then concatenated to obtain a hash code for the target object information.
[0110] Continuing to refer to FIG5 , it can be understood that during the model training phase, the computer device can determine the difference between the label similarity and the hash similarity corresponding to any two sample object information to obtain a first loss value. The hash similarity is the similarity between the hash codes generated by the hash generation model to be trained for any two sample object information. For each targeted sample object information in the sample set, the first hash similarity between the targeted sample object information and similar sample object information in the sample set is determined, and the second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set is determined. The second loss value is determined based on the first hash similarity and the second hash similarity corresponding to each targeted sample object information in the sample set, and the hash generation model to be trained is trained based on the first loss value and the second loss value to obtain a trained hash generation model. It can be understood that during the model training phase, the hash code of the sample object information is continuously updated.
[0111] In one embodiment, a feature processing network includes an image feature extraction unit, a text feature extraction unit and a feature fusion unit, and the target object information includes object image information in image mode and object text information in text mode; the target object information is input into the feature processing network to extract object information features of the target object information through the feature processing network, including: inputting the object image information into the image feature extraction unit to extract object image features of the object image information through the image feature extraction unit; inputting the object text information into the text feature extraction unit to extract object text features of the object text information through the text feature extraction unit; inputting the object image features and the object text features into the feature fusion unit to fuse the object image features and the object text features through the feature fusion unit to obtain object information features of the target object information.
[0112] In one embodiment, the target object information includes object image information in image modality and object text information in text modality. Continuing with FIG5 , the feature processing network includes an image feature extraction unit, a text feature extraction unit, and a feature fusion unit. The computer device may input the object image information in the target object information into the image feature extraction unit, which extracts object image features of the object image information. Furthermore, the computer device may input the object text information in the target object information into the text feature extraction unit, which extracts object text features of the object text information. Furthermore, the computer device may input the object image features and object text features corresponding to the same target object information into the feature fusion unit, which fuses the object image features and object text features corresponding to the same target object information to obtain object information features of the target object information. This embodiment extracts object image features of the object image information through the image feature extraction unit, extracts object text features of the object text information through the text feature extraction unit, and fuses the object image features and object text features through the feature fusion unit to obtain object information features of the target object information. This further improves the accuracy of hash code generation, thereby further avoiding the waste of hardware resources used to support hash code generation for object information.
[0113] In one embodiment, the feature processing network also includes an image feature mapping unit and a text feature mapping unit, and the object image feature and the object text feature are input into the feature fusion unit, so as to fuse the object image feature and the object text feature through the feature fusion unit to obtain the object information feature of the target object information, including: inputting the object image feature into the image feature mapping unit, so as to map the object image feature to the target feature space through the image feature mapping unit to obtain the image mapping feature; inputting the object text feature into the text feature mapping unit, so as to map the object text feature to the target feature space through the text feature mapping unit to obtain the text mapping feature, and the image mapping feature and the text mapping feature have the same feature dimension in the target feature space; inputting the image mapping feature and the text mapping feature into the feature fusion unit, so as to fuse the image mapping feature and the text mapping feature through the feature fusion unit to obtain the object information feature of the target object information.
[0114] In one embodiment, with continued reference to FIG5 , the feature processing network further includes an image feature mapping unit and a text feature mapping unit. For each target object information, the computer device may input the object image feature corresponding to the target object information into the image feature mapping unit, so that the image feature of the object is mapped to the target feature space by the image feature mapping unit to obtain an image mapping feature. Furthermore, the computer device may input the object text feature corresponding to the target object information into the text feature mapping unit, so that the text feature of the object is mapped to the target feature space by the text feature mapping unit to obtain a text mapping feature. It is understood that the image mapping feature and the text mapping feature have the same feature dimension in the target feature space. Furthermore, the computer device may input the image mapping feature and the text mapping feature corresponding to the same target object information into the feature fusion unit, so that the image mapping feature and the text mapping feature corresponding to the same target object information are fused by the feature fusion unit to obtain the object information feature of the target object information. This embodiment maps the object image features to the target feature space through the image feature mapping unit to obtain image mapping features, maps the object text features to the target feature space through the text feature mapping unit to obtain text mapping features, and fuses the image mapping features and the text mapping features through the feature fusion unit to obtain object information features of the target object information, thereby further improving the accuracy of hash code generation, thereby further avoiding the waste of hardware resources used to support the generation of object information hash codes.
[0115] In one embodiment, the target object information includes object image information in image mode and object text information in text mode, which is expressed as in, Indicates target object information o i The object image information in Indicates target object information o i The object text information in .
[0116] In one embodiment, the computer device may map the object image feature corresponding to the target object information to the target feature space through the image feature mapping unit to obtain the image mapping feature, which is expressed as Among them, MLP v represents the image feature mapping unit, Θ v Represents the unit parameters of the image feature map unit. Represents object image features. Represents an image map feature.
[0117] In one embodiment, the computer device may map the object text feature corresponding to the target object information to the target feature space through the text feature mapping unit to obtain the text mapping feature, which is expressed as Among them, MLPt represents the text feature mapping unit, Θ t Represents the unit parameters of the text feature map unit. Represents an object text feature. Represents a text mapping feature.
[0118] In one embodiment, the computer device may map the image corresponding to the same target object information i to the feature map and text mapping features Input to the feature fusion unit to map the image features corresponding to the same target object information through the feature fusion unit and text mapping features Splicing is performed to obtain the object information features of the target object information, which is expressed as Among them, g i Object information features representing target object information.
[0119] In the above embodiment, the accuracy of the target object information's object information features can be improved by inputting the target object information into a feature processing network to extract the target object information's object information features. Furthermore, the accuracy of the hash bits corresponding to each feature field can be improved by inputting the object information features into a hash generation network to hash-code each feature field in the object information features, thereby further avoiding waste of hardware resources used to support the generation of object information hash codes.
[0120] In one embodiment, the method further includes: inputting the target object information into a trained hash generation model to generate a hash code of the target object information through the trained hash generation model; and determining object information that matches the target object information from the object information stored in the information retrieval library based on the similarity between the hash code of the target object information and the hash code of the object information stored in a pre-built information retrieval library.
[0121] Specifically, the object information in the information retrieval library is stored in association with the corresponding hash code. It is understood that the hash code can serve as an index for information retrieval. It is understood that in an information retrieval scenario, a computer device can input the target object information into a trained hash generation model to generate a hash code for the target object information using the trained hash generation model. Furthermore, based on the similarity between the hash code of the target object information and the hash code of the object information stored in the pre-built information retrieval library, the computer device can search for object information that matches the target object information from the object information stored in the information retrieval library. For example, the object information found can be object information that has a high degree of similarity to the target object information.
[0122] In one embodiment, the hash code of the object information stored in the information retrieval library is generated in advance using a trained hash generation model.
[0123] In one embodiment, the computer device may extract features of the hash code of the target object information and features of the hash code of the object information stored in the information retrieval library. Furthermore, based on the similarity between the features of the hash code of the target object information and the features of the hash code of the stored object information, the computer device may search for object information that matches the target object information from the object information stored in the information retrieval library. The stored object information is the object information stored in the information retrieval library.
[0124] In the above embodiment, the target object information is input into a trained hash generation model to generate a hash code for the target object information using the trained hash generation model, thereby improving the accuracy of the hash code for the target object information. Furthermore, by directly determining the similarity between the hash code for the target object information and the hash codes for the object information stored in the pre-built information retrieval library, object information matching the target object information is determined from the object information stored in the information retrieval library. This improves information retrieval accuracy while maintaining rapid retrieval, thereby avoiding waste of hardware resources used to support information retrieval.
[0125] In one embodiment, object information matching the target object information is determined from the object information stored in the information retrieval library based on the similarity between the hash code of the target object information and the hash code of the object information stored in the pre-built information retrieval library, including: determining the Hamming distance between the hash code of the target object information and the hash code of the object information stored in the information retrieval library; the Hamming distance is negatively correlated with the target hash similarity; the target hash similarity is the similarity between the hash code of the target object information and the hash code of the object information stored in the information retrieval library; and determining the object information matching the target object information from the object information stored in the information retrieval library based on the Hamming distance.
[0126] The Hamming distance is used to represent the number of different characters in the corresponding hash positions of two hash codes. The Hamming distance between two hash codes is negatively correlated with the hash similarity between the two hash codes.
[0127] In one embodiment, the computer device may determine a Hamming distance between a hash code of the target object information and a hash code of object information stored in the information retrieval library. Based on the determined Hamming distance, the computer device may determine object information from the object information stored in the information retrieval library whose Hamming distance is less than a preset Hamming distance, thereby obtaining object information that matches the target object information. It is understood that the determined object information may be object information that has a high degree of similarity to the target object information.
[0128] In one embodiment, the Hamming distance between two hash codes may be calculated using the following formula:
[0129] Among them, b i and b j Respectively represent the hash codes of object information i and object information j, k represents the number of feature fields contained in the object information feature of the object information. It can be understood that the number of feature fields contained in the object information feature of object information i is consistent with the number of feature fields contained in the object information feature of object information j. H (b i ,b j ) represents the Hamming distance between the hash codes of object information i and object information j.
[0130] In the above embodiment, since the Hamming distance between two hash codes is negatively correlated with their corresponding hash similarities, by determining the object information matching the target object information from the object information stored in the information retrieval library through the Hamming distance between the hash code of the target object information and the hash code of the object information stored in the information retrieval library, the information retrieval efficiency can be improved, and the waste of hardware resources used to support information retrieval can be further avoided.
[0131] In one embodiment, the hash code of the object information stored in the information retrieval library is represented in binary form; the method further includes: binarizing the hash code of the target object information to obtain a binary hash code representing the target object information in binary form; determining object information matching the target object information from the object information stored in the information retrieval library based on the similarity between the hash code of the target object information and the hash code of the object information stored in the pre-built information retrieval library, including: determining object information matching the target object information from the object information stored in the information retrieval library based on the similarity between the binary hash code and the hash code of the object information stored in the information retrieval library.
[0132] Specifically, the computer device may input the target object information into a trained hash generation model to generate a hash code for the target object information using the trained hash generation model. Furthermore, the computer device may binarize the hash code for the target object information to obtain a binary hash code for the target object information represented in binary form, where the binary hash code is a hash code represented in binary form. The computer device may determine object information that matches the target object information from the object information stored in the information retrieval library based on a similarity between the binary hash code and a hash code for the object information stored in the information retrieval library and represented in binary form.
[0133] In one embodiment, the hash code of the object information stored in the information retrieval library is pre-generated using a trained hash generation model. The hash code of the object information stored in the information retrieval library is represented in binary form, and the hash code of the object information represented in binary form is also obtained by binarizing the hash code of the object information stored in the information retrieval library.
[0134] In one embodiment, the computer device may perform binarization processing on the hash code of the target object information through a symbolic function to obtain a binary hash code of the target object information.
[0135] In one embodiment, the binary hash code of the target object information may be determined by the following formula:
[0136] in, Represents the hash code of the target object information, sgn() represents the sign function, which is used to generate the hash code of all 1 and -1. i A binary hash code representing the target object's information.
[0137] In the above embodiment, the hash code of the object information stored in the information retrieval library is represented in binary form, which can reduce storage resource overhead. Because the hash code represented in binary form can be supported by hardware for bitwise exclusive-OR operations, the object information stored in the information retrieval library can be used to determine the object information that matches the target object information by comparing the similarity between the binary hash code and the hash code of the object information stored in the information retrieval library. This can reduce the computational complexity of the retrieval process, thereby improving information retrieval efficiency and further avoiding the waste of hardware resources used to support information retrieval.
[0138] As shown in FIG6 , in one embodiment, a method for processing object information is provided. The method can be applied to a computer device, which can be a terminal or a server. The method can be executed independently by the terminal or server itself, or through interaction between the terminal and the server. This embodiment uses the method applied to a computer device as an example to illustrate the method. The method specifically includes the following steps:
[0139] Step 602: Acquire a sample set, where the sample set includes sample object information, and the sample object information corresponds to a label.
[0140] Step 604: Obtain the label similarity of the labels corresponding to any two sample object information in the sample set, obtain the hash similarity between the hash codes generated by the hash generation model to be trained for any two sample object information, determine the difference between the label similarity and the hash similarity, and obtain a first loss value.
[0141] Step 606 : For each piece of sample object information in the sample set, sample object information in the sample set that has at least one common label with the targeted sample object information is regarded as sample object information similar to the targeted sample object information.
[0142] Step 608 : The sample object information in the sample set that does not have the same label as the targeted sample object information is regarded as sample object information that is dissimilar to the targeted sample object information.
[0143] Step 610 : For each piece of sample object information in the sample set, determine a first hash similarity between the sample object information and similar sample object information in the sample set.
[0144] Step 612: Determine a second hash similarity between the sample object information and the dissimilar sample object information in the sample set.
[0145] Step 614 : For each sample object information in the sample set, determine the global hash similarity according to the first hash similarity and the second hash similarity corresponding to the sample object information.
[0146] Step 616: Determine a similarity ratio parameter corresponding to the sample object information according to the ratio of the first hash similarity to the global hash similarity.
[0147] Step 618: Determine a second loss value based on the similarity ratio parameters corresponding to each sample object information in the sample set.
[0148] In step 620 , the first loss value and the second loss value are weighted to obtain a target loss value, and the hash generation model to be trained is trained in a direction that reduces the target loss value to obtain a trained hash generation model.
[0149] In step 622 , the object information in each modality of the acquired target object information is input into the trained hash generation model, so as to extract information sub-features of the object information in each modality through the trained hash generation model.
[0150] In step 624 , the information sub-features corresponding to the object information in each modality in the same target object information are fused to obtain the object information features of the target object information.
[0151] Step 626: Hash-code each feature field in the object information feature to obtain a hash bit corresponding to each feature field.
[0152] Step 628: Concatenate the hash bits corresponding to the characteristic fields to obtain a hash code of the target object information.
[0153] Step 630, determining the Hamming distance between the hash code of the target object information and the hash code of the object information stored in the information retrieval library; the Hamming distance is negatively correlated with the target hash similarity; the target hash similarity is the similarity between the hash code of the target object information and the hash code of the object information stored in the information retrieval library.
[0154] Step 632: Determine object information that matches the target object information from the object information stored in the information retrieval library based on the Hamming distance.
[0155] The present application also provides an application scenario, which applies the above-mentioned object information processing method. Specifically, the object information processing method can be applied to the scenario of advertising search. It can be understood that the object may include advertisements, and the object information includes advertising information. Specifically, the computer device can obtain a sample set, and the sample set includes sample advertising information, and the sample advertising information corresponds to a label. The label similarity of the labels corresponding to any two sample advertising information in the sample set is obtained, and the hash similarity between the hash codes generated by the hash generation model to be trained for any two sample advertising information is obtained, the difference between the label similarity and the hash similarity is determined, and a first loss value is obtained.
[0156] For each piece of sample advertising information in the sample set, the computer device may identify sample advertising information in the sample set that has at least one common label with the targeted sample advertising information as sample advertising information similar to the targeted sample advertising information. It may also identify sample advertising information in the sample set that does not have the same label as the targeted sample advertising information as sample advertising information dissimilar to the targeted sample advertising information. For each piece of sample advertising information in the sample set, a first hash similarity is determined between the targeted sample advertising information and similar sample advertising information in the sample set. A second hash similarity is determined between the targeted sample advertising information and dissimilar sample advertising information in the sample set. For each piece of sample advertising information in the sample set, a global hash similarity is determined based on the first hash similarity and the second hash similarity corresponding to the targeted sample advertising information. A similarity ratio parameter corresponding to the targeted sample advertising information is determined based on the ratio of the first hash similarity to the global hash similarity. A second loss value is determined based on the similarity ratio parameters corresponding to each piece of targeted sample advertising information in the sample set. A hash generation model to be trained is trained based on the first loss value and the second loss value to obtain a trained hash generation model.
[0157] The computer device may input the acquired advertising information in each modality of the target advertising information into a trained hash generation model to extract information sub-features of the advertising information in each modality through the trained hash generation model. The information sub-features corresponding to the advertising information in each modality of the same target advertising information are fused to obtain the advertising information features of the target advertising information. Each feature field in the advertising information features is hash-encoded to obtain the hash bits corresponding to each feature field. The hash bits corresponding to each feature field are concatenated to obtain the hash code of the target advertising information. It is understood that the advertising information may include advertising image information in image modality and advertising text information in text modality.
[0158] The computer device can determine the Hamming distance between the hash code of the target advertising information and the hash codes of the advertising information stored in the information retrieval library. The Hamming distance is negatively correlated with the target hash similarity, which is the similarity between the hash code of the target advertising information and the hash codes of the advertising information stored in the information retrieval library. Based on the Hamming distance, advertising information that matches the target advertising information can be identified from the advertising information stored in the information retrieval library, thereby improving the accuracy of advertising retrieval.
[0159] To further understand advertisement retrieval, let's take an example. Image A1 and text B1 describing an advertisement are input. It can be understood that image A1 and text B1 are input as an image-text pair into a trained hash generation model, and a hash code for the image-text pair is generated by the trained hash generation model. The information retrieval library pre-stores hash codes for candidate advertisement information (i.e., image-text pairs) generated by the trained hash generation model. It can be understood that each candidate advertisement information is associated with a corresponding hash code, which serves as a retrieval index. During the retrieval process, the computer device can calculate the Hamming distance between the hash code of the input image A1 and text B1 pair and each hash code in the information retrieval library to determine an image-text pair that matches the image A1 and text B1 pair from among the image-text pairs stored in the information retrieval library. For example, the image-text pair retrieved with the highest similarity to the image A1 and text B1 pair is image A2 and text B2.
[0160] The present application also provides an application scenario, which applies the above-mentioned object information processing method. Specifically, the object information processing method can be applied to the scenario of commodity sorting. It can be understood that the object may include commodities, and the object information includes commodity information. It can be understood that the commodity information may include at least one of the commodity image information in image mode, the commodity text information in text mode, and the commodity audio information in audio mode. Through the object information processing method of the present application, the accuracy of the hash code of the commodity information can be improved, thereby further improving the accuracy of commodity sorting.
[0161] It should be understood that, although the various steps in the flow chart of the above-mentioned embodiments are shown in sequence, these steps are not necessarily performed in sequence. Unless clearly stated herein, the execution of these steps does not have strict order restrictions, and these steps can be performed in other sequences. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0162] In one embodiment, as shown in FIG7 , an object information processing device 700 is provided, which specifically includes:
[0163] An acquisition module 702 is configured to acquire a sample set, where the sample set includes sample object information, and the sample object information corresponds to a label;
[0164] Determination module 704 is configured to obtain label similarity between labels corresponding to any two sample object information in the sample set, obtain hash similarity between hash codes generated by the hash generation model to be trained for any two sample object information, determine the difference between label similarity and hash similarity, and obtain a first loss value; determine, for each sample object information in the sample set, a first hash similarity between the targeted sample object information and similar sample object information in the sample set, where similar sample object information is sample object information in the sample set that is similar to the targeted sample object information; determine a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set, where dissimilar sample object information is sample object information in the sample set that is dissimilar to the targeted sample object information; and determine a second loss value based on the first hash similarity and the second hash similarity corresponding to each sample object information in the sample set;
[0165] The training module 706 is used to train the hash generation model to be trained according to the first loss value and the second loss value to obtain a trained hash generation model; the trained hash generation model is used to generate a corresponding hash code for the input target object information.
[0166] In one embodiment, the determination module 704 is also used to determine the global hash similarity for each sample object information in the sample set based on the first hash similarity and the second hash similarity corresponding to the sample object information; determine the similarity ratio parameter corresponding to the sample object information based on the ratio of the first hash similarity to the global hash similarity; and determine the second loss value based on the similarity ratio parameter corresponding to each sample object information in the sample set.
[0167] In one embodiment, the determination module 704 is further configured to, for each piece of sample object information in the sample set, consider the sample object information in the sample set that has at least one identical label with the targeted sample object information as sample object information similar to the targeted sample object information; and consider the sample object information in the sample set that does not have the identical label with the targeted sample object information as sample object information dissimilar to the targeted sample object information.
[0168] In one embodiment, the determination module 704 is further used to obtain a first hash code generated by the hash generation model to be trained for the targeted sample object information; obtain a second hash code generated by the hash generation model to be trained for sample object information in the sample set that is similar to the targeted sample object information, and obtain a first hash similarity based on the similarity between the first hash code and the second hash code; obtain a third hash code generated by the hash generation model to be trained for sample object information in the sample set that is not similar to the targeted sample object information; and obtain a second hash similarity based on the similarity between the first hash code and the third hash code.
[0169] In one embodiment, referring to FIG8 , the object information processing apparatus 700 further includes:
[0170] The generation module 708 is used to input the target object information into the trained hash generation model to extract the object information features of the target object information through the trained hash generation model; hash encode each feature field in the object information features to obtain the hash bits corresponding to each feature field; cascade the hash bits corresponding to each feature field to obtain the hash code of the target object information.
[0171] In one embodiment, the target object information is an information group including object information under at least two modalities; the number of target object information is at least one, and the generation module 708 is further used to input the object information under each modality in the target object information into the trained hash generation model to extract the information sub-features of the object information under each modality through the trained hash generation model; the information sub-features corresponding to the object information under each modality in the same target object information are fused to obtain the object information features of the target object information.
[0172] In one embodiment, the target object information includes object image information in image mode and object text information in text mode; the information sub-features include object image features extracted from the object image information and object text features extracted from the object text information; the generation module 708 is also used to fuse the object image features and object text features corresponding to the same target object information to obtain the object information features of the target object information.
[0173] In one embodiment, the generation module 708 is also used to map the object image features corresponding to the target object information to the target feature space to obtain image mapping features; map the object text features corresponding to the target object information to the target feature space to obtain text mapping features; the image mapping features and the text mapping features have the same feature dimension in the target feature space; and fuse the image mapping features and text mapping features corresponding to the same target object information to obtain the object information features of the target object information.
[0174] In one embodiment, the trained hash generation model includes a feature processing network and a hash generation network; the generation module 708 is also used to input the target object information into the feature processing network to extract the object information features of the target object information through the feature processing network; the object information features are input into the hash generation network to hash encode each feature field in the object information features through the hash generation network to obtain the hash bits corresponding to each feature field.
[0175] In one embodiment, the feature processing network includes an image feature extraction unit, a text feature extraction unit and a feature fusion unit, and the target object information includes object image information in image mode and object text information in text mode; the generation module 708 is also used to input the object image information into the image feature extraction unit to extract the object image features of the object image information through the image feature extraction unit; input the object text information into the text feature extraction unit to extract the object text features of the object text information through the text feature extraction unit; input the object image features and the object text features into the feature fusion unit to fuse the object image features and the object text features through the feature fusion unit to obtain the object information features of the target object information.
[0176] In one embodiment, the feature processing network also includes an image feature mapping unit and a text feature mapping unit, and the generation module 708 is further used to input the object image feature into the image feature mapping unit, so as to map the object image feature to the target feature space through the image feature mapping unit to obtain the image mapping feature; input the object text feature into the text feature mapping unit, so as to map the object text feature to the target feature space through the text feature mapping unit to obtain the text mapping feature, and the image mapping feature and the text mapping feature have the same feature dimension in the target feature space; input the image mapping feature and the text mapping feature into the feature fusion unit, so as to fuse the image mapping feature and the text mapping feature through the feature fusion unit to obtain the object information feature of the target object information.
[0177] In one embodiment, referring to FIG8 , the object information processing apparatus 700 further includes:
[0178] The retrieval module 710 is used to input the target object information into the trained hash generation model to generate a hash code of the target object information through the trained hash generation model; based on the similarity between the hash code of the target object information and the hash code of the object information stored in the pre-built information retrieval library, determine the object information that matches the target object information from the object information stored in the information retrieval library.
[0179] In one embodiment, the retrieval module 710 is further used to determine the Hamming distance between the hash code of the target object information and the hash code of the object information stored in the information retrieval library; the Hamming distance is negatively correlated with the target hash similarity; the target hash similarity is the similarity between the hash code of the target object information and the hash code of the object information stored in the information retrieval library; based on the Hamming distance, object information matching the target object information is determined from the object information stored in the information retrieval library.
[0180] In one embodiment, the hash code of the object information stored in the information retrieval library is represented in binary form; the retrieval module 710 is further used to binarize the hash code of the target object information to obtain a binary hash code of the target object information represented in binary form; and based on the similarity between the binary hash code and the hash code of the object information stored in the information retrieval library, determine the object information that matches the target object information from the object information stored in the information retrieval library.
[0181] In one embodiment, the training module 706 is further configured to weight the first loss value and the second loss value to obtain a target loss value; and to train the hash generation model to be trained in a direction that reduces the target loss value to obtain a trained hash generation model.
[0182] The object information processing device obtains a sample set, comprising sample object information, each of which has a corresponding label; obtains the label similarity between the labels corresponding to any two sample object information in the sample set; obtains the hash similarity between hash codes generated by a hash generation model to be trained for any two sample object information; determines the difference between the label similarity and the hash similarity, and obtains a first loss value. For each sample object information in the sample set, the device determines a first hash similarity between the sample object information and similar sample object information in the sample set; determines a second hash similarity between the sample object information and dissimilar sample object information in the sample set; and determines a second loss value based on the first and second hash similarities corresponding to each sample object information in the sample set. The hash generation model to be trained is trained based on the first and second loss values to obtain a trained hash generation model. During model training, the first loss value considers both the label similarity and hash similarity of the sample object information, and the second loss value corresponding to each sample object information considers both the correlation between the sample object information and similar sample object information in the entire sample set and the repulsion between the sample object information and dissimilar sample object information in the entire sample set. This way, even when training in batches, sample object information will not be unnecessarily close or distant, preventing data oscillation during model training. Therefore, the hash generation model trained using the first and second loss values can generate accurate hash codes for target object information, improving hash code generation accuracy and avoiding the waste of hardware resources used to support object information hash code generation.
[0183] Each module in the object information processing device described above may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0184] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in Figure 9. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer-readable instructions and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer-readable instructions are executed by the processor, an object information processing method is implemented.
[0185] In one embodiment, a computer device is provided, which may be a terminal. A diagram of its internal structure may be shown in FIG10 . The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals via wired or wireless communication, where the wireless communication may be achieved via Wi-Fi, a mobile cellular network, NFC (near field communication), or other technologies. When executed by the processor, the computer-readable instructions implement an object information processing method. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0186] Those skilled in the art will understand that the structures shown in Figures 9 and 10 are merely block diagrams of partial structures related to the solution of the present application, and do not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different component arrangement.
[0187] In one embodiment, a computer device is further provided, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and the processor implements the steps in the above-mentioned method embodiments when executing the computer-readable instructions.
[0188] In one embodiment, one or more computer-readable storage media are provided, storing computer-readable instructions, which implement the steps of the above-mentioned method embodiments when executed by one or more processors.
[0189] In one embodiment, a computer program product is provided, comprising computer-readable instructions, which implement the steps of the above-mentioned method embodiments when executed by one or more processors.
[0190] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0191] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0192] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0193] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for processing object information, executed by a computer device, the method comprising: Acquire a sample set, the sample set including sample object information, and the sample object information corresponds to a label; Obtaining the label similarity of labels corresponding to any two sample object information in the sample set, and obtaining the hash similarity between hash codes generated by the hash generation model to be trained for the any two sample object information; Determine a difference between the label similarity and the hash similarity, and obtain a first loss value based on the difference; For each piece of sample object information in the sample set, determining a first hash similarity between the targeted sample object information and similar sample object information in the sample set, wherein the similar sample object information is sample object information in the sample set that is similar to the targeted sample object information; determining a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set, wherein the dissimilar sample object information is sample object information in the sample set that is dissimilar to the targeted sample object information; Determine a second loss value according to the first hash similarity and the second hash similarity respectively corresponding to each of the sample object information in the sample set; According to the first loss value and the second loss value, the hash generation model to be trained is trained to obtain a trained hash generation model, and the trained hash generation model is used to generate a corresponding hash code for the input target object information.
2. The method according to claim 1, wherein determining the second loss value according to the first hash similarity and the second hash similarity respectively corresponding to each of the sample object information in the sample set comprises: For each sample object information in the sample set, determining a global hash similarity according to the first hash similarity and the second hash similarity corresponding to the sample object information; Determining a similarity ratio parameter corresponding to the sample object information according to a ratio of the first hash similarity to the global hash similarity; A second loss value is determined according to the similarity ratio parameters respectively corresponding to the sample object information in the sample set.
3. The method according to any one of claims 1 or 2, further comprising: For each piece of sample object information in the sample set, taking the sample object information in the sample set that has at least one same label as the targeted sample object information as sample object information similar to the targeted sample object information; The sample object information in the sample set that does not have the same label as the targeted sample object information is regarded as sample object information that is dissimilar to the targeted sample object information.
4. The method according to any one of claims 1 to 3, wherein determining a first hash similarity between the targeted sample object information and similar sample object information in the sample set comprises: Obtaining a first hash code generated by the hash generation model to be trained for the sample object information; Obtain a second hash code generated by the hash generation model to be trained for sample object information in the sample set that is similar to the targeted sample object information; Obtaining a first hash similarity according to a similarity between the first hash code and the second hash code; The determining a second hash similarity between the targeted sample object information and the dissimilar sample object information in the sample set includes: Obtain the hash generation model to be trained to generate a third hash code for sample object information in the sample set that is not similar to the targeted sample object information; A second hash similarity is obtained according to the similarity between the first hash code and the third hash code.
5. The method according to any one of claims 1 to 4, further comprising: Inputting the target object information into the trained hash generation model to extract object information features of the target object information through the trained hash generation model; Hash-code each feature field in the object information feature to obtain a hash bit corresponding to each feature field; The hash bits corresponding to the characteristic fields are cascaded to obtain a hash code of the target object information.
6. The method according to claim 5, wherein the target object information is an information group including object information in at least two modes, the number of the target object information is at least one, and the step of inputting the target object information into the trained hash generation model to extract object information features of the target object information through the trained hash generation model comprises: Inputting the object information under each modality in the target object information into the trained hash generation model, so as to extract information sub-features of the object information under each modality through the trained hash generation model; The information sub-features corresponding to the object information under each mode in the same target object information are fused to obtain the object information features of the target object information.
7. The method according to claim 6, wherein the target object information includes object image information in image mode and object text information in text mode, and the information sub-features include object image features extracted from the object image information and object text features extracted from the object text information; The step of fusing the information sub-features corresponding to the object information in each mode in the same target object information to obtain the object information features of the target object information includes: The object image features and the object text features corresponding to the same target object information are fused to obtain the object information features of the target object information.
8. The method according to claim 7, wherein fusing the object image feature and the object text feature corresponding to the same target object information to obtain the object information feature of the target object information comprises: Mapping the object image features corresponding to the target object information to a target feature space to obtain image mapping features; Mapping the object text feature corresponding to the target object information to the target feature space to obtain a text mapping feature, wherein the image mapping feature and the text mapping feature have the same feature dimension in the target feature space; The image mapping feature and the text mapping feature corresponding to the same target object information are fused to obtain the object information feature of the target object information.
9. The method according to any one of claims 5 to 8, wherein the trained hash generation model comprises a feature processing network and a hash generation network; The step of inputting the target object information into the trained hash generation model to extract object information features of the target object information through the trained hash generation model includes: Inputting the target object information into the feature processing network to extract object information features of the target object information through the feature processing network; The step of performing hash coding on each feature field in the object information feature to obtain hash bits corresponding to each feature field includes: The object information feature is input into the hash generation network, so that each feature field in the object information feature is hash-encoded by the hash generation network to obtain hash bits corresponding to each feature field.
10. The method according to claim 9, wherein the feature processing network comprises an image feature extraction unit, a text feature extraction unit and a feature fusion unit, and the target object information comprises object image information in an image mode and object text information in a text mode; The step of inputting the target object information into the feature processing network to extract object information features of the target object information through the feature processing network includes: inputting the object image information into the image feature extraction unit so as to extract the object image features of the object image information through the image feature extraction unit; Inputting the object text information into the text feature extraction unit so as to extract the object text features of the object text information through the text feature extraction unit; The object image feature and the object text feature are input into the feature fusion unit, so that the object image feature and the object text feature are fused by the feature fusion unit to obtain the object information feature of the target object information.
11. The method according to claim 10, wherein the feature processing network further comprises an image feature mapping unit and a text feature mapping unit, and the step of inputting the object image feature and the object text feature into the feature fusion unit so as to fuse the object image feature and the object text feature through the feature fusion unit to obtain the object information feature of the target object information comprises: Inputting the object image feature into the image feature mapping unit, so as to map the object image feature into a target feature space through the image feature mapping unit to obtain an image mapping feature; Inputting the object text feature into the text feature mapping unit, so as to map the object text feature to the target feature space through the text feature mapping unit to obtain a text mapping feature, wherein the image mapping feature and the text mapping feature have the same feature dimension in the target feature space; The image mapping feature and the text mapping feature are input into the feature fusion unit, so that the image mapping feature and the text mapping feature are fused by the feature fusion unit to obtain the object information feature of the target object information.
12. The method according to any one of claims 1 to 11, further comprising: Inputting the target object information into the trained hash generation model to generate a hash code of the target object information through the trained hash generation model; According to the similarity between the hash code of the target object information and the hash code of the object information stored in the pre-built information retrieval library, object information matching the target object information is determined from the object information stored in the information retrieval library.
13. The method according to claim 12, wherein the determining, from the object information stored in the information retrieval library, object information matching the target object information based on the similarity between the hash code of the target object information and the hash code of the object information stored in the pre-built information retrieval library comprises: Determine a Hamming distance between a hash code of the target object information and a hash code of the object information stored in the information retrieval library, wherein the Hamming distance is negatively correlated with a target hash similarity, and the target hash similarity is a similarity between a hash code of the target object information and a hash code of the object information stored in the information retrieval library; According to the Hamming distance, object information matching the target object information is determined from the object information stored in the information retrieval library.
14. According to the method of any one of claims 12 or 13, the hash code of the object information stored in the information retrieval library is represented in binary form, and the method further comprises: Binarizing the hash code of the target object information to obtain a binary hash code of the target object information represented in binary form; The determining, based on the similarity between the hash code of the target object information and the hash code of the object information stored in the pre-built information retrieval library, object information matching the target object information from the object information stored in the information retrieval library comprises: According to the similarity between the binary hash code and the hash code of the object information stored in the information retrieval library, object information matching the target object information is determined from the object information stored in the information retrieval library.
15. The method according to any one of claims 1 to 14, wherein the training the hash generation model to be trained according to the first loss value and the second loss value to obtain the trained hash generation model comprises: Weighting the first loss value and the second loss value to obtain a target loss value; The hash generation model to be trained is trained in a direction that reduces the target loss value to obtain a trained hash generation model.
16. An object information processing device, the device comprising: An acquisition module, used to acquire a sample set, wherein the sample set includes sample object information, and the sample object information corresponds to a label; A determination module, configured to obtain the label similarity of labels corresponding to any two sample object information in the sample set, and obtain the hash similarity between the hash codes generated by the hash generation model to be trained for the any two sample object information, determine the difference between the label similarity and the hash similarity, and obtain a first loss value based on the difference; For each sample object information in the sample set, determine the sample object information similar to that in the sample set. a first hash similarity between sample object information, wherein the similar sample object information is sample object information in the sample set that is similar to the targeted sample object information; determining a second hash similarity between the targeted sample object information and dissimilar sample object information in the sample set, wherein the dissimilar sample object information is sample object information in the sample set that is dissimilar to the targeted sample object information; and determining a second loss value according to the first hash similarity and the second hash similarity respectively corresponding to each of the sample object information in the sample set; A training module is used to train the hash generation model to be trained according to the first loss value and the second loss value to obtain a trained hash generation model, and the trained hash generation model is used to generate a corresponding hash code for the input target object information.
17. A computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and the processors implement the steps of the method according to any one of claims 1 to 15 when executing the computer-readable instructions.
18. One or more computer-readable storage media storing computer-readable instructions, wherein the computer-readable instructions, when executed by one or more processors, implement the steps of the method according to any one of claims 1 to 15.
19. A computer program product comprising computer readable instructions, which when executed by one or more processors implement the steps of the method of any one of claims 1 to 15.
Citation Information
Patent Citations
An online nearest neighbor query method for high-dimensional data based on hash learning
CN109299097A
Deep hash image retrieval method fusing semantic information and multi-level similarity
CN109977250A
Multi-label image retrieval method and equipment based on direct-push type zero sample hash
CN110795590A
Attention-based deep cross-modal hash retrieval method and apparatus, and related device
WO2022155994A1
