Data processing method, device and equipment

By using pre-trained feature extraction models and feature extraction algorithms, combined with image title information and clustering algorithms, the problem of low image retrieval accuracy is solved and a more efficient image retrieval effect is achieved.

CN114238744BActive Publication Date: 2024-10-01ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111574694.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2024-10-01
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In the existing technology, when retrieving products through image similarity, the retrieval accuracy is low and cannot meet user needs, especially when there are many types of products and small differences.

Method used

A pre-trained feature extraction model is used, a feature extraction model is constructed based on the feature extraction algorithm and metric learning algorithm, and the title information of the image and the clustering algorithm are used to determine the feature vector, thereby improving the accuracy of image retrieval.

Benefits of technology

By learning the fine-grained features of images, the accuracy of image retrieval is improved, and similar images can be determined more accurately to meet the user's retrieval needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238744B_ABST
    Figure CN114238744B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide a data processing method, apparatus and equipment, the method comprising: upon receiving a similar image retrieval instruction for a first image, determining a candidate image corresponding to the first image; based on a pre-trained feature extraction model, obtaining a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image, the feature extraction model being based on a second image and a label of the second image, and being obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm, the label of the second image being determined based on title information of the second image and a preset clustering algorithm; based on the first feature vector and the second feature vector, determining a target image corresponding to the first image in the candidate images, and determining the target image as a retrieval result corresponding to the similar graphic retrieval instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of data processing technology, and in particular to a data processing method, device and equipment. Background Art

[0002] With the rapid development of the Internet industry, application service providers can provide users with more and more diversified business services, and users can use more and more services.

[0003] For example, a user can search for a product on a shopping platform by using an image of the product. After receiving the search image, the server of the shopping platform can obtain the image similarity between each stored image and the search image, and return the products corresponding to the stored images with higher image similarity to the user as search results. However, as the types of products increase and the differences between products decrease, searching for products only by image similarity has low search accuracy and cannot meet the search needs of users. Therefore, a solution is needed to improve the search accuracy when searching by image. Summary of the invention

[0004] The purpose of the embodiments of this specification is to provide a data processing method, device and equipment to provide a solution that can improve the retrieval accuracy when searching through images.

[0005] In order to implement the above technical solution, the embodiments of this specification are implemented as follows:

[0006] In a first aspect, an embodiment of the present specification provides a data processing method, comprising: upon receiving a similar image retrieval instruction for a first image, determining a candidate image corresponding to the first image; based on a pre-trained feature extraction model, obtaining a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image, wherein the feature extraction model is based on a second image and a label of the second image, and is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm, and the label of the second image is determined based on title information of the second image and a preset clustering algorithm; based on the first feature vector and the second feature vector, determining a target image corresponding to the first image in the candidate images, and determining the target image as a retrieval result corresponding to the similar graphic retrieval instruction.

[0007] In a second aspect, an embodiment of the present specification provides a data processing method, which is applied to a blockchain system, including: upon receiving a similar image retrieval instruction for a first image, based on a first smart contract pre-deployed in the blockchain system, obtaining a candidate image corresponding to the first image; based on the first smart contract and a pre-trained feature extraction model, obtaining a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image, wherein the feature extraction model is based on the second image and the label of the second image, and is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm; based on the first smart contract, the first feature vector and the second feature vector, determining a target image corresponding to the first image in the candidate images, and determining the target image as a retrieval result corresponding to the similar graphic retrieval instruction.

[0008] In a third aspect, an embodiment of the present specification provides a data processing device, comprising: an image selection module, for determining a candidate image corresponding to the first image when a similar image retrieval instruction for the first image is received; a vector acquisition module, for acquiring a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, and the label of the second image is determined based on title information of the second image and a preset clustering algorithm; an image determination module, for determining a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determining the target image as a retrieval result corresponding to the similar graphic retrieval instruction.

[0009] In a fourth aspect, an embodiment of the present specification provides a data processing device, which is a device in a blockchain system, comprising: an image selection module, which is used to obtain a candidate image corresponding to the first image based on a first smart contract pre-deployed in the blockchain system when a similar image retrieval instruction for the first image is received; a vector acquisition module, which is used to obtain a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on the first smart contract and a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm; an image determination module, which is used to determine a target image corresponding to the first image in the candidate images based on the first smart contract, the first feature vector and the second feature vector, and determine the target image as a retrieval result corresponding to the similar graphic retrieval instruction.

[0010] In a fifth aspect, an embodiment of the present specification provides a data processing device, which is a device in a blockchain system, and the data processing device includes: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions, when executed, cause the processor to: determine a candidate image corresponding to the first image when a similar image retrieval instruction for a first image is received; obtain a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, wherein the feature extraction model is based on a second image and a label of the second image, and is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm; determine a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determine the target image as a retrieval result corresponding to the similar graphic retrieval instruction.

[0011] In a sixth aspect, an embodiment of the present specification provides a data processing device, which is a device in a blockchain system, comprising: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to: upon receiving an execution instruction from a target user for a first business, obtain an identity authentication page corresponding to the first business based on a third smart contract pre-deployed in the blockchain system, wherein the identity authentication page is used to authenticate the target user for triggering execution of the first business; based on the third smart contract, obtain identity prompt information matching the first business, and based on the third smart contract, the identity prompt information and the identity authentication page, generate a target verification page for the target user and carrying the identity prompt information; provide the target verification page to the target user's device, and obtain the first identity authentication information entered by the target user on the target verification page from the target user's device based on the third smart contract; based on the third smart contract and the first identity authentication information, authenticate the target user for triggering execution of the first business, and execute the first business if the identity authentication passes.

[0012] In the seventh aspect, an embodiment of the present specification provides a storage medium, which is used to store computer-executable instructions, and the executable instructions implement the following process when executed: when receiving an execution instruction from a target user for a first business, obtaining an identity authentication page corresponding to the first business, and the identity authentication page is used to authenticate the target user to trigger the execution of the first business; obtaining identity prompt information matching the first business, and based on the identity prompt information and the identity authentication page, generating a target verification page for the target user and carrying the identity prompt information; receiving the first identity authentication information entered by the target user on the target verification page, and authenticating the target user to trigger the execution of the first business based on the first identity authentication information; if the identity authentication passes, executing the first business.

[0013] In an eighth aspect, an embodiment of the present specification provides a storage medium, wherein the storage medium is used to store computer-executable instructions, and the executable instructions implement the following process when executed by a processor: when a similar image retrieval instruction for a first image is received, based on a first smart contract pre-deployed in a blockchain system, a candidate image corresponding to the first image is obtained; based on the first smart contract and a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained, wherein the feature extraction model is based on the second image and the label of the second image, and is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm; based on the first smart contract, the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as the retrieval result corresponding to the similar graphic retrieval instruction. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0015] Figure 1A A flowchart of a data processing method embodiment of this specification;

[0016] Figure 1B A schematic diagram of a processing process of a data processing method embodiment of this specification;

[0017] Figure 2 This is a schematic diagram of a method for determining a first image in this specification;

[0018] Figure 3 This is a schematic diagram of another method for determining a first image in this specification;

[0019] Figure 4 This is a schematic diagram of another method for determining a first image in this specification;

[0020] Figure 5 A schematic diagram of a processing process of another data processing method embodiment of the present specification;

[0021] Figure 6 A schematic diagram of an image extraction model in this specification;

[0022] Fig. 7AA flowchart of a data processing method embodiment of this specification;

[0023] Figure 7B A schematic diagram of a processing process of another data processing method embodiment of the present specification;

[0024] Figure 8 A schematic diagram of a processing process of another data processing method embodiment of the present specification;

[0025] Fig. 9 A schematic diagram of the structure of a data processing device according to an embodiment of the present specification;

[0026] Fig.10 A schematic diagram of the structure of another data processing device embodiment of the present specification;

[0027] Fig.11 This is a structural schematic diagram of a data processing device in this specification. DETAILED DESCRIPTION

[0028] The embodiments of this specification provide a data processing method, device and equipment.

[0029] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0030] Embodiment 1

[0031] like Figure 1A and Figure 1B As shown, an embodiment of the present specification provides a data processing method, the execution subject of the method may be a server, and the server may be an independent server or a server cluster composed of multiple servers.

[0032] The method may specifically include the following steps:

[0033] In S102 , when a similar image search instruction for a first image is received, a candidate image corresponding to the first image is determined.

[0034] Among them, the first image can be any image, for example, the first image can be any image uploaded by the user device (such as an image taken by the user through the user device, or an image stored by the user device, etc.), and the candidate image can be any image pre-stored by the server.

[0035] In practice, with the rapid development of the Internet industry, the business services that application service providers can provide to users are becoming more and more diversified, and there are more and more businesses available to users. For example, on a shopping platform, a user can search for a certain product through an image with the product, wherein the server of the shopping platform, after receiving the search image, can obtain the image similarity between each stored image and the search image, and return the products corresponding to the stored images with higher image similarity to the user as search results. However, as there are more and more types of products and the differences between products are getting smaller and smaller, searching for products only through image similarity has low retrieval accuracy and cannot meet the user's search needs. Therefore, a solution to improve the retrieval accuracy when searching for items through images is needed. To this end, the embodiments of this specification provide a technical solution that can solve the above-mentioned problems, and please refer to the following content for details.

[0036] Taking the server as a backend server of a commodity trading application as an example, a user can trigger and start the commodity trading application on a user device (such as a terminal device or a server, etc.). Figure 2 In the page shown, the user can enter key information (such as mobile phone, top, leisure food, etc.) in the input box to search for products, or trigger the target control next to the "search" control to search for products by inputting an image. For example, after receiving the user's trigger instruction on the target control, the user device can display the following Figure 3 In the first image acquisition interface shown, after the user detects the trigger instruction of the user on the first control, the user device can use the image captured in the image shooting area as the first image. After the user detects the trigger instruction of the user on the second control, the user device can display the image stored in the user device and determine the image corresponding to the user's selection instruction on the stored image as the first image.

[0037] Or, if Figure 4 As shown, in the image display page, the user device can receive a predetermined operation (such as a right swipe operation, a double-click operation, etc.) of the user on a certain image. After receiving the predetermined operation for a certain image, the user device can display a similar image retrieval control for the image, and after receiving a trigger instruction from the user on the similar image retrieval control, the image is determined as the first image, that is, Figure 4 Image 1 in may be the first image.

[0038] When the server receives a similar image retrieval instruction for the first image, the server may determine the locally stored image as a candidate image corresponding to the first image. Alternatively, the server may obtain the image similarity between the locally stored image and the first image, and determine the image in the locally stored images whose image similarity is greater than a preset image similarity threshold as the candidate image corresponding to the first image.

[0039] The above-mentioned method for determining the first image and the candidate image is an optional and feasible determination method. In actual application scenarios, there may be a variety of different determination methods, which may vary according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0040] In S104, based on a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained.

[0041] Among them, the feature extraction model is based on the second image and the label of the second image, and is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm. The second image can be any image, such as the second image can be an image pre-stored by the server. The feature extraction algorithm is used to extract features from the second image, and the metric learning (Metric Learning) algorithm is used to make the similarity between images of different types small and the similarity between images of the same type large. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm. The title information of the second image can be information that can characterize the category of the second image. For example, the title information of the second image can be "2021 new mobile phones", "Women's tops", etc. The preset clustering algorithm can be any algorithm, such as the preset clustering algorithm can be a DBSCAN algorithm, a K-MEANS algorithm, a K nearest neighbor algorithm, etc.

[0042] In implementation, the server can obtain the second image and title information of the second image stored locally, and cluster the second image according to the title information and a preset clustering algorithm. The category corresponding to each second image can be used as a label for the second image.

[0043] After determining the label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm can be trained based on the second image and the label of the second image. The feature extraction algorithm and metric learning algorithm used to construct the feature extraction model can select different feature extraction algorithms and metric learning algorithms according to the needs of the actual application scenario. The embodiments of this specification do not specifically limit the selected feature extraction algorithm and metric learning algorithm.

[0044] The server performs feature extraction on the first image and the second image respectively according to the trained feature extraction model to obtain a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image.

[0045] In addition, if the first image is an image sent by the server to the user device for display (such as Figure 4 As shown, the first image is image 1, and image 1 is the image sent by the server to the user device for display), then, when the server receives a similar graphic retrieval instruction for the first image, it can determine whether there are new images locally (such as whether there are new images in the past three days). If there are no new images, the server can determine a pre-stored image that is correlated with the first image as a candidate image corresponding to the first image. If there are new images, the server can determine a pre-stored image that is correlated with the first image and the new image as candidate images corresponding to the first image.

[0046] In S106, based on the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as a retrieval result corresponding to the similar graphic retrieval instruction.

[0047] In implementation, the vector similarity between the first feature vector and the second feature vector can be determined based on a preset vector similarity acquisition algorithm, and one or more candidate images whose vector similarity is greater than a preset vector similarity threshold are determined as target images corresponding to the first image. The preset vector similarity acquisition algorithm can be a cosine similarity algorithm, a Euclidean distance algorithm, etc.

[0048] In addition, if Figure 1B As shown, after determining the target image, the server can return the target image to the user device for display.

[0049] The above-mentioned method for determining the target image is an optional and feasible verification method. In actual application scenarios, there may be a variety of different determination methods, which may vary according to the actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0050] The embodiment of the present specification provides a data processing method, in the case of receiving a similar image retrieval instruction for a first image, determining a candidate image corresponding to the first image, obtaining a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, determining a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determining the target image as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn fine-grained features of different images, and then after the model is trained, the trained feature extraction model can accurately extract features of images (including the first image and the second image), so as to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving images.

[0051] Embodiment 2

[0052] like Figure 5 As shown, the embodiment of this specification provides a data processing method, the execution subject of the method can be a server, the server can be an independent server, or a server cluster composed of multiple servers. The method can specifically include the following steps:

[0053] In S502 , when a similar image search instruction for a first image is received, a candidate image corresponding to the first image is determined.

[0054] In S504, the title information of the second image is obtained.

[0055] The specific processing process of the above S502 to S504 can refer to the relevant content of S102 to S104 in the above embodiment 1, which will not be repeated here.

[0056] In S506 , a first vector corresponding to the second image is determined based on the pre-built vocabulary and the title information of the second image.

[0057] The pre-built word library may be a word library built by the server based on historical search keywords, search common words, etc.

[0058] In implementation, in actual applications, the above S506 can be processed in various ways. An optional implementation is provided below. For details, please refer to the following steps 1 to 5:

[0059] Step 1: Determine the quantity vector corresponding to each second image based on the quantity of each word included in the pre-built word library in the title information of each second image.

[0060] In implementation, for example, assuming that the pre-built vocabulary contains three words, namely "a", "b" and "w", and the title information of the second image 1 is "abcdd", it can be seen that the number of "a" in the second image 1 is 1, the number of "b" in the second image 1 is 1, and "w" is not included in the title information of the second image 1, that is, the quantity vector corresponding to the second image 1 is (1, 1, 0).

[0061] Step 2: Determine the position vector corresponding to each second image based on the position information of each word included in the pre-built word library in the title information of each second image.

[0062] In implementation, it is assumed that the words at the front have more important meanings, that is, when searching, users usually put the keywords that can describe the items more in front. Therefore, the position vector corresponding to each second image can be determined according to the position information of each word contained in the pre-constructed vocabulary in the title information of each second image. For example, assuming that the pre-constructed vocabulary contains 3 words, namely "a", "b" and "w", and the title information of the second image 1 is "abcdd", it can be seen that "a" is located at the first position in the title information of the second image 1, "b" is located at the second position in the title information of the second image 1, and "w" is not included in the title information of the second image 1. Therefore, the reciprocal of the position information can be determined as the corresponding position vector value, and the position vector corresponding to the second image 1 is constructed, that is, the position vector corresponding to the second image 1 can be (1, 1 / 2, 0).

[0063] Step three, based on the title information of the second image, determine the classification entropy of each word contained in the pre-constructed vocabulary, and determine the entropy vector corresponding to each second image according to the classification entropy of each word contained in the pre-constructed vocabulary and the title information of each second image.

[0064] In implementation, the classification entropy of each word included in the pre-constructed word library can be determined according to the preset entropy algorithm and the title information of the second image. For example, assuming that the pre-constructed word library contains 3 words, namely "a", "b" and "w", and the title information of the second image 1 is "abdd", based on the title information of the second image (including the second image 1 and other second images) and the preset entropy algorithm, it can be determined that the classification entropy corresponding to "a" is "A1", the classification entropy corresponding to "b" is "B1", and the classification entropy corresponding to "w" is "W1". Then, the entropy vector corresponding to the second image 1 can be (A1, B1, 0)

[0065] Step 4: Determine a word frequency vector corresponding to each second image based on the number of times each word included in the pre-built word library appears in the title information of each second image and the number of times each word appears in the title information of other second images.

[0066] In implementation, the word frequency vector corresponding to each second image may be determined according to the TF-IDF algorithm.

[0067] Step five: determine the first vector corresponding to the second image based on the quantity vector, the position vector, the entropy vector and the word frequency vector.

[0068] In implementation, it is assumed that the pre-built word library contains three words, namely "a", "b" and "c", and there are two second images, namely second image 1 and second image 2, wherein the title information of second image 1 is "abdd" and the title information of second image 2 is "cc". Then, the quantity vector, position vector, entropy vector and word frequency vector of second image 1 and second image 2 can be shown in Table 1 below.

[0069] Table 1

[0070]

[0071] After determining the quantity vector, position vector, entropy vector and word frequency vector of each second image, as shown in Table 1 above, the sum of the quantity vector, position vector, entropy vector and word frequency vector of the second image can be determined as the first vector of the second image. Alternatively, a weighted calculation can be performed based on the weights corresponding to the quantity vector, position vector, entropy vector and word frequency vector to obtain the first vector of the second image. If the pre-built word library contains n words, then the first vector is an n-dimensional vector.

[0072] There may be multiple methods for determining the first vector corresponding to the second image. In actual application scenarios, there may also be multiple different determination methods, which may vary depending on the actual application scenarios. The embodiments of this specification do not specifically limit this.

[0073] In S508, clustering is performed on the second image based on the first vector and a preset clustering algorithm to obtain a plurality of categories.

[0074] In S510 , a label of the second image is determined based on the category corresponding to the second image.

[0075] In implementation, the category corresponding to the second image may be determined as the label of the second image.

[0076] In S512, based on the second image and the label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain a pre-trained feature extraction model.

[0077] In implementation, in actual applications, the processing methods of the above S512 can be various. The following provides an optional implementation method, which can be specifically referred to in the following steps 1 to 2:

[0078] Step 1: determine the second image corresponding to the target category as the third image.

[0079] Among them, the number of second images corresponding to the target category is greater than a preset number threshold. For example, the second image corresponding to the target category containing at least two second images (i.e., the third image) can be used as a sample for model training to improve the accuracy of model training.

[0080] Step 2: Based on the third image and the label of the third image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain a pre-trained feature extraction model.

[0081] In implementation, in order to deal with label noise and category imbalance problems, a weighted cross entropy loss can be designed according to the number of category samples (i.e., the number of third images corresponding to the target category).

[0082] Based on the number of third images corresponding to the target category, the category weight corresponding to the target category is determined. For example, the number of third images corresponding to the target category can be substituted into the following formula:

[0083] ω i =1 / logN i ,

[0084] Get the category weight corresponding to the target category, where ω i is the category weight corresponding to the i-th target category, N i is the number of the third image corresponding to the i-th target category.

[0085] Based on the label of the third image, a target category corresponding to the third image is determined, and a category weight corresponding to the target category is determined as the category weight corresponding to the third image.

[0086] Based on the third image and the category weight corresponding to the third image, a feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain a pre-trained feature extraction model. The category weight corresponding to the third image is used to determine the cross entropy loss corresponding to the third image during the model training process, so as to train the feature extraction model based on the cross entropy loss.

[0087] Among them, the feature extraction model includes a feature extraction layer and an embedding layer. The feature extraction layer can be used to extract image features of the third image, and the embedding layer can be used to convert the image features into feature vectors of predetermined dimensions. The loss function of the feature extraction model is a face recognition loss function including a weighted cross entropy loss.

[0088] For example, Figure 6 As shown, the feature extraction model may include a feature extraction layer composed of the Efficientnet-b3 algorithm, the GAP algorithm, BatchNorm1D, and Normalize, and an Embedding layer (i.e., an embedding layer), and the loss function is a face recognition loss function (i.e., ArcFace Loss) including a weighted cross entropy loss. Among them, the Efficientnet-b3 algorithm can be used as a basic network to extract image features from the third image, the GAP algorithm is used to perform metric learning based on image features, BatchNorm1D and Normalize are normalization layers, BatchNorm1D is used to keep the input of each layer in the same distribution, that is, to perform regularization on the input data, Normalize is used to limit the output data within a certain range, the Embedding layer can convert the image features into a feature vector of a predetermined dimension (e.g., 512 dimensions), the margin and scale of ArcFace Loss can be preset values, such as margin can be 0.5, scale can be 30, and the optimizer used during training can be the Adam optimizer.

[0089] In this way, by processing the title information of the second image, the label of each second image is obtained, and the model is trained by the second image and the label of the second image, the model can better learn the fine-grained features of different images in the same category, thereby improving the retrieval accuracy of similar images.

[0090] In S514, based on a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained.

[0091] In S516 , based on the first feature vector and the second feature vector, the image similarity between each candidate image and the first image is determined.

[0092] In S518, based on the image similarity between each candidate image and the first image, a target image corresponding to the first image in the candidate images is determined.

[0093] In implementation, in actual applications, the processing methods of the above S518 can be various. The following provides an optional implementation method, which can be specifically referred to in the following steps 1 to 5:

[0094] Step 1: Determine the candidate images whose image similarity is greater than a preset similarity threshold among the candidate images as target candidate images.

[0095] Step 2: Based on the second feature vector and the first feature vector corresponding to the target candidate image, the first feature vector is updated to obtain the updated first feature vector.

[0096] In implementation, when there are multiple target candidate images, the first mean of the second eigenvectors corresponding to the multiple target candidate images can be obtained, and the first mean and the mean of the first eigenvector are determined as the first eigenvector after update processing.

[0097] Step three: determine a target image corresponding to the first image in the candidate images based on the updated first feature vector and the second feature vector corresponding to the candidate image.

[0098] In implementation, the vector similarity between the updated first feature vector and the second feature vector corresponding to the candidate image can be obtained, and the candidate image whose vector similarity is greater than a preset vector similarity threshold is determined as the target image corresponding to the first image. In addition, in the case where there are multiple candidate images whose vector similarity is greater than the preset vector similarity threshold, the multiple candidate images can be sorted based on the vector similarity, and a preset number of candidate images can be determined as target images, such as the candidate images corresponding to the first 10 vector similarities can be determined as target images.

[0099] In S520, the target image is determined as a search result corresponding to the similar graphic search instruction.

[0100] The embodiment of the present specification provides a data processing method, in the case of receiving a similar image retrieval instruction for a first image, determining a candidate image corresponding to the first image, obtaining a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, determining a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determining the target image as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn fine-grained features of different images, and then after the model is trained, the trained feature extraction model can accurately extract features of images (including the first image and the second image), so as to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving images.

[0101] Embodiment 3

[0102] like Fig. 7A and Figure 7B As shown, the embodiment of this specification provides a data processing method, and the execution subject of the method can be a blockchain system. The method can specifically include the following steps:

[0103] In S702, when a similar image retrieval instruction for a first image is received, a candidate image corresponding to the first image is obtained based on a first smart contract pre-deployed in the blockchain system.

[0104] The similar image retrieval instruction includes a first image.

[0105] In implementation, in a scenario where a transaction item is detected as a risky item, the image of the transaction item can be used to search whether there is an image similar to the image of the transaction item in the risky item image. If so, it can be determined that the transaction item is a risky item.

[0106] In order to ensure data security and prevent tampering during risk detection, images can be retrieved through the blockchain system. That is, according to the functions of the blockchain, corresponding trusted applications can be developed, and the trusted applications can be packaged into an independent application and installed by the user in the local terminal device or server. Alternatively, users can also jointly agree on a certain application as a trusted application, and send relevant information (such as similar image retrieval instructions for the first image) to the blockchain system through the trusted application.

[0107] The user can trigger a similar image retrieval instruction for the first image on the terminal device. That is, when the terminal device detects that the user has triggered a similar image retrieval instruction for the first image, the terminal device can send the similar image retrieval instruction for the first image to the blockchain system through a locally installed trusted application.

[0108] The blockchain system can obtain a candidate image corresponding to the first image based on a pre-deployed first smart contract.

[0109] In S704, based on the first smart contract and the pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained.

[0110] Among them, the feature extraction model is based on the second image and the label of the second image, and is obtained by training the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm.

[0111] In implementation, the blockchain system can obtain a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on the first smart contract and the pre-trained feature extraction model, wherein the determination process of the first feature vector and the second feature vector can refer to the relevant content in S104 of Example 1 and will not be repeated here.

[0112] In S706, based on the first smart contract, the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as a retrieval result corresponding to the similar graphic retrieval instruction.

[0113] In implementation, after determining the search results, the blockchain system can also return the search results to the user device based on the first smart contract.

[0114] An embodiment of the present specification provides a data processing method. When a similar image retrieval instruction for a first image is received, a candidate image corresponding to the first image is obtained based on a first smart contract pre-deployed in a blockchain system. A first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained based on the first smart contract and a pre-trained feature extraction model. The feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm. Based on the first smart contract, the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn the fine-grained features of different images. After the model is trained, the trained feature extraction model can accurately extract features of the image (including the first image and the second image) to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving the image. In addition, by determining the retrieval results through the blockchain, the security of the data during the retrieval process can be guaranteed, and the retrieval results can be determined without being tampered with.

[0115] Embodiment 4

[0116] like Figure 8 As shown, the embodiment of this specification provides a data processing method, and the execution subject of the method can be a blockchain system. The method can specifically include the following steps:

[0117] In S802, when a similar image retrieval instruction for a first image is received, a candidate image corresponding to the first image is obtained based on a first smart contract pre-deployed in the blockchain system.

[0118] In S804, based on a second smart contract pre-deployed in the blockchain system, title information of the second image is obtained.

[0119] In S806, based on the second smart contract, the pre-built vocabulary, and the title information of the second image, a first vector corresponding to the second image is determined.

[0120] In S808, clustering is performed on the second image based on the second smart contract, the first vector and a preset clustering algorithm to obtain multiple categories.

[0121] In S810, a label of the second image is determined based on the second smart contract and the category corresponding to the second image.

[0122] In S812, based on the third smart contract pre-deployed in the blockchain system, the second image, and the label of the second image, a feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain a pre-trained feature extraction model.

[0123] In S814, based on the first smart contract and the pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained.

[0124] Among them, the feature extraction model is based on the second image and the label of the second image, and is obtained by training the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm.

[0125] In S816, based on the first smart contract, the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as a retrieval result corresponding to the similar graphic retrieval instruction.

[0126] The specific processing process in the above S802 to S816 can refer to the relevant content of S502 to S520 in the above embodiment 2, which will not be repeated here.

[0127] An embodiment of the present specification provides a data processing method. When a similar image retrieval instruction for a first image is received, a candidate image corresponding to the first image is obtained based on a first smart contract pre-deployed in a blockchain system. A first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained based on the first smart contract and a pre-trained feature extraction model. The feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm. Based on the first smart contract, the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn the fine-grained features of different images. After the model is trained, the trained feature extraction model can accurately extract features of the image (including the first image and the second image) to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving the image. In addition, by determining the retrieval results through the blockchain, the security of the data during the retrieval process can be guaranteed, and the retrieval results can be determined without being tampered with.

[0128] Embodiment 5

[0129] The above is a data processing method provided in the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide a data processing device, such as Fig. 9 shown.

[0130] The data processing device comprises: an image selection module 901, a vector acquisition module 902 and an image determination module 903, wherein:

[0131] An image selection module 901 is used to determine a candidate image corresponding to a first image when a similar image search instruction for the first image is received;

[0132] A vector acquisition module 902 is used to acquire a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm;

[0133] The image determination module 903 is used to determine a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determine the target image as a retrieval result corresponding to the similar graphic retrieval instruction.

[0134] In the embodiment of this specification, the image determination module 903 includes:

[0135] a similarity determination unit, configured to determine an image similarity between each of the candidate images and the first image based on the first feature vector and the second feature vector;

[0136] An image determination unit is used to determine a target image corresponding to the first image in the candidate images based on the image similarity between each of the candidate images and the first image.

[0137] In the embodiment of this specification, the image determination unit is used to:

[0138] Determine the candidate images whose image similarity is greater than a preset similarity threshold value as target candidate images;

[0139] Based on a second feature vector corresponding to the target candidate image and the first feature vector, updating the first feature vector to obtain an updated first feature vector;

[0140] Based on the updated first feature vector and the second feature vector corresponding to the candidate image, a target image corresponding to the first image in the candidate images is determined.

[0141] In the embodiment of this specification, there are multiple target candidate images, and the image determination unit is used to:

[0142] A first mean value of the second feature vectors corresponding to the plurality of target candidate images is obtained, and the first mean value and the mean value of the first feature vector are determined as the first feature vector after the update process.

[0143] In the embodiment of this specification, the device further includes:

[0144] An information acquisition module, used to acquire title information of the second image;

[0145] a first vector determination module, configured to determine a first vector corresponding to the second image based on a pre-built vocabulary and title information of the second image;

[0146] A clustering module, configured to perform clustering processing on the second image based on the first vector and the preset clustering algorithm to obtain a plurality of categories;

[0147] a label determination module, configured to determine a label of the second image based on a category corresponding to the second image;

[0148] A model training module is used to train the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the second image and the label of the second image to obtain the pre-trained feature extraction model.

[0149] In the embodiment of this specification, the first vector determination module includes:

[0150] A first determining unit, configured to determine a quantity vector corresponding to each second image based on the quantity of each word included in the pre-built vocabulary in the title information of each second image;

[0151] A second determining unit, configured to determine a position vector corresponding to each second image based on position information of each word included in the pre-built vocabulary in the title information of each second image;

[0152] a third determining unit, configured to determine, based on the title information of the second image, a classification entropy of each word included in the pre-constructed vocabulary, and determine an entropy vector corresponding to each second image according to the classification entropy of each word included in the pre-constructed vocabulary and the title information of each second image;

[0153] a fourth determining unit, configured to determine a word frequency vector corresponding to each second image based on the number of times each word included in the pre-built word library appears in the title information of each second image and the number of times each word appears in the title information of other second images;

[0154] A fifth determining unit is used to determine a first vector corresponding to the second image based on the quantity vector, the position vector, the entropy vector and the word frequency vector.

[0155] In the embodiments of this specification, the model training module is used to:

[0156] an image screening unit, configured to determine as a third image the second image corresponding to the target category, wherein the number of the second images corresponding to the target category is greater than a preset number threshold;

[0157] A model training unit is used to train the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the third image and the label of the third image to obtain the pre-trained feature extraction model.

[0158] In the embodiment of this specification, the model training unit is used to:

[0159] Determining a category weight corresponding to the target category based on the number of third images corresponding to the target category;

[0160] Determining, based on the label of the third image, a target category corresponding to the third image, and determining a category weight corresponding to the target category as the category weight corresponding to the third image;

[0161] Based on the third image and the category weight corresponding to the third image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model, and the category weight corresponding to the third image is used to determine the cross entropy loss corresponding to the third image during the model training process, so as to train the feature extraction model based on the cross entropy loss

[0162] In an embodiment of the present specification, the feature extraction model includes a feature extraction layer and an embedding layer, the feature extraction layer is used to extract image features of the third image, the embedding layer is used to convert the image features into feature vectors of a predetermined dimension, and the loss function of the feature extraction model is a face recognition loss function including a weighted cross entropy loss.

[0163] The embodiment of the present specification provides a data processing device, which, upon receiving a similar image retrieval instruction for a first image, determines a candidate image corresponding to the first image, obtains a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, and determines a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determines the target image as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn fine-grained features of different images, and then after the model is trained, the trained feature extraction model can accurately extract features of images (including the first image and the second image), so as to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving images.

[0164] Embodiment 6

[0165] The above is a data processing method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data processing device, which is a device in the blockchain system, such as Fig.10 shown.

[0166] The data processing device comprises: an image selection module 1001, a vector acquisition module 1002 and an image determination module 1003, wherein:

[0167] The image selection module 1001 is used to obtain a candidate image corresponding to the first image based on a first smart contract pre-deployed in the blockchain system when a similar image search instruction for the first image is received;

[0168] A vector acquisition module 1002 is used to acquire a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on the first smart contract and a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm;

[0169] The image determination module 1003 is used to determine a target image corresponding to the first image in the candidate images based on the first smart contract, the first feature vector and the second feature vector, and determine the target image as a retrieval result corresponding to the similar graphic retrieval instruction.

[0170] In the embodiment of this specification, the device further includes:

[0171] an information acquisition module, configured to acquire title information of the second image based on a second smart contract pre-deployed in the blockchain system;

[0172] a first vector determination module, configured to determine a first vector corresponding to the second image based on the second smart contract, a pre-built vocabulary, and title information of the second image;

[0173] A clustering module, configured to perform clustering processing on the second image based on the second smart contract, the first vector and the preset clustering algorithm to obtain multiple categories;

[0174] A label determination module is used to determine a label of the second image based on the second smart contract and the category corresponding to the second image.

[0175] In the embodiment of this specification, the device further includes:

[0176] A model training module is used to train the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on a third smart contract pre-deployed in the blockchain system, the second image, and a label of the second image to obtain the pre-trained feature extraction model.

[0177] An embodiment of the present specification provides a data processing device, which, upon receiving a similar image retrieval instruction for a first image, obtains a candidate image corresponding to the first image based on a first smart contract pre-deployed in a blockchain system, obtains a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on the first smart contract and a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, the label of the second image is determined based on title information of the second image and a preset clustering algorithm, determines a target image corresponding to the first image in the candidate images based on the first smart contract, the first feature vector and the second feature vector, and determines the target image as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn the fine-grained features of different images. After the model is trained, the trained feature extraction model can accurately extract features of the image (including the first image and the second image) to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving the image. In addition, by determining the retrieval results through the blockchain, the security of the data during the retrieval process can be guaranteed, and the retrieval results can be determined without being tampered with.

[0178] Embodiment 7

[0179] Based on the same idea, the embodiment of this specification also provides a data processing device, such as Fig.11 shown.

[0180] The data processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 1101 and memory 1102, and the memory 1102 may store one or more storage applications or data. Among them, the memory 1102 may be a short-term storage or a persistent storage. The application stored in the memory 1102 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the data processing device. Furthermore, the processor 1101 may be configured to communicate with the memory 1102 and execute a series of computer executable instructions in the memory 1102 on the data processing device. The data processing device may also include one or more power supplies 1103, one or more wired or wireless network interfaces 1104, one or more input and output interfaces 1105, and one or more keyboards 1106.

[0181] Specifically in this embodiment, the data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:

[0182] Upon receiving a similar image search instruction for a first image, determining a candidate image corresponding to the first image;

[0183] Based on a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, and the label of the second image is determined based on title information of the second image and a preset clustering algorithm;

[0184] Based on the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as a retrieval result corresponding to the similar graphic retrieval instruction.

[0185] Optionally, determining a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector includes:

[0186] Determining an image similarity between each of the candidate images and the first image based on the first feature vector and the second feature vector;

[0187] Based on the image similarity between each of the candidate images and the first image, a target image corresponding to the first image in the candidate images is determined.

[0188] Optionally, determining a target image corresponding to the first image in the candidate images based on the image similarity between each of the candidate images and the first image includes:

[0189] Determine the candidate images whose image similarity is greater than a preset similarity threshold value as target candidate images;

[0190] Based on a second feature vector corresponding to the target candidate image and the first feature vector, updating the first feature vector to obtain an updated first feature vector;

[0191] Based on the updated first feature vector and the second feature vector corresponding to the candidate image, a target image corresponding to the first image in the candidate images is determined.

[0192] Optionally, there are multiple target candidate images, and the updating of the first feature vector based on the second feature vector corresponding to the target candidate image and the first feature vector to obtain the updated first feature vector includes:

[0193] A first mean value of the second feature vectors corresponding to the plurality of target candidate images is obtained, and the first mean value and the mean value of the first feature vector are determined as the first feature vector after the update process.

[0194] Optionally, before acquiring the first feature vector corresponding to the first image and the second feature vector corresponding to the candidate image based on the pre-trained feature extraction model, the method further includes:

[0195] Acquire title information of the second image;

[0196] Determine a first vector corresponding to the second image based on a pre-built vocabulary and title information of the second image;

[0197] Based on the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories;

[0198] Determining a label of the second image based on the category corresponding to the second image;

[0199] Based on the second image and the label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

[0200] Optionally, determining the first vector corresponding to the second image based on a pre-built vocabulary and title information of the second image includes:

[0201] Determine a quantity vector corresponding to each second image based on the quantity of each word included in the pre-built vocabulary in the title information of each second image;

[0202] Determine a position vector corresponding to each second image based on position information of each word included in the pre-built word library in the title information of each second image;

[0203] Determine, based on the title information of the second image, the classification entropy of each word included in the pre-constructed vocabulary, and determine, according to the classification entropy of each word included in the pre-constructed vocabulary and the title information of each second image, an entropy vector corresponding to each second image;

[0204] Determine a word frequency vector corresponding to each second image based on the number of times each word included in the pre-built word library appears in the title information of each second image and the number of times each word appears in the title information of other second images;

[0205] Based on the quantity vector, the position vector, the entropy vector and the word frequency vector, a first vector corresponding to the second image is determined.

[0206] Optionally, the training of the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the second image and the label of the second image to obtain the pre-trained feature extraction model includes:

[0207] Determining the second image corresponding to the target category as the third image, wherein the number of the second images corresponding to the target category is greater than a preset number threshold;

[0208] Based on the third image and the label of the third image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

[0209] Optionally, the training of the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the third image and the label of the third image to obtain the pre-trained feature extraction model includes:

[0210] Determining a category weight corresponding to the target category based on the number of third images corresponding to the target category;

[0211] Determining, based on the label of the third image, a target category corresponding to the third image, and determining a category weight corresponding to the target category as the category weight corresponding to the third image;

[0212] Based on the third image and the category weight corresponding to the third image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model. The category weight corresponding to the third image is used to determine the cross entropy loss corresponding to the third image during the model training process, so as to train the feature extraction model based on the cross entropy loss.

[0213] Optionally, the feature extraction model includes a feature extraction layer and an embedding layer, the feature extraction layer is used to extract image features of the third image, the embedding layer is used to convert the image features into feature vectors of predetermined dimensions, and the loss function of the feature extraction model is a face recognition loss function including a weighted cross entropy loss.

[0214] In addition, specifically in this embodiment, the data processing device is a device in the blockchain system, and the data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the data processing device, and the one or more programs are configured to be executed by one or more processors, including the following computer executable instructions:

[0215] Upon receiving a similar image retrieval instruction for a first image, obtaining a candidate image corresponding to the first image based on a first smart contract pre-deployed in the blockchain system;

[0216] Based on the first smart contract and a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, and the label of the second image is determined based on the title information of the second image and a preset clustering algorithm;

[0217] Based on the first smart contract, the first feature vector and the second feature vector, a target image corresponding to the first image in the candidate images is determined, and the target image is determined as a retrieval result corresponding to the similar graphic retrieval instruction.

[0218] Optionally, before acquiring a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on the first smart contract and a pre-trained feature extraction model, the method further includes:

[0219] Based on a second smart contract pre-deployed in the blockchain system, obtaining title information of the second image;

[0220] Determine a first vector corresponding to the second image based on the second smart contract, a pre-built vocabulary, and title information of the second image;

[0221] Based on the second smart contract, the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories;

[0222] Determine a label of the second image based on the second smart contract and the category corresponding to the second image.

[0223] Optionally, before acquiring a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on the first smart contract and a pre-trained feature extraction model, the method further includes:

[0224] Based on a third smart contract pre-deployed in the blockchain system, the second image, and a label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

[0225] The embodiment of the present specification provides a data processing device, which, upon receiving a similar image retrieval instruction for a first image, determines a candidate image corresponding to the first image, obtains a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, wherein the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, and determines a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determines the target image as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn fine-grained features of different images, and then after the model is trained, the trained feature extraction model can accurately extract features of images (including the first image and the second image), so as to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving images.

[0226] Embodiment 8

[0227] The embodiments of this specification also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0228] The embodiment of the present specification provides a computer-readable storage medium, which, upon receiving a similar image retrieval instruction for a first image, determines a candidate image corresponding to the first image, obtains a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, wherein the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, and determines a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determines the target image as a retrieval result corresponding to the similar graphic retrieval instruction. In this way, since the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image, the feature extraction model can learn fine-grained features of different images, and then after the model is trained, the trained feature extraction model can accurately extract features of images (including the first image and the second image), so as to determine the corresponding retrieval results through the extracted features, thereby improving the retrieval accuracy when retrieving images.

[0229] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0230] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0231] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0232] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0233] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0234] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0235] The embodiments of this specification are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0236] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0237] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0238] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0239] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0240] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0241] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0242] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0243] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0244] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0245] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A data processing method, comprising: Upon receiving a similar image search instruction for a first image, determining a candidate image corresponding to the first image; Based on a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, wherein the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, wherein the metric learning algorithm is used to make the similarity between images of different classes small and the similarity between images of the same class large, wherein the feature extraction model includes a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer, wherein the Efficientnet-b3 algorithm is used to extract image features, the GAP algorithm is used to perform metric learning according to image features, the BatchNorm1D and the Normalize are normalization layers, the BatchNorm1D is used to make the input data of each layer maintain the same distribution, the Normalize is used to limit the output data within a preset range, and the embedding layer converts the image features into a feature vector of a predetermined dimension; Based on the first feature vector and the second feature vector, determining a target image corresponding to the first image in the candidate images, and determining the target image as a search result corresponding to the similar image search instruction; Before acquiring the first feature vector corresponding to the first image and the second feature vector corresponding to the candidate image based on the pre-trained feature extraction model, the method further includes: Based on a pre-constructed vocabulary and the title information of the second image, determining a first vector corresponding to the second image, the first vector being determined based on a quantity vector, a position vector, an entropy vector and a word frequency vector corresponding to each second image, the quantity vector and the position vector corresponding to each second image being respectively determined based on the quantity and the position information of each word included in the pre-constructed vocabulary in the title information of each second image, the entropy vector corresponding to each second image being determined based on the title information of the second image, and according to the classification entropy of each word included in the pre-constructed vocabulary and the title information of each second image, the word frequency vector corresponding to each second image is determined based on the number of times each word included in the pre-constructed vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; Based on the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories; Determining a label of the second image based on the category corresponding to the second image; Based on the second image and the label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

2. The method according to claim 1, wherein determining a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector comprises: Determining an image similarity between each of the candidate images and the first image based on the first feature vector and the second feature vector; Based on the image similarity between each of the candidate images and the first image, a target image corresponding to the first image in the candidate images is determined.

3. The method according to claim 2, wherein determining a target image corresponding to the first image in the candidate images based on the image similarity between each of the candidate images and the first image comprises: Determine the candidate images whose image similarity is greater than a preset similarity threshold value as target candidate images; Based on a second feature vector corresponding to the target candidate image and the first feature vector, updating the first feature vector to obtain an updated first feature vector; Based on the updated first feature vector and the second feature vector corresponding to the candidate image, a target image corresponding to the first image in the candidate images is determined.

4. The method according to claim 3, wherein there are multiple target candidate images, and the updating process of the first feature vector based on the second feature vector corresponding to the target candidate image and the first feature vector to obtain the updated first feature vector comprises: A first mean value of the second feature vectors corresponding to the plurality of target candidate images is obtained, and the first mean value and the mean value of the first feature vector are determined as the first feature vector after the update process.

5. The method according to claim 1, wherein determining the first vector corresponding to the second image based on a pre-built vocabulary and title information of the second image comprises: Determine a quantity vector corresponding to each second image based on the quantity of each word included in the pre-built vocabulary in the title information of each second image; Determine a position vector corresponding to each second image based on position information of each word included in the pre-built word library in the title information of each second image; Determine, based on the title information of the second image, the classification entropy of each word included in the pre-constructed vocabulary, and determine, according to the classification entropy of each word included in the pre-constructed vocabulary and the title information of each second image, an entropy vector corresponding to each second image; Determine a word frequency vector corresponding to each second image based on the number of times each word included in the pre-built word library appears in the title information of each second image and the number of times each word appears in the title information of other second images; Based on the quantity vector, the position vector, the entropy vector and the word frequency vector, a first vector corresponding to the second image is determined.

6. The method according to claim 5, wherein the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained based on the second image and the label of the second image to obtain the pre-trained feature extraction model, comprising: Determining the second image corresponding to the target category as the third image, wherein the number of the second images corresponding to the target category is greater than a preset number threshold; Based on the third image and the label of the third image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

7. The method according to claim 6, wherein the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained based on the third image and the label of the third image to obtain the pre-trained feature extraction model, comprising: Determining a category weight corresponding to the target category based on the number of third images corresponding to the target category; Determining, based on the label of the third image, a target category corresponding to the third image, and determining a category weight corresponding to the target category as the category weight corresponding to the third image; Based on the third image and the category weight corresponding to the third image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model. The category weight corresponding to the third image is used to determine the cross entropy loss corresponding to the third image during the model training process, so as to train the feature extraction model based on the cross entropy loss.

8. According to the method of claim 7, the feature extraction model comprises a feature extraction layer and an embedding layer, the feature extraction layer is used to extract image features of the third image, the embedding layer is used to convert the image features into feature vectors of predetermined dimensions, and the loss function of the feature extraction model is a face recognition loss function including a weighted cross entropy loss.

9. A data processing method, applied to a blockchain system, comprising: Upon receiving a similar image retrieval instruction for a first image, obtaining a candidate image corresponding to the first image based on a first smart contract pre-deployed in the blockchain system; Based on the first smart contract and the pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained. The feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm. The metric learning algorithm is used to make the similarity between images of different categories small and the similarity between images of the same category large. The feature extraction model includes a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer. The Efficientnet-b3 algorithm is used to extract image features. The GAP algorithm is used to perform metric learning based on image features. The BatchNorm1D and Normalize are normalization layers. The BatchNorm1D is used to keep the input data of each layer in the same distribution. The Normalize is used to limit the output data within a preset range. The embedding layer converts image features into feature vectors of a predetermined dimension. Determine a target image corresponding to the first image among the candidate images based on the first smart contract, the first feature vector, and the second feature vector, and determine the target image as a search result corresponding to the similar image search instruction; Before acquiring a first feature vector corresponding to the first image based on the first smart contract and the pre-trained feature extraction model, the method further includes: Based on a second smart contract pre-deployed in the blockchain system, obtaining title information of the second image; Based on the second smart contract, the pre-built vocabulary and the title information of the second image, determine a first vector corresponding to the second image, the first vector being determined based on the quantity vector, position vector, entropy vector and word frequency vector corresponding to each second image, the quantity vector and position vector corresponding to each second image being determined based on the quantity and position information of each word included in the pre-built vocabulary in the title information of each second image, respectively, the entropy vector corresponding to each second image being determined based on the title information of the second image, the classification entropy of each word included in the pre-built vocabulary and the title information of each second image, and the word frequency vector corresponding to each second image being determined based on the number of times each word included in the pre-built vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; Based on the second smart contract, the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories; Based on the second smart contract and the category corresponding to the second image, a label of the second image is determined, so as to train a feature extraction model based on a third smart contract pre-deployed in the blockchain system, the second image, and the label of the second image.

10. The method according to claim 9, before acquiring the first feature vector corresponding to the first image and the second feature vector corresponding to the candidate image based on the first smart contract and the pre-trained feature extraction model, further comprises: Based on a third smart contract pre-deployed in the blockchain system, the second image, and a label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

11. A data processing device, comprising: An image selection module, configured to determine a candidate image corresponding to a first image when a similar image search instruction for the first image is received; a vector acquisition module, configured to acquire a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, wherein the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, wherein the metric learning algorithm is configured to reduce the similarity between images of different classes and increase the similarity between images of the same class, wherein the feature extraction model comprises a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer, wherein the Efficientnet-b3 algorithm is configured to extract image features, the GAP algorithm is configured to perform metric learning based on image features, the BatchNorm1D and the Normalize are normalization layers, the BatchNorm1D is configured to maintain the same distribution of input data of each layer, the Normalize is configured to limit output data within a preset range, and the embedding layer converts image features into feature vectors of a predetermined dimension; an image determination module, configured to determine a target image corresponding to the first image in the candidate images based on the first feature vector and the second feature vector, and determine the target image as a search result corresponding to the similar image search instruction; The device also includes: a first vector determination module, configured to determine a first vector corresponding to the second image based on a pre-constructed vocabulary and the title information of the second image, wherein the first vector is determined based on a quantity vector, a position vector, an entropy vector and a word frequency vector corresponding to each second image, wherein the quantity vector and the position vector corresponding to each second image are respectively determined based on the quantity and the position information of each word included in the pre-constructed vocabulary in the title information of each second image, the entropy vector corresponding to each second image is determined based on the title information of the second image by determining the classification entropy of each word included in the pre-constructed vocabulary and the title information of each second image, and the word frequency vector corresponding to each second image is determined based on the number of times each word included in the pre-constructed vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; A clustering module, configured to perform clustering processing on the second image based on the first vector and the preset clustering algorithm to obtain a plurality of categories; a label determination module, configured to determine a label of the second image based on a category corresponding to the second image; A model training module is used to train the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm based on the second image and the label of the second image to obtain the pre-trained feature extraction model.

12. A data processing device, the device being a device in a blockchain system, comprising: an image selection module, configured to, upon receiving a similar image search instruction for a first image, obtain a candidate image corresponding to the first image based on a first smart contract pre-deployed in the blockchain system; A vector acquisition module, used to acquire a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image based on the first smart contract and a pre-trained feature extraction model, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, wherein the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, wherein the metric learning algorithm is used to make the similarity between images of different classes small and the similarity between images of the same class large, wherein the feature extraction model includes a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer, wherein the Efficientnet-b3 algorithm is used to extract image features, the GAP algorithm is used to perform metric learning based on image features, the BatchNorm1D and the Normalize are normalization layers, the BatchNorm1D is used to keep the input data of each layer in the same distribution, the Normalize is used to limit the output data within a preset range, and the embedding layer converts the image features into a feature vector of a predetermined dimension; an image determination module, configured to determine a target image corresponding to the first image among the candidate images based on the first smart contract, the first feature vector, and the second feature vector, and determine the target image as a search result corresponding to the similar image search instruction; The device also includes: an information acquisition module, configured to acquire title information of the second image based on a second smart contract pre-deployed in the blockchain system; a first vector determination module, configured to determine a first vector corresponding to the second image based on the second smart contract, a pre-built vocabulary and the title information of the second image, wherein the first vector is determined based on a quantity vector, a position vector, an entropy vector and a word frequency vector corresponding to each second image, wherein the quantity vector and the position vector corresponding to each second image are respectively determined based on the quantity and the position information of each word included in the pre-built vocabulary in the title information of each second image, wherein the entropy vector corresponding to each second image is determined based on the title information of the second image, and the classification entropy of each word included in the pre-built vocabulary and the title information of each second image is determined, and according to the classification entropy of each word included in the pre-built vocabulary and the title information of each second image, the word frequency vector corresponding to each second image is determined based on the number of times each word included in the pre-built vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; A clustering module, configured to perform clustering processing on the second image based on the second smart contract, the first vector and the preset clustering algorithm to obtain multiple categories; A label determination module is used to determine the label of the second image based on the second smart contract and the category corresponding to the second image, so as to train a feature extraction model based on a third smart contract pre-deployed in the blockchain system, the second image, and the label of the second image.

13. A data processing device, comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Upon receiving a similar image search instruction for a first image, determining a candidate image corresponding to the first image; Based on a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, wherein the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, wherein the metric learning algorithm is used to make the similarity between images of different classes small and the similarity between images of the same class large, wherein the feature extraction model includes a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer, wherein the Efficientnet-b3 algorithm is used to extract image features, the GAP algorithm is used to perform metric learning according to image features, the BatchNorm1D and the Normalize are normalization layers, the BatchNorm1D is used to make the input data of each layer maintain the same distribution, the Normalize is used to limit the output data within a preset range, and the embedding layer converts the image features into a feature vector of a predetermined dimension; Based on the first feature vector and the second feature vector, determining a target image corresponding to the first image in the candidate images, and determining the target image as a search result corresponding to the similar image search instruction; Before acquiring the first feature vector corresponding to the first image and the second feature vector corresponding to the candidate image based on the pre-trained feature extraction model, the method further includes: Based on a pre-constructed vocabulary and the title information of the second image, determining a first vector corresponding to the second image, the first vector being determined based on a quantity vector, a position vector, an entropy vector and a word frequency vector corresponding to each second image, the quantity vector and the position vector corresponding to each second image being respectively determined based on the quantity and the position information of each word included in the pre-constructed vocabulary in the title information of each second image, the entropy vector corresponding to each second image being determined based on the title information of the second image, and according to the classification entropy of each word included in the pre-constructed vocabulary and the title information of each second image, the word frequency vector corresponding to each second image is determined based on the number of times each word included in the pre-constructed vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; Based on the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories; Determining a label of the second image based on the category corresponding to the second image; Based on the second image and the label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

14. A data processing device, the data processing device being a device in a blockchain system, comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Upon receiving a similar image retrieval instruction for a first image, obtaining a candidate image corresponding to the first image based on a first smart contract pre-deployed in the blockchain system; Based on the first smart contract and the pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained. The feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm. The metric learning algorithm is used to make the similarity between images of different categories small and the similarity between images of the same category large. The feature extraction model includes a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer. The Efficientnet-b3 algorithm is used to extract image features. The GAP algorithm is used to perform metric learning based on image features. The BatchNorm1D and Normalize are normalization layers. The BatchNorm1D is used to keep the input data of each layer in the same distribution. The Normalize is used to limit the output data within a preset range. The embedding layer converts image features into feature vectors of a predetermined dimension. Determine a target image corresponding to the first image among the candidate images based on the first smart contract, the first feature vector, and the second feature vector, and determine the target image as a search result corresponding to the similar image search instruction; Before acquiring a first feature vector corresponding to the first image based on the first smart contract and the pre-trained feature extraction model, the method further includes: Based on a second smart contract pre-deployed in the blockchain system, obtaining title information of the second image; Based on the second smart contract, the pre-built vocabulary and the title information of the second image, determine a first vector corresponding to the second image, the first vector being determined based on the quantity vector, position vector, entropy vector and word frequency vector corresponding to each second image, the quantity vector and position vector corresponding to each second image being determined based on the quantity and position information of each word included in the pre-built vocabulary in the title information of each second image, respectively, the entropy vector corresponding to each second image being determined based on the title information of the second image, the classification entropy of each word included in the pre-built vocabulary and the title information of each second image, and the word frequency vector corresponding to each second image being determined based on the number of times each word included in the pre-built vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; Based on the second smart contract, the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories; Based on the second smart contract and the category corresponding to the second image, a label of the second image is determined, so as to train a feature extraction model based on a third smart contract pre-deployed in the blockchain system, the second image, and the label of the second image.

15. A storage medium for storing computer executable instructions, wherein the executable instructions implement the following process when executed by a processor: Upon receiving a similar image search instruction for a first image, determining a candidate image corresponding to the first image; Based on a pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained, wherein the feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on a second image and a label of the second image, wherein the label of the second image is determined based on the title information of the second image and a preset clustering algorithm, wherein the metric learning algorithm is used to make the similarity between images of different classes small and the similarity between images of the same class large, wherein the feature extraction model includes a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer, wherein the Efficientnet-b3 algorithm is used to extract image features, the GAP algorithm is used to perform metric learning according to image features, the BatchNorm1D and the Normalize are normalization layers, the BatchNorm1D is used to make the input data of each layer maintain the same distribution, the Normalize is used to limit the output data within a preset range, and the embedding layer converts the image features into a feature vector of a predetermined dimension; Based on the first feature vector and the second feature vector, determining a target image corresponding to the first image in the candidate images, and determining the target image as a search result corresponding to the similar image search instruction; Before acquiring the first feature vector corresponding to the first image and the second feature vector corresponding to the candidate image based on the pre-trained feature extraction model, the method further includes: Based on a pre-constructed vocabulary and the title information of the second image, determining a first vector corresponding to the second image, the first vector being determined based on a quantity vector, a position vector, an entropy vector and a word frequency vector corresponding to each second image, the quantity vector and the position vector corresponding to each second image being respectively determined based on the quantity and the position information of each word included in the pre-constructed vocabulary in the title information of each second image, the entropy vector corresponding to each second image being determined based on the title information of the second image, and according to the classification entropy of each word included in the pre-constructed vocabulary and the title information of each second image, the word frequency vector corresponding to each second image is determined based on the number of times each word included in the pre-constructed vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; Based on the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories; Determining a label of the second image based on the category corresponding to the second image; Based on the second image and the label of the second image, the feature extraction model constructed by the feature extraction algorithm and the metric learning algorithm is trained to obtain the pre-trained feature extraction model.

16. A storage medium for storing computer executable instructions, wherein the executable instructions implement the following process when executed by a processor: Upon receiving a similar image retrieval instruction for a first image, obtaining a candidate image corresponding to the first image based on a first smart contract pre-deployed in the blockchain system; Based on the first smart contract and the pre-trained feature extraction model, a first feature vector corresponding to the first image and a second feature vector corresponding to the candidate image are obtained. The feature extraction model is obtained by training a feature extraction model constructed by a feature extraction algorithm and a metric learning algorithm based on the second image and the label of the second image. The label of the second image is determined based on the title information of the second image and a preset clustering algorithm. The metric learning algorithm is used to make the similarity between images of different categories small and the similarity between images of the same category large. The feature extraction model includes a feature extraction layer composed of an Efficientnet-b3 algorithm, a GAP algorithm, BatchNorm1D, and Normalize, and an embedding layer. The Efficientnet-b3 algorithm is used to extract image features. The GAP algorithm is used to perform metric learning based on image features. The BatchNorm1D and Normalize are normalization layers. The BatchNorm1D is used to keep the input data of each layer in the same distribution. The Normalize is used to limit the output data within a preset range. The embedding layer converts image features into feature vectors of a predetermined dimension. Determine a target image corresponding to the first image among the candidate images based on the first smart contract, the first feature vector, and the second feature vector, and determine the target image as a search result corresponding to the similar image search instruction; Before acquiring a first feature vector corresponding to the first image based on the first smart contract and the pre-trained feature extraction model, the method further includes: Based on a second smart contract pre-deployed in the blockchain system, obtaining title information of the second image; Based on the second smart contract, the pre-built vocabulary and the title information of the second image, determine a first vector corresponding to the second image, the first vector being determined based on the quantity vector, position vector, entropy vector and word frequency vector corresponding to each second image, the quantity vector and position vector corresponding to each second image being determined based on the quantity and position information of each word included in the pre-built vocabulary in the title information of each second image, respectively, the entropy vector corresponding to each second image being determined based on the title information of the second image, the classification entropy of each word included in the pre-built vocabulary and the title information of each second image, and the word frequency vector corresponding to each second image being determined based on the number of times each word included in the pre-built vocabulary appears in the title information of each second image and the number of times each word appears in the title information of other second images; Based on the second smart contract, the first vector and the preset clustering algorithm, clustering the second image to obtain multiple categories; Based on the second smart contract and the category corresponding to the second image, a label of the second image is determined, so as to train a feature extraction model based on a third smart contract pre-deployed in the blockchain system, the second image, and the label of the second image.